Skip to content

test(w9): public charge of a violation and stale-before-evaluation witness - #1220

Merged
flyingrobots merged 2 commits into
mainfrom
test/w9-public-limits
Dec 2, 2026
Merged

flyingrobots merged 2 commits into
mainfrom
test/w9-public-limits

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Closes the two remaining limits of the Ambyte W9 evidence, both through Echo's public API.

  1. EchoOperationViolationV1::charge() reports a bounded-read violation's charge: the field for ChargeExceedsBound, 0 for every other violation (specification TA-Viol). It is computed from the recorded violation; the C016 tag 9 encoding is unchanged. capability_violation asserts Echo's charge equals the oracle's (0), field by field.
  2. stale_basis_refused replaces the grant with one lacking ReadAtoms and submits, through tick_once, the read on the old basis and, as calibration, on the current basis. The current one is Violated(CapabilityNotGranted); the old one is RefusedStale, anchored to the submitted old basis, with no observation. This shows the stale refusal precedes evaluation's first act.

Failing first:

  • Part 1: no charge method (compile error E0599). With the accessor returning 1 for CapabilityNotGranted: Echo's violation charge equals the oracle's left: (1, 0, 0) right: (0, 0, 0).
  • Part 2: with the stale refusal bypassed for that read, the part fails with EchoOutcome: Some(Violated(... violation: CapabilityNotGranted { capability: ReadAtoms } ...)).
    Both mutations were restored before the commit.

Checks: verify-ambyte-w9-conformance.sh (14 parts pass, 0 frontier) and ambyte-w9-low-u-mutation.sh pass; fmt, ban-nondeterminism, clippy (workspace, warp-core default and runtime features, warp-wasm engine) and the new unit test pass. No promoted component's non-test source references warp-core, so no component bytes change and no G4 round is needed.

Summary by CodeRabbit

  • New Features
    • Violation details now report the completed charge when a charge exceeds its bound; other violation types report zero.
  • Bug Fixes
    • Stale-basis requests are refused before read-capability checks, with no observation returned.
  • Tests
    • Added conformance coverage for violation charges and stale-read refusal behavior.

…ion publicly

Report the charge of a bounded-read violation through the public API
(EchoOperationViolationV1::charge: the field for ChargeExceedsBound, 0
otherwise, per TA-Viol), without changing the C016 tag 9 encoding, and
assert it equals the oracle's in capability_violation. Show in
stale_basis_refused that a stale read whose grant lacks ReadAtoms is
published RefusedStale, while the same read on the current basis is
Violated(CapabilityNotGranted).

Agent-Session: 84c4f2c8-461c-47b5-85a3-6a0711d52495
Agent-Tool: claude-code
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds EchoOperationViolationV1::charge() and extends typed-read conformance checks. The tests compare violation charges with the oracle and check that stale reads are refused without an observation, while current-basis reads without ReadAtoms produce Violated(CapabilityNotGranted).

Changes: Typed-read conformance

Layer / File(s) Summary
Violation charge accessor
crates/warp-core/src/echo_operation/action_record.rs, crates/warp-core/src/echo_operation/violation_record_tests.rs
EchoOperationViolationV1::charge() returns the recorded charge for ChargeExceedsBound and zero for other violation variants. A unit test checks these values.
Conformance checks
tests/ambyte-w9-conformance/tests/w9_typed_read_conformance.rs, CHANGELOG.md
The conformance tests compare Echo’s violation charge with the oracle and check the current-basis capability violation and stale-basis refusal outcomes. The changelog describes the accessor and test coverage.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related issues

  • flyingrobots/echo#1083 — The accessor exposes the recorded charge for the violation defined by this issue; this change does not add its evaluator check.
  • flyingrobots/echo#1140 — The stale-basis conformance case checks refusal without an observation alongside a current-basis peer.
  • flyingrobots/echo#1138 — The capability-violation conformance case compares Echo’s zero charge with the oracle’s charge.
  • flyingrobots/echo#1056 — The changes extend the typed-read conformance test package introduced by this issue.

Possibly related PRs

  • flyingrobots/echo#1217 — This PR adds the accessor and conformance checks for violation records and outcomes defined by PR #1217.
Merge Risk: Minimal · up to 2c29a

