Skip to content

perf(check): classify displayed Rust stub choices once per file - #15818

Merged
EffortlessSteven merged 6 commits into
mainfrom
perf/15682-bounded-stub-inventory
Nov 22, 2026
Merged

EffortlessSteven merged 6 commits into
mainfrom
perf/15682-bounded-stub-inventory

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

A Rust finding can refer to several seams on one line. Validating which commands to print previously classified every seam in the file for each requested inventory. This collects the displayed candidates by file and resolves their eligible seam IDs together against the full evidence corpus.

Swarm / Source Boundary

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

Source-of-truth Links

Proposal: #15682.
Spec: RIPR-SPEC-0122, bounded human check output, and RIPR-SPEC-0431, complete stub-guidance reuse.
ADR: existing staged evidence and cache contracts.
Plan item: #15682 production reproduction and route equivalence.
Governing issue or accepted claim: #15682.
Acceptance delta (one sentence): a batch of eligible stub choices resolves each scoped file once and preserves the advice each row receives.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): perf/15682-bounded-stub-inventory
Stack parent or prerequisite PR (if any): #14850 and #13542 already merged.
Proposed replacement of PR (if any; not yet accepted): none.
Acceptance retained from a replaced candidate (if any): no candidate is displaced.
Accepted winner and losing candidate disposition (when decided): standalone candidate for #15682.

The module split in #15609 reduced the workload of that PR. This change addresses ambiguity validation in the analyzer independent of that split. #13401 owns placement and #15642 owns error hints.

Scope

The check producer gathers eligible seam IDs after expression narrowing and the existing eight-candidate limit. Repeated IDs share a compact validated result. Each finding retains its original order, weak-oracle/refusal priorities and eligibility rules. An incomplete inventory still withholds advice. A distinct content-bound identity covers multi-ID results; a singleton uses the existing single-seam identity.

Scope Proof

The unbatched test oracle searches the complete inventory per candidate in original order. Increasing a file from 8 to 32 functions must still yield one preparation and two classifications across four planned rows, including a missing ID and an over-limit row. The external CLI comparison independently covers two changed files with twenty findings and ten stub commands.

Support-tier Impact

  • none

Policy Impact

  • doc artifacts

Spec 0122 and its traceability entry cover how the existing navigation producer handles multiple displayed rows.

Proof

The source of the production report is the scoped JSON check used by the PR-evidence producer. The historic hosted failure bound base 17e7460 to incident head 6915b31. The November 20 local run used current-main binary 0d6b9c7 for the old producer and the same incident tree, Git diff, cold cache, native Linux Rust 1.95 debug profile and 400 s cap for both producers.

  • Exact c162669 product on the full original issue diff finished in 173.85 s with exit 0, peak RSS 2,460,096 KiB. It emitted 767,945 bytes, 35 findings, SHA-256 0d95d529358037bcd8eb9e80547c739267d6a610679590a07c22107e811604c8. Main timed out at the 400 s cap, exiting 124 after 410.60 s including shutdown/grace, peak RSS 3,386,572 KiB and zero output bytes. This gives a lower bound on the elapsed improvement. Full baseline output remains unavailable from the 400 s run.
  • A separate cold two-file CLI replay emitted the same 97,013 bytes on both exact products, including twenty findings, ten stub commands and their navigation. SHA-256 9f342abf629033cd83d7ac45d5faefaca506686b38ce46c104dea7f037a655e8. Baseline 0.89 s / 98,692 KiB; final 0.17 s / 97,444 KiB. Intermediate 68aecf5 and final also produced byte-identical full incident reports.
  • Native Linux app::test_stub passed 38/38. The separate single-seam evidence-count test passed. The independent whole-file oracle and scoped work-count test checked both 8- and 32-function inputs. cargo fmt, check-traceability, check-spec-format and check-changelog-fragments passed. Final product binary SHA-256 f79bef1b882f3cb1a8a8f1e88f5f77d2a71d9e42a1eb40d547984912a7b9e724; exact Git diff SHA-256 77bd33e34843af9ea3c9cc4af5df7e91b9f65334a43c45cdd6d1613ddcb1dcff.

On e82fd51 the only change from c162669 is the location of one cfg(test) function and one documentation line. The complete remaining source bytes and the body of that test are identical. This avoids two textual conflicts with queued #15642 without importing its product code. Both merge orders with 5c62799 yield tree 2ccfb7ddc6706a1e6e5305d26dbc1119b70635b9. A native Rust 1.95 Linux build of that synthetic tree passed all 40 app::test_stub tests across both changes. The previous H qualification was cancelled after this ordinary fast-forward.

An additional full baseline run under a 3,600 s ceiling finished in 2,752.19 s. Its runtime PATH selected system Cargo 1.75.0, which failed offline metadata for this edition-2024 workspace. The paired 400 s runs above selected Cargo 1.95.0, which succeeded. Compared across those different environments, all 35 finding IDs, classifications, navigation routes, summary and canonical next action match. Seven findings differ in observed-value totals. One of those also differs in related-test count and another has a different displayed test and evidence path. Full JSON digests differ across those inputs. The final-binary control selecting the same system PATH finished in 203.13 s and emitted the exact 768,039 baseline bytes (SHA-256 3346eeb7165c06b9267c4a204de6edb706ad4b2c93f5feb6ff06f43edf6ba4c4). All seven discrepancies are reproducible by switching runtime PATH with the final product held constant. With the final analyzer and rustc 1.95.0 held fixed, switching only the cargo executable to 1.75.0 also reproduced all 768,039 system-environment bytes. A warm-cache Cargo 1.95.0 replay reproduced all 767,945 pinned cold-cache bytes. The subject tree was 1728e7f9ae03270b44177302a49e521a76c5aad1 and Git reported no tracked, untracked or ignored changes. The cold Cargo 1.95.0 baseline completed in 2,622.54 s (exit 0, peak RSS 3,480,724 KiB). Its full 767,945 bytes are identical to the cold and warm candidate reports, SHA-256 0d95d529358037bcd8eb9e80547c739267d6a610679590a07c22107e811604c8. On this incident the cold candidate completed 15.08 times faster and used 29.32% less peak RSS. The separate hosted PR evidence run measured 341.524 s for its own scoped check and reached the two existing canonical snapshot timeouts (125.769 s and 125.241 s). The required hosted result passed.

Claim Boundary

The measured runtime and memory apply to these inputs. The typed evidence classifier, support tiers and mutation claims retain their existing contracts. A direct standalone whole-file inventory remains available to consumers that request it.

Rollback

Revert the navigation batching, many-ID lookup and its accompanying proof together. The distinct multi-ID cache keys are advisory and unreachable from the previous producer.

Spec-Test-Code Traceability

  • Spec and receipt declaration: RIPR-SPEC-0122 and .ripr/traceability.d/15682-bounded-stub-choices.toml.
  • Test: ambiguous_rows_share_one_bounded_evaluation_and_match_whole_file_guidance, existing app::test_stub and single-seam controls.
  • Code: crates/ripr/src/app/test_stub.rs and crates/ripr/src/analysis/seam_inventory.rs.

Static Language Check

A route records a static decision about producing a Rust test stub. Runtime mutation coverage is outside this proof.

CI Economics

The historical failure spent its full 3,600 s scoped-check allowance. This change bounds classified seams per group and reuses compact outcomes. Hosted qualification uses its existing controls.

Engineering Check

Candidate collection and classification run before decisions are folded. A hidden row never triggers its unique direct route. Candidate-order and original-HEAD comparisons are exercised through real inputs.

Gates

Local proof is recorded above. Native PR and merge-group qualification are owned by the protected queue.

Closes #15682.

@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 20, 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 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 147 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: 2a4ce476-4a84-4c7e-9eb2-cf81bf2358f3
Commits

Reviewing files that changed from the base of the PR and between 7cf9cd6 and facc34a.

