Skip to content

test(vcr-mem): layer-2 end-to-end budget pipeline on real gust fixture (#242, #383) - #423

Merged
avrabe merged 1 commit into
mainfrom
vcr-mem-001-layer2-e2e-pipeline-test
Jun 22, 2026
Merged

test(vcr-mem): layer-2 end-to-end budget pipeline on real gust fixture (#242, #383)#423
avrabe merged 1 commit into
mainfrom
vcr-mem-001-layer2-e2e-pipeline-test

Conversation

@avrabe

@avrabe avrabe commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What

Closes the join that the #392 scry spike and the shadow_budget unit suite (#421) each cover only half of:

layer2_budget_pipeline_msgq_end_to_end_383 (synth-cli main.rs cfg(test)) runs the full chain on the real msgq_put_359.wasm gust fixture:

scry::analyze(msgq) → StackBound::Bytes(32)
  → [adapter 1:1] → StackDepthBound::Bytes(32)
  → budget_from_bound(_, sp_init=65536, fallback=Some(4096))
  → BudgetDecision::Use { bytes: 32, source: ProvenStackDepth }

It asserts the 2048× over-reservation (the 65536-byte declared page) collapses to a proven 32-byte budget — and that with a fallback available, the proven path is preferred over the asserted one (ProvenStackDepth, not AssertedFallback).

Frozen-safe

scry-sai-core stays a dev-dependency exercised only under cfg(test), so the production binary pulls no scry and emits identical bytes — the change is entirely in #[cfg(test)] code. No MODULE.bazel pin (tests aren't in the Bazel graph). Independent of the from_cargo migration (#422) — it uses the existing dev-dep under the current resolution.

The inline 1:1 StackBound → StackDepthBound map is the adapter that becomes impl From<scry::StackBound> when step 2b promotes scry to a (feature-gated) production dep. This test is the oracle that the gated --shadow-stack-size auto wiring must match.

Verification

  • cargo test -p synth-cli --bin synth layer2_budget_pipeline → pass (alongside the 9 shadow_budget units)
  • cargo fmt --check clean; cargo clippy -p synth-cli --all-targets -- -D warnings clean
  • rivet check → zero non-xref errors; roadmap VCR-MEM-001 updated with the end-to-end criterion

Refs #242 (VCR epic), #383 (layer-1).

🤖 Generated with Claude Code

#242, #383)

Closes the join the #392 spike and the shadow_budget unit suite each cover
only half of: `layer2_budget_pipeline_msgq_end_to_end_383` (synth-cli main.rs
cfg(test)) runs scry's `analyze()` on the REAL msgq_put_359.wasm gust
fixture, maps its proven StackBound through the synth-owned StackDepthBound
(the 1:1 adapter that becomes `impl From<scry::StackBound>` when 2b promotes
scry to a production dep), feeds `budget_from_bound`, and asserts the 2048x
over-reservation (65536 B page) collapses to a PROVEN 32-byte budget —
source=ProvenStackDepth, preferred over the asserted 4096 fallback.

Frozen-safe: scry-sai-core stays a DEV-dependency exercised only under
cfg(test), so the production binary pulls no scry and emits identical bytes
(the change is entirely in #[cfg(test)] code). No MODULE.bazel pin (tests are
not in the Bazel graph). Independent of the from_cargo migration (#422) — it
uses the existing dev-dep under the current resolution.

This test is the oracle the gated 2b wiring (`--shadow-stack-size auto`) must
match. Roadmap VCR-MEM-001 updated with the end-to-end criterion.

Verification: `cargo test -p synth-cli --bin synth layer2_budget_pipeline` →
pass (alongside the 9 shadow_budget units); fmt + clippy -D warnings clean;
rivet check zero non-xref errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@avrabe
avrabe merged commit 3a6321e into main Jun 22, 2026
14 checks passed
@avrabe
avrabe deleted the vcr-mem-001-layer2-e2e-pipeline-test branch June 22, 2026 16:19
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/synth-cli/src/main.rs 90.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

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