Repository navigation
fix(agent-stub): carry the --at nearest-gap note into a human refusal - #8452
Conversation
An --at line with no gap whose nearest gap refuses printed the refused seam without saying it replaced the requested line; only --json carried the note. Also pin the note's requested/stubbed order in the app test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CvyZKPHWVfaUwiSBjvijqk
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CvyZKPHWVfaUwiSBjvijqk
|
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! |
|
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 2 minutes. View limit details
Comment |
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm refusal_message appends note with '. ' prefix, matching the JSON rendered wording claimed in the test.
Refuted
- The deletion-side removal of the loose contains('nearest') check weakens coverage; refuted because: The new assertion is strictly stronger: it pins both the requested-line-first ordering and the exact wording of the nearest-gap phrase, which is the precise regression the PR fixes.
- A sibling refusal path with at_note also needs propagation, so refusal_message is incomplete; refuted because: Only the nearest-gap refusal arm in run_agent_stub carries resolution.at_note; the not_found and JSON-only paths do not construct or have an at_note. The helper is the single bottleneck for the human message at the only point where the note exists.
- Helper duplicates the JSON envelope path conceptually but is not code-level duplication: human and JSON paths diverge intentionally (#6309) and share only the seam_id/kind/reason tuple which is sourced identically.
- refusal_message should live in app/ alongside render so both JSON and human consumers could share note formatting; refuted because: JSON and human envelopes have different contracts per #6309 (parseable JSON vs human text). Moving the helper to app/ would couple the JSON renderer to human punctuation and re-introduce the same bug class (note dropped) in a different shape. Colocation with the only human caller is correct.
Evidence gaps
- cargo-test sensor is receipt-absent; refusal_message test and the tightened test_stub.rs assertion are not witnessed by this packet.
- Model proof intent was rejected by deterministic validation.
- cargo-test sensor is scheduled-late so no executed test receipt is available yet; lane must rely on the test source as evidence rather than a proof run.
- PR body claim 'verified in-session with cargo xtask precommit (exit 0)' is unverified here: heavy build leases are disabled in this profile and cargo-test is still scheduled-late, so this lane cannot corroborate compile or test execution.
Before: when
ripr agent stub --at FILE:LINEnamed a line with no gap and the nearest gap refused, the human-mode error named the refused seam and never said it had replaced the requested line. Only--jsoncarried the note from #8364.After: the human refusal message ends with the same "has no stubbable gap; this stub is for the nearest one" note. The #8364 test now pins the note's order (requested line first, stubbed line last), so swapped lines fail it.
How: an independent review of merged #8364 found the refusal arm in
agent_stub.rsbuilt its message withoutresolution.at_note. A smallrefusal_messagehelper appends the note and is unit tested with and without one. Refs #6298; remaining gaps are tracked in #8444. Verified in-session withcargo xtask precommit(exit 0). Not verified: hosted CI.Generated by Claude Code