Repository navigation
perf(agent): state brief snapshot and verify commands once under next (#13673) - #13971
Conversation
…#13673) Brief schema 0.2. The before/after snapshot commands moved from each top seam's verification block to next, and the per-seam verify_command (a copy of next.verify_after_edit) was dropped. Per-seam verification keeps only suggested_test_command. A byte-budget test pins the brief and that each command appears once. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EQRVyeTRLJJXWtwT7E
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 41 minutes. View limit details
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head review (head 4cf74b1)
1 blocking finding: the PR's own new byte-budget test fails at this head on this Windows host. cargo test -p ripr --test cli_smoke agent_brief → agent_output_budget::agent_brief_states_workflow_commands_once panicked at crates\ripr\tests\cli_smoke\agent_output_budget.rs:72: "agent brief --json grew to 9198 bytes, over its 8900-byte agent budget" (measured 9,198 B vs the body's claimed 8,660 B). Root cause, visible in the failure text: the rendered next commands embed the absolute temp workspace in forward-slash form (F:/Temp/ripr-agent-brief-budget-...), while the run() helper normalizes with a single .replace(&root, "<root>") whose needle is the native backslash path (crates/ripr/tests/cli_smoke/agent_output_budget.rs:63-64). On Windows the substitution misses all 10 path occurrences, so the measured size depends on the temp-path length: 10 × (60 − 5) ≈ +550 B over the normalized ≈8,648 B, which matches the 8,660 B claim. The ceiling is not host-stable on Windows. Suggested fix: replace both separator forms of the root in run() (or canonicalize the needle) so the measurement is path-independent, then re-derive the ceiling on the normalized form. Hosted note: windows-gate-run passed at this head while this focused run is red — before merge, please confirm which hosted lane actually executes cli_smoke::agent_output_budget on Windows (several lanes skip in draft state).
Verified
- Move semantics preserved: the relocated commands render from the same
command_rootcomputed once inrender_agent_brief_json(crates/ripr/src/output/agent_brief.rs:38,bound_root(&root_path_display(root))) — the identical rule the old per-seamverification_jsonapplied — so root spelling is byte-identical and only the location moved. Exact-string Unix pins cover the newnext.before/after_snapshot_command(agent_brief.rs:445,agent_brief_next_snapshot_commands_preserve_literal_backslash_unix_root). - Windows root rendering stays owned by
agent::loop_commandshost-explicit tests (root_path_text_for_host(.., true)across verbatim/UNC/space/percent cases,crates/ripr/src/agent/loop_commands.rs:784-808). Residual (low): the replacement test is#[cfg(unix)]-gated, so the brief-level end-to-end Windows rendering of the moved commands is no longer asserted anywhere; leaf-owner coverage carries it. - Refusal envelopes: brief output and refusals share the single
AGENT_BRIEF_SCHEMA_VERSIONconst (crates/ripr/src/cli/commands/agent.rs:129,:574;"0.2"atagent_brief.rs:18), and the smoke helper pins refusal/schema_versionstrictly (crates/ripr/tests/cli_smoke.rs:4855, pointer loop:4891-4892). - Journey tests exercise the rendered commands end-to-end through the new JSON pointers (
crates/ripr/tests/agent_command_journey.rs:793-810) and pass on Windows at this head. - No in-repo consumer of the removed fields: grep over
crates(lsp/mcp/agent/app),xtask, andfixturesfinds no reader oftop_seams[].verification.{before,after}_snapshot_command/verify_command; remainingverify_commandhits are other surfaces (pilot, scorecard, agent status, contractcanonical_item.verify_command). The only brief-shape golden is updated consistently (fixtures/boundary_gap/expected/editor-agent-loop/agent-brief.json), and SPEC-0010 has no remaining0.1/verify_commandreferences at this head.
Findings (non-blocking, documentation parity)
- Medium —
docs/OUTPUT_SCHEMA.md:1681still reads "schema_version("0.1"for diff and agent brief, ...". Actual at this head: agent brief refusals report0.2; diff stays0.1(crates/ripr/src/output/diff_report.rs:266). This PR edits this same file's table row but missed this second occurrence in the same file. - Medium —
docs/specs/RIPR-SPEC-0241-check-json-refusal-envelope.md:202-203carries the same stale claim — in the refusal-envelope spec this change's own acceptance sentence is about. SPEC-0010 and SPEC-0291 were updated; SPEC-0241 was not. - Medium —
docs/specs/RIPR-SPEC-0291-agent-brief-root-display.mdtest mapping no longer resolves::107namesagent_brief_seam_verification_preserves_literal_backslash_unix_root(renamed at this head toagent_brief_next_snapshot_commands_preserve_literal_backslash_unix_root,agent_brief.rs:445) and:109namesagent_brief_verification_preserves_a_literal_backslash_unix_root(deleted at this head). Also stale::41("The agent brief JSON (schema0.1) keeps every field.") and the per-seam Required Evidence at:93/:101; the overlay note at:32-37does not reconcile those sections. No current gate resolves spec::tests::symbols, so hosted checks stay green while the mapping is dead.
Proof run at this head (Windows 10.0.26300, Git Bash, cargo 1.95.0 from ~/.cargo/bin, detached throwaway worktree at the head SHA)
- Main-health premise checked first:
cargo test -p ripr --libcannot compile at this head or on origin/main —crates/ripr/src/output/human.rs:9260and:9264both initializeowner_opt_outs: Vec::new()in one test struct literal (E0062 "fieldowner_opt_outsspecified more than once"). No repair on main (#13954 open; #13951/#13938/#13920 closed unmerged). Per the lane instruction I removed the single line at:9264in the throwaway review worktree only; the PR branch, main, and the shared checkout are untouched, and no patch is included in this review. cargo test -p ripr --lib agent_brief→ 79 passed, 0 failed.cargo test -p ripr --test cli_smoke agent_brief→ 4 ran: 3 passed, 1 failed (the budget test above); exit 101.cargo test -p ripr --test agent_command_journey brief_artifact_command→ 3 passed, 0 failed; exit 0.
These are focused local proof lanes on one Windows host, not the hosted CI matrix.
Residual
- #13426 touches the same renderer (noted in the body); whichever lands second repairs its conflict.
…oc parity (#13673) Normalize both separator spellings of the root in the budget helper so Windows measures the same bytes, and update OUTPUT_SCHEMA, SPEC-0241 and SPEC-0291 for brief schema 0.2. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EQRVyeTRLJJXWtwT7E
|
Thanks, all four findings fixed in 157f947.
Local: cli_smoke Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head review (head 157f947)
Reviewed; 1 blocking finding: the PR's own acceptance-delta byte-budget test fails on Windows at this head because its new root-tokenization normalization never matches on Windows (verbatim-path mismatch). The dedup itself is semantically clean and the rest of the affected surface passes locally. Findings below; 1 blocks merge, two more are small follow-ups worth folding into this PR.
Verified
- Dedup semantics: the removed per-seam
verify_commandwas identical tonext.verify_after_edit(bothagent_verify_command(root, BEFORE, AFTER, None); removed code vscrates/ripr/src/output/agent_brief.rs:85-90at head), and the snapshot commands moved to the samecommand_rootbinding —agent_brief.rs:34-38retains the #4287/#8995bound_root(&root_path_display(root))rule the old per-seam copies computed independently. No root-spelling behavior change. - Schema version is single-sourced: every emission reads
AGENT_BRIEF_SCHEMA_VERSION(agent_brief.rs:18,40;cli/commands/agent.rs:129,574;output/schemas.rs:53,407), so the refusal envelope reports0.2without a literal edit; repo grep at this head found no stale brief"0.1"literal and zero remaining references totop_seams[...]["verification"]paths or a briefverify_commandreader (editors/, lsp/, mcp/ have no brief consumers;agent briefoutput is JSON-only,agent.rs:548-560). Historical CHANGELOG lines are the only old-name mentions. - Honesty invariants: #7391 stays fail-closed —
not_applicablestill serializes nullsuggested_test_command(agent_brief.rs:212-217), pinned by the retained not-applicable test and the new shape pinseam_verification_carries_only_the_suggested_test_command(agent_brief.rs:556). The new budget test asserts each command appears exactly once and no"verify_command"key remains (crates/ripr/tests/cli_smoke/agent_output_budget.rs:143-163). - Docs parity: OUTPUT_SCHEMA.md table row + refusal paragraph, SPEC-0010 JSON examples and field contract, and SPEC-0241 all updated;
diff --jsoncorrectly stays"0.1". SPEC-0291's note blockquote and Test Mapping track the moved fields and the renamed test. - Journey coverage follows the move:
crates/ripr/tests/agent_command_journey.rs:796,805execute the relocatednext.before/after_snapshot_commandstrings verbatim, including the mkdir-prefix-from-foreign-cwd behavior (#7289). - Windows branch of the root rule remains pinned at the component level host-independently:
crates/ripr/src/agent/loop_commands.rs:767-797asserts bothwindows=true(separator normalization) andwindows=false(verbatim) forroot_path_text_for_host, whichroot_path_displaydelegates to. - CI at this exact head: Windows Gate succeeded on
157f94772d96321a55f431a8f75d837ba4853879(run 42563134735, head_sha verified via API), plus source-of-truth, spec-maintenance-digest, ub-review; zero failing checks. Note the Windows Gate runs only two narrow filters (windows-gate.yml:150,163:lsp::gap_artifactsand one cache-warning cli_smoke filter), so it never executes the new budget test; the windows-advisory test lanes are skipping on this draft. - E0062 state at this head confirmed:
crates/ripr/src/output/human.rs:9260and:9264both readowner_opt_outs: Vec::new(),inside#[cfg(test)] mod tests(human.rs:1654-1655) — inherited from main, owned by #13954, honestly disclosed in the PR body. I did patch the copy of that one line in my throwaway review worktree (1-line deletion, not part of the PR) to run the lib unit tests; stated under Local runs.
Findings
- blocking — the PR's own new budget test fails on Windows at this head, and the second commit's "host-stable" normalization is ineffective on Windows:
- Ran
cargo test -p ripr --test cli_smoke agent_brief_states_workflow_commands_onceat157f9477(throwaway worktree, shared target dir):test result: FAILED. 0 passed; 1 failed, native exit 101, panic atcrates\ripr\tests\cli_smoke\agent_output_budget.rs:77withagent brief --json: 9248 bytes (ceiling 8900), and the panic dump shows the raw absolute root (F:/code/Rust/ripr-agent-brief-budget-…) surviving inside the measured text — the<root>tokenization never applied. - Mechanism:
run()tokenizesproject.to_string_lossy()and its/-form (agent_output_budget.rs:65-69), butunique_external_workspacereturns acanonicalize()d path (cli_smoke.rs:834-836,853-873), and on Windowscanonicalizeyields the verbatim form — empirically probed on this host:std::fs::canonicalize("F:/code/Rust")prints\\?\F:\code\Rust. The binary renders the plain drive spelling (the renderer folds verbatim prefixes,loop_commands.rsfold_verbatim_for_host; the brief's commands showedF:/code/...). Neither token spelling matches\\?\F:\..., so on every Windows host the full absolute path (here 64 chars, ~6 occurrences) is measured: 9,248 B > 8,900. Whether it slips under the ceiling elsewhere is pure path-length luck, not a pass. - Why CI is green: the Windows Gate does not run this test (see above) and the windows-advisory lanes are skipping on the draft.
- Exact fix (one line + import): derive the root through the sibling helper
printed_path(cli_smoke.rs:816-831, the #9660 pattern that strips\\?\and\\?\UNC\and renders/separators — i.e. exactly the spelling the binary emits): inagent_output_budget.rsuselet root = printed_path(project);before the two.replace(...)calls, importing it fromsuperalongsiderun_command, unique_external_workspace. On Unixprinted_pathis the identity, so Linux/macOS behavior is unchanged. After the fix, re-verify the budget on Windows and keep the ceiling at 8,900 (or re-measure).
- Ran
- minor —
.ripr/traceability.toml:21035-21036still maps RIPR-SPEC-0291 to the renamed and the deleted test names:…::tests::agent_brief_seam_verification_preserves_literal_backslash_unix_root(renamed at head toagent_brief_next_snapshot_commands_preserve_literal_backslash_unix_root) and…::tests::agent_brief_verification_preserves_a_literal_backslash_unix_root(deleted at head). The PR updated SPEC-0291's Test Mapping but not the machine manifest.check-traceabilityexplicitly does not verify::symbolsuffixes (xtask/src/main.rs:7022-7029: "It does not enumerate Rust tests... A::symbolsuffix remains advisory"), so CI stays green while the behavior mapping names two tests that no longer exist. Fix: swap line 21035 to the new test name and drop line 21036. - advisory — no CHANGELOG Unreleased bullet for a consumer-visible contract change (schema
0.1->0.2, per-seam fields removed). Recent convention adds one per behavior-changing PR (#5068 added 8 lines, #5064 added 15 to CHANGELOG.md in their own merges), and earlier brief command changes got bullets (CHANGELOG.md:3273, CHANGELOG.md:5686). The PR body's consumer note covers agents, but the durable changelog entry should exist by release. - informational — the deleted
agent_brief_verification_preserves_a_literal_backslash_unix_rootwas the only brief-surface test exercising the Windows else-branch (cfg!(unix)else: stable/separators) of a backslash-containing root. The component rule stays pinned (loop_commands.rs:767-797) and SPEC-0291's Required Evidence was updated to the Unix-only pair, so this is a covered composition reduction, not a regression; acfg(windows)pin of onenextcommand string would restore the surface-level pin.
Local runs (Windows 10, Git Bash, toolchain 1.95.0, worktree F:\code\Rust\ripr-swarm-review-13971 at 157f9477)
- FAILED:
cargo test -p ripr --test cli_smoke agent_brief_states_workflow_commands_once— 1 failed (Finding 1). An earlier run'sexit 0was the| tailpipeline, not cargo; corrected by rerunning and reading the native exit (101) and the report. - ok:
cargo test -p ripr --test cli_smoke agent_brief_json→agent_brief_json_unresolvable_base_emits_refusal_envelopepassed (refusal envelope emits0.2). - ok:
cargo test -p ripr --test cli_smoke agent_brief_diff_scope_outputs_jsonpassed. - ok:
cargo test -p ripr --test agent_command_journey brief_artifact_command→ 3 passed (inspect/after/before execute the relocatednext.*commands verbatim). - ok:
cargo test -p ripr --lib output::agent_brief→ 5 passed, 0 failed (16m03s cold lib-test compile; the two literal-backslash pins are#[cfg(unix)]and correctly absent on this host). This run required removing ONE duplicateowner_opt_outs: Vec::new(),line (human.rs:9264) in the throwaway worktree only — the E0062 duplicate-field inherited from main (human.rs:9260+9264, inside#[cfg(test)]) blocks any lib-test compile at this head; the fix itself is owned by #13954 and is not part of this PR. - Not established locally:
cargo xtask goldens check(build-heavy; hosted lane owns it — the updated golden's sorted-key<cwd>projection is consistent with the existing file by inspection), and the full hosted Rust matrix (skipping on draft).
…y and changelog (#13673) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EQRVj9myeTRLJJXWtwT7E
|
Second review addressed (head after this push merges current main).
Qualification stays on hold until main's lib-test build is green (#13981; fixes #13978/#13982). Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Source review of the full diff at af9e990 by the owning session.
Inspected: the relocated next.before_snapshot_command / next.after_snapshot_command render from the same command_root the per-seam copies used, so root spelling is unchanged; per-seam verification keeps only suggested_test_command with the #7391 null for not_applicable; schema 0.2 is single-sourced through AGENT_BRIEF_SCHEMA_VERSION, so refusal envelopes follow; OUTPUT_SCHEMA, SPEC-0010, SPEC-0241, SPEC-0291, traceability and the golden agree; changelog fragment added. Both earlier exact-head reviews are addressed: the budget helper now tokenizes the root through printed_path, and the doc and traceability parity items are fixed.
Local proof on this head after merging current main: cargo test -p ripr --lib agent_brief 82 passed, cli_smoke agent_brief 4 passed, cargo xtask precommit passed on the prior head.
Scope: source and oracle review only. Windows execution of the budget test was verified by the reviewer's analysis, not rerun here; hosted qualification on the exact head is requested next.
Generated by Claude Code
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
ripr static exposure checkCommit Took 31s. |
Assistant-proof reads next.verify_after_edit from a brief, the schema registry and task_first_facade refusal pins move to 0.2, SPEC-0291 example and SPEC-0010 traceability cover the new shape. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EQRVj9myeTRLJJXWtwT7E
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Source review of the full diff at c4c86e6 by the owning session, refreshing the affected dimensions after the last attestation.
Changed since the previous attestation: assistant-proof now reads next.verify_after_edit from a brief (new lib test), the schema registry and task_first_facade refusal pins track brief schema 0.2, SPEC-0291 example and mapping and SPEC-0010 traceability cover the new shape. All three Devin threads are replied to and resolved.
Local proof on this head: cargo xtask precommit exit 0; full -p ripr --lib passed apart from one fixture-dependency environment gap unrelated to this change; --test cli_smoke 751 passed; --test task_first_facade 108 passed.
Scope: source and oracle review only; hosted qualification on the exact head is requested next.
Generated by Claude Code
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY
Final pass at c4c86e6 by the owning session, with the exact-head hosted results inspected.
Hosted results on this head: Ripr Rust Small Result success (rust gates plus all four test shards and shard verify), Ripr Windows Gate Result success, Rust-only feature lane, kani, paste on three OSes, Python package and journey lanes, cargo-deny, dependency-review, source-of-truth and spec-maintenance-digest all success. ub-review was cancelled (advisory only) and the bot reviewers CodeRabbit and Gemini are quota limited, which is missing review from those providers and not clean review from them. The Devin review findings were real and are fixed and resolved.
Integration: main moved by eight commits after this head; a merge-tree of the head against current main is clean and none of those commits touch the brief renderer, the proof reader or the brief schema.
Prior exact-head reviews (two) had every finding fixed or answered. Residual noted, not blocking: no brief-level Windows end-to-end pin for the moved commands; the component rule is pinned in the loop_commands tests.
Generated by Claude Code
Requested by Steven Zimmerman · project thread
Governing issue or accepted claim: #13673 (follow-up 2, claim comment on the issue)
Acceptance delta (one sentence):
ripr agent brief --jsonstates the before/after snapshot commands once undernextand drops the per-seam copies, with a byte-budget test pinning it.What
0.1->0.2.nextgainsbefore_snapshot_commandandafter_snapshot_command; per-seamverificationkeeps onlysuggested_test_command; the per-seamverify_command(a copy ofnext.verify_after_edit) is removed.0.2.agent_brief_states_workflow_commands_oncebudget test: 5-gap brief is 8,660 B (ceiling 8,900), each command appears once.Proof
cargo xtask precommit: exit 0 (run with main's duplicateowner_opt_outsline removed locally, uncommitted; that fix is fix(main-health): restore lib-test build and finish the cache schema 1.177 fallout (#13952, #13956) #13954).Consumer note: any reader of
top_seams[].verification.{before,after}_snapshot_command/verify_commandmust switch tonext.*. No in-repo consumer other than the updated tests used them.Not claimed: items 1, 3, 4 of #13673. #13426 touches the same renderer; whichever lands second repairs its conflict.
Generated by Claude Code