Files selected for processing: 6

  • .ripr/traceability.d/15682-bounded-stub-choices.toml
  • changelog.d/15682-bounded-stub-choices.md
  • crates/ripr/src/analysis/mod.rs
  • crates/ripr/src/analysis/seam_inventory.rs
  • crates/ripr/src/app/test_stub.rs
  • docs/specs/RIPR-SPEC-0122-bounded-human-check-output.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

Reviewed head: c162669.

I reviewed post-expression selection, the per-row eight-candidate cap, scoped and unscoped inventory selection, content-bound cache identity, row order, hidden-row behavior, and whole-inventory failure versus an absent ID. The final version evaluates each requested ID once, keeps its original first match, and drops the classified payload before preparing another file. Its finite reference test folds the old complete-inventory search independently for each original row. The two-file native CLI control retained all 97,013 output bytes, including ten real stub commands for 20 findings. The focused 38 tests and a separate single-seam control passed. Keep the bounded timeout and final-original-incident measurement distinct in reporting. The hosted required checks and actual protected merge group remain outstanding.

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@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

Reviewed head: e82fd51.

The preceding c162669 implementation, proof and source review still apply. The change restores a comment anchor and moves the existing reference test without changing its behavior. Before this adjustment, the prior head conflicted in two places with queued #15642 on 5c62799. I verified the heads now join in both orders at identical tree 2ccfb7ddc6706a1e6e5305d26dbc1119b70635b9. All 40 native test_stub tests passed on the joined tree. The exact full incident took 173.85 seconds on the reviewed implementation and preserved the earlier candidate's complete 767,945-byte JSON. The prior current-main 400-second trial produced no JSON. Hosted qualification on this new head and protected landing remain outstanding.

@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.

REVIEW_READY

Reviewed e82fd51. I retain the exact source judgment on per-file candidate batching, ordered ambiguity decisions, failure behavior, corpus identity and the conflict-free composition with #15642. The matched cold original and candidate used Cargo 1.95 on the full incident tree. Original 2,622.54 s / 3,480,724 KiB, candidate 173.85 s / 2,460,096 KiB. Both produced the exact same 767,945 bytes, SHA-256 0d95d529358037bcd8eb9e80547c739267d6a610679590a07c22107e811604c8; I checked the retained original file digest. A separate pair using Cargo 1.75 had the same bytes within that pair, and the narrow control identified the Cargo executable as the cause of the previously observed cross-environment differences.

Run 44826586784 passed for this head, including required Result 136622776414. Its different synthetic PR input took 341.524 s for the scoped check and two canonical snapshots timed out with an explicit unavailable result. Those costs remain separate from the incident replay. No unresolved review threads. The shared account already placed this exact head in native queue entry MQE_lQDOSiSx0c8AAAABQxiIB84ABWODzgQxDXY. This final review supports that existing entry and its subsequent protected qualification.

EffortlessSteven commented Nov 21, 2026 •

Copy link
Copy Markdown
Member Author

Native composition break at 56206cb7bbab5cd2b74e3d5e0d455c7a619a4b57: #15818 shard stops at E0425 in app/test_stub.rs:821; #15823 docs and VS Code compilation inherit it. #15818 put the one-finding stub_route_for_finding behind #[cfg(test)], but #15642 landed a production stub_route_seam_choice caller. The composed blob has both. On current main, keep that small single-finding wrapper available to the non-test build (it can delegate to the same batched implementation) and preserve the existing ambiguous MCP seam control. Check the non-test lib plus both single-route and batched work-count controls on the new head before requalification. The old green PR preview is not evidence for this composition; no duplicate run requested.

Native readback: 44964126769, candidate fc134d32eaeb01c6ce37b71f858ce16f70cc59f8, admitted but shard 1 failed on one stale refusal baseline row in pr_evidence.rs, changed by the earlier #15554 constituent. No stub failure was observed in that shard. Preserve the source review and exact hosted result; qualify a new native composition after isolating/correcting the ancestor, not a replay of this group.

01:05 UTC rebuild: 44968683378, candidate e66e420c88982fdca53c4c1d506aca8fb8f5f41d, excludes the earlier #15554 constituent eae223f6. Native admission passes and full checks are running; no duplicate requested.

@EffortlessSteven
EffortlessSteven removed this pull request from the merge queue due to a manual request Nov 21, 2026
@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 21, 2026
@EffortlessSteven
EffortlessSteven removed this pull request from the merge queue due to a manual request Nov 21, 2026
@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 21, 2026
@EffortlessSteven
EffortlessSteven removed this pull request from the merge queue due to a manual request Nov 21, 2026
#15642 landed stub_route_seam_choice, a production caller of
stub_route_for_finding, after this branch gated that helper to tests. The
queue composition stopped at E0425. The helper already completes through
the batched route, so only the cfg gate goes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmo5LTikCwnHLzQsL5J

Copy link
Copy Markdown
Member Author

Composition repair on facc34a639 (open-PR drain). Merged main at 7cf9cd6d61 and removed the #[cfg(test)] gate from stub_route_for_finding, because #15642's stub_route_seam_choice calls it in the production build (the E0425 at app/test_stub.rs:821). The helper still plans one route and completes it through finish_stub_routes, so the batched classification and the ambiguity handling are unchanged.

Local proof: cargo check -p ripr --all-targets and cargo fmt --check pass on the composed tree. The lib test binary cannot be linked on this machine (memory), so the test run is the hosted qualification requested by the fresh merge-ready label.


Generated by Claude Code

@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

Independent source-only review of facc34a6395ac40f830432701352d1b586fd09a2 on main 7cf9cd6d61feb6c2f4ea58d2ca1a0b8fa51adce2 for the #15642 interaction. The last commit removes the test-only gate from the existing single-finding helper and adds a comment; it doesn't introduce a second classifier or alter the route choice. The production stub_route_seam_choice caller can now use it. The wrapper and the check path still share finish_stub_routes; check completes the combined visible/hidden plans once, dedupes eligible IDs per scoped file, and restores prior row order. Ambiguous or withheld candidates do not get an executable seam command, and incomplete inventory or an absent/over-limit choice still withholds advice.

No source blocker found in the composition delta. The author reports exact-head cargo check --all-targets and formatting passed; the local lib test build did not complete. I did not rerun Rust tests. Hosted 44950373629 stopped at the former review attestation before Rust jobs, so the fresh hosted and native qualification, including the ambiguous single-route and batched work-count controls, still need to pass. Technical COMMENT only; no merge approval.

@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

Head facc34a6395ac40f830432701352d1b586fd09a2 (open-PR drain). Scope of this pass is the delta since the previously attested head e82fd51e27: a clean merge of main at 7cf9cd6d61 plus one repair commit. The repair removes the #[cfg(test)] gate from stub_route_for_finding because main's stub_route_seam_choice calls it in the production build; the body is unchanged and still completes through finish_stub_routes.

The earlier source review of e82fd51e27 stands for everything else; the merge brought no conflict and no other file of this PR changed. Proof on this head: cargo check -p ripr --all-targets and cargo fmt --check pass locally. The test run is not established locally (the lib test binary cannot be linked in this container) and is requested from hosted qualification.


Generated by Claude Code

@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.

REVIEW_READY

Final pre-enqueue pass on facc34a6395ac40f830432701352d1b586fd09a2 (open-PR drain). Hosted qualification on this exact head is green: https://github.com/EffortlessMetrics/ripr-swarm/actions/runs/44951392767/job/137004717012 (Rust gates, both test shards, shard verification and Ripr Rust Small Result). That run supplies the test evidence the source review on this head recorded as missing locally. No review thread is unresolved and no new finding was posted on this head. The queue run on the composed tree is the remaining proof.


Generated by Claude Code

Merged via the queue into main with commit e66e420 Nov 22, 2026
30 of 32 checks passed
@EffortlessSteven
EffortlessSteven deleted the perf/15682-bounded-stub-inventory branch November 22, 2026 01:43
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.

perf(check): stub-route ambiguity validation classifies a large changed file for minutes (PR-evidence 3,600 s timeout)

2 participants