This change adds a public accessor for the violation charge and extends conformance tests. It does not change runtime behavior or the persisted encoding. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change correctly: a test-only (w9) addition covering the public charge of a violation and the stale-before-evaluation witness. The changeset adds EchoOperationViolationV1::charge()…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change correctly: a test-only (w9) addition covering the public charge of a violation and the stale-before-evaluation witness. The changeset adds EchoOperationViolationV1::charge() and public conformance tests for charge and stale-basis precedence, so the title matches the main change. The title is concise, single-sentence, and uses the conventional type(scope) prefix. Note that the title says 'stale-before-evaluation', but the revised test claims only outcome precedence. The public test does not prove call order; the zero-call invariant is covered by the internal stale_candidate_does_not_reach_evaluation witness. The title therefore slightly overstates what the public test proves.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e541877 and 2c29a45.

Files selected for processing: 4

  • CHANGELOG.md
  • crates/warp-core/src/echo_operation/action_record.rs
  • crates/warp-core/src/echo_operation/violation_record_tests.rs
  • tests/ambyte-w9-conformance/tests/w9_typed_read_conformance.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@flyingrobots

Copy link
Copy Markdown
Owner Author

Council code review, first review: codex, at 63d6a057

The reviewer had every earlier review and disposition, and the audit of constants and numbers was scoped to what this pull request adds or changes. Unedited except that machine-local paths are made repository-relative.


Findings

  • P2 — The public stale witness proves outcome precedence, but its assertions cannot establish evaluator call order. tests/ambyte-w9-conformance/tests/w9_typed_read_conformance.rs:1708 and CHANGELOG.md:19. A regression could evaluate the stale candidate, discard its CapabilityNotGranted verdict, and then publish RefusedStale with the submitted basis and no observation. The current-basis peer would still publish Violated(CapabilityNotGranted), so every new assertion at lines 1781–1820 would pass. The current production code does return stale before calling the evaluator (crates/warp-core/src/echo_operation.rs:6731, :6807). Describe the public witness as proving published-outcome precedence and cite the existing zero-call witness for the ordering guarantee (crates/warp-core/src/echo_operation/bounded_read_tick_tests.rs:305). If W9 requires direct evidence of call order for the missing-capability case, extend that counting witness to use the lacking grant.

