Repository navigation
fix(agent-stub): name the nearest gap when --at lands off the requested line - #8364
Conversation
PR #8275 (RIPR-SPEC-0122) converted the bounded human render to plain language but missed these 8 fixtures. Each diff is wording-only: Summary/State/Static exposure/Hidden schema tokens become plain words with identical class counts; check.json and human-full.txt are byte-identical. Blessed via cargo xtask goldens bless with reason citing #8165/RIPR-SPEC-0122. Windows-only ts_repair_packet quoting drift intentionally not blessed.
…ed line (#6298) 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 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 22 minutes. View limit details
Comment |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CvyZKPHWVfaUwiSBjvijqk
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Note text embeds resolution.owner verbatim from classify; ensure it is a stable identifier and not user-controlled.
- Disclosure ordering: note is insert(0)'d ahead of grip-class warnings in agent_stub.rs. No test asserts the relative order between the at_note and the existing warnings, so a future refactor that reorders could regress disclosure clarity silently.
Verification questions
- Confirm testStubResolution now carries a public-at-crate surface field; any other TestStubResolution constructor site beyond AtCandidate::resolution and resolution_for must initialize at_note to avoid future uninitialized reads.
- Confirm new test asserts exact line has no note, but only checks return_value family; other seam kinds may format seam_line differently than display_line.
Refuted
at_noteshould be modeled as a typed variant (RequestedExact vs SubstitutedNear) on TestStubResolution rather than Option for safer disclosure; refuted because: The note is a single caller-presentational string with one variant and one consumer; introducing an enum would expand surface without changing observable behavior and contradicts the smallest-complete-fix posture.- Note can leak exact line info when called on a file the user did not name; refuted because: at_note is populated only when the user supplied --at FILE:LINE; resolution.owner comes from the same request; no new info disclosure surface vs. existing disclosure.warnings content.
Parked follow-ups
- at_note is set unconditionally when seam_line != line, even when outcome is a refusal; coverage of that path is absent and could mask a warning-storm regression if resolve_at changes.
- Helper
stub_grip_disclosureis not extended to accept the note; if a second consumer ever appears, the note must be re-threaded. Acceptable for current single caller.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
Head df41b96. Local: Independent review (Sonnet subagent) found one wording issue, fixed in this head: the note said "no gap is on file:line", which is wrong when an exact-line seam exists but was refused. It now reads "file:line has no stubbable gap; this stub is for the nearest one in On the github-actions review: 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! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Merged current main into this branch to pick up #8341, which fixes Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm disclosure ordering has no test pinning the at_note ahead of grip warnings, so a future refactor that drops
insert(0)silently regresses the 'nearest gap' disclosure. - Confirm off-line test only covers return_value family via with_kind("return_value"). seam_line is sourced from candidate.seam().display_line() which may format differently for other seam kinds (e.g., function-level, expression-level); format mismatch could yield a malformed note that still passes substring checks or surprises a future seam kind.
- Confirm github-actions prior review flagged that disclosure ordering (note insert(0) ahead of grip-class warnings) has no test asserting relative order; a future refactor that reorders could regress disclosure clarity silently. New PR did not add such an assertion.
Refuted
- Off-line
--atthat still ends in Err could leak a staleat_notefrom an earlier (succeeded) candidate iteration.; refuted because: Diff sets at_note per-iteration on a freshresolution = candidate.resolution(...); when a later iteration produces Ok, that resolution (with its own at_note) is returned, replacing any earlier note. When all iterations Err,first_refusal = Some(candidate.resolution(...))is taken from the same iteration that set at_note, so the note is coherent with the refused seam. - Only return_value family tested means the at_note contract is unproven for other seam kinds.; refuted because: Substring assertion (
contains("src/lib.rs:7")+"nearest") does not tightly depend on seam-kind-specific formatting of display_line for the demonstrated off-line case; gap exists for full multi-kind coverage but is not a correctness blocker for the reported issue. - A user-controlled FILE in --at could inject newlines/code into the at_note via the format! interpolation; refuted because: file in resolve_at comes from the parsed --at FILE:LINE selector (already validated by TestStubSelector::parse_at earlier in the pipeline), not from classify; format uses {file} not {resolution.owner} for the user-side tokens, and owner comes from classify symbol. Within the scope of this diff the substring rendered is bounded; escaping/quoting for terminal output is the consumer's job and out of diff scope.
Parked follow-ups
- Disclosure ordering has no test asserting at_note precedes grip warnings; a future refactor that reorders could regress clarity silently. Parked, not blocking per PR body.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
Same as #8365: the only red on the merged-main head was 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! |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- 8 fixture goldens (one_hop_field_projection[_discarded|_sibling|_wrong_sink], rust_map_insert_count_empty, rust_map_overwrite_count, seeded_push_after_early_return, typescript_mock_payload_iife_impl) contain 'Pending ... (n)' CHANGELOG hunks and human.txt plain-language rewording from PR #8351 rebased in; not strictly part of #6298 but present in the head and unverified by hosted CI in this PR.
Verification questions
- Confirm new test at_a_line_without_a_gap_names_the_nearest_gap_it_stubbed pins return_value family only; seam_line comes from candidate.seam().display_line() which other seam kinds may format differently, so notes could be malformed yet still match the source:line substring.
- Confirm disclosure ordering has no test pinning at_note ahead of grip warnings via insert(0); a future refactor that drops the insert could regress clarity silently.
- Confirm new test only exercises return_value seam kind; other kinds' display_line formatting is unverified.
Refuted
- at_note should live in the CLI/disclosure layer so TestStubResolution stays minimal.; refuted because: TestStubResolution already owns caller-presentational fields (grip_class) that the same CLI site consumes; resolve_at is the only place that knows the requested vs. resolved line, so moving formatting out would duplicate seam_line derivation. Boundary placement on the resolution is the smallest complete fix.
- Typed-variant modeling (RequestedExact vs SubstitutedNear) is safer than Option for at_note.; refuted because: Author and prior github-actions review both note this is a single caller-presentational string with one consumer; an enum would expand surface without adding safety since the only decision on the consumer side is whether to prepend.
Parked follow-ups
- Disclosure ordering: note is prepended via warnings.insert(0, note.clone()) so the substitution message leads the grip-class warnings; a future reorder could regress silently because no test pins relative order.
- Fixture goldens are no-op provenance from merging #8351's head for RIPR-SPEC-0122 plain-language rebless, not behavioral changes introduced by this PR. Test assertions only check return_value family via with_kind('return_value'); other seam kinds could format seam_line differently, but that is orthogonal to this PR's boundary choice.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…e line (#8412) #8412 made ripr check print the stub route or a 'No test stub here' refusal for every probe family, which changed human.txt for 35 fixtures; the goldens were not re-blessed, so goldens check fails on main. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BhjduQtMUKUnheruL7mphH
There was a problem hiding this comment.
Confirmed findings
- Pre-existing fixture drift (8 goldens from #8351 rebased in) is not part of #6298 scope; correctness of this PR is unaffected but reviewers should be aware the head carries unrelated golden churn unverified by hosted CI.
- Boundary placement is acceptable for the smallest complete fix; the only architectural smell (presentation String on resolver) mirrors the existing
grip_classprecedent and the alternative (enum on disclosure items) is a refactor that expands surface area beyond the issue's scope (#6298). at_noteis inserted as a raw String into the warnings vec viainsert(0, note.clone()). Boundary-wise this couples a typed presentation field (at_note: Option<String>) to an untypedVec<String>warnings aggregation; consider exposingat_notethrough a typed disclosure-item enum (or at minimum a wrapper type withnote: String/grip: SeamGripClassvariants) so future reordering/formatting is testable and the resolver->CLI contract is explicit. (crates/ripr/src/cli/commands/agent_stub.rs:56).- 8 fixture goldens in head contain 'Pending ... (n)' CHANGELOG hunks and human.txt rewording from PR #8351 rebased in; unrelated to #6298 surface but present and unverified by hosted CI in this PR.
Verification questions
- Confirm no test pins disclosure.warnings.insert(0) ordering relative to grip-class warnings; a future refactor could regress.
- Confirm disclosure ordering (at_note ahead of grip warnings) is not pinned by any test; a future refactor that drops insert(0) could regress silently.
- Confirm new test only covers return_value seam family; other seam kinds' display_line formatting is unverified against note construction.
- Confirm new test covers return_value seam kind only; other kinds' display_line could format differently and still satisfy the substring checks.
- Confirm new test only exercises return_value seam kind; seam_line formatting via display_line for other families is unverified.
Refuted
- Exact-line assertion (assert_eq!(exact.at_note, None)) is a no-op because Option::None could pass even if at_note were spuriously populated.; refuted because: resolve_at sets at_note only inside
if seam_line != line; the exact-match branch never executes the format!, so Option::None is the only possible value. The assertion is a positive anchor against future regression. - at_note should be modeled as a typed variant (RequestedExact vs SubstitutedNear) instead of Option; refuted because: Single caller-presentational string with one consumer; enum would expand surface without enabling new behavior; the None-vs-Some distinction already encodes the exact/substituted split.
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_01CvyZKPHWVfaUwiSBjvijqk
|
Hosted Generated by Claude Code |
There was a problem hiding this comment.
Confirmed findings
- At least one of the 73 fixture goldens contains a relative path '/fixtures/...' literally; if any new test renders absolute cwd the goldens may need re-bless under #8418 instead of #6298. Risk is low because the inline fixture churn is already attributed.
at_noteembedsresolution.ownerverbatim from the classifier; not user-controlled per author, but the resolver->CLI contract is an untypedVec<String>plus an opaqueOption<String>note. Architectural smell mirrors existinggrip_classprecedent; not blocking for #6298 scope.- Disclosure coupling is acceptable for the smallest complete fix; the architectural smell (typed Option resolver field inserted untyped into Vec warnings) mirrors the grip_class precedent and expanding to a typed enum is out of scope for #6298. Reviewers should be aware insert(0) ordering is not pinned by a test.
Verification questions
- Confirm new test only exercises the
return_valueseam kind;seam_linefromcandidate.seam().display_line()may format differently for other seam kinds, so a malformed note could still pass the substring check. Other seam families are unverified. - Confirm the at_note is inserted ahead of grip-class warnings via disclosure.warnings.insert(0, note.clone()) in agent_stub.rs, coupling a typed resolver field to an untyped Vec; no test pins the relative order so a future refactor that drops insert(0) regresses silently.
- Confirm new test at_a_line_without_a_gap_names_the_nearest_gap_it_stubbed covers only the return_value seam kind via with_kind("return_value"); other kinds' display_line formatting is unverified.
- Confirm disclosure ordering: at_note is insert(0)'d ahead of grip warnings with no test pinning relative position; a future refactor that drops insert(0) silently regresses clarity.
Refuted
- Stale at_note leaks from an earlier failed candidate into a later Ok resolution in resolve_at.; refuted because: resolve_at builds
let mut resolution = candidate.resolution(source.clone())per iteration and only returnsOk(resolution)for that same iteration's resolution; an earlier Err iteration's at_note never escapes that loop iteration's resolution handle. at_noteshould be modeled as a typed variant (RequestedExact vs SubstitutedNear) on TestStubResolution rather than Option for safer disclosure.; refuted because: Author and prior review treated as a refactor that expands surface beyond #6298 scope; the note is one caller-presentational string with one consumer.- TestStubResolution should be split into a presentation layer (CLI owns the note) so the resolver stays minimal.; refuted because: Rejecting because resolve_at already owns file/line context and owner symbol at the seam site, and centralizing formatting avoids duplicating the requested-vs-stubbed line computation across CLI paths. Mirrors existing grip_class layering.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Parked follow-ups
There was a problem hiding this comment.
Confirmed findings
- Resolver->CLI architectural smell: typed Option presentation field on resolver inserted untyped into Vec warnings aggregation; mirrors existing grip_class precedent. Typed disclosure-item enum would be testable but expands surface beyond #6298 scope.
- Head carries 8 unrelated fixture-golden churn from rebased #8351/#8418 (Pending... hunks + human.txt rewordings); not part of #6298 scope but unverified by hosted CI on this PR's branch.
Verification questions
- Confirm test only exercises return_value seam kind; seam_line formatting for function-level/expression-level seams could yield malformed notes that still pass the substring check - no coverage for other families.
- Confirm disclosure ordering of at_note vs grip warnings via insert(0) has no test pinning relative position; a future refactor that drops insert could regress silently - matches prior reviewer flag and remains unaddressed in this diff.
- Confirm new test only exercises return_value seam kind; display_line formatting for other seam kinds (function/expression-level) is unverified.
- Confirm insert(0) ordering of at_note ahead of grip warnings is not pinned by any test; a future refactor that drops the insert would silently regress disclosure clarity. Author flagged as non-blocking follow-up; architectural smell mirrors existing grip_class precedent.
- Confirm new test only exercises return_value seam kind; other families' display_line formatting unverified for note text.
Refuted
- Any future TestStubResolution constructor site could leave at_note uninitialized and silently regress disclosure.; refuted because: All three current constructor sites (AtCandidate::Finding inline struct, AtCandidate::Classified -> resolution_for, and the second resolution_for at the trailing site) explicitly initialize at_note; a clippy::missing_docs/added_default warning would catch drift. No new constructor was introduced.
- at_note should be modeled as a typed enum (RequestedExact vs SubstitutedNear) on TestStubResolution for safer disclosure.; refuted because: Single caller-presentational string with one variant and one consumer; enum expands surface without changing behavior; refuted by author in prior thread.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Parked follow-ups
- insert(0) ordering of at_note vs grip-class warnings has no test pinning relative order; a future refactor that drops the insert could silently regress disclosure clarity. Author already noted as parked follow-up.
- Prior reviewer flagged that off-line --at that still ends in Err could leak a stale at_note across candidate iterations; author refuted it because resolution is constructed fresh per-iteration and only the Ok one returns. This lane cannot independently prove the refutation without a refused-substitution test - parked as follow-up, not blocking.
Requested by Steven · project thread
Before:
ripr agent stub --at FILE:LINEsilently stubbed the nearest gap when the named line held none, so the agent could not tell the stub targeted a different line.After: the stub's disclosure warnings lead with a note naming the requested line, the line actually stubbed, and that it is the nearest gap. An exact line match carries no note.
How:
resolve_atsets a newat_noteonTestStubResolutionwhen the matched seam line differs from the requested one;agent_stub.rsinserts it first in the disclosure warnings. Covered byat_a_line_without_a_gap_names_the_nearest_gap_it_stubbed(exact line has no note; off line names both lines). Refs #6298.Verified:
cargo test -p ripr --lib test_stub(47 pass) andcargo xtask precommit(exit 0) in-session. Not verified: hosted CI.Generated by Claude Code