Skip to content

fix(agent-stub): place --at --kind stubs where the repair cage admits them (#13383) - #13405

Closed
EffortlessSteven wants to merge 1 commit into
mainfrom
claude/stub-kind-placement
Closed

EffortlessSteven wants to merge 1 commit into
mainfrom
claude/stub-kind-placement

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Governing issue or accepted claim: #13383
Acceptance delta (one sentence): ripr agent stub --at FILE:LINE --kind FAMILY --write, the command ripr check prints, places the stub in the tests/ file the repair cage admits (or is refused by the existing divergence guard) instead of writing an inline module into the production file.

Problem

--at --kind resolves from a single-file parse and always places a new inline mod ripr_tests in the production file. The repair packet admits only tests/<file>.rs, so a following ripr continue fails with edit_cage_violation. The RIPR-SPEC-0287 (#8727) divergence guard only runs for classified resolutions, so it never covered this path. Without --kind the stub already targets tests/.

Fix

In resolve_test_stub, when a file-parse stub is produced and the scoped inventory holds the same seam, resolve it through the existing classified owner (resolution_for). Placement then matches --seam-id and the unkinded --at, and next_repair_for plus divergent_write_refusal apply unchanged. If the classified stub refuses (weak oracle, no placement) the file-parse resolution and its disclosure are kept. No new validator.

Reproduction (scratch crate, before the fix)

lib fn price with a weak tests/lib.rs test and a behavior-changing diff: agent stub --at src/lib.rs:2 placed into tests/lib.rs with a Next repair line; adding --kind predicate placed a new inline module in src/lib.rs.

Proof

  • Red then green: crates/ripr/tests/agent_stub_at_disclosure.rs::at_kind_write_places_into_the_tests_file_the_repair_cage_admits
  • cargo test -p ripr --test agent_stub_at_disclosure (10 pass), --test agent_stub_compiles (40 pass), --lib test_stub (77 pass)
  • cargo xtask precommit: all gates passed through check-user-text, then stopped on an instrument timeout (covered_by enumeration of rust_activation killed after 300s under shared-build lock contention); not a source or policy failure. Not rerun to completion.
  • Not run: a live ripr continue --attempt loop, full workspace tests, hosted CI.

Spec RIPR-SPEC-0287, traceability and changelog fragment updated.


Generated by Claude Code

… them (#13383)

The command ripr check prints, agent stub --at --kind --write, resolved from
a file parse and always placed an inline module in the production file, which
the repair packet's tests/-only edit cage then refused (edit_cage_violation)
and which the RIPR-SPEC-0287 divergence guard never saw. Upgrade the file-parse
resolution to the classified resolution when the inventory holds the same seam
and stubs it, so placement and the existing guard match --seam-id and the
unkinded --at.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzSYtntK6oMwg5TaJEA
@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 Nov 6, 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 43 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 155 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: a3eaeb29-8eb0-40eb-a54f-9268780149e4
Commits

Reviewing files that changed from the base of the PR and between abf2272 and 71c977d.

Files selected for processing: 5

  • .ripr/traceability.toml
  • changelog.d/13383-stub-at-kind-places-in-repair-cage.md
  • crates/ripr/src/app/test_stub.rs
  • crates/ripr/tests/agent_stub_at_disclosure.rs
  • docs/specs/RIPR-SPEC-0287-agent-stub-repair-journey-pointer.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SOURCE_REVIEW_READY

An independent fresh-subagent review of head 71c977d found no blocking findings. It inspected the full diff, resolve_test_stub, resolution_for, next_repair_for and all callers of resolve_test_stub. The upgrade applies only to the kinded file-parse path, swaps in the classified resolution only when it succeeds, and otherwise keeps the file-parse stub and its disclosure. Repair pointer and divergence guard come from the existing owner, with no new validator. The integration test has an unkinded control, a placement-equality check and an untouched-production-file check. Spec, traceability and changelog match the change. Hosted exact-head proof is requested by merge-ready.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 6, 2026 06:33
@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 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

ripr static exposure check

Commit 71c977d25a45 · run · advisory, static evidence only (not a mutation run).

#ripr agent static-advisory base=abf2272472cb4a368c9133f803d85a07aea36550 findings=20 gaps=7 infection_unknown=1 reachable_unrevealed=7 static_unknown=6 weakly_exposed=6
reachable_unrevealed|crates/ripr/src/app/test_stub.rs:202|resolution_for(root, config, &entry, resolution.source.clone())|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_app_test_stub.rs:call_deletion:2bc1bbfb
reachable_unrevealed|crates/ripr/src/app/test_stub.rs:204|classified.at_note = resolution.at_note.take();|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_app_test_stub.rs:call_deletion:77a82cfc
reachable_unrevealed|crates/ripr/src/app/test_stub.rs:208|resolution.grip_class.get_or_insert(entry.class)|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_app_test_stub.rs:call_deletion:8662b4ca
reachable_unrevealed|crates/ripr/src/app/test_stub.rs:211|.take()|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_app_test_stub.rs:call_deletion:5d88621f
reachable_unrevealed|crates/ripr/src/app/test_stub.rs:212|.or_else(\|\| super::task_first::weak_oracle_guidance(&entry));|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_app_test_stub.rs:call_deletion:9c5278ce
t1=crates/ripr/src/cli/commands/agent_stub.rs:869 already_present_write_revalidates_the_placement_file unknown miss=no_assertion
+2 more gaps not shown; `--format json` lists all
limits=infection_unknown:1,reachable_unrevealed:1,static_unknown:6,weakly_exposed:5
next=ripr explain --root /home/runner/work/ripr-swarm/ripr-swarm/head --base abf2272472cb4a368c9133f803d85a07aea36550 --committed --mode draft --format agent probe:crates_ripr_src_app_test_stub.rs:call_deletion:2bc1bbfb

Took 51s.

Copy link
Copy Markdown
Member Author

Closing as a duplicate of #13401, which claimed #13383 earlier (05:43Z vs 06:21Z) and implements the same fix (classified resolution_for placement for --at --kind) with fuller proof. I found it only after opening this PR. The two required-check failures here (collection_out_parameter_repair and the preview-navigation test) are not worth fixing separately; #13401 is the one to land.


Generated by Claude Code

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants