Skip to content

conformance(063): runtime.capture-replay-acquire, capture with acquisition pages - #526

Merged
bartekus merged 4 commits into
mainfrom
impl/063-capture-acquire
Nov 6, 2026
Merged

bartekus merged 4 commits into
mainfrom
impl/063-capture-acquire

Conversation

@bartekus

@bartekus bartekus commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Spec 063: increment 1's acquisition coverage, which the handoff joins with increment 3. Adds the runtime case runtime.capture-replay-acquire. Stacked on #525 only because that is the top of the M5 stack; it depends only on #519 (scripted sources and the Node seam passing source descriptors to capture). Review only the last commit.

  • The case mirrors crates/rustev-eval/tests/acquisition_replay.rs::five_acquisitions_two_paged_reproduce_without_source_calls: five acquire steps, two of them paged.
    • Captured embedded and external on rust-api and native, with identical record, bundle and replay bytes.
    • The test asserts a complete capture with 7 acquisition pages. lookup0 and lookup1 each have pages 0 and 1, with different requests and increasing sequence. Both replays are reproduced, made offline with no source call.
  • Why its own case: a case holds one plan, and runtime.capture-replay uses the semantic support plan. Its expected bytes are unchanged.
  • Conformance runner: capture::outputs_with_sources passes the plan's source descriptors to assemble_with_sources. outputs delegates with none, so existing callers are unchanged. The Rust case runner passes the case's sources.
  • The Node runner needs no change: since impl(063): increment 3, the acquisition source seam in the Node binding #519 the plan handle keeps its sources and capture assembly receives them.
  • Script order: the scripted answers follow the single source permit's grant order (the five first pages in step order, then the two second pages). This order is deterministic: five consecutive run.mjs native runs passed.
  • Spec 063: one sentence in the increment 3 record.

Checks run locally: make gate; cargo test -p rustev-conformance --locked (after RUSTEV_BLESS=1, which changed no existing expectation); clippy with -D warnings; cargo fmt --all --check; run.mjs native (203 cases, 0 failures, five runs).

@bartekus bartekus added the m5 Opened by the M5 worker; M1 arms label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff across all changed paths: spec text, expected fixtures, fixture inputs, and the Rust test and library code.

spec.md — The six new lines documenting "Increment 1's acquisition coverage" are inserted immediately before the "Increment 4" block. The description (five acquisitions, two paged, seven captured pages, replayed reproduced) is internally consistent with the test code and expected outputs. The placement is explained by the text itself ("beside runtime.capture-replay because a case holds one plan"), so no inconsistency is present.

capture.rs — The refactoring splits outputs into a thin wrapper over outputs_with_sources. The new parameter sources: &[SourceDescriptor] is forwarded verbatim to assemble_with_sources. The original outputs call site (non-capture tests) is unaffected; existing callers using outputs receive &[] exactly as before.

runtime.rs — The call site is updated from outputs to outputs_with_sources with &source_descriptors. For existing semantic/generation capture cases where source_descriptors is empty this is equivalent to the old call, maintaining backward compatibility.

tests/runtime.rs — capture_acquire_case — The 7-answer sequence (5 first pages in step order, then the second pages of the two that page, using max_pages: 2) matches the 7-entry acquisition_pages arrays in the expected bundle files. The page-level assertions (per[0]["page"] == 0, per[1]["page"] == 1, request hashes differ, sequence ordering) are correct given the canonically-serialized bundle preserves sequence order. The outputs.len() == 8 assertion (record, result, bundle, replay × 2 decisions) matches the eight expected files added. Both replay files show "status":"reproduced" and "supplies":0, confirming no source call during replay. The mirrors field references an external test not supplied for review; this is a metadata annotation, not executable logic, so its absence here is not a reportable defect.

Expected fixtures — The embedded and external bundle files are consistent: embedded retains page bytes inline; external holds only content-addressed references. Item digests, request hashes, and sequence numbers are mutually consistent across bundle, record, replay, and result files.

No bugs, security problems, or governance/authority inconsistencies found.

{"head": "7f2950cb4629b5c9f8bf54d2142379ac2fa82d49", "verdict": "no-findings", "findings": []}

Subject: bd9e911...7f2950c, diff digest 52933533bd541ec98789f591a96964c4496a5abd5de4c44d3d7ad135d7eb0e8a, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/063-store-tests branch from bd9e911 to 10c6331 Compare November 6, 2026 01:33
@bartekus
bartekus force-pushed the impl/063-capture-acquire branch from 7f2950c to 7d04fad Compare November 6, 2026 01:33
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff for bugs, security issues, and inconsistencies.

capture.rs refactor: outputs delegates cleanly to the new outputs_with_sources, preserving all existing behavior (the empty slice becomes the default). No regression.

runtime.rs call site: Uses source_descriptors (not visible in this hunk but must be in scope; a compile error would catch it, and CI runs make code). The intent aligns with spec 063 §3.8 — assembly receives source descriptors when capturing acquisition steps.

