Skip to content

feat(benchmark): replay recorded report identity decisions - #713

Merged
zzwong merged 2 commits into
mainfrom
zzwong/report-identity-replay
Nov 6, 2026
Merged

zzwong merged 2 commits into
mainfrom
zzwong/report-identity-replay

Conversation

@zzwong

@zzwong zzwong commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add cr benchmark replay <fixture.json> to inspect recorded report-identity decisions offline. It produces deterministic finding groups or prior-thread associations from a fixture, making those decisions repeatable and reviewable.

The v1 fixture contains the original records, caller-selected thread eligibility and recorded pair decisions. Validation and pair hashes reject malformed or stale inputs. Missing, abstained, failed or contradictory cohort decisions leave findings in singleton groups. Prior-thread replay reports associations without choosing thread actions, and the result retains every original finding and thread.

The matching component is used only by the offline benchmark command. An architecture test prevents review-runtime packages from importing it. The change adds no provider calls, profile changes, posting behavior or live review decisions.

Command evidence

Before: cr 0.10.367 at 4bd02e8 exposes compare, doctor, run, select and validate under cr benchmark, with no replay command.

After: the locally built candidate replays the checked-in synthetic fixtures:

Fixture Observed result Exit
complete-cohort.json Three originals retained in one group, with the blocking finding beta as representative. 0
prior-thread-unresolved.json Original records retained, one association and explicit unresolved comparisons. 0
recorded-error.json Full JSON result retained, singleton groups and an error diagnostic on stderr. 1
Invalid file-anchor fields Usage diagnostic and empty stdout. 2

Two runs of the complete fixture produced byte-identical stdout. Invalid inherited profile, catalog and credential-backend selections did not affect that replay. This is local synthetic command evidence, not a production or model-quality measurement.

Validation

  • Matcher, benchmark-command, architecture, LLM and review-plan tests passed. Matcher checks include strict decoding, stale pair hashes, complete-link consistency, deterministic representatives, eligibility and finding retention.
  • Independent probes checked all 15,625 four-finding observation graphs and stale hashes after 11 record-field mutations across all four recorded choices.
  • A checked-in line-anchor regression records a valid hash, changes only the line, and requires rejection for both tasks and all four choices. A Go-overlay mutation omitting the line was caught by all eight subtests.
  • make tidy, make lint and make build passed; dependencies are unchanged.
  • The full Go suite, static smoke tests, installed Pi runtime tests and 1Password opt-out tests passed in CI. Linux, macOS and Windows builds also passed. The initial local suite exceeded the pipeline package's default 10-minute timeout during Git-fixture setup; that test passed alone, and the longer local retry was stopped after the full CI suite passed.

Type of Change

  • New feature
  • Documentation update

Checklist

  • I have read the contributing guide
  • My change follows the project structure and conventions
  • make tidy passes
  • make lint passes
  • make test passes in CI
  • make build passes

Docs: Added the fixture contract and command behavior to the benchmark guide and documented the offline import boundary.

@zzwong
zzwong marked this pull request as ready for review November 6, 2026 22:45

@zzwong zzwong left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation includes the line in the finding hash, but its regression test should protect that behavior: record a valid line-anchored decision, change only the line, and verify that the original hash is rejected.

@zzwong
zzwong merged commit f4ca4bd into main Nov 6, 2026
12 checks passed
@zzwong
zzwong deleted the zzwong/report-identity-replay branch November 6, 2026 23:22
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.

1 participant