Skip to content

fix(agent-stub): name the nearest gap when --at lands off the requested line - #8364

Merged
EffortlessSteven merged 10 commits into
mainfrom
claude/agent-stub-at-line
Oct 17, 2026
Merged

EffortlessSteven merged 10 commits into
mainfrom
claude/agent-stub-at-line

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Before: ripr agent stub --at FILE:LINE silently 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_at sets a new at_note on TestStubResolution when the matched seam line differs from the requested one; agent_stub.rs inserts it first in the disclosure warnings. Covered by at_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) and cargo xtask precommit (exit 0) in-session. Not verified: hosted CI.


Generated by Claude Code

EffortlessSteven and others added 2 commits October 17, 2026 00:31
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
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 63 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: f26a81ff-5d28-4180-9e82-138bd6a02b6d
📥 Commits

Reviewing files that changed from the base of the PR and between d91a25d and 622cef7.

📒 Files selected for processing: 3
  • changelog.d/6298-agent-stub-at-nearest-note.md
  • crates/ripr/src/app/test_stub.rs
  • crates/ripr/src/cli/commands/agent_stub.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_note should 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_disclosure is 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.

Copy link
Copy Markdown
Member Author

Head df41b96. Local: cargo test -p ripr --lib test_stub passes and cargo xtask precommit exits 0. Hosted CI not yet run.

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 owner, file:seam_line".

On the github-actions review: resolution.owner comes from the classifier's owner symbol, not user input; every TestStubResolution constructor (AtCandidate::resolution, resolution_for) sets at_note; the typed-variant suggestion was already refuted there. Ordering of the note versus grip warnings and a refused-substitution test are reasonable follow-ups and are not blocking.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 05:25
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven EffortlessSteven self-assigned this Oct 17, 2026
@EffortlessSteven
EffortlessSteven marked this pull request as draft October 17, 2026 05:40
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 05:40
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copy link
Copy Markdown
Member Author

Merged current main into this branch to pick up #8341, which fixes check_python_finding_with_repair_card_points_at_the_card (red on the base commit, same failure seen on the sibling PR #8365; unrelated to this change). Cycled Draft to Ready to admit the new head.


Generated by Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --at that still ends in Err could leak a stale at_note from an earlier (succeeded) candidate iteration.; refuted because: Diff sets at_note per-iteration on a fresh resolution = 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.

@EffortlessSteven
EffortlessSteven marked this pull request as draft October 17, 2026 06:09
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 06:09

Copy link
Copy Markdown
Member Author

Same as #8365: the only red on the merged-main head was cargo xtask goldens check over 8 fixture goldens that #8275 left stale, which open PR #8351 re-blesses. Merged #8351's head into this branch (fixture and changelog files only, no-ops once it lands) and cycled Draft to Ready.


Generated by Claude Code

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@EffortlessSteven
EffortlessSteven marked this pull request as draft October 17, 2026 06:57
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 06:57
@gemini-code-assist

Copy link
Copy Markdown

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_class precedent and the alternative (enum on disclosure items) is a refactor that expands surface area beyond the issue's scope (#6298).
  • at_note is inserted as a raw String into the warnings vec via insert(0, note.clone()). Boundary-wise this couples a typed presentation field (at_note: Option<String>) to an untyped Vec<String> warnings aggregation; consider exposing at_note through a typed disclosure-item enum (or at minimum a wrapper type with note: String/grip: SeamGripClass variants) 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.

@settings settings Bot removed the merge-ready label Oct 17, 2026
@EffortlessSteven
EffortlessSteven marked this pull request as draft October 17, 2026 07:30
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 07:30

Copy link
Copy Markdown
Member Author

Hosted Rust gates failed on 785450a in cargo xtask goldens check: 35 human.txt goldens drift on the new No test stub here: ... line. That is not this PR's change. #8412 (already on main) added that line to ripr check output without re-blessing, and #8418 carries the re-bless. I merged #8418's head into this branch (b4f0704), which adds only golden/CHANGELOG files, and cycled Draft/Ready so CI re-runs on the new head. This will be a no-op once #8418 lands.


Generated by Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_note embeds resolution.owner verbatim from the classifier; not user-controlled per author, but the resolver->CLI contract is an untyped Vec<String> plus an opaque Option<String> note. Architectural smell mirrors existing grip_class precedent; 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_value seam kind; seam_line from candidate.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 returns Ok(resolution) for that same iteration's resolution; an earlier Err iteration's at_note never escapes that loop iteration's resolution handle.
  • at_note should 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

  • 70 of 73 changed files are fixture goldens whose added 'No test stub here: ...' line is #8412/#8418 output, rebased into this branch to keep CI green; correctness of #6298 is independent of that churn.

@EffortlessSteven
EffortlessSteven marked this pull request as draft October 17, 2026 08:15
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 08:15

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants