Repository navigation
fix(check): print the line the agent stub targets when the finding line holds no gap (#8444) - #8514
Conversation
…ne holds no gap (#8444) check suggested 'agent stub --at L' with the finding's line even when the resolver stubbed the nearest gap instead. It now prints the seam's own line, and prints no route unless asking for that line resolves to the same seam. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013MM86yqGaKAkkeaCza1mXP
|
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 17 minutes. View limit details
Comment |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- residual-risk: stub_route_for_finding now performs two resolve_at_location calls per finding when at_note.is_some(); worst case negligible (one finding per check output) but redundant. Consider capturing seam_id once or extending resolve_at_location to return both requested and seam lines in one pass.
Verification questions
- Confirm new TestStubResolution.seam_line field is only populated by AtCandidate and resolution_for; downstream consumers must read it instead of recomputing.
Refuted
- The new test asserts stdout.contains("src/lib.rs:3") but the printed route is src/lib.rs:2; the assertion is tautological with the includes checks.; refuted because: stdout.contains("src/lib.rs:3") asserts the finding line appears in check output (it is mentioned in finding context, not the printed route). The route checks use args iterators against the parsed --at argument. No tautology; assertion order is correct.
- The fail-closed re-resolve changes command-line behavior for legitimate continuation-line findings, hiding valid stubs as 'no route' rather than letting the agent pick them up.; refuted because: Test check_routes_a_continuation_line_finding_to_the_line_the_stub_targets shows the positive path still emits src/lib.rs:2; the fail-closed only triggers when the seam_line does not resolve to the same seam without a substitution note, which by definition means the printed command would not produce the promised stub.
- seam_id equality is unsound: two distinct gaps within one function could share a seam_id and the guard would mis-accept a stale seam; refuted because: stub_route_for_finding only enters the new arm when at_note.is_some(); the second resolve returns the same seam_id only if the seam still resolves identically. Same seam_id on a different gap would still satisfy at_note.is_none(), but the printed --at line would then be the gap's own line, not the finding line. Fail-closed semantics preserved.
Parked follow-ups
- TestStubResolution lacks a Debug impl while peer resolution structs in this file do derive Debug; adding the field without updating derived Debug means the new field is invisible in test failure dumps if a future test prints the struct.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Source/oracle review of exact head d28df5d (self-review, COMMENT disposition).
reviewed_head_sha: d28df5d
integration_basis: merged with main b58b5c3 in a local tree (clean merge, not pushed)
claim_boundary: #8444 item 1 only (route line printed by ripr check)
surfaces inspected: stub_route_for_finding and TestStubResolution.seam_line in app/test_stub.rs (the semantic owner; the route is still decided by resolve_at_location, no parallel validator); the new agent_stub_compiles test through the real ripr check and ripr agent stub binaries.
blocking_findings: none
non_blocking_suggestions: none
proof observed: cargo xtask precommit exit 0 on the merged tree; agent_stub_compiles 26 passed; test_stub lib tests 54 passed. Removal challenge: reverting the printed line to the finding line (line: seam_line -> line) makes the new test fail at the route-line assertion, so the oracle discriminates old behavior. The fail-closed branch (!same returns no route) is not covered by a negative test; residual, not blocking.
proof_or_review_missing: hosted Rust lanes (skipped while draft), no external review provider output
non-claims: item 2 (direct return_value stubs) is not addressed
disposition: REVIEW_INCOMPLETE for merge until hosted checks on this exact head pass; no source defects found.
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-SPEC-0122: the printed 'ripr agent stub --at' line is the seam line the stub targets. In all 12 drifted fixtures the old line triggered nearest-gap substitution and the new line resolves with no note. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TaZzbapKKD6UuEzYyzeajf
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Re-resolving
resolve_at_locationtwice per finding withat_note.is_some()adds a second seam-classification pass. Worst-case cost is one extra pass percheckoutput finding; profile disables build leases so no perf sensor evidence. Inconsequential at this scale, but a single-pass API returning(seam_id, seam_line, at_note)would remove the duplication.
Verification questions
- Confirm no negative test for fail-closed path (stub_route_for_finding returns None when re-resolve at seam_line yields a different seam or another substitution): directly under-tested, only positive branch has oracle.
- Confirm negative test coverage for the 'same == false' branch is missing; reviewer notes acknowledge this. Risk is low because the branch is a single early-return None but is the entire behavior change for invalid continuation-line findings.
Refuted
- Fail-closed branch can misroute when the second resolve returns Ok with a different seam_id (silent route to wrong gap).; refuted because: Branch returns None unless exact.seam_id == resolution.seam_id AND exact.at_note.is_none(); a divergent seam_id or any retained substitution note suppresses the route. Worst observable behavior is 'no printed stub' rather than a misrouted command.
Parked follow-ups
- Expected/human.txt routes were updated (line changed) but CHANGELOG.md only appends a Pending block, not a recorded entry; 12 fixtures all follow same pattern — goldens may need bless to record and lock values.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
…iguous (#8444) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TaZzbapKKD6UuEzYyzeajf
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Resolution::seam_line is a new field added without a doc-commented field on every constructor path; only AtCandidate::Ok and resolution_for populate it, but if future constructors forget, downstream callers will read 0.
Refuted
- The fail-closed branch could misroute silently when re-resolve returns Ok with a different seam_id.; refuted because: Branch requires exact.seam_id == resolution.seam_id AND exact.at_note.is_none(); any mismatch returns None, so no silent misroute. New ambiguous-gap test exercises a refusal variant, not this branch directly, leaving branch coverage partial but the guard correct.
- AtCandidate::resolve is being duplicated inline inside stub_route_for_finding to compute seam_line; refuted because: The diff re-uses the existing resolve_at_location entry point; no parallel classifier or helper is introduced. The duplication is one extra call, not a parallel path.
- Fail-closed branch could silently route to a wrong gap when second resolve returns Ok with a different seam_id (e.g., due to non-determinism or shared mutable state between calls).; refuted because: resolve_at_location is deterministic and read-only over (root, config, file, line, kind); the guard requires exact.seam_id == resolution.seam_id AND exact.at_note.is_none(), so any divergence in either field short-circuits to None. No IO, no caching, no global state observed in the diff.
Parked follow-ups
- Golden human.txt updates rename printed --at lines to seam lines for ten RIPR-SPEC-0122 fixtures; no check.json diff in the patch, so json-route divergence is a parked risk if check.json still names old line.
- Performance concern from prior review (double resolve_at_location when at_note.is_some) is real but worst-case is one extra pass per check finding; profile disables build leases so no perf sensor. Acceptable for fix scope; single-pass API returning (seam_id, seam_line, at_note) would be cleaner but is parked.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N5f9YVQsrqQiS5EYjYVNm7
There was a problem hiding this comment.
Confirmed findings
- DOC:
TestStubResolutiongains a newseam_line: usizefield with no documentation that it must be set by every constructor; default-init = 0 is silent. Behavior contracts belong on the struct, not duplicated at each constructor call site. Not addressed by either new test (continuation or ambiguous-gap). - TestStubResolution.seam_line is a new field populated only by AtCandidate::Ok and resolution_for; a default of 0 on any new constructor would read as line 0 to downstream consumers if added later. Suggest doc-comment requirement or #[non_exhaustive] / explicit ctor.
Verification questions
- Confirm reusing the existing resolve_at_location entry point avoids a parallel seam classifier. The double work is one extra call, not a divergent path. The new test exercises an ambiguous-gap refusal, not the seam_id mismatch branch directly, leaving branch coverage partial but the guard correct.
- Confirm item 1 of #8444 only (printed stub route line); item 2 (direct
return_valuestubs) stays open per PR body Summary. - Confirm the fail-closed guard after nearest-gap substitution is not directly isolated by a test.
- Confirm testStubResolution.seam_line is a new field populated only in AtCandidate::Ok and resolution_for constructors. Other constructors that default-initialize the struct will leave seam_line = 0, and any future caller that reads it without going through these two paths sees a silent 0 instead of a panic.
- Confirm testStubResolution.seam_line lacks doc comment on the field declaration but has one in this diff; only AtCandidate::Ok arm and resolution_for populate it today, so a future constructor path would not see compile errors but would silently zero the printed line.
- Confirm the changed route behavior is substantially covered, while one defensive guard branch lacks a direct negative test.
Refuted
- The new test asserts stdout.contains("src/lib.rs:3") but the printed route is src/lib.rs:2, so the contains check is tautological with the --at parsed arg.; refuted because: stdout.contains("src/lib.rs:3") only verifies the finding line is mentioned in check output (it is in finding context), not the printed route. The route checks iterate the parsed --at args and assert src/lib.rs:2 is present and src/lib.rs:3 is absent. No tautology; assertion order is correct.
- The changed fail-closed behavior is wholly untested.; refuted because: The ambiguous-line test exercises a no-route case for an unusable substituted seam, but this does not fully refute the narrower residual test gap concerning the explicit post-substitution exact-resolution guard.
- A parallel seam classifier or new
at-seamresolver API is being introduced inside stub_route_for_finding, mirroring the seam-classification logic and risking drift between two paths.; refuted because: The added arm is a single.is_ok_andguard that re-enters the existingresolve_at_locationentry point. No new struct, no helper function, no shadow classifier is added; only one extra call per finding withat_note.is_some(). Verified by scanning the diff forfn,impl, andpub(crate)declarations adjacent to the change.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
Main repair PRs #9201 and #9202 are both open and add the same allowlist entry. I am not editing the process-policy allowlist from this PR. Once one of them lands, this PR needs main merged in and the Rust gates re-run on the resulting head. Generated by Claude Code |
… traceability, changelog (#8444) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N5f9YVQsrqQiS5EYjYVNm7
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Fail-closed guard in verified_seam_line is not directly isolated by a regression test; only positive branch has an oracle. Branch is a single early-return None and low risk, but is the entire behavior change for invalid continuation-line findings.
- Helper duplication is acceptable: const_consumer_route differs in fallback policy (continue vs return None), and the seam_id equality check is inherent to the fail-closed contract. A single-pass API returning (seam_id, seam_line, at_note) would remove one call but not change correctness; current shape respects smallest-complete-fix boundary.
Verification questions
- Confirm testStubResolution.seam_line is a new public(crate) field with a doc-comment requirement that only AtCandidate::Ok and resolution_for set; no constructor invariant.
Refuted
- stub_route_for_finding's new arm duplicates a parallel seam classifier instead of reusing resolve_at_location; refuted because: Diff adds verified_seam_line which calls the existing resolve_at_location entry point with resolution.seam_line; no parallel classifier or AtCandidate method copy is introduced; double work is one extra classifier pass, not a divergent path.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY for head 2caf015.
Refreshed since the earlier d28df5d pass: fail-closed verified_seam_line (re-resolve at the seam's own line must give the same seam_id and no at_note), the same verification for changed-constant consumer routes (unverifiable consumers are skipped), 12 blessed goldens under RIPR-SPEC-0122, spec/traceability/changelog updates, three tests that run ripr check, parse the printed command and run it, and two merges of main.
Inspected: full diff, owning resolver and consumers, test stimulus and oracle (positive route, ambiguous no-route, constant consumer), golden diffs (each only changes the printed line), exact-head hosted result Ripr Rust Small Result plus Rust gates, admission and paste lanes all green, all review threads resolved. Bot reviews that were rate limited are treated as missing, not clean. Item 2 of #8444 remains open.
Generated by Claude Code
Requested by Steven Zimmerman · project thread
Summary
Partial #8444 (item 1 only; item 2, direct
return_valuestubs, stays open).Before:
ripr checkprintedripr agent stub --at FILE:Lwith the finding's line even when the resolver stubbed the nearest gap instead.After:
stub_route_for_findingprints the seam's own line when a nearest-gap substitution happened, and emits no route unless resolving that line yields the same seam with no substitution note (fail-closed).TestStubResolutiongainsseam_lineto carry this.Source-of-truth Links
Spec: RIPR-SPEC-0122
Governing issue or accepted claim: #8444 (item 1: the printed stub route line)
Acceptance delta (one sentence):
ripr checkprints theagent stub --atline the stub actually targets, and no route when that line would not resolve to the same seam.Proof
check_routes_a_continuation_line_finding_to_the_line_the_stub_targets: finding on line 3 of a multi-lineSome(...)routes tosrc/lib.rs:2; the printed command runs with no substitution warning. Reverting the printed line to the finding line makes it fail.check_prints_no_route_when_the_nearest_gap_line_is_ambiguous: no printed command when the nearest gap line holds two seams.human.txtplusCHANGELOG.md) blessed under RIPR-SPEC-0122; for each, the old printed line triggered nearest-gap substitution and the new line resolves with none.cargo xtask precommit,agent_stub_compilesandtest_stublib tests pass locally on the merged tree.🤖 Generated with Claude Code
https://claude.ai/code/session_01TaZzbapKKD6UuEzYyzeajf