Repository navigation
fix(agent): stub rewrite idempotency and truthful grip wording (wave 2, Lane X) - #8990
Conversation
|
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 35 minutes. View limit details
Summary by CodeRabbit
Walkthrough
ChangesAgent stub rewrite clarity
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Low Sequence Diagram(s)sequenceDiagram
participant AgentStubCLI
participant StubRevalidation
participant StubWriter
AgentStubCLI->>StubRevalidation: Revalidate an already-present stub
StubRevalidation-->>AgentStubCLI: Return current status or a fresh resolution
AgentStubCLI->>StubWriter: Write only if the stub is no longer present
AgentStubCLI-->>AgentStubCLI: Report already_present and written state
Possibly related PRs
Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Code Review
This pull request implements RIPR-SPEC-0288 to improve the clarity of agent stub rewrites (resolving issue #8891). It introduces an already_present detection mechanism that prevents a second run of 'ripr agent stub --write' for the same seam from writing a duplicate test with a '_2' suffix, instead reporting that the stub is already written. Additionally, it updates the disclosure for 'strongly_gripped' seams on the stub path to truthfully state that existing tests already discriminate the seam, rather than claiming it is 'configured off'. These changes are accompanied by updated documentation, a new specification file, and comprehensive unit and integration tests. There are no review comments, and I have no additional feedback to provide.
…e-clarity # Conflicts: # docs/specs/README.md # policy/doc-artifacts.toml
…se the uniqueness scope (#8891) PR #8990 review X1: when another test owns the base name, the first --write creates a _2 stub and the second run created a _3 duplicate, because already_present compared only the base-named rendering. The candidate search now renders each generated name (base, _2, _3, ...) up to the first free one and reports already_present under the matched name when the on-disk #[test] fn is byte-identical; a genuinely different body under the candidate name still suffixes. PR #8990 review X2: scope_contains_test_fn and unique_test_name searched raw scope text, so a copy of the rendered stub inside a block comment or raw string both blocked the base name and flagged the stub present while Cargo discovers no such test. Both checks are now parser-backed over the scope's parse unit and byte range, reusing has_test_attribute from the syntax owner; scopes that do not parse keep the previous lexical fallback, which errs toward suffixing. Comment lines and indentation are normalized out of the comparison so the check depends only on the executable fn text. The collision test now applies the write twice and asserts the second run is flagged already_present with the file unchanged; a commented-stub negative control covers both the block-comment and raw-string shapes.
…nt write skip (#8891) PR #8990 review X3: the already_present branch bypassed write_test_stub, so a concurrent edit that removed the stub after resolution left the second --write reporting success from bytes the resolver read earlier. The CLI now re-resolves from current bytes before trusting the skip: an unchanged placement keeps the no-op report, a vanished stub falls through to the normal guarded write with the fresh resolution, and a workspace that no longer resolves the seam refuses with the same rerun message shape write_test_stub uses for a changed owner file. A CLI test drives the transition directly: resolve while the stub is on disk, remove it, and assert the revalidation hands back a fresh not-present stub that the guarded write restores.
There was a problem hiding this comment.
Confirmed findings
- The new allowlist entry for
crates/ripr/tests/agent_stub_at_disclosure.rsrecords the wrong command. It says the tests spawnagent repair --phase before, butsecond_write_reports_already_written_instead_of_a_duplicate(and the helperstub_write) spawnripr agent stub --write(sometimes with--json). Allowlist entries are audited against spawned commands, so a wrong command+wrong allowed count will silently pass audit while the real spawn is underdocumented. Update the allowed command toagent stub --writeand recount (the helper uses oneCommand::newplus a second test that also issues oneCommand::new— currentCommand::new\|2count is plausible but only if the test bodies each spawn exactly once). (policy/process_allowlist.txt:43). - crates/ripr/src/analysis/test_stub.rs:471 — scope_contains_test_fn compares normalized texts (line endings, indent, comment lines, blanks stripped). normalize_test_fn_text drops comment lines via
starts_with("//")only; block comments attached to the fn item are stripped by the parser's text() call, but doc-comments (///) are also stripped, which is fine. However, the comparison ignores intra-line whitespace differences inside expressions only via outer trim; 'fn test() { x }' vs 'fn test() { x }' would not match. Worth a small dedicated equality-via-AST test (or pin the contract in the spec). - Revalidation error path uses CommandError::Failure for a 'workspace changed after the stub was computed; rerun
ripr agent stub' shape that does not carry the standard refusal envelope (refusal/kind).run_agent_stubonly routes refusal-shaped errors throughsplit_refusal_envelope. Agent consumers that key off refusal.kind to decide retry budget (#8726) cannot distinguish "changed workspace" from operational failures. (crates/ripr/src/cli/commands/agent_stub.rs:120). - scope_contains_test_fn does not match the placement offset to the chosen module's item_start.
inline_placementsets StubScope.range = body_start..offset (up to where the resolver itself sits), and a test fn whose text range starts atoffsetmay be silently counted as already-present while its full body extends past the seam. Tighten to body_start..(module.close_brace_start) so the parsed fn must lie inside the chosen module. (crates/ripr/src/analysis/test_stub.rs:460). - second_write_for_the_same_seam_reports_already_written and already_present_write_revalidates_the_placement_file both call scratch_crate then std::fs::remove_dir_all only on some error arms; an early panic between cleanup steps can leak /tmp dirs. Low risk; not a correctness issue.
Verification questions
- Confirm run_agent_stub inserts the 'Stub already written at' line via println before printing Test stub / Wrote lines; ordering relative to warnings and the AT note is the same code path used by non-already-present runs. The new test pins the 'Run it:' follow-up, but no test pins the relative ordering of warnings vs the 'Stub already written' line in the already-present human path.
- Confirm revalidate_already_present_stub delegates to resolve_test_stub on each re-check; tests only verify
CurrentandRewriteoutcomes. A refusal outcome from the fresh resolve is mapped to an error, but no test exercises a seam that refuses on the second resolve (e.g. signature changed or seam disappeared) to assert the 'workspace changed; rerun' wording contract. - Confirm policy/process_allowlist.txt newly added entry's standalone_reason text mentions 'agent repair --phase before' twice while the integration test executes
agent stub ... --write. Read-only cosmetic inconsistency; command count 2 and 'agent-stub-disclosure-proof' kind remain accurate, so the allowlist gate is satisfied.
Refuted
- The advisory pointer arithmetic card is inapplicable: StubScope uses checked UTF-8 string slicing and fallback behavior.
- The unsafe-review card at agent_stub.rs:122 represents an actionable pointer-arithmetic safety defect.; refuted because: No unsafe operation is present on that route. Source access uses checked str::get; absent parser-backed scope handling falls back to empty text or lexical matching, so the card is advisory noise rather than a PR defect.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- The allowlist note for agent_stub_at_disclosure.rs says the binary is exercised via
agent repair --phase before; that command is not the one this PR's new integration test runs (the test spawnsripr agent stub --write). Note accuracy is a policy/audit drift, not a behavior bug, but it should be updated before merge.
…llowlist entry (#8891) The merge of origin/main left two entries for crates/ripr/tests/agent_stub_at_disclosure.rs|Command::new: the sorted #8891 entry and main's older #8444 copy further down, which tripped check-process-policy. Remove the duplicate and keep the sorted entry; its count of 2 matches the two Command::new sites in the test file. cargo xtask check-process-policy: pass.
|
Bounded review/integration coordination (2026-10-20): candidate 3bba46e remains with the existing Lane X writer. Returned to Draft because the current unresolved Graphite finding r4331075447 is source-confirmed: Please repair this oracle in the owning branch and cover the actual CLI collision flow: first write chooses Integration evidence: current GitHub merge subject 44f40cd has parents a816499 and this head, tree e613d44a2508f9653ba4c72218333f3124426f81. A nonpublishing |
) Merge-gate clippy (-D warnings) reported five lints on the X3 revalidation code and its tests: - three manual_inspect sites in the already-present revalidation test where a map_err closure only cleaned up the scratch crate and returned the error unchanged: two now use inspect_err, and the pure identity adapter on the selector parse is dropped entirely; - nonminimal_bool in scope_contains_test_fn: !name().is_some_and(..) becomes name().is_none_or(..), clippy's suggested spelling; - large_enum_variant on AlreadyPresentRevalidation: the Rewrite variant now boxes the fresh TestStubResolution (272 bytes vs the data-less Current variant). Behavior is unchanged everywhere; error values that map_err genuinely replaces keep map_err. cargo clippy -p ripr --lib is clean, and the lib compiles under --cfg test with no diagnostics in the touched files (only the 12 pre-existing dev-dependency-gated errors elsewhere, which the forced flag surfaces on any commit).
|
Existing hosted proof now independently inspected (reused, no rerun requested): https://github.com/EffortlessMetrics/ripr-swarm/actions/runs/39509296271/job/118925999740 . The checkout log explicitly records merge commit 44f40cd (candidate 3bba46e into a816499; fetched subject tree e613d44a2508f9653ba4c72218333f3124426f81). Rust-only feature lane actually fails |
EffortlessSteven
left a comment
There was a problem hiding this comment.
REPAIR_REQUIRED — independent review of current head 7db52ff, with prior-head findings refreshed against the complete 3bba46e..7db52ff delta. Existing Lane X remains the repair writer; this review does not change candidate files.
Blocking test/oracle defect: analysis/test_stub/tests.rs::same_named_but_different_test_still_suffixes still splices the nonempty second.text into rewritten and asserts byte equality (lines 183–192). The producer deliberately returns the identical function text even when already_present == true; only the CLI write gate skips the write. The assertion therefore appends a second _2 function and fails. This is the same still-open finding as discussion_r4331075447. The new 7db52ff commit changes Clippy shapes and boxes Rewrite, but changes neither this test nor the nonempty-text contract.
Observed/reused runtime evidence: job 118925999740 ran the earlier merge subject 44f40cd (parents a816499 and 3bba46e; tree e613d44). Its Rust-only lib result was 9947 passed / 1 failed / 1 ignored, with this assertion failing at line189, exit101. This is reused earlier-subject failure evidence, not a current-head pass. The affected test and insertion behavior persist at the current head. An independent local default-feature targeted build was intentionally interrupted/reaped (exit130) once that exact failure evidence was recovered; no local test pass is claimed.
Repair direction: keep the resolver assertion for matching the existing suffixed name and already_present flag, then exercise two actual CLI --write calls against a genuinely different base-named test. Capture the file bytes after the first _2 write and compare after the second human and JSON calls; assert exit0, _2 retained, no _3, already_present:true and written:false. The existing unsuffixed CLI test counts names after a call but does not assert full byte equality, and the current suffix test never reaches the real CLI skip. This supplies the required no-write discriminator without changing the producer text contract.
Inspected surfaces/owners: all17 changed paths from base ca2b342, #8891 and RIPR-SPEC-0288; parser-backed scope/name/presence detection, inline/existing integration placement, app revalidation, CLI write/JSON/human/help consumers, grip wording, spec/docs/traceability and process allowance. Prior comment/raw-string and suffix defects have concrete source repairs. The historical automated offset complaint is refuted: range ends at the selected module close brace and requires whole-function containment. The historical allowlist-command complaint is fixed in3bba46e2. Exact rendered-text identity deliberately does not promise AST-equivalent whitespace matching.
Remaining evidence: current-head focused runtime and integration/hosted qualification after the existing writer repairs the oracle; independent review must refresh for that final head. No Ready or merge clearance is given.
|
Independent targeted runtime receipt for current head 7db52ff: actual CLI suffix correctness and true no-write behavior pass. Built this exact detached head with Four isolated crate cases: no pre-existing generated name / genuinely different base-named test, each with LF / CRLF source. Each case ran the actual binary three times: first This independently establishes the production CLI skip and suffixed lookup, beyond the existing name-count assertions. It does not fix or clear the false resolver-unit splice oracle in review5593162243: disposition remains REPAIR_REQUIRED until Lane X repairs that test, retains the actual CLI byte/no-write discriminator, and obtains final-head proof/review. No candidate files changed and no qualification campaign was requested. |
…sent (#8990 x #8989 semantic merge) Same one-line fix as #10030 so this PR is a self-sufficient carrier for the current main. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cuuiz4GRfXbHkeQuoNnjcz
Main's #8727 and #8990 each compiled alone; together the lib tests did not. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC
#8989 and #8990 composed on main: the new next_repair test builds a RustTestStub without the already_present field #8990 added, so the lib-test target (default and Rust-only lanes) does not compile. Surfaced by the #9205 convergence merge of main. Proof: cargo test -p ripr --no-default-features --features lang-rust --lib (next_repair, keyword_probe, durable_selected): 16 passed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6PpvQbrLxYbxRjHqJ4Aby
…main's #8989 test vs #8990 field) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX
* test(mcp): compare the CLI restart display against the literal-backslash-preserving root rendering (#10011) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cuuiz4GRfXbHkeQuoNnjcz * test(app): construct the repair-journey witness stub with already_present (#8990 x #8989 semantic merge) Same one-line fix as #10030 so this PR is a self-sufficient carrier for the current main. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cuuiz4GRfXbHkeQuoNnjcz --------- Co-authored-by: Claude <noreply@anthropic.com>
… inherited from main ad1e3bb (#8990) landed the RIPR-SPEC-0288 block with its outputs list unclosed and the RIPR-SPEC-0289 header swallowed; check-traceability fails on main's own tip. Close the outputs list, restore the metrics list and the 0289 [[behavior]] header. Local-gate repair routed here because this PR edits the same authored map.
…d unterminated #8990 landed the 0288 entry without its outputs closing bracket and metrics list, so .ripr/traceability.toml fails to parse and check-traceability fails on every open merge ref (main heads 5950c91, ad1e3bb and 280e020 all ran red). Close the array and add the standard unit_test_pass_rate metrics list. cargo xtask check-traceability passes with this.
main's required check (Ripr Rust Small Result on 0285907, run 40041202217) fails with E0063: #8990 added RustTestStub.already_present but missed the initializer in next_repair_start_preserves_a_literal_backslash_unix_root. This merge inherits that break; add the field (false, matching the sibling initializers). The same gate run also carries a Windows-only unused_mut in output::doctor (the unix-only case pushes need it); bind the mutable binding under cfg(unix) so both platforms lint clean.
#8989 x #8990) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6PpvQbrLxYbxRjHqJ4Aby
) * feat(python): emit row-owned missing_input for RelatedTestMiss (#5491) A strong related-test row on a predicate-boundary finding gains missing_input only when its own owner calls all bind and resolve both compared operands off the boundary. no_call_path stays withheld. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * fix(python): make row missing_input fail-closed on indirect reach and unknown operands (#5491) Require direct owner calls only (no helper, alias, map/partial, fixture, dynamic or foreign-receiver reach), a readable old equality pair, unrebound compared parameters, an unchanged relational operand pair, and same-kind comparable literals. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * fix(python): withhold row missing_input when implicit setup can reach the owner (#5491) Fail closed by existence: autouse fixtures, pytestmark, setup/teardown hooks, module-level calls, test-module rebinding of the owner name, decorated owners and conftest fixtures or hooks on the directory chain. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * fix(python): withhold row missing_input for inherited/decorated test classes and conftest top-level effects (#5491) Class bases and decorators, module and conftest top-level calls or attribute assignments count as implicit reach; the variable-receiver branch is removed; the spec states the visible-evidence-only limits. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * fix(python): close subscript/decorator/constructor/hook reach for row missing_input (#5491) The row guard is a closed-world allowlist: subscript or call-result callees, non-inert test decorators, pytest_* hooks in the test module and rebound import aliases withhold the claim; instance methods are never claimed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * fix(python): restrict row missing_input to the real assertion API and direction-preserving changes (#5491) Only the unittest.TestCase assertion API and pytest raises/warns/approx are safe callees; assert/check/verify helpers, non-test class methods and star imports withhold the claim; a relational change must keep its direction. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * fix(python): withhold row missing_input for recursive owners and widened condition edits (#5491) An owner that calls its own name, another project function or a same-class callee keeps no miss; a relational change must leave the rest of the line identical, and an equality change must be the whole condition. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * fix(python): bind a call keyword only to a declared parameter for row missing_input (#5491) A keyword captured by **kwargs no longer stands for a body local of the same name when resolving the compared operands. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * fix(python): trust builtins and framework APIs for row missing_input only with established identity (#5491) A bare builtin is inert only while the test and module do not rebind it, and raises/warns/approx/assert* are trusted only on self in a unittest.TestCase class or the real pytest import; any other receiver withholds the claim. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * fix(python): vet the arguments of trusted calls for row missing_input (#5491) A project callable passed by reference to a trusted call (pytest.raises, assertRaises, sorted/max key=) or a test that mentions builtins withholds the claim; arguments may only be literals, unshadowed builtins and exceptions, plain locals and nested calls. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * Close plain_locals leaks with a closed-world rule; re-bless fixtures with the tool A name is a plain local only if assigned once on one balanced physical line from closed words and every other occurrence is a bare operand. Fixture goldens regenerated via cargo xtask goldens bless. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * Repair traceability.toml after the merge: reapply the missing_input entries and close main's truncated RIPR-SPEC-0288 entry Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * Remove stray traceability.toml.orig merge artifact Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * Track bracket depth in plain_locals: a continuation line is never an assignment Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * Fix merged-tree compile: RustTestStub literal gains already_present (main's #8989 test vs #8990 field) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * Require a whole-token def/class statement head before skipping a call as a definition Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX * Drop the duplicate already_present initializer left by two main fixes Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MgavuLHJQpW3ywBXBiGzkX --------- Co-authored-by: Claude <noreply@anthropic.com>
) (#9995) * fix(analysis): facade crate reach and doctest name-token relation (#9982) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC * fix(analysis): tie facade reach to the owner and manifest crate name (#9982) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC * fix(traceability): close the unterminated RIPR-SPEC-0288 block from main Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC * fix(analysis): tie facade reach to owner visibility, module chain and test (#9982) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC * docs(spec): facade reach limits, linked issue and tests (#9982) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC * fix(test): set already_present in the next-repair backslash stub test Main's #8727 and #8990 each compiled alone; together the lib tests did not. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC * fix(analysis): tie method owners to their type and own file; spec and docs (#9982) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC * fix(analysis): require the method owner's impl at the file root; tighten tests and spec (#9982) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AUS4vFoCEv5DiNwucKqSbC --------- Co-authored-by: Claude <noreply@anthropic.com>
…ained value (#9833) (#9868) * feat(python): credit a guarded self-field write when every call enters the guard (#9833) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015jyhvmnQnqYgyfnycQYsvx * fix(python): bind guarded field credit to safe execution and retained value * fix(python): preserve nested formal and non-code indentation positives * test(python): pin guarded field honesty and native syntax controls * fix(python): distinguish retained field reads from native stores * test(python): pin native retention counterexamples and read positives * style(python): retain literal refusal predicate as match guard * test(python): complete guarded-write honesty and human projections * docs(python): keep fixture traceability spec IDs machine-readable * fix(ci): restore omitted main golden and gate metadata * test(python): refresh guarded-write Summary legend projections * test(mcp): compare the CLI restart display against the literal-backslash-preserving root rendering (#10011) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cuuiz4GRfXbHkeQuoNnjcz * fix(agent-stub): repair main test compilation after the #8989/#8990 semantic merge #8990 (ad1e3bb) added `already_present` to `RustTestStub`; #8989 (0285907) added `next_repair_start_preserves_a_literal_backslash_unix_root` constructing the stub without the new field. Each PR's CI ran against a base that lacked the other change, so main has not compiled the lib test target since the two landed. The witness constructs a fresh stub, which is by definition not already present: `already_present: false`. --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Steven Zimmerman <steven@effortlesssteven.com>
… pins (#9496) (#10145) * fix(typescript): skipped describe registrations are not a partial extraction A registration inside describe.skip/todo or a describe with a skip option never runs and is not a dropped one; stop disclosing it as language_scope_unsupported. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix(typescript): credit done-settled callbacks and old-value boundary pins Rule 5 collects assertions of a callback that must call done() for a mocha test to pass. Rule 6 keeps the boundary witness when the expectation pins the unchanged value (fails against the changed code). Flips mocha-done-callback-value and mocha-nested-describe-boundary. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * chore(typescript): drop known_false entries for fixed rows and stale entries Removes mocha-done-callback-value and mocha-nested-describe-boundary (fixed here) and the six rows #9591 also removes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * docs: name changelog fragment for PR 9627 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix(typescript): require done named once; skip only literal skip/todo suites Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix(typescript): todo suites stay active; a later spread or computed key voids skip:true Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * chore(typescript): delete known-false rows for the two fixed cases Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * docs: cite the issue and PR in the changelog fragment Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix(typescript): a skipped suite bound to a variable is not walked for dropped registrations Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * docs: rule 7 in test comment Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix: restore closing brace after merge Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * chore: raise the spec-example floor to 134 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix(repo-ops): close the RIPR-SPEC-0288 traceability entry main merged unterminated #8990 landed the 0288 entry without its outputs closing bracket and metrics list, so .ripr/traceability.toml fails to parse and check-traceability fails on every open merge ref (main heads 5950c91, ad1e3bb and 280e020 all ran red). Close the array and add the standard unit_test_pass_rate metrics list. cargo xtask check-traceability passes with this. * Re-measure missed_credit_ceiling on main (perl 23, python 30, rust 134) Perl case PRs landed after #9628 measured 21, so verdict-corpus check --language perl fails on main. Python and Rust fell; ceilings must equal the blessed count. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU * Raise TypeScript spec-example floor to 154 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AnfxntsP9VxYNTBs5FukBi --------- Co-authored-by: Claude <noreply@anthropic.com>
… two comparisons treat differently (#9437) (#9783) * fix(typescript): ternary-condition comparison edit needs an input the two comparisons treat differently (#9437) Adds RIPR-SPEC-0246 rule 7. Moves shape-template-plural-boundary from false exposed to gap. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUHWUDUbb64pDwgshpzSGG * fix(tests): compile repairs main's red gate needs main's required check (Ripr Rust Small Result on 0285907, run 40041202217) fails with E0063: #8990 added RustTestStub.already_present but missed the initializer in next_repair_start_preserves_a_literal_backslash_unix_root. This merge inherits that break; add the field (false, matching the sibling initializers). The same gate run also carries a Windows-only unused_mut in output::doctor (the unix-only case pushes need it); bind the mutable binding under cfg(unix) so both platforms lint clean. * fix(typescript): rule 9 rides the ladder's unexercised-arm demotion (#9437) Merging main brings #9497's RIPR-SPEC-0243 rule 18, which demotes a same-outcome returned expression at the ladder before the post-ladder rule 9 hook can fire, so the plural fixture kept weakly_exposed but with the generic changed-arm note. Keep both behaviors: rule 18 still owns the demotion, and when the comparison witness proves every observed call passes a literal the two comparisons treat alike, the ladder limitation names the condition and the differing value (the rule 9 wording, now built by ComparisonEdit::limitation and shared with the post-ladder hook). An argument only rule 18's evaluator can read (1 + 1) keeps the generic note; its pin moves to its own test. Spec rule 9 and example 17 describe the interaction; traceability lists the new test. * fix(typescript): differing_value refuses literals beyond i64 instead of overflowing (#9437) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUHWUDUbb64pDwgshpzSGG * fix(typescript): drop needless borrow in rule 9 hook (#9437) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUHWUDUbb64pDwgshpzSGG --------- Co-authored-by: Claude <noreply@anthropic.com>
* fix(check): treat pure reformats as behavior-neutral so they seed no probes (#9450) * fix(check): fail closed on position macros, whitespace literals, and joint puncts in rewrap neutrality (#9450) * test(check): pin selector joint-punct control for rewrap squeeze (#9450) * fix(check): keep joint puncts, unicode whitespace literals, and comma wraps out of rewrap neutrality (#9450) * docs(check): record joint-punct guards and track_caller residual in RIPR-SPEC-0310 (#9450) * fix(check): register RIPR-SPEC-0310 in verdict-corpus spec coverage (#9450) * fix(check): drop blank line at EOF in corpus coverage files (#9450) * fix(check): register RIPR-SPEC-0310 in TypeScript corpus coverage (#9450) * fix(corpus): drop three Rust known_false entries stale on main (#9441 cases fixed upstream) * fix(corpus): take upstream rust coverage ledger as truth, keep only the RIPR-SPEC-0310 entry (#9450) * fix(check): guard whole-file position-macro spans so split line!/column! names stay probed (#9450) Review thread PRRT_kwDOSiSx0c6vO9PB: observes_position judges one physical line, and the caller's whole-file prose_lines set carried only token-macro spans, so a rewrap or reindent of an invocation whose name and ! sit on different lines (line / !()) read as a pure reformat and seeded no probe while the expansion's value changed. prose_lines now extends the invocation-span scan over POSITION_MACROS too (macro_invocation_lines, shared with token_macro_lines), vetoing both neutrality paths from either side of the diff. Spec RIPR-SPEC-0311 Rule 3 and Test Mapping updated. * fix(traceability): rebuild traceability map from main and map the split-position-macro regressions The first main merge duplicated the gap-bound TypeScript behavior block and dropped others; the map is restored to main's exact bytes with the RIPR-SPEC-0348 pure-reformats block (plus the two new split-position-macro tests) appended. * style(check): rustfmt the split-position-macro fix * fix(traceability): complete the truncated stub-rewrite behavior block inherited from main ad1e3bb (#8990) landed the RIPR-SPEC-0288 block with its outputs list unclosed and the RIPR-SPEC-0289 header swallowed; check-traceability fails on main's own tip. Close the outputs list, restore the metrics list and the 0289 [[behavior]] header. Local-gate repair routed here because this PR edits the same authored map. * fix(test-stub): keep one already_present field after merging main's repair The main merges delivered #8989's initializer without the field and then live main's version of the same initializer with it, at two positions; keep the single field in main's order. File is byte-identical to origin/main. * fix: preserve numeric-dot wrap token boundaries (#9462 contribution) Bounded Git-object handoff to the existing canonical PR; no branch ref update. Reviewed-source-head: 829b32427030b2da7a2698679aa02d0f060ff4a4 Reviewed-tree: 2b6b964 Canonical-base: 1d8463d Patch-blob: 885047b Proof-blob: 7e44593 Proof-SHA256: 6de4f56168d783293df7cd7ffe4e08980ed0633b52c84ce3f1a3dbeec1f8715a Local locked build and 19 real CLI controls passed; numeric guard removal fails four numeric checks while formatting passes. Independent exact-source and receipt review completed. Unit execution remains unverified: unrelated unchanged test initializer E0063. No full or hosted qualification claim. * test(check): cover both sides of numeric-dot wraps through probe seeding --------- Co-authored-by: Steven Zimmerman, CPA <steven@effortlessmetrics.com>
…10224) * fix(typescript): skipped describe registrations are not a partial extraction A registration inside describe.skip/todo or a describe with a skip option never runs and is not a dropped one; stop disclosing it as language_scope_unsupported. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix(typescript): credit done-settled callbacks and old-value boundary pins Rule 5 collects assertions of a callback that must call done() for a mocha test to pass. Rule 6 keeps the boundary witness when the expectation pins the unchanged value (fails against the changed code). Flips mocha-done-callback-value and mocha-nested-describe-boundary. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * chore(typescript): drop known_false entries for fixed rows and stale entries Removes mocha-done-callback-value and mocha-nested-describe-boundary (fixed here) and the six rows #9591 also removes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * docs: name changelog fragment for PR 9627 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix(typescript): require done named once; skip only literal skip/todo suites Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix(typescript): todo suites stay active; a later spread or computed key voids skip:true Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * chore(typescript): delete known-false rows for the two fixed cases Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * docs: cite the issue and PR in the changelog fragment Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix(typescript): a skipped suite bound to a variable is not walked for dropped registrations Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * docs: rule 7 in test comment Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix: restore closing brace after merge Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * chore: raise the spec-example floor to 134 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE * fix(repo-ops): close the RIPR-SPEC-0288 traceability entry main merged unterminated #8990 landed the 0288 entry without its outputs closing bracket and metrics list, so .ripr/traceability.toml fails to parse and check-traceability fails on every open merge ref (main heads 5950c91, ad1e3bb and 280e020 all ran red). Close the array and add the standard unit_test_pass_rate metrics list. cargo xtask check-traceability passes with this. * Re-measure missed_credit_ceiling on main (perl 23, python 30, rust 134) Perl case PRs landed after #9628 measured 21, so verdict-corpus check --language perl fails on main. Python and Rust fell; ceilings must equal the blessed count. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU * Raise TypeScript spec-example floor to 154 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AnfxntsP9VxYNTBs5FukBi * test(typescript): discriminate skipped suite binding identity * fix(typescript): resolve skipped suite declaration bindings * fix(typescript): retain notices across uncertain mutation and evaluation * fix(typescript): preserve hoisted aliases and evaluated callees * fix(typescript): retain default carriers and wrapper evaluation * fix(typescript): memoize possible runner mutation by binding * docs(typescript): use static policy vocabulary for runner imports * test(typescript): expose escaped runners and evaluated constructors * fix(typescript): retain escaped-runner and evaluated invocation notices * fix(typescript): preserve block rebindings in evaluated invocations * fix(typescript): keep nested lexical rebindings inside their scope * fix(typescript): scope loop catch and switch registration bindings * test(typescript): discriminate for-in binding scope entry * fix(typescript): preserve evaluation mode through control flow * fix(typescript): scope global-object writes and arrow returns precisely Review of the published head identified two dormancy defects: 1. A bare ambient global-object write (globalThis.fetch = mock) pushed the global alias into member_writes, where root_value resolves it to GlobalObject and mutated_runner stripped dormancy from every skipped suite in the file. An unshadowed global-object write now withdraws only the written property name via global_writes; a shadowed local of the same name remains a whole-file mutation risk. 2. An expression-bodied arrow (const get = () => describe) returned the runner without recording an escape, so get().skip = custom stayed invisible and a genuinely mutated runner kept its dormant verdict. Arrow expression bodies now record their operand as an escape. New grouped discriminator skipped_suite_bindings_treat_ambient_global_ writes_precisely covers both directions; traceability and the RIPR-SPEC-0243 escape list follow. * fix(typescript): reject qualified reads of globally written runners A global-object write withdraws the written runner name, but resolve only consulted global_writes for the bare root name, so globalThis.describe.skip (or window.describe.skip) after globalThis.describe = custom still resolved to a dormant skipped root and dropped the nested registration notice. GlobalObject members now reject names in global_writes; Namespace members are unchanged. Controls: qualified dormant/retained reads in skipped_suite_bindings_treat_ambient_global_writes_precisely, and new skipped_suite_bindings_treat_x_spelled_suites_as_dormant pinning xdescribe/xcontext/xsuite dormancy named in RIPR-SPEC-0243. * style: rustfmt the merged TypeScript tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSiDdMNjK7Lxr7u3ZT * fix(typescript): bind only runtime function parameters in declaration bindings Type-only parameter lists (TSFunctionType, TSMethodSignature, declare functions, overload signatures) share the FormalParameters AST node, so visiting FormalParameters bound their identifiers into the enclosing runtime scope. A top-level 'type Fn = (test: T) => void' shadowed the runner for the whole file and dormant skipped suites produced spurious partial-extraction notices. Bind parameters from the Function (bodied only) and ArrowFunctionExpression arms instead. Regression test: detect_partial_none_when_type_only_parameters_name_the_runner. --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Steven Zimmerman <steven@perllsp.org> Co-authored-by: Steven Zimmerman, CPA <steven@effortlessmetrics.com>
Governing issue or accepted claim: #8891
Acceptance delta (one sentence): second
--writefor the same seam reports the existing stub instead of writing a_2duplicate, and the strongly_gripped refusal on the stub path names the real reason (the seam is already exposed) instead of falsely claiming it is configured off.What changed
Idempotent second
--write(#8891 item 1).crates/ripr/src/analysis/test_stub.rs:rust_test_stub_for_targetnow renders the base-named test function and compares it against the stub's uniqueness scope (modulo line endings, which the write adapts to CRLF files) before honoring theunique_test_namesuffix. A byte-identical recompute sets the newRustTestStub.already_presentflag and keeps the basetest_name; a genuinely different test that happens to share the generated name still suffixes (_2, …) and writes as before.crates/ripr/src/cli/commands/agent_stub.rs:--writeskips the file edit whenalready_presentand human output saysStub already written at <file>:<line> ...(still followed by the run command); therust_test_stubJSON document (schema0.2) gains the additivealready_presentboolean whilewrittenstaysfalse(nothing was appended this run).Truthful strongly_gripped disclosure (#8891 item 2).
stub_grip_disclosureno longer reuses the agent packet/brief omission wording verbatim. Forstrongly_grippedthe warning now readsseam <id> is strongly_gripped: existing tests already discriminate it, so a stub would add nothing— the real reason. The old "configured off" text came fromAgentBriefPolicy::omission_reason_for_classmatchingSeverityConfig::for_seam(StronglyGripped) == ConfigSeverity::Off, but thatOffis the built-in default inSeamSeverityConfig(agent-brief rendering policy: exposed seams are not brief repair targets), not user configuration, and the seam is omitted precisely because its tests already discriminate it (classification counterpartexposed). A class a user severity actually disables (e.g.weakly_gripped = "off"inripr.toml) keeps the packet "configured off" wording on the stub path.crates/ripr/src/cli/help/agent.rs,docs/AGENT_WORKFLOWS.md,docs/OUTPUT_SCHEMA.md(newalready_presentfield documented).Tests (match sibling style):
analysis/test_stub/tests.rs:recomputed_stub_for_the_same_seam_is_flagged_already_present,same_named_but_different_test_still_suffixes.cli/commands/agent_stub.rs:second_write_for_the_same_seam_reports_already_written(real scratch-crate collision throughrun_agent_stub),strongly_gripped_stub_names_the_real_reason,config_disabled_class_stub_keeps_the_configured_off_wording.tests/agent_stub_at_disclosure.rs:second_write_reports_already_written_instead_of_a_duplicate(end-to-end binary: human + JSON second-write pins); the grip-warning wording pin inoff_line_predicate_note_precedes_the_grip_class_warningupdated.tests/agent_stub_compiles.rs::at_kind_stub_discloses_strongly_gripped_classificationupdated to the reasoned wording.Spec wiring: new
docs/specs/RIPR-SPEC-0288-agent-stub-rewrite-clarity.md, README table row (after 0284),policy/doc-artifacts.tomlartifact,.ripr/traceability.tomlbehavior (RIPR-SPEC-0288,unit_test_pass_rate),changelog.d/8891-agent-stub-rewrite-clarity.md. Both TOML files validated with pythontomllib(parse + unique ids).Deviations / notes
OutsideInlineTestRegion ... unparseableterminal refusal (missing fix-the-syntax hint in its CRLF-oriented recovery paragraph) lives in the edit-cage attempt authority (crates/ripr/src/edit_cage/inline_test_region/, rendered viaevaluate_edit_cage), not the stub path, so it is intentionally not changed here; the hint belongs to a separate lane.--writewhose placement is a new integration file still fails loudly atcreate_new("failed to create ... already exists") rather than reporting "already written"; content-based already-written detection covers inline and existing-integration placements (the reported_2case).Test plan
cargo fmt -p ripr -- --check— clean.cargo check -p ripr --lib— green.cargo check -p ripr --test agent_stub_at_disclosureand--test agent_stub_compiles— green.policy/doc-artifacts.tomland.ripr/traceability.toml— unique ids, 0288 present.Closes #8891