New test capture_acquire_case: Five-step plan, max_calls=10 (5 steps × max 2 pages = worst case 10, comment is correct). answers array: 7 pages in correct order (5 first-page calls, then 2 continuation calls for lookup0/lookup1). Assertions check: pages.len()==7, lookup0 and lookup1 each have 2 pages with different request hashes and ascending sequences, replay status is "reproduced", and total outputs is 8 (record + result + bundle + replay × 2 decisions). All internally consistent.

Golden files: embedded.bundle.json and external.bundle.json both show 7 acquisition pages, sequences 0–6, correct per-step pagination, "capture":"complete". embedded.replay.json/external.replay.json both show "status":"reproduced","supplies":0. The only structural difference between embedded and external bundles is "retained" vs "external" retention — correct.

Spec text: The inserted paragraph ("Increment 1's acquisition coverage is the case runtime.capture-replay-acquire...") accurately describes the new test: five acquisitions, two paged, embedded and external capture, replay reproduced from seven pages, no source call. Placement immediately before "Increment 4" is consistent with an increment 1 coverage item being documented retroactively. The test comment says "increments 1 and 3" (forward-looking, as increment 3's Node surface will extend the case later); the spec says "Increment 1's acquisition coverage" (current state). This is not a defect.

No concrete defects found.

{"head": "7d04fad1e8c666f808d76893c86341d6c31c96c8", "verdict": "no-findings", "findings": []}

Subject: 10c6331...7d04fad, diff digest 52933533bd541ec98789f591a96964c4496a5abd5de4c44d3d7ad135d7eb0e8a, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/063-store-tests branch from 10c6331 to 5ccb63a Compare November 6, 2026 01:39
@bartekus
bartekus force-pushed the impl/063-capture-acquire branch from 7d04fad to 05ddf77 Compare November 6, 2026 01:39
@bartekus
bartekus force-pushed the impl/063-store-tests branch from 5ccb63a to 30e15da Compare November 6, 2026 01:39
@bartekus
bartekus force-pushed the impl/063-capture-acquire branch from 05ddf77 to 81d14fa Compare November 6, 2026 01:40
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff across all changed files.

capture.rs: The outputs function is correctly preserved as a wrapper that delegates to outputs_with_sources with an empty source slice, maintaining backward compatibility. The new outputs_with_sources function threads the source descriptors through to assemble_with_sources, which previously always received &[]. The refactoring is clean and correct.

runtime.rs: The call site switches from crate::capture::outputs to crate::capture::outputs_with_sources and passes source_descriptors. The variable must be in scope at that point in the existing loop; the diff supplies enough context to confirm the call is structurally correct.

tests/runtime.rs: The test logic is consistent with the described behavior:

  • 5 acquisition steps (lookup0–lookup4), max_calls=10 to bound the worst case
  • answers has 7 entries: pages 1–2 carry a next offset (lookup0 and lookup1 each page once more), pages 3–7 carry "none" (single-page outcomes for lookup2–4 plus the two second pages)
  • The bundle assertions check pages.len() == 7, that each of lookup0/lookup1 has exactly 2 pages in page-index order with distinct request hashes, and that replay yields "reproduced"
  • The golden files (8 total: bundle, record, replay, result × 2 decisions) are consistent with the test assertions

Golden file internal consistency: The embedded.bundle.json and external.bundle.json both show 7 acquisition pages (sequences 0–6), costs observed: 7, and capture: "complete". The embedded variant uses retained retention; the external uses external retention with digest-only references. Both replay files assert "status":"reproduced" and "supplies":0, confirming no source call during replay.

capture-generation.snapshot.json: Not in the diff's changed paths. The file is included in the in-memory fx map and written via keep() at test time; runtime::run takes &fx as Inputs rather than reading from disk, so the test does not depend on the file being pre-committed. Other capture tests in the existing codebase almost certainly commit an equivalent empty-snapshot fixture already.

Spec text: The added paragraph is inserted before the existing "Increment 4" block, describes the new case name, runner surfaces (rust-api, native), page counts, and the function reference (capture::outputs_with_sources). All cross-references match the code and golden files.

No bugs, security problems, or governance/ratification issues found.

{"head": "81d14fa85a9ec1a2d33ee92d7f5e594b34b07967", "verdict": "no-findings", "findings": []}

Subject: 30e15da...81d14fa, diff digest 52933533bd541ec98789f591a96964c4496a5abd5de4c44d3d7ad135d7eb0e8a, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/063-store-tests branch from 30e15da to 3e91c05 Compare November 6, 2026 01:48
@bartekus
bartekus force-pushed the impl/063-capture-acquire branch from 81d14fa to 8f44257 Compare November 6, 2026 01:48
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff across all changed paths.

capture.rs: The refactor of outputs to delegate to outputs_with_sources with an empty slice preserves the original behavior exactly. The new outputs_with_sources function's signature and delegation to assemble_with_sources are consistent with the original call site.

runtime.rs: The call site switches from crate::capture::outputs to crate::capture::outputs_with_sources and passes &source_descriptors. The variable source_descriptors is not defined within the visible hunk, but its use at this location is structurally consistent with the surrounding runtime dispatch pattern for capture cases. No visible scope or type mismatch.

tests/runtime.rs: The test constructs a 5-step acquisition plan (lookup0–lookup4), provides 7 paginated answers (lookup0 and lookup1 each return a page-1 continuation, the other three terminate on page 0), asserts pages.len() == 7 per bundle, asserts "status":"reproduced" per replay, and asserts outputs.len() == 8 (record + result + bundle + replay for each of the two decisions). These counts are mutually consistent with the expected golden files.

Expected golden files: embedded.bundle.json and external.bundle.json each contain 7 acquisition pages with sequences 0–6. lookup0 and lookup1 each appear twice (pages 0 and 1) with distinct request hashes and ascending sequence numbers; lookup2–4 appear once each. The replay files both carry "status":"reproduced" and "supplies":0. Internal SHA-256 digests are cross-consistent between the bundle's retained bytes and the per-page digest fields.

Fixture files: capture-acquire.plan.json has 5 acquisition steps, all pointing to the same catalog source (sha256:1938f...). capture-catalog.source.json identity (sha256:1938f...) matches the source reference in the plan and in the bundles' sources array.

Spec text (spec.md): The added paragraph accurately describes the case — five acquisitions, two of them paged, seven pages total, reproduced replay, capture::outputs_with_sources as the assembly entry point.

No bugs, security problems, or governance inconsistencies are supported by the supplied evidence.

{"head": "8f442579f6b92475abc7a010ff002f8ef8f2519e", "verdict": "no-findings", "findings": []}

Subject: 3e91c05...8f44257, diff digest 52933533bd541ec98789f591a96964c4496a5abd5de4c44d3d7ad135d7eb0e8a, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/063-store-tests branch from 3e91c05 to fdacda6 Compare November 6, 2026 01:57
@bartekus
bartekus force-pushed the impl/063-capture-acquire branch from 8f44257 to f2d0b71 Compare November 6, 2026 01:57
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff for bugs, security problems, and inconsistencies.

specs/063-node-binding-parity/spec.md — The inserted paragraph documents Increment 1's acquisition coverage as runtime.capture-replay-acquire. It is correctly placed before the existing Increment 4 block, describes five acquisitions, two paged, seven pages total, and reproduced replay, all matching the test and expected files. The reference to capture::outputs_with_sources names the new public function accurately.

tools/rustev-conformance/src/capture.rs — outputs() now delegates to outputs_with_sources() with an empty slice, preserving all existing call sites. The new function is a clean extension; no logic is altered for the non-source path.

tools/rustev-conformance/src/runtime.rs — The call site correctly passes source_descriptors to outputs_with_sources, wiring the runtime's resolved source descriptors through to assembly. No other call sites are affected.

tools/rustev-conformance/tests/runtime.rs — capture_acquire_case

  • Five steps (lookup0–lookup4), acquisition limits max_calls:10 / max_items:25 / max_bytes:32768. Consistent with the plan fixture and the plan embedded in the bundle files.
  • Seven source answers: pages 0–4 for lookup0–4 (lookup0 and lookup1 carry next: offset:1, lookup2–4 carry next:"none"), then pages 1 for lookup0 and lookup1 (next:"none"). Gives 7 total pages, matching assert_eq!(pages.len(), 7) and the bundle files.
  • Both decisions use the same answers for embedded and external, which is correct since each decision independently consumes from its own answer pool.
  • Assertions on per[0]["page"]/per[1]["page"] and per[0]["request"] != per[1]["request"] are well-formed: page-1 requests include the offset parameter and therefore hash differently.
  • assert_eq!(outputs.len(), 8) correctly matches 4 files × 2 decisions (bundle, record, result, replay).
  • "supplies": 0 in both replay files verifies no source call during replay. This is confirmed by the expected embedded.replay.json and external.replay.json.

Expected output files — Internal cross-checks:

  • embedded.bundle.json / external.bundle.json: "capture":"complete", 7 acquisition pages with correct sequences (0–6), two requests (sha256:9e7155… for page 0, sha256:5f27f4… for page 1).
  • embedded.record.json / external.record.json: tier data matches pages (lookup0 and lookup1 each have 2 pages with the two distinct request hashes; lookup2–4 have 1 page each). Item counts and stopped_by:"exhausted" are consistent with max_pages:2.
  • Replay files: "status":"reproduced", "supplies":0. Consistent with the spec prose.
  • Result files: "status":"judged" for both. Consistent with the termination:"judged" in the run records.

Governance — No managed files are changed, no lifecycle or authority fields are modified. Spec 063 already exists in the base tree; this PR adds conformance coverage and test fixtures for it. No approval or ratification claims are made in the diff.

No concrete defects found.

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

Subject: fdacda6...f2d0b71, diff digest 52933533bd541ec98789f591a96964c4496a5abd5de4c44d3d7ad135d7eb0e8a, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/063-capture-acquire branch from f2d0b71 to 2f035ae Compare November 6, 2026 02:04
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the PR for correctness, security, and consistency against the governance context.

Spec change (specs/063-node-binding-parity/spec.md)

The added paragraph documents "Increment 1's acquisition coverage" and is inserted between the end of the increment 3 description and the **Increment 4, 2026-11-06** heading. This is a retroactive documentation note for increment 1 added in what is clearly an increment 4 commit; the placement is out of chronological order relative to the increments structure, but it is a documentation clarification, not a behavior claim, and does not conflict with any governance rule about spec ordering.

capture.rs refactor

outputs() now delegates to outputs_with_sources() with sources: &[], preserving all existing callers. The new function passes sources through to assemble_with_sources, which previously always received &[]. The change is correct and backward-compatible.

runtime.rs call-site change

capture::outputs is replaced with capture::outputs_with_sources(..., &source_descriptors). The variable source_descriptors is not visible in the truncated diff, but the fixture files were clearly generated by running the test, confirming the reference compiles and produces the expected output.

New test capture_acquire_case

  • Five steps cloned from one acquire_definition step, each given a distinct id — correct.
  • max_calls: 10 to cover five steps × max two pages each — correct.
  • answers has 7 entries (5 first pages + 2 second pages for lookup0 and lookup1) — matches the spec text "seven captured pages" and the bundle assertions.
  • assert_eq!(outputs.len(), 8) matches record + result + bundle + replay for each of two decisions.
  • Assertions on acquisition_pages for paged steps check page values (0, 1) and that requests differ between pages and sequences are ordered — all internally consistent with the fixture files.

Fixture consistency

Both embedded.* and external.* fixtures contain 7 acquisition_pages entries consistent with the test assertions. The embedded.bundle.json embeds full page bytes while external.bundle.json uses digest references — both are structurally consistent with the respective retention modes. The plan digest sha256:8a68fc4525e... and definition digest sha256:51b523d0cf... are consistent across the bundle, record, replay, and result files.

No concrete defects found.

{"head": "2f035ae1e189ac06e095a0065a33579e04d3b550", "verdict": "no-findings", "findings": []}

Subject: 8d5f107...2f035ae, diff digest 52933533bd541ec98789f591a96964c4496a5abd5de4c44d3d7ad135d7eb0e8a, 1 call(s). An AI comment is not an approval.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the diff. The change adds a new conformance test case runtime.capture-replay-acquire for spec 063, refactors capture::outputs to delegate to a new outputs_with_sources, updates the runtime runner to pass source descriptors, and adds expected golden files and fixtures.

Structural checks

  • capture.rs: The refactor is clean — outputs delegates to outputs_with_sources with &[], preserving all existing callers. No behavioral change for them.
  • runtime.rs: The hunk switches from outputs(&input, …) (which hard-coded &[]) to outputs_with_sources(&input, …, &source_descriptors). The variable source_descriptors was already in scope; this is the targeted fix.
  • Expected files: The embedded bundle contains 7 acquisition-page entries (lookup0-4 on page 0, plus lookup0 and lookup1 on page 1), consistent with the spec's "five acquisitions, two of them paged" producing 5 + 2 = 7 pages. Replay files carry "status":"reproduced" for both decisions. The 8-output assertion (4 files × 2 decisions) matches the directory contents.
  • Internal consistency of digest values in embedded vs. external retention appears correct — external mode uses content-addressed reference = digest, matching the convention used elsewhere in the bundle schemas.

Finding

The spec paragraph inserted before Increment 4 labels this as "Increment 1's acquisition coverage," but the test's doc comment in tests/runtime.rs (line 1265) explicitly states the case covers increments 1 and 3 ("063 increments 1 and 3"). The spec text and the test comment contradict each other on which increments are exercised, which could mislead readers auditing increment 3's test coverage.

{
  "head": "3e7842c40ec0a78b380eee68f8a8fcd1cd0f5d2c",
  "verdict": "findings",
  "findings": [
    {
      "path": "specs/063-node-binding-parity/spec.md",
      "line": 816,
      "severity": "low",
      "category": "correctness",
      "summary": "The inserted paragraph says 'Increment 1's acquisition coverage' but the mirroring test comment (tests/runtime.rs line 1265) says the case covers increments 1 and 3; the spec text should name both increments to avoid gaps in coverage attribution."
    }
  ]
}

Subject: a56901b...3e7842c, diff digest 832c0732a442debba90b51bbfa3b128ea97c0b72e30ac513587a729e4415db55, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception November 6, 2026 08:16 — with GitHub Actions Error
bartekus added a commit that referenced this pull request Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff against governance context and repo structure.

specs/063-node-binding-parity/spec.md — The added paragraph documents runtime.capture-replay-acquire as increment 1's acquisition coverage running through increment 3's source seam, captured embedded and external, replayed reproduced from seven pages. This is consistent with the test: five steps (lookup0–lookup4), lookup0 and lookup1 each produce two pages (paged on {"offset":{"integer":1}}), the other three produce one each — 7 pages total. The claim of reproduced status is validated in the test. The claim of rust-api and native surfaces matches the "surfaces":["rust-api","native"] field in the generated case JSON.

tools/rustev-conformance/src/capture.rs — outputs now delegates to outputs_with_sources with an empty slice, preserving all existing behavior. outputs_with_sources is correctly pub and receives the source descriptors, which are forwarded to assemble_with_sources. Clean, non-breaking refactor.

tools/rustev-conformance/src/runtime.rs — The call site now passes source_descriptors instead of &[]. The source_descriptors variable must already be in scope at that point in the function (it was computed earlier from the case's source configuration); this change correctly threads plan source descriptors into assembly so the bundle records them for replay.

tools/rustev-conformance/tests/runtime.rs — The test constructs five identical acquire steps with max_pages: 2, gives a source that answers the first two steps with a continuation and the rest as final, producing exactly 7 pages. Assertions check: acquisition_pages.len() == 7, each of lookup0 and lookup1 has two pages with monotone sequence numbers and distinct request hashes, replay status is "reproduced", and total output count is 8 (record + result + bundle + replay for each of "embedded" and "external").

Expected fixture files — embedded.bundle.json has 7 entries in acquisition_pages with correct step/page/sequence assignments and matching digests in the run and core.recorded sections. The external bundle uses content-hash references consistent with how external retention is represented elsewhere in the corpus. embedded.replay.json and external.replay.json both show "status":"reproduced" with "supplies":0 as expected for a replay that consumed no source calls.

No concrete defects found.

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

Subject: a56901b...b1d33f2, diff digest df7bf3b3e685a6b550f375bb46db8c19db63e795ce91379a03b32a9602ca803d, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/063-store-tests branch from a56901b to e49d5d9 Compare November 6, 2026 09:17
bartekus added a commit that referenced this pull request Nov 6, 2026
@bartekus
bartekus force-pushed the impl/063-capture-acquire branch from b1d33f2 to 6734f96 Compare November 6, 2026 09:17
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the PR against the governance context and the diff.

Spec text (specs/063-node-binding-parity/spec.md): The added paragraph correctly describes the new conformance case — five acquisition steps, two of which page, captured in both embedded and external modes, replayed reproduced with no source call. The count of seven captured pages (five first pages + two second pages for lookup0/lookup1) is consistent with the test code and expected output files.

capture.rs refactor: outputs now delegates to outputs_with_sources(input, retain, &[]), preserving its original behaviour (the previous hardcoded &[] becomes the third argument). The new pub function is an internal conformance-tool surface; no production boundary concern.

runtime.rs call site: The hunk replaces crate::capture::outputs(...) with crate::capture::outputs_with_sources(..., &source_descriptors). The variable source_descriptors is not introduced in this hunk but must be in scope from the surrounding function (the diff context shows it immediately inside a block that processes sources; the test sets up explicit sources and the case compiles and produces the correct golden output). No contradiction is visible in the supplied evidence.

Test logic (tests/runtime.rs): Seven answer pages match the expected seven acquisition-page entries in both bundle files. The two-page steps (lookup0, lookup1) are verified to have sequential page values 0 and 1 and distinct request hashes. Replay status reproduced with supplies:0 in the expected .replay.json files is consistent with the replay consuming only captured pages. The final assertion outputs.len() == 8 correctly counts four output kinds × two decisions.

Digest consistency: The plan identity sha256:eb1f2... and source identity sha256:1938f8... appear identically in the fixture JSONs and all eight expected output files. External and embedded bundles differ only in retention shape (external vs retained), which is the correct structural distinction.

Expected files: Both embedded and external bundles carry "capture":"complete", "acquisition_pages" of length 7, and correct sequence ordering (0–6). The inner run and evidence blobs in embedded.bundle.json and embedded.record.json are consistent with each other. No internal digest contradictions are visible.

No concrete defects found.

{"head": "6734f96ec332302671fc351d87200bdf236e2e80", "verdict": "no-findings", "findings": []}

Subject: e49d5d9...6734f96, diff digest 738d5aac9e403fa1ce301b0c504bccd8c6ecf8b43155378d87c8af2d9944e7bc, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/063-store-tests branch from e49d5d9 to fe4e7a6 Compare November 6, 2026 09:21
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff systematically across the five changed areas.

specs/063-node-binding-parity/spec.md

The new paragraph (lines ~843–848) is appended directly after the preceding sentence with no blank line separator. In the rendered Markdown this merges into the previous paragraph rather than standing alone. Low-severity style, not a correctness defect; leaving as a note rather than a finding.

tools/rustev-conformance/src/capture.rs

outputs now delegates to outputs_with_sources with an empty slice, preserving all existing call sites. The refactoring is backward-compatible and the logic inside the function body is unchanged.

tools/rustev-conformance/src/runtime.rs

The diff replaces &[] with &source_descriptors. The variable is not defined in the shown hunk; it must be in the surrounding context omitted by the diff. Because the compilation would fail if it were absent and there is no evidence in the supplied diff that it is missing, nothing to report here.

tools/rustev-conformance/tests/runtime.rs — the new test

Spot-checks:

  • Five steps (lookup0–lookup4) × max 2 pages each → 7 pages total (5 first-pages + 2 second-pages for lookup0 and lookup1). The assert_eq!(pages.len(), 7) assertion is consistent.
  • outputs.len() == 8: 2 decisions × 4 file types (record, result, bundle, replay) = 8. Correct.
  • "supplies":0 in both replay files is consistent with "replayed without a source call."
  • Both embedded and external decisions use identical source answers, so their core evidence is identical (only decision_id differs).

Expected output files

  • Plan digest sha256:eb1f218... matches across all eight expected files.
  • Snapshot digest sha256:c18bca6... matches across all files.
  • 7 acquisition pages in both embedded.bundle.json and external.bundle.json.
  • External bundle correctly uses "retention":{"external":{...}} for all blobs; embedded bundle inlines the bytes.
  • Run digest differs between embedded (f32329f8...) and external (9acc78fa...) because decision_id differs — correct.
  • embedded.replay.json and external.replay.json both show "status":"reproduced" and "supplies":0 — consistent with the replay claim.

No concrete defects found.

{"head": "49faf6e08c30503ae29bab1e0d9349033ce54632", "verdict": "no-findings", "findings": []}

Subject: 531624e...49faf6e, diff digest 738d5aac9e403fa1ce301b0c504bccd8c6ecf8b43155378d87c8af2d9944e7bc, 1 call(s). An AI comment is not an approval.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff: spec documentation update, new conformance fixtures and expected outputs, a small refactor in capture.rs splitting outputs into outputs + outputs_with_sources, the matching call-site change in runtime.rs, and a new test capture_acquire_case.

Spec text (spec.md): The added paragraph is placed between the increment 3 narrative and the **Increment 4** heading. The text's claim — five acquisitions, two paged, seven captured pages, replayed reproduced without a source call — is consistent with the test code (5 steps × answers array of length 7, assert_eq!(pages.len(), 7, …), and the replay assertion on "status": "reproduced").

Fixture consistency: capture-acquire.plan.json contains a plan with five acquisition steps (lookup0–lookup4), each referencing sha256:1938f8... as the catalog source. That identity appears in capture-catalog.source.json and in every bundle's sources array and plan field. The definition_id (sha256:51b523...) and plan_id (sha256:eb1f21...) are consistent across plan fixture, embedded bundle, embedded record, replay outputs, and external equivalents.

Page accounting: Seven acquisition pages (5 first-pages + 2 second-pages for lookup0 and lookup1); aligns with the answers array (7 entries), the spec description ("seven captured pages"), and assert_eq!(pages.len(), 7). The per-step loop checks exactly lookup0 and lookup1 have 2 pages each, lookup2–lookup4 have 1 each (implicitly, via total count).

capture.rs refactor: outputs now delegates to outputs_with_sources(&[], …), preserving existing behavior. The new pub fn outputs_with_sources threads sources through to assemble_with_sources. The change to runtime.rs passes &source_descriptors where &[] was previously hardcoded; this is the spec 063 §3.8 requirement that assembly receives source descriptors for a plan bound to acquisition sources.

Double-use of answers in the test: answers is a serde_json::Value and is used twice in json!({"embedded": answers, "external": answers}). Whether this compiles depends on serde_json's internal macro expansion: if the catch-all arm serializes by reference (&T) rather than by move, both uses borrow answers and the code is valid. The presence of committed expected-output files (which the keep() calls produce only when the test actually runs) is evidence the test compiles and executes successfully. No finding reported without clearer evidence of a defect.

Security: No credential handling, no unsafe code, no I/O boundary violations in the changed paths. The expected files contain only synthetic test digests and test-scoped tenant/scope/revision strings.

No concrete defects found that the supplied evidence supports.

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

Subject: 5ca0bac...b8da75d, diff digest 738d5aac9e403fa1ce301b0c504bccd8c6ecf8b43155378d87c8af2d9944e7bc, 1 call(s). An AI comment is not an approval.

bartekus added a commit that referenced this pull request Nov 6, 2026
@bartekus
bartekus force-pushed the impl/063-capture-acquire branch from b8da75d to a9d0187 Compare November 6, 2026 11:29
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff across the five areas of change.

spec 063 body edit (specs/063-node-binding-parity/spec.md)

The added paragraph documents runtime.capture-replay-acquire inside the existing Increment 1 prose. No frontmatter is touched, so no lifecycle or authority claim changes. The text claims "five acquisitions, two of them paged … seven captured pages … replayed reproduced … with no source call." Each of those claims is verified against the fixture data below.

Fixture data consistency check

Both embedded.bundle.json and external.bundle.json carry exactly 7 acquisition_pages entries: steps lookup0–lookup4 at page 0 (5 entries) plus lookup0 and lookup1 at page 1 (2 entries). The sequence numbers are strictly increasing. The next field in the retained page bytes is {"offset":{"integer":1}} for the first pages of lookup0/lookup1 and "none" for all others, which is what drives the paging. Both replay files carry "status":"reproduced" and "supplies":0. All consistent with the spec prose.

capture.rs refactor

outputs now delegates to outputs_with_sources with sources = &[], preserving its prior behaviour identically. The new function signature threads caller-supplied SourceDescriptor slices into assemble_with_sources, which previously always received &[] from this path. No semantic change to the existing call site.

runtime.rs wiring

The capture loop now calls outputs_with_sources(&input, &settings.retain[id], &source_descriptors). source_descriptors must be in scope at that point in run(); since the diff compiles (the CI gate would catch otherwise) and the surrounding context is not modified, this is consistent.

tests/runtime.rs test

Five acquisition steps are built, each with max_pages: 2. The answer script provides 7 responses in the documented order. The test asserts pages.len() == 7, validates that lookup0/lookup1 each contribute pages 0 and 1 with distinct requests and increasing sequences, verifies replay status is "reproduced", and counts exactly 8 output files (4 per decision). All assertions are consistent with the expected files in the diff. The capture-generation.snapshot.json fixture is built inline into fx and passed directly to runtime::run; it does not need to pre-exist on disk for the test to execute correctly.

No bugs, security problems, authority changes, or ratification changes found.

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

Subject: 348c18e...a9d0187, diff digest 738d5aac9e403fa1ce301b0c504bccd8c6ecf8b43155378d87c8af2d9944e7bc, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/063-store-tests branch from 348c18e to 0303912 Compare November 6, 2026 18:14
bartekus added a commit that referenced this pull request Nov 6, 2026
@bartekus
bartekus force-pushed the impl/063-capture-acquire branch from a9d0187 to 30e33e9 Compare November 6, 2026 18:14
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff against the governance context and the repository's rules.

Scope of changes. The PR adds a new conformance case runtime.capture-replay-acquire to spec 063, supplies its expected outputs and fixtures, refactors capture::outputs into a wrapper around a new outputs_with_sources helper, threads source descriptors through the capture path in runtime.rs, and adds the driving test.

Spec-first requirement (Constitution III / AGENTS.md). The spec file is updated before the code and test, and the paragraph correctly names the case, its runner surfaces, and the mirror test. No issue.

Managed files. None of .github/workflows/statecraft-*.yml, scripts/statecraft/*, .statecraft/setup/*, or .github/CODEOWNERS are touched. The owner exception is not needed.

Lifecycle / ratification. The diff adds only prose to spec 063; it does not advance or change the status/implementation keys. No ratification concern.

Backward compatibility of outputs. outputs is now a one-line wrapper calling outputs_with_sources with an empty slice — identical behaviour for all existing callers. The refactor is correct.

Test correctness.

  • Five steps × max_pages 2 → worst case 10 source calls; acquisition limit max_calls:10 is set to match.
  • answers has 7 entries: 5 first pages (lookup0–lookup4, all using next.offset.integer:1 for lookup0 and lookup1, "none" for the rest) plus 2 second pages (lookup0 p1, lookup1 p1 → "none"). The comment and the spec paragraph are consistent with that count.
  • The bundle assertions check acquisition_pages.len() == 7, two-page coverage for lookup0 and lookup1 specifically, different request hashes across pages, and ascending sequence values — all verifiable from the expected fixtures, which show exactly that structure.
  • outputs.len() == 8: record + result + bundle + replay × 2 decisions = 8. Correct.
  • "status":"reproduced" and "supplies":0 in both replay fixtures match the spec claim that replay uses no source call.

Authority / security. No changes to approvals, owners, or trust boundaries. The new public outputs_with_sources is an internal conformance-tool function; no security surface is opened.

No concrete defects found.

{"head": "30e33e965e6a35896978ffcdee34c5d311489533", "verdict": "no-findings", "findings": []}

Subject: 0303912...30e33e9, diff digest 738d5aac9e403fa1ce301b0c504bccd8c6ecf8b43155378d87c8af2d9944e7bc, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus force-pushed the impl/063-store-tests branch from 0303912 to bbe7b09 Compare November 6, 2026 18:17
bartekus added a commit that referenced this pull request Nov 6, 2026
@bartekus
bartekus force-pushed the impl/063-capture-acquire branch from 30e33e9 to 09d0275 Compare November 6, 2026 18:17
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the PR, which adds conformance case runtime.capture-replay-acquire to spec 063, covering acquisition-page capture and replay.

spec.md addition (specs/063-node-binding-parity/spec.md, line ~843)

The new paragraph is inserted before "Increment 4" and correctly describes the case as belonging to increment 1's acquisition coverage running through increment 3's source seam. The placement is consistent with the surrounding narrative structure. No contradiction with adjacent text.

capture.rs refactor

outputs now delegates to outputs_with_sources with an empty slice — the behaviour is identical to what it was before, so existing callers are unaffected. The new public function's signature is consistent with how assemble_with_sources is called downstream.

runtime.rs change

source_descriptors is used at the call site; it must be defined in the unchanged part of the function (not visible in the hunk). The change is a straightforward threading of an already-computed value to the new API. No issue.

Test logic (tests/runtime.rs)

  • Five steps, each with max_pages:2, global max_calls:10: the worst-case budget (5 × 2 = 10) matches exactly.
  • Seven answers: five first-page answers (pages 0 of lookup0–4) plus two continuation answers for the two steps that return a next-page cursor. The assert_eq!(pages.len(), 7, ...) assertion matches.
  • The check assert_ne!(per[0]["request"], per[1]["request"]) is correct: the continuation request carries an offset cursor, so its hash must differ.
  • outputs.len() == 8 = 4 files × 2 decisions (embedded, external). Correct.

Fixture consistency

Both bundles reference plan identity sha256:eb1f... and definition id sha256:51b5... consistently. The replay files both carry "status":"reproduced". The external bundle uses "retention":{"external":{...}} throughout, matching the embedded bundle's "retention":{"retained":{...}} pattern. Cross-checking the acquisition-page sequence numbers (0 through 6) and step names against the answer order: consistent.

Governance

tools/rustev-conformance/cases is excluded from review (review.exclude); the generated case file lands there. The expected/ directory is not excluded and is in scope; CI's bless/harvest checks verify those bytes against their source. No managed files are hand-edited. No spec lifecycle or authority change.

No concrete defects found.

{"head": "09d02752cc402070be809601d545c7aca78c76e3", "verdict": "no-findings", "findings": []}

Subject: bbe7b09...09d0275, diff digest 738d5aac9e403fa1ce301b0c504bccd8c6ecf8b43155378d87c8af2d9944e7bc, 1 call(s). An AI comment is not an approval.

Base automatically changed from impl/063-store-tests to main November 6, 2026 18:59
…ition pages

Increment 1's acquisition coverage, joined with increment 3: five
acquisitions, two paged, captured embedded and external with the plan's
source descriptors and replayed reproduced without a source call, on
rust-api and native with identical bytes.
@bartekus

bartekus commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

M1: #525 merged and #526 now targets main. It needs a restack onto main (M5) for a main-based run; M1 arms on green.

@bartekus
bartekus force-pushed the impl/063-capture-acquire branch from 09d0275 to 57cf57c Compare November 6, 2026 19:03
@bartekus

bartekus commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

M5: rebased onto main at 96b480c (#525 merged); clean, with make refresh and make gate run at every commit. Re-bless found nothing new. Locally at 57cf57c: make code, node tests 90 pass, run.mjs native 226 cases 0 failures, verify 027 passed. The record reads increments 1, 2, 3a, 3, 4 in order. Ready to arm on green.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

AI review (no-findings)

Looking at this PR, I'll check the spec change, the refactored capture module, the new conformance test, and consistency between the expected fixtures and the test logic.

Spec change (specs/063-node-binding-parity/spec.md): The added text documents runtime.capture-replay-acquire as increment 1's acquisition coverage running through increment 3's source seam. The claim — five acquisitions, two paged, seven total captured pages — is verifiable against the fixtures: 5 steps × 1 first page + 2 steps × 1 second page = 7, matching acquisition_pages.length in both bundle files. The description is internally consistent.

capture.rs refactor: outputs is rewritten to delegate to outputs_with_sources with an empty slice, preserving its prior behavior. outputs_with_sources threads the caller-supplied sources slice down to assemble_with_sources, which previously always received &[]. The change is minimal and correct.

runtime.rs call site: The existing call to crate::capture::outputs(...) is updated to outputs_with_sources(..., &source_descriptors), which is the right call to pass source descriptors to assembly for capture cases that have acquisition steps.

tests/runtime.rs — new test: The fixture map builds three files (capture-acquire.plan.json, capture-catalog.source.json, capture-generation.snapshot.json). The plan has 5 acquisition steps each with max_pages: 2; the source answers 7 pages (5 first pages in step order, then 2 second pages for lookup0 and lookup1). Assertions check: 7 total acquisition pages, 2 per paging step with distinct requests and ordered sequences, replay status reproduced, and 8 total outputs (4 per decision × 2 decisions). All of these match the expected fixtures.

Fixture consistency: The embedded.bundle.json sequences 0–4 are the five page-0 fetches, and sequences 5–6 are the page-1 fetches for lookup0 and lookup1, with two distinct request hashes. The external bundle mirrors this structure with external retention references. Both replay files show "status":"reproduced". Timestamps are fixed (created_at_ms: 1790164800000, expires_at_ms: 1790769600000, difference = 7 days), making the test deterministic.

No bugs, security issues, authority changes, or governance violations are supported by the evidence.

{"head": "57cf57c9c62bb25dee33633d8db958e0fc7076ba", "verdict": "no-findings", "findings": []}

Subject: 96b480c...57cf57c, diff digest 738d5aac9e403fa1ce301b0c504bccd8c6ecf8b43155378d87c8af2d9944e7bc, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit e9fe4c4 Nov 6, 2026
26 checks passed
@bartekus
bartekus deleted the impl/063-capture-acquire branch November 6, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

m5 Opened by the M5 worker; M1 arms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant