Skip to content

conformance: replay bundle fixtures are harvested on the manual clock (#362) - #504

Merged
bartekus merged 1 commit into
mainfrom
conformance/replay-manual-clock-362
Nov 4, 2026
Merged

bartekus merged 1 commit into
mainfrom
conformance/replay-manual-clock-362

Conversation

@bartekus

@bartekus bartekus commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #362.

make conformance-harvest was not reproducible: the support.replay and lodging.replay cases take a freshly captured replay bundle as input, and the run record retained in it carried the capture run's real attempt dispatched_ms/ended_ms and elapsed_ms. Each harvest could shift them, and with them the bundle SHA-256 in cases/cli/*.replay.json and cases/manifest.json.

  • crates/rustev-cli/tests/replay.rs: before the harvested replay, the test applies the goldens' timing normalization (spec 027, 3.12.3, the shared normalize.rs) to the bundle's retained run record and re-digests it. Replay reproduces the judgment, never the timing, so the bundle still reproduces and the replay goldens are unchanged.
  • The two bundle fixtures, their cases and the manifest are regenerated once to the normalized bytes (all timing fields 0).
  • Spec 027 and spec 004: dated Implementation record paragraphs (2026-11-04). No normative text changes.
  • crates/rustev-eval/src/testdata/lodging-emb.record.json: the crate's packaged copy of the lodging bundle's retained record, refreshed to the new bytes (tests/packaged_fixtures.rs keeps it equal to the fixture); spec 004 records it as test only.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the four changed files:

crates/rustev-cli/tests/replay.rs — normalize_bundle_timing reads the bundle, destructures the Retention::Retained variant (panicking on any other variant, which is a valid test assertion), runs normalize_timing on the JSON, re-parses via RunRecord::parse and re-canonicalises to update bytes and digest, then writes the outer bundle via b.record_canonical(). The mutation flows through correctly: the struct fields are mutated in place through the mutable reference before record_canonical() serialises them. identity: null on the run document means there is no outer digest to synchronise. The logic is sound.

specs/027-node-and-wasm-bindings/spec.md — The revision entry accurately describes the problem (per-attempt dispatched_ms/ended_ms and overall elapsed_ms varied across harvests, moving the bundle SHA-256), the fix (apply the existing timing normalisation before the replay that is harvested), and the scope of the fixture change (two bundle files, digests updated once, no case comparison changes). The entry is placed before the ## Decisions at approval heading, consistent with how other dated revision entries appear in the spec.

tools/rustev-conformance/fixtures/cli/lodging.replay/lodging-emb.bundle.json and support.replay/support-emb.bundle.json — In both fixtures only the run retention changes: all per-attempt dispatched_ms/ended_ms are zeroed, the outer timing.elapsed_ms and timing.queued_ms are zeroed, and the run.retention.digest is updated to match the new bytes. plan, snapshot, descriptors, supplies and their digests are unchanged, consistent with the spec note's claim of no other case changes.

No bugs, security issues, or inconsistencies found.

{"head": "6de1006da48ef64d90d1c7028c09de64106e9610", "verdict": "no-findings", "findings": []}

Subject: 983b4ac...6de1006, diff digest dc6469aaece65d2692eee97135ae493a5eedbc1b2a21ba2fb816c902aaf2eb23, 1 call(s). An AI comment is not an approval.

…#362)

The replay cases' bundle fixtures retained the capture run's real attempt
dispatch/end times and elapsed time, so each harvest could shift them and
the bundle digests in the cases and the manifest. The CLI replay test now
applies the goldens' timing normalization to the retained run record and
re-digests it before the harvested replay. rustev-eval's packaged copy of
the lodging record is refreshed to match. Specs 027 and 004 record the fix.
@bartekus
bartekus force-pushed the conformance/replay-manual-clock-362 branch from 6de1006 to 5a4dfe7 Compare November 4, 2026 01:09
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

AI review (no-findings)

I reviewed all six changed paths carefully.

crates/rustev-cli/tests/replay.rs — normalize_bundle_timing correctly pattern-matches on Retention::Retained, parses the embedded bytes as Json, calls the existing normalize_timing helper, round-trips through RunRecord::parse → record_canonical → record_digest to get a correctly re-digested record, then re-serialises the whole bundle with record_canonical. The call site inserts the normalisation between capture and replay, which is the right order: the replay that follows uses the judgment/evidence, not timing, so the golden still passes.

crates/rustev-eval/src/testdata/lodging-emb.record.json — All dispatched_ms/ended_ms within requests[*].attempts[*] and both timing.elapsed_ms/timing.queued_ms are set to 0. Consistent with the normalisation applied.

tools/rustev-conformance/fixtures/cli/lodging.replay/lodging-emb.bundle.json — Run-record retention bytes updated to match the zeroed-timing record; run.retention.retained.digest changed from sha256:4bcd3… to sha256:924cd2…, consistent with the new bytes. All other retained documents (plan, snapshot, backend descriptor, backend outputs) are unchanged.

tools/rustev-conformance/fixtures/cli/support.replay/support-emb.bundle.json — Same pattern: dispatched_ms/ended_ms zeroed for all three requests, run.retention.retained.digest changed from sha256:58dd9… to sha256:afe57…. Other retained documents unchanged.

specs/004-evaluation-and-replay/spec.md — Revision note accurately describes a test-only fixture refresh and explicitly disclaimed as "no claim of this spec changes." Correct placement.

specs/027-node-and-wasm-bindings/spec.md — Revision note correctly attributes the fix to issue #362, describes the root cause (non-zero attempt timings in retained record making harvest non-reproducible), and the mechanism used (apply 3.12.3 timing normalisation before the harvested replay). Placed before "Decisions at approval," correct.

No bugs, security issues, digest contradictions, or governance violations found.

{"head": "5a4dfe76e5c7fc61365e2406e1085c17a8151eef", "verdict": "no-findings", "findings": []}

Subject: 983b4ac...5a4dfe7, diff digest 5c801937ee7b93493f33472120debff62183502c4fd595453ecbfcf46fe5f6c9, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit d49a12d Nov 4, 2026
33 checks passed
@bartekus
bartekus deleted the conformance/replay-manual-clock-362 branch November 4, 2026 02:59
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.

conformance-harvest: replay bundle fixtures embed wall-clock timings

1 participant