Skip to content

feat(fixtures): add repeated metric comparisons - #85

Draft
adityathebe wants to merge 4 commits into
mainfrom
feat/fixture-metrics
Draft

feat(fixtures): add repeated metric comparisons#85
adityathebe wants to merge 4 commits into
mainfrom
feat/fixture-metrics

Conversation

@adityathebe

Copy link
Copy Markdown
Member

Summary

  • add serial logical-row repeats under one shared fixture timeout while retaining per-sample command, CEL, metric, and process evidence
  • add generic finite numeric CEL extraction, mean/median/min/max/p95 aggregates, absolute thresholds, and direction-aware row baseline comparisons
  • finalize comparison-aware outcomes once per logical row and extend JSON/Pretty reporting without changing legacy fixtures that omit repeat and metrics
  • keep the integration generic: no Captain imports or hard-coded observation paths; the acceptance fixture emits structured JSON from a shell command

Validation

  • go test ./fixtures/...
  • go vet ./fixtures/...
  • GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=commit.gpgsign GIT_CONFIG_VALUE_0=false go test ./cmd/gavel
  • go build ./cmd/gavel
  • JSON acceptance fixture verified one result per row, 3/5/2 retained samples, all five aggregates, both regression directions, explicit zero exit codes, and once-per-row callbacks
  • focused failure checks verified min/max threshold failures, missing/duplicate/zero baseline errors, metric-spec mismatches, CEL/metric outcome separation, ordinary sample failure continuation, and shared timeout exhaustion

Repository-wide caveats

A raw go test ./... is not green in this orb because its global Git config references a transient missing SSH signing buffer, history/date tests run against a shallow checkout whose newest commit predates their query window, and testrunner/ui expects an unavailable google-chrome executable. Signing-dependent cmd/gavel, commit, and todos/claude checks pass with the one-command signing override above; the affected fixture packages pass normally.

Closes #84

Fixture matrices need repeated command observations and numeric regression checks without inflating logical row counts.

Run samples serially under one row timeout, retain per-sample command, CEL, and metric evidence, and finalize generic aggregates, thresholds, and baseline comparisons after all rows complete. Preserve the legacy single-run path and omit additive fields for existing fixtures.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0397c-0e63-731f-b7f4-84ab67aeac1a
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Gavel summary

Source Pass Fail Skip Duration
./site 14 0 0 1.1s
./testrunner/ui 64 0 0 349ms
baseline 18 0 0 469.039µs
changegraph 14 0 0 270ms
commit 115 0 0 1.4s
fixtures 22 0 5 2ms
gavel 10 0 0 164ms
git 155 0 4 6.8s
github.com/flanksource/gavel/ai 7 0 0 -
github.com/flanksource/gavel/ai/aifix 18 0 0 -
github.com/flanksource/gavel/claudehistory 16 0 0 -
github.com/flanksource/gavel/cmd/gavel 167 0 0 37.8s
github.com/flanksource/gavel/cmd/gavel/choose 18 0 0 -
github.com/flanksource/gavel/commit 196 0 0 9.0s
github.com/flanksource/gavel/fixtures 143 0 0 140ms
github.com/flanksource/gavel/fixtures/types 10 0 0 10ms
github.com/flanksource/gavel/git 38 0 0 10ms
github.com/flanksource/gavel/github 110 0 2 20ms
github.com/flanksource/gavel/github/activity 8 0 0 10ms
github.com/flanksource/gavel/github/cache 64 0 5 -
github.com/flanksource/gavel/internal/ttyrender 3 0 0 -
github.com/flanksource/gavel/linters 49 0 0 20ms
github.com/flanksource/gavel/linters/betterleaks 14 0 0 -
github.com/flanksource/gavel/linters/golangci 2 0 0 -
github.com/flanksource/gavel/linters/jscpd 23 0 0 -
github.com/flanksource/gavel/linters/jscpd/testdata/sample 0 0 1 -
github.com/flanksource/gavel/linters/tsc 11 0 0 -
github.com/flanksource/gavel/pr/ui 45 0 0 -
github.com/flanksource/gavel/prwatch 87 0 0 -
github.com/flanksource/gavel/service 46 0 0 4.5s
github.com/flanksource/gavel/snapshots 19 0 0 820ms
github.com/flanksource/gavel/status 48 0 0 1.4s
github.com/flanksource/gavel/testrunner 147 0 0 6.8s
github.com/flanksource/gavel/testrunner/bench 12 0 0 -
github.com/flanksource/gavel/testrunner/history 6 0 0 10ms
github.com/flanksource/gavel/testrunner/parsers 90 0 0 170ms
github.com/flanksource/gavel/testrunner/runners 72 0 0 20ms
github.com/flanksource/gavel/testrunner/ui 53 0 0 110ms
github.com/flanksource/gavel/todos 36 0 0 -
github.com/flanksource/gavel/todos/claude 55 0 0 620ms
github.com/flanksource/gavel/todos/types 30 0 0 -
github.com/flanksource/gavel/utils 51 0 0 -
github.com/flanksource/gavel/verify 199 0 0 -
kubernetes 43 0 0 15ms
lint: betterleaks 0 0 1 -
lint: golangci-lint 1 0 0 3m9s
lint: tsc 3 0 0 22.3s
linters 8 0 0 14ms
parsers 22 0 0 700.591µs
runcache 11 0 0 186ms
serve 28 0 0 490ms
testrunner 1 0 0 86ms
ui 20 0 0 48.6s
utils 75 0 0 16ms

Totals: 2517 passed · 0 failed · 18 skipped · 5m33s

View full results

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Gavel summary

Source Pass Fail Skip Duration

Totals: 0 passed · 0 failed · 0 skipped · -

View full results

PTY startup failures left a zero exit code, so command expectations could incorrectly pass. Derived metric arithmetic could also store infinities and make JSON reporting fail.

Mark failed PTY starts with a negative exit code, scale mean and even-median aggregation, and reject non-finite aggregate or regression results before storing them.
The PTY cancellation callback used syscall.Kill from an untagged file, preventing the exec fixture type from compiling on Windows.

Keep Unix process-group cancellation in a Unix-only helper and use os.Process.Kill on other platforms.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0397c-0e63-731f-b7f4-84ab67aeac1a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add repeated fixture samples and generic CEL-extracted metric comparisons

1 participant