Verification Checklist

  • Git range and merges — executed. Inspected the requested three-dot diff, two-dot log, commit parents, status, and git diff --check. The clean checkout matched 63d6a0573a736a10bdeb1ccdf0b6570abeca1531. The range contains one commit, whose sole parent is the pinned base e54187743560a8f3a0d9184cad80183c95590a2c. There were no merges or conflict resolutions to audit.
  • Public charge and specification — inspected. At the oracle revision pinned in tests/ambyte-w9-conformance/Cargo.toml:27, docs/SPEC_ambyte-core-semantics-v0.md:216 and :704–712 prescribe zero for every violation except F5, which reports the completed charge and admitted bound. Echo produces F5 only when the completed charge exceeds that bound (crates/warp-core/src/echo_operation/bounded_read_commit.rs:232–257) and preserves both fields in the public violation (:286–287). The exhaustive accessor returns the recorded charge for F5 and zero for all eight other variants (crates/warp-core/src/echo_operation/action_record.rs:337–349). TA-Cap requires the named capability, zero charge, no reads, and no proposal (Amblicit spec :95–101). The evaluator checks the whole plan’s required capabilities before firing steps (crates/warp-core/src/echo_operation/bounded_read_evaluator.rs:568–594). The witness requires the exact public violation, compares Echo’s accessor against the oracle’s independently checked zero, and checks the unchanged basis and absent observation (tests/ambyte-w9-conformance/tests/w9_typed_read_conformance.rs:1206–1284). A wrong capability or nonzero public charge would fail those assertions. The separate F5 unit case would catch an accessor that always returned zero.
  • Live paths and parallel preparation — inspected. WAL-ack submission (crates/warp-core/src/trusted_runtime_host.rs:9078) reaches admission and scheduler dispatch at :2491–2513. The scheduler resolves the deciding basis and invokes shared preparation (crates/warp-core/src/coordinator.rs:5921–5953). Direct host preparation also calls that function (crates/warp-core/src/trusted_runtime_host.rs:1648–1670). Shared preparation checks basis validity, returns the stale arm with the submitted identity and no observation, or calls the evaluator and maps its violation (crates/warp-core/src/echo_operation.rs:6731–6753, :6793–6830). The test uses two distinct submissions and requires both exact arms. The negative assertion alone cannot distinguish a discarded evaluator call, as described in the finding.
  • Settlement, persistence, and recovery — inspected. Scheduler settlement (crates/warp-core/src/coordinator.rs:6013–6022) aborts a bounded-read unit on a violator and preserves its stale peer’s arm (crates/warp-core/src/echo_operation/settlement.rs:103–105, crates/warp-core/src/echo_operation/settlement/abort.rs:30–40, :68–74). Attempt materialization publishes the stale arm and the violation without an observation (crates/warp-core/src/echo_operation/action_record.rs:2230–2261). The separate committing-peer route publishes stale through crates/warp-core/src/echo_operation/settlement.rs:444–449. WAL error handling precedes public outcome insertion (crates/warp-core/src/trusted_runtime_host.rs:2723–2768). Recovery checks stale against basis validity and capability violations against the retained grant, then reconstructs the same public record (crates/warp-core/src/echo_operation/action_record.rs:2335–2360, crates/warp-core/src/echo_operation/violation_record.rs:126–143, crates/warp-core/src/trusted_runtime_host.rs:7546, :7600–7640). Live and recovered callers use the same accessor. The diff leaves the enum fields and codec untouched, including the existing F5 payload and tag 9 (crates/warp-core/src/echo_operation/action_record.rs:869–993, :1167–1179, :1853–1860). The only production change is a pure accessor, so it introduces no new durability transition or wire version.
  • Constants and documentation figures — inspected. 41 > 40 is a synthetic F5 fixture, with 41 deliberately distinct from the bound. Zero is prescribed by TA-Viol and TA-Cap. U + 3 is 1,048,587, derived from the existing U = 1,048,584, and sits above the admission minimum. The fresh calibration uses U, so the two invocations differ in budget as well as basis. Both budgets satisfy the same threshold, and the capability branch does not consult that budget (tests/ambyte-w9-conformance/tests/w9_typed_read_conformance.rs:97–109, :287, :1745–1764, crates/warp-core/src/echo_operation.rs:4775–4787, crates/warp-core/src/echo_operation/bounded_read_evaluator.rs:574–585). The three u64::MAX values are test policy ceilings for delegated steps, read bytes, and write bytes. The invocation still carries the installation’s delegated budget and the evaluator uses effective limits (tests/ambyte-w9-conformance/tests/w9_typed_read_conformance.rs:739–748, :1727–1736, crates/warp-core/src/echo_operation/bounded_read_commit.rs:85–94). The changelog’s count of two corresponds to two added public assertions, and its zero and tag 9 claims agree with the specification and codec. The claim that both limits are fully shown through the public API is overstated as described in the finding. The PR changes no README, other documentation figures, or evidence files. No added value is a measured performance threshold.
  • Execution and evidence limits. Used read-only Git, grep, and static source inspection. Skipped builds, tests, mutation runs, and WAL restart execution as requested. No calibration output for the new assertions was located in the reviewed tree, so RED-to-GREEN execution remains unverified. No files were modified, and nothing was committed, pushed, or posted.

REQUEST CHANGES

… not

Agent-Session: 84c4f2c8-461c-47b5-85a3-6a0711d52495
Agent-Tool: claude-code
@flyingrobots

Copy link
Copy Markdown
Owner Author

