Skip to content

fix(pilot): rank the current change past the inventory seam limit (#6943) - #6961

Merged
EffortlessSteven merged 6 commits into
mainfrom
claude/project-thread-dszsrc
Oct 7, 2026
Merged

EffortlessSteven merged 6 commits into
mainfrom
claude/project-thread-dszsrc

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

  • Before: on a repo past the inventory seam limit (default 10,000), ripr pilot cut the seams the developer just changed before it loaded the change. On tokio with semaphore.rs:1261 flipped, pilot said "scope: change-first" but could only report that the seam limit may have hidden the change (pilot: on a repo past the seam limit, the change's own seams are cut before classification, so change-first ranking cannot rank them #6943).
  • After: when the inventory limit fired and the change touches Rust files, pilot classifies the seams on the changed lines on their own, in what is left of its deadline, and adds the ones the cut dropped. On the same tokio branch the changed seam ranks first: "current change: part of it … tokio/src/sync/semaphore.rs:1261".
  • How: the cached repo inventory stays diff-independent (a diff-aware cut would miss the cache on every edit). classify_seams_in_files_at_with_config reuses the diff-scoped inventory (as ripr rerun and the MCP repair card do) with no caller expansion and an evidence stage that only evaluates seams on changed lines. PilotCurrentChange::fold_classified_change adds the cut seams, counts them as analyzed, and decides whether the seam-limit caveat on the change still applies. Design decision recorded on pilot: on a repo past the seam limit, the change's own seams are cut before classification, so change-first ranking cannot rank them #6943.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Proposal: n/a
Spec: RIPR-SPEC-0009 (defaults-first adoption, pilot current change)
ADR: n/a
Plan item: 0.11 first-run readiness
Governing issue or accepted claim: #6943
Acceptance delta (one sentence): pilot ranks the current change's seams change-first even when the inventory seam limit cut them.

Candidate Relationships

Candidate branch: claude/project-thread-dszsrc
Stack parent or prerequisite PR: none (builds on merged #6946)
Proposed replacement of PR: none

Scope

  • Pilot only. ripr check, the repo-exposure inventory and its cache are unchanged.

Scope Classification

  • One production behavior

Production delta:

  • Pilot classifies the change's seams past the inventory seam limit, under its own share of pilot's deadline. A failure or timeout there prints one stderr line, keeps the seam-limit caveat, and never fails pilot.
  • Pilot's repo-exposure.json drops the comparable artifact identity when it added seams ripr check never classifies (same rule as the pilot budget).
  • A change with no Rust file no longer carries the "seam limit may hide seams on the change" caveat; a limit with nothing left unanalyzed is cleared.

Evidence/support delta:

  • Unit tests for adding cut seams once, path decoding, and the fold's Ok / Err / not-run / no-Rust-file branches; a CLI smoke test with RIPR_REPO_EXPOSURE_SEAM_LIMIT=1.

Single acceptance criterion:

  • With the inventory limit cutting the changed seam, pilot's top recommendation is on the change and counts it as analyzed.

Non-goals:

  • Changing the inventory's own cut or cache key; the "ranked the first N of M seams" wording (N already included budget-kept change seams before this PR).

Support-tier Impact

  • none

Policy Impact

  • none

Proof

cargo test -p ripr --test cli_smoke pilot_      # 20 passed
cargo test -p ripr --lib output::pilot          # 65 passed
cargo xtask precommit                           # exit 0
ripr pilot on tokio b263675 + operator flip     # changed seam ranks first

Result, failures, or skipped proof:

  • The new smoke test fails on the previous pilot flow (negative control run locally: "ranked the first 1 of" still present).
  • tokio, release build, first version of this change: cold 30.8 s, warm 3.8 s (inventory cache hit 1.6 s, change classification about 2 s with evidence for all 135 seams in the changed file). The final version evaluates only the seams on changed lines; re-measure pending in the review of record.

Claim Boundary

  • May claim: pilot sees and ranks the current change's seams on repos past the inventory seam limit.
  • Must not claim: anything about seams elsewhere in the repo that the limit cut, or that pilot's snapshot is comparable with ripr check when it added change seams (it says so by omitting the identity).

Rollback

  • Revert the PR; no schema, cache or config change.

Spec-Test-Code Traceability

  • Spec: docs/specs/RIPR-SPEC-0009-defaults-first-adoption.md (new acceptance case), docs/OUTPUT_SCHEMA.md
  • Tests: crates/ripr/tests/cli_smoke.rs::pilot_ranks_the_current_change_past_the_inventory_seam_limit, output::pilot::tests::{change_seams_cut_by_the_inventory_limit_are_added_once, folding_the_classified_change_keeps_the_caveat_only_when_it_can_hold}
  • Code: cli/commands/pilot.rs, output/pilot/current_change.rs, analysis/seam_inventory.rs

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

CI Economics

n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • Public JSON/schema changes are documented.

Gates

  • cargo fmt --check (via precommit)

🤖 Generated with Claude Code

https://claude.ai/code/session_01NjuTkhQFnZGSqKhx7Tam4K


Generated by Claude Code

claude added 3 commits October 7, 2026 03:34
…old snapshot identity (#6943)

Review findings: a late change classification no longer discards the
finished inventory; only seams on changed lines get evidence; the
snapshot drops the comparable identity when pilot added seams check
never classifies; changed paths decode from stable path text; a change
with no Rust file drops the seam-limit caveat; a limit with nothing left
unanalyzed is cleared.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjuTkhQFnZGSqKhx7Tam4K
@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 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 1ce8f7a4-d049-4206-aa38-55eaa4da540d
📥 Commits

Reviewing files that changed from the base of the PR and between db8527b and e2b5d44.

📒 Files selected for processing (4)
  • changelog.d/6943-pilot-ranks-change-past-seam-limit.md
  • crates/ripr/src/output/pilot/render/complete.rs
  • crates/ripr/src/output/pilot/tests.rs
  • crates/ripr/tests/cli_smoke.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.


Summary by CodeRabbit

  • Bug Fixes

    • ripr pilot now classifies and ranks actionable seams on changed Rust lines even when the repository inventory seam limit is reached. The summary reports how many seams were ranked and avoids warning that the limit may have hidden a seam on the current change when classification succeeds.
    • If classification fails or times out, pilot reports the issue and retains the seam-limit caveat without failing.
    • Repo-exposure snapshots omit artifact identity when the seam budget truncates results or pilot adds seams beyond the inventory limit.
  • Documentation

    • Clarified how pilot reports inventory limits and changed-file classification in its summary and specification.

Walkthrough

When the repository inventory seam limit omits seams on changed lines, ripr pilot classifies changed Rust files within the remaining deadline. It adds matching seams to the current-change ranking and updates analyzed counts and limit caveats.

Changes

Pilot changed-seam ranking

Layer / File(s) Summary
Scoped seam classification and change matching
crates/ripr/src/analysis/mod.rs, crates/ripr/src/analysis/seam_inventory.rs, crates/ripr/src/output/pilot/current_change.rs
A new crate-visible helper classifies seams in specified changed files. Current-change helpers identify changed Rust files, add classified seams that touch changed lines and are not already present, and update the inventory limit information.
Deadline-bounded pilot integration
crates/ripr/src/cli/commands/pilot.rs
When the inventory limit fires, pilot attempts classification within the remaining deadline. It folds successful results into the ranking and limit information, reports classification errors without failing, and omits artifact identity when the population differs from check.
Regression coverage and behavior documentation
crates/ripr/src/output/pilot/tests.rs, crates/ripr/tests/cli_smoke.rs, docs/specs/RIPR-SPEC-0009-defaults-first-adoption.md, docs/OUTPUT_SCHEMA.md, changelog.d/6943-pilot-ranks-change-past-seam-limit.md, .ripr/traceability.toml, crates/ripr/src/output/pilot/render/complete.rs
Tests cover classification and ranking beyond the limit, including caveats and artifact identity. The specification, output schema, changelog, renderer messages, and traceability entry describe or track the behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Pilot
  participant CurrentChange
  participant SeamInventory
  Pilot->>CurrentChange: Read changed Rust file paths
  Pilot->>SeamInventory: Classify changed files within remaining deadline
  SeamInventory-->>Pilot: Return classified seams or error
  Pilot->>CurrentChange: Fold classification into ranking and limit information
Loading

Possibly related PRs

Merge Risk: ⚪ Minimal · up to e2b5d

Changed-line seams are incorporated into pilot’s ranking when classification succeeds, while the caveat is retained on failure or timeout. No established issue prevents merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to e2b5d

The change stays within local repository analysis and preserves safeguards against comparing incompatible snapshots. Remaining uncertainty concerns work continuing after a cooperative timeout, rather than increased privileges or a new external interface.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected recovery path operates with the same repository root and configuration as the initial inventory. Its incremental exposure is additional repository analysis and existing file-fact-cache activity, not a newly established tenant, service, credential, or privileged execution boundary.

Trust Boundaries and Controls

  • observed — Decoded changed-file paths are intersected with the collected production-file set before seam selection. Evidence is evaluated for seams overlapping changed lines, rather than granting those paths unrestricted authority over the recovery scope.

Resilience and Maintainability Implications

  • observed — The existing timeout mechanism requests cooperative cancellation and waits five seconds, but cannot forcibly stop a detached worker. Recovery now uses that mechanism without an extension. An initial inventory timeout exits before recovery starts, preventing overlap between those two workers in the same invocation. A late recovery worker may still finish an in-flight fact-cache operation; this does not establish a new security finding.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 81.48% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 6 files. (2 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: ranking the current change beyond the inventory seam limit.
Description check ✅ Passed The description is detailed and follows nearly all template sections. It explains the scope, acceptance criterion, implementation, proof, claim boundary, rollback, and traceability. Some template deta…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the changed lines with care,
And finds the seams the limit left elsewhere.
Within the clock, new rankings come to light,
The change goes first, its count now right.
“Ranked N of M,” the little rabbit sings,
Then hops away past inventory strings.

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

…ording (#6943)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjuTkhQFnZGSqKhx7Tam4K
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 7, 2026 04:35
@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

Review of record — head db8527bbb279b9f86798dec75bc99bb15850ea96

Three independent reviewer agents read the exact diff against source; two in round one (at 43954254f), one on the fixed head (at 6efc6cb13, the last commit after it is doc wording, a stderr notice and a unit test).

Angle Finding Resolution
Tests / contract Blocking: pilot's repo-exposure.json kept the comparable artifact identity after pilot added seams ripr check never classifies, so agent verify would compare two populations Fixed in 6efc6cb13: identity withheld when change seams were added; smoke test asserts no artifact key
Correctness A slow change classification inside the inventory deadline turned a finished inventory into a pilot timeout Fixed: runs after the inventory under what is left of the deadline; timeout or error keeps the caveat and prints one stderr line
Performance Evidence computed for every seam in the changed files Fixed: evidence stage evaluates only seams on changed lines (tokio: 1 of 135); warm pilot on tokio 3.2 s, cold 28.7 s
Correctness %-escaped stable path keys never matched the inventory Fixed: decoded with decode_stable_path_text; unit test
Contract Caveat kept for a change with no Rust file; "first N of N" when every cut seam was on the change Fixed: caveat dropped / limit cleared; unit tests
Tests Fold and gating branches untested Added folding_the_classified_change_keeps_the_caveat_only_when_it_can_hold and change_classification_past_the_limit_runs_only_when_it_can_matter
Contract (nits) Spec / schema / changelog wording Fixed in db8527bbb
Progress Silent classification after the inventory's progress run completed db8527bbb prints one stderr line unless --quiet

Not changed, recorded: the warm path still re-reads the workspace and rebuilds the index for the change classification on repos past the limit (about 1.5 s on tokio, 22k seams); "ranked the first N of M seams" is not literal when change seams are added (already true for budget-kept seams before this PR).

Local proof: cargo xtask precommit exit 0; cargo test -p ripr --test cli_smoke pilot 21 passed; cargo test -p ripr --lib output::pilot 65 passed; the new smoke test fails on the old pilot flow. cli::commands::pilot::tests::unwritable_out_dir_names_out_not_out_dir fails locally only because this container runs as root (a read-only dir is writable); it fails the same way without this PR's pilot changes.

Verdict: nothing blocking on this head. Merge when required CI is green.


Generated by Claude Code

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Devin Review

Comment thread crates/ripr/src/cli/commands/pilot.rs Resolved
claude added 2 commits October 7, 2026 04:53
The ranked set can include change seams past the inventory cut, so it
is no longer a prefix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjuTkhQFnZGSqKhx7Tam4K
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NjuTkhQFnZGSqKhx7Tam4K
@EffortlessSteven
EffortlessSteven marked this pull request as draft October 7, 2026 04:59
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 7, 2026 04:59
@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

Review of record, addendum: head e2b5d447b16f20a07b084c143d7d8fc6d75d7a2a

Since db8527bbb: 68237ad3f fixes the Devin finding (the seam-limit line said "ranked the first N of M seams"; it now says "ranked N of M seams", since change seams past the cut are not a prefix), and e2b5d447b is rustfmt. I reviewed this delta directly: the wording change is in two format strings, and the four tests that asserted the old text were updated. CodeRabbit reported no actionable comments on it. Precommit passed, pilot smoke tests 21/21, and output::pilot unit tests 65/65. Required Ripr Rust Small Result is green on this head; no review threads are open. Nothing blocking, so I'm merging.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven merged commit ca6679c into main Oct 7, 2026
37 of 38 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-dszsrc branch October 7, 2026 05:55

Copy link
Copy Markdown
Member Author

Follow-up source check on current main b13fc83fc10fc0d0d85e5c19ada07f99e06a4303, after this merge. The prefix wording fix is confirmed and retired.

Evidence boundary for both findings: source-supported; runtime NOT_PROVEN. No executable reproduction or new test run is claimed.

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