Disposition of the first review: the P2 is accepted. A public observation cannot establish evaluator call order, so the test comment and the changelog now claim only outcome precedence (the stale refusal is published in place of evaluation's first act), and cite the internal stale_candidate_does_not_reach_evaluation (calls == 0) for the never-called invariant. Comment and changelog only; no assertion changed.

@flyingrobots
flyingrobots marked this pull request as ready for review December 2, 2026 00:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T00:09:16.820181Z 2c29a45 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@flyingrobots

Copy link
Copy Markdown
Owner Author

Footprint

4 files, +185/-4 · origin/main...2c29a45a6ac0e121522159b53ddc72f56210906f

Structural analysis unavailable: graft could not be resolved.

Composition
pie showData
    title Changed lines by file kind
    "source" : 43
    "test" : 134
    "docs" : 12
Loading
Kind Files +/- Share
source 2 +43/-0 22.8%
test 1 +130/-4 70.9%
docs 1 +12/-0 6.3%
total 4 +185/-4 100%
Files (4)

docs

  • CHANGELOG.md +12/-0

source

  • crates/warp-core/src/echo_operation/action_record.rs +22/-0
  • crates/warp-core/src/echo_operation/violation_record_tests.rs +21/-0

test

  • tests/ambyte-w9-conformance/tests/w9_typed_read_conformance.rs +130/-4

Figures computed from git diff --numstat. Composition is a sanity check, not a verdict.

Before merge

  • 1 changed file match the guard rule: CHANGELOG.md (version).

After merge

No landing steps are declared: RELEASE.md is absent; AGENTS.md declares no release or landing section. footprint states none rather than inventing them.

After-merge steps are read from this repository's own RELEASE.md and AGENTS.md, never invented. The guard rule is path patterns, documented in footprint's docs/topics/landing/README.md.

Blast radius

Export-surface diff unavailable (graft.exports_failed): graft struct exports e541877 2c29a45 --json exited 1: Error: Git command failed with code 128.

Exported symbols from graft struct exports --json (graft.cli.struct_exports 1.0.0). Whatever graft parses counts as an export surface, including fields in config and lock files.

Every changed source file was in a language footprint recognises graft's grammars can parse.

Open pull requests

6 of 7 other open pull requests touch a file this change touches. 1 pull request's files could not be read.

This change against its base: git merge-tree merges them cleanly.

  • Execute structured bounded effect loops and branches in the runtime; keep ordered profiles closed #974 Execute structured bounded effect loops and branches in the runtime; keep ordered profiles closed (draft) — CHANGELOG.md · git merge-tree conflicts in CHANGELOG.md, crates/warp-core/src/edict_effects/compiled_program.rs, crates/warp-core/src/edict_effects/control_order.rs and 5 more files
    • CHANGELOG.md: symbol level undetermined — graft has no grammar for .md files, so the file has no symbols to compare
  • feat(warp-core): admit a bounded read against U and B (candidate) #1190 feat(warp-core): admit a bounded read against U and B (candidate) (draft) — CHANGELOG.md · git merge-tree conflicts in CHANGELOG.md, crates/echo-edict-provider-lowerer/src/executable_operation.rs, crates/echo-edict-provider-lowerer/src/executable_operation/bounded_read.rs and 36 more files
    • CHANGELOG.md: symbol level undetermined — graft has no grammar for .md files, so the file has no symbols to compare
  • feat(warp-core): decode the bounded-read grant document (candidate) #1193 feat(warp-core): decode the bounded-read grant document (candidate) (draft) — CHANGELOG.md · git merge-tree conflicts in CHANGELOG.md, crates/echo-edict-provider-lowerer/src/executable_operation.rs, crates/echo-edict-provider-lowerer/src/executable_operation/bounded_read.rs and 37 more files
    • CHANGELOG.md: symbol level undetermined — graft has no grammar for .md files, so the file has no symbols to compare

3 more pull requests omitted to keep the comment under GitHub's 65536-character limit; the overlap result line carries every one.

Proposed merge order (4 waves)

Wave 1 — #974

Wave 2 — #1190, #1193, #1199, #1202, after wave 1

Wave 3 — #1204, after wave 2

1 more wave omitted to keep the comment under GitHub's 65536-character limit; the overlap result line carries every one.

18 more conflicts omitted to keep the comment under GitHub's 65536-character limit; the overlap result line carries every one.

Pull requests from gh pr list; their files from gh pr diff --name-only; the symbols of a shared file from git diff -U0 against each side's merge base and the top-level symbols of graft read outline at both ends (24 of at most 24 outline calls this run); merge results from git merge-tree --write-tree on the two heads (22 of at most 300 merges; 0 missing heads fetched into footprint's scratch repository, never the clone), textual evidence and not a guarantee the changes work together. A conflicted edge separates waves and a clean one does not. Merge waves are greedy first-fit over the conflict graph: a proposal, not a minimum, and not a gate.

Changelog
Timestamp SHA Change Reason Remarks
2026-12-02T00:27:06Z 2c29a45 Final head 2c29a45 Before merge Local footprint checkout

@flyingrobots
flyingrobots merged commit 1aac89b into main Dec 2, 2026
44 checks passed
@flyingrobots
flyingrobots deleted the test/w9-public-limits branch December 2, 2026 00:27
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