Repository navigation
fix(typescript): count source candidates against the workspace walk cap - #12031
Conversation
RIPR_TS_MAX_WORKSPACE_FILES now counts admitted TS/JS source files rather than every directory entry, so a large non-source tree no longer truncates discovery before those sources are seen. A 10x total-entry backstop still terminates huge asset trees through the existing truncated flag. Advances #11984. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Findings
|
| Layer / File(s) | Summary |
|---|---|
Candidate and entry limits crates/ripr/src/analysis/language/typescript/discovery.rs, changelog.d/11984-ts-walk-count-candidates.md |
The workspace walk counts accepted, non-generated TypeScript and JavaScript files toward the candidate cap. A separate 5× backstop counts visited entries. Tests cover candidate-cap behavior, excluded assets and generated files, backstop truncation, and sorted traversal. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Merge Risk: 
Moderate · previous review ffe9e
-
This change counts only candidate source files against the workspace walk cap. As a side effect, a directory with a very large number of entries is now read fully into memory before any limit applies. Link-heavy workspaces may also spend more time on alias checks, and the truncation message can name the wrong limit. These affect large or unusual workspaces, but they should be resolved or explicitly accepted before merge.
Pre-merge checks: 
5
-
Full details: Description check
-
Explanation
The description includes the required sections, scope, acceptance criterion, non-goals, proof results, claim boundary, rollback plan, traceability, engineering checks, and CI status. It also records skipped gates and residual follow-up work.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 1 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
A rabbit counts the files in rows,
TS and JS pass through the gate.
Assets do not add to the tally,
Sorted paths decide what comes first.
A fivefold stop marks the walk truncated,
Then soft paws close the changelog.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head source/oracle review (author COMMENT; GitHub cannot count this as approval).
reviewed_head_sha: e35b6888f3a753ba2723b9161044fb5626764112
integration_basis: origin/main a69bf0214f7bd7e0537a1cdd07e95608e5a366e8
claim_boundary: #11984 item 1 only — count admitted TS/JS sources against RIPR_TS_MAX_WORKSPACE_FILES; 10× total-entry backstop; existing truncated flag. Not item 2 (reference-tree pruning) or item 3 (changed-path walk order).
changed_surfaces_and_semantic_owners_inspected: crates/ripr/src/analysis/language/typescript/discovery.rs (visit_workspace_with_handwritten, is_candidate_workspace_source); consumers repo.rs truncated-walk disclosure (unchanged text); changelog.d/11984-ts-walk-count-candidates.md
blocking_findings: none in source/oracle for this claim
non_blocking_suggestions: none
refuted_or_stale_findings: cargo xtask precommit check-process-policy fail is inherited from origin/main (orphaned `use std::process::Command` allowlist for first_pr/run_chain.rs). Reproduced on a69bf0214f with this diff stashed. Not this candidate.
proof_and_ci_observed: red-before (assets consumed the cap; directory entries stole a source slot); 27 discovery tests + 25 repo_tests green after; cargo clippy -p ripr --all-targets -- -D warnings pass; goldens check skipped (no output-surface change)
proof_or_review_missing: hosted Ripr Rust Small Result on this exact head; ub-review and other provider reviews
affected_currentness_dimensions: production implementation, test stimulus, test oracle, public claim (changelog). Unchanged: disclosure wording, env parsing, goldens, generated relationships.
residual_assumptions_and_non_claims: does not prove microsoft/TypeScript clone completion; does not prune baselines/; does not change typescript_repo_discovery_truncated wording; minified `.min.js` is treated as non-candidate via the existing generated-name helper
disposition: REVIEW_INCOMPLETE for missing hosted exact-head qualification; source/oracle for this claim is clean and is not a merge clearance
Challenges:
- Mutation: counting every entry still would fail
workspace_file_limit_counts_source_candidates_not_assets(truncated=false/ all three sources). - Mutation: counting
src/as a candidate would keepworkspace_file_limit_truncates_when_sources_exceed_the_capatfiles.len()==1. - Mutation: omitting the 10× backstop would leave
workspace_walk_total_entry_backstop_trips_on_huge_nonsource_treewithtruncated=false. - Consumer:
repo_tests::truncated_discovery_walk_is_partialstill truncates (6 sources, walk_limit 3) without touching repo.rs.
Stop conditions not hit: disclosure remains in repo.rs unused by this diff; goldens did not change.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Head frozen at Inherited from main, not this diff: |
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head e35b688): REPAIR_REQUIRED
First independent review on this PR. It is bound to the head below and rests on the source at that head and on the hosted checks at that head.
Inspected:
- Head
e35b6888f3a753ba2723b9161044fb5626764112; not draft; labelmerge-ready;mergeable: MERGEABLE,mergeStateStatus: BLOCKED; title "fix(typescript): count source candidates against the workspace walk cap"; governed by issue #11984. - The candidate's whole change against the current main tip
a69bf0214f7bd7e0537a1cdd07e95608e5a366e8, which is also this branch's base, is 2 paths, +140/-29:changelog.d/11984-ts-walk-count-candidates.md(+6/-0, new) andcrates/ripr/src/analysis/language/typescript/discovery.rs(+134/-29). - What the change does.
visit_workspace_with_handwritten(discovery.rs:192) now keeps two counters instead of one.total_entries(:212) counts every directory entry and is compared againstmax_total_entries = max_entries * 10(:197,:213).candidates(:261) counts only admitted TS/JS source candidates —is_candidate_workspace_source(:179) isTypeScriptAdapter.accepts_path(path) && !is_detectable_generated_typescript_path(path)— and is compared againstmax_entries(:262). Either cap setstruncated. - I read the filters to establish what "candidate" actually means, because that word carries the claim.
is_candidate_workspace_sourcedoes not include the policy exclusion;is_detectable_excluded_typescript_pathis applied later, inside the same arm (:265-270), after the candidate has already been counted, and only then decides whether the file is pushed intoout. - The oracle. Three new unit tests in the same file:
workspace_file_limit_counts_source_candidates_not_assets(:854),workspace_file_limit_truncates_when_sources_exceed_the_cap, andworkspace_walk_total_entry_backstop_trips_on_huge_nonsource_tree(:911). One existing test's premise was rewritten from limit 4 to limit 2, and its comment was rewritten with it — that part is honest, and the new comment says why.
Blocking:
- The governing spec now contradicts the implementation.
docs/specs/RIPR-SPEC-0240-unknown-not-a-gap.mdhas a section titled "A TypeScript workspace walk cut short at its entry cap (#11767)" that states: "TypeScript discovery visits at mostRIPR_TS_MAX_WORKSPACE_FILESdirectory entries (20,000 by default), counting entries that are never indexed." This PR inverts that clause. After it, entries that are never indexed do not count toward the limit, the limit counts admitted source candidates, and a separate 10x total-entry backstop bounds the walk. The section's title and its body both state the pre-change contract, and this PR touches no spec. This is not a wording preference: that paragraph is the stated justification for rewritingno_static_pathfindings intostatic_unknownundertypescript_workspace_discovery_truncated, and it tells the reader the test universe was cut short at the entry cap — which after this change is no longer what happened. - The operator-facing disclosure reports a bound that is no longer the bound that applied.
crates/ripr/src/analysis/language/typescript/mod.rs:1688-1700pushes the limitation with the detail "Workspace discovery stopped at the {}-entry visit cap (RIPR_TS_MAX_WORKSPACE_FILES) before covering the workspace; discovered files are a partial set…" and interpolatests_workspace_file_limit(). Before this change that string was exact: the walk stopped when it had visitedmax_entriesentries. After it, the walk stops either after admittingmax_entriescandidates — having visited an unknown number of entries, up to ten times that — or after10 x max_entriesentries. Neither is "the N-entry visit cap". This is the one place the operator reads, and it is a receipt: correct before the change, incorrect after. The same PR updated three code doc comments (DEFAULT_TS_MAX_WORKSPACE_FILES:114,ts_workspace_file_limit,WorkspaceScan), so the author knew the limit's meaning changed; the string that reaches the operator was left describing the old meaning. - The public documentation of the setting still states the old semantics, and one of those places documents a wire-level output kind.
docs/CONFIGURATION.md:267: "Maximum directory entries visited during TypeScript/JavaScript workspace discovery, including entries that are not accepted source files."docs/OUTPUT_SCHEMA.md:3266documents the kindtypescript_workspace_discovery_truncatedas discovery having "stopped atRIPR_TS_MAX_WORKSPACE_FILES".docs/STATIC_LIMITS.md:92: "stopped at its entry cap". Plusdocs/LANGUAGE_ADAPTER_PREVIEW.md:345and:351. Plus the spec text quoted above. None updated.typescript_workspace_discovery_truncatedis a documented output kind with a documented meaning; this change alters what that kind reports without altering its description, so a consumer reading the kind cannot tell whether the candidate cap or the 10x backstop tripped, and the documented recovery ("raise the cap") no longer describes a single bound.
Non-blocking:
- "Admitted" over-claims. The PR body says the change "counts only admitted TypeScript/JavaScript source files against
RIPR_TS_MAX_WORKSPACE_FILES", and the new doc onDEFAULT_TS_MAX_WORKSPACE_FILESsays "Default ceiling on admitted TS/JS source candidates". The implementation counts a candidate at:261and decides admission only afterwards at:265-270. A TS/JS file under an excluded directory that the walk nevertheless reaches — reachable because a declared hand-written file keeps that ancestor alive throughdeclared_typescript_handwritten_under— consumes the candidate budget without being admitted. The window is narrow, but the word "admitted" is the claim and the counter does not implement it. Either count admitted files, or reword to "candidate". - Efficiency: the worst-case traversal grew by an order of magnitude, and the change does not say so. The default limit is 20,000 (
:114); the walk may now visit up to10 x 20,000 = 200,000directory entries (:197). Each entry costs aread_dirstep plus afile_type()call, and the walk keeps aPathBufstack. The repository shape this PR exists for — a large asset tree — is exactly the one that now pays up to ten times the previous scan before the walk gives up. The PR body describes the backstop neutrally ("A separate 10x total-entry backstop still terminates huge asset trees"); it does not state that the maximum scan grew from 20,000 entries to 200,000, and nothing in the change measures the new bound. A note beside the constant, or a default-scale cost statement, would make the trade visible to the maintainer and to the operator readingCONFIGURATION.md. - The backstop test does not pin the bound it is named for.
workspace_walk_total_entry_backstop_trips_on_huge_nonsource_tree(:911) asserts onlyscan.truncatedandscan.files.is_empty(). A walk that stopped after a single entry would satisfy it. The candidate-cap sibling does pin its bound (scan.files.len() == 2), so the asymmetry is inside this PR's own test set. The counter the PR already computes (total_entries:212) is the missing assertion, and the repository already has the pattern for it: the#[cfg(test)] SCAN_COUNTcounter incrates/ripr/src/analysis/classify/macro_item_names.rs. truncatednow conflates two bounds.WorkspaceScan.truncated(:158) is set by either cap, andrepo.rs:105plus the twomod.rssites consume it as one condition. A consumer cannot tell which bound applied. The recovery advice remains sufficient only because the backstop is derived from the same limit — a fact the disclosure does not mention.
Not run:
- The Rust toolchain on this host is not on
PATH: nothing was compiled, tested, linted, or run throughcargo xtask. Every Rust-level statement above comes from the source at the reviewed head or from hosted job logs. - The hosted Rust gates at this head do not exercise the change. Run
41266791058, job124731307224fails at step 16 "Repository policy preflight" withcheck-process-policy: "crates/ripr/src/output/first_pr/run_chain.rs allowlist entry foruse std::process::Commandis orphaned: max_count=1 but pattern not found in any tracked file; remove the entry". That is the known base-side red at main tipa69bf0214(job124707375551), whose repair carrier is #11975. The candidate contributes two paths and neither spawns a process, so this red is not candidate-attributable. But the first failed step is authoritative, so steps 17-39 were skipped — including "All-features ripr target check" (:21), "Strict workspace Clippy" (:22), "Golden output contracts" (:23), "Fixture contracts" (:25), "Verdict corpora" (:28) and "Required Rust tests" (:30). The PR's three new unit tests were therefore never compiled or executed at this head, and the verdict-corpus rows coveringtypescript_workspace_discovery_truncatedwere not re-validated against the new bound semantics. - The
merge-readylanes still in progress at the time of reading (ub-reviewjob124730996778,windows-advisory-subsetjob124731146616,Rust-only feature lanejob124731147186) were not read to a terminal state.
Suggested repair shape: update RIPR-SPEC-0240's "cut short at its entry cap" section to state the two bounds and their relationship; make the mod.rs:1688 disclosure name the bound that actually applied, or say which one tripped; update CONFIGURATION.md, OUTPUT_SCHEMA.md, STATIC_LIMITS.md and LANGUAGE_ADAPTER_PREVIEW.md; and either count admitted files rather than candidates or reword "admitted" to "candidate". The implementation itself reads correctly — the defect is in the contract and receipt surfaces it leaves stale, plus the one counter that does not match its name.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head e35b6888f3a753ba2723b9161044fb5626764112. Not an approval.
|
Reply to independent review 1–3 (spec,
Recovery remains 4 — repairing in-file. The ITEM 5 shape is “candidate TS/JS source entries (extensions the walker admits, minus 5 — repairing in-file. Note beside the backstop constant that default 20_000 candidates implies a 200_000-entry walk. 6 — repairing in-file. Pin 7 — residual. Splitting Inherited |
Record directory entries seen by the last workspace walk so the 10x total-entry backstop test cannot pass after a one-entry stop. Reword comments and the changelog to "candidate" because excluded-path files can consume the cap without being indexed. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head source/oracle review after in-file repair (author COMMENT; GitHub cannot count this as approval).
reviewed_head_sha: b7ec93fc20077ad334ba75f9f7c98f4526c34def
integration_basis: origin/main a69bf0214f7bd7e0537a1cdd07e95608e5a366e8
claim_boundary: #11984 item 1 only — count candidate TS/JS sources (routed extensions minus *.generated.*) against RIPR_TS_MAX_WORKSPACE_FILES; 10× total-entry backstop (200_000 at default); existing truncated flag. Not item 2 (reference-tree pruning) or item 3 (changed-path walk order).
changed_surfaces_and_semantic_owners_inspected: crates/ripr/src/analysis/language/typescript/discovery.rs (visit_workspace_with_handwritten, is_candidate_workspace_source, LAST_WALK_TOTAL_ENTRIES, DEFAULT_TS_MAX_WORKSPACE_FILES / TS_WORKSPACE_TOTAL_ENTRY_BACKSTOP_MULTIPLIER comments); changelog.d/11984-ts-walk-count-candidates.md; consumers repo.rs / typescript/mod.rs truncated-walk disclosure (unchanged text, fenced/busy)
blocking_findings: none in source/oracle for this claim on this head
non_blocking_suggestions: none in allowed files
refuted_or_stale_findings: independent review 5726215881 items 4/5/6 repaired on this head (candidate wording, 20_000×10=200_000 note, LAST_WALK_TOTAL_ENTRIES == backstop+1). Items 1/2/3/7 remain residual: spec/mod.rs/docs are fenced or busy; truncated still conflates two bounds by ITEM 5 contract. cargo xtask precommit check-process-policy fail is inherited from origin/main (orphaned `use std::process::Command` allowlist for first_pr/run_chain.rs). Reproduced on a69bf0214f with this diff stashed. Not this candidate (#11975).
proof_and_ci_observed: red-before (assets consumed the cap; directory entries stole a source slot); 27 discovery tests + 25 repo_tests green after; cargo clippy -p ripr --all-targets -- -D warnings pass; goldens check skipped (no output-surface change). Hosted Ripr Rust Small Result not yet requested on this SHA.
proof_or_review_missing: hosted Ripr Rust Small Result on this exact head; ub-review and other provider reviews on this SHA
affected_currentness_dimensions: production implementation, test stimulus, test oracle, public claim (changelog). Unchanged: disclosure wording, env parsing, goldens, generated relationships.
residual_assumptions_and_non_claims: does not prove microsoft/TypeScript clone completion; does not prune baselines/; does not change typescript_repo_discovery_truncated wording; minified `.min.js` is treated as non-candidate via the existing generated-name helper; RIPR-SPEC-0240 / CONFIGURATION.md / OUTPUT_SCHEMA.md / STATIC_LIMITS.md still describe the pre-change all-entry cap (follow-up when those surfaces are free)
disposition: REVIEW_INCOMPLETE for missing hosted exact-head qualification; source/oracle for this claim is clean and is not a merge clearance
Challenges:
- Mutation: counting every entry still would fail
workspace_file_limit_counts_source_candidates_not_assets(truncated=false/ all three sources). - Mutation: counting
src/as a candidate would keepworkspace_file_limit_truncates_when_sources_exceed_the_capatfiles.len()==1. - Mutation: omitting the 10× backstop would leave
workspace_walk_total_entry_backstop_trips_on_huge_nonsource_treewithtruncated=false. - Mutation: stopping after one asset would fail
LAST_WALK_TOTAL_ENTRIES == backstop + 1. - Consumer:
repo_tests::truncated_discovery_walk_is_partialstill truncates (6 sources, walk_limit 3) without touching repo.rs.
Zero inline threads. Independent review 5726215881 answered on the PR; in-file 4/5/6 landed here; 1/2/3/7 residual by ITEM 5 stop condition.
Stop conditions not hit: disclosure remains in repo.rs unused by this diff; goldens did not change.
|
Head frozen at In-file repair of independent review 5726215881 items 4/5/6 is on this head. Items 1/2/3/7 remain residual (spec/ Inherited from main, not this diff: |
|
Head stays frozen. |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head b7ec93f): REPAIR_REQUIRED
Supersedes my earlier review on this PR, which was bound to head e35b6888f. The head has moved to b7ec93fc2 and the delta answers three of that review's findings, so this review re-disposes every earlier finding against the current head.
Inspected:
- Head
b7ec93fc20077ad334ba75f9f7c98f4526c34def; not draft; labelmerge-ready;mergeable: MERGEABLE,mergeStateStatus: BLOCKED; title "fix(typescript): count source candidates against the workspace walk cap"; governed by issue #11984. - The delta from
e35b6888fto this head is one commit, two paths:b7ec93fc2"test(typescript): pin the walk backstop and say candidate, not admitted" —changelog.d/11984-ts-walk-count-candidates.md(+3/-3) andcrates/ripr/src/analysis/language/typescript/discovery.rs(+25/-7). The candidate's total contribution againstorigin/mainis still two paths,changelog.d/11984-ts-walk-count-candidates.mdandcrates/ripr/src/analysis/language/typescript/discovery.rs. - The implementation is otherwise as I read it at
e35b6888f:visit_workspace_with_handwritten(discovery.rs:192) keeps two counters,total_entries(:212) againstmax_total_entries = max_entries * 10(:197,:213) andcandidates(:261) againstmax_entries(:262); either cap setstruncated.is_candidate_workspace_source(:179) isTypeScriptAdapter.accepts_path(path) && !is_detectable_generated_typescript_path(path), and the policy exclusionis_detectable_excluded_typescript_pathis applied afterwards, at:265-270, after the candidate has already been counted.
Re-disposition of my earlier findings:
- Finding 1 — the governing spec now contradicts the implementation — STILL HOLDS.
docs/specs/RIPR-SPEC-0240-unknown-not-a-gap.mdstill has the section "A TypeScript workspace walk cut short at its entry cap (#11767)" stating "TypeScript discovery visits at mostRIPR_TS_MAX_WORKSPACE_FILESdirectory entries (20,000 by default), counting entries that are never indexed". The delta changes no spec file. The clause is still inverted by the implementation, and the section title still names the old behaviour. - Finding 2 — the operator-facing disclosure reports a bound that is no longer the bound that applied — STILL HOLDS.
crates/ripr/src/analysis/language/typescript/mod.rs:1688-1700still pushes the limitation with the detail "Workspace discovery stopped at the {}-entry visit cap (RIPR_TS_MAX_WORKSPACE_FILES) before covering the workspace…" and still interpolatests_workspace_file_limit(). The delta changes no file undermod.rs. After this change the walk stops either after admittingmax_entriescandidates — having visited an unknown number of entries, up to ten times that — or after10 × max_entriesentries; neither is "the N-entry visit cap". The disclosure also still cannot tell the operator which of the two caps tripped, and the recovery advice is only unconditionally sufficient because the backstop is derived from the same limit. - Finding 3 — the public documentation of the setting still states the old semantics — STILL HOLDS.
docs/CONFIGURATION.md:267("Maximum directory entries visited during TypeScript/JavaScript workspace discovery, including entries that are not accepted source files"),docs/OUTPUT_SCHEMA.md:3266(the documented meaning of the wire kindtypescript_workspace_discovery_truncated),docs/STATIC_LIMITS.md:92("stopped at its entry cap"), anddocs/LANGUAGE_ADAPTER_PREVIEW.md:345and:351are all unchanged by the delta. - Finding 4 — "admitted" over-claims relative to the implementation — REPAIRED. The changelog fragment now reads "counts only candidate TS/JS source files", and the doc on
DEFAULT_TS_MAX_WORKSPACE_FILESnow states the rule the code actually implements: "Default ceiling on candidate TS/JS source files during workspace discovery (routed extensions minus the generated-name family)". Thevisit_workspace_with_handwrittendoc and the two test comments were updated to match. This is exactly the correction I asked for, and it removes the over-claim. - Finding 5 — the ten-fold growth in the worst-case walk was not stated — REPAIRED. The changelog now says "A separate 10× total-entry backstop (200,000 entries at the default 20,000-candidate limit) still terminates huge asset trees", and the multiplier's doc says "Default
20_000 × 10 = 200_000directory entries" with the constant's doc adding "the default 20_000 candidates imply a 200_000-entry walk before the walk gives up". The ceiling is now visible to whoever reads the change. - Finding 6 — the backstop test did not pin the bound it was named for — REPAIRED. The delta adds a
#[cfg(test)] thread_local! { static LAST_WALK_TOTAL_ENTRIES: std::cell::Cell<usize> }counter, sets it at the end ofvisit_workspace_with_handwritten(:313-314), and asserts inworkspace_walk_total_entry_backstop_trips_on_huge_nonsource_tree:The counter isassert_eq!( LAST_WALK_TOTAL_ENTRIES.get(), backstop + 1, "the walk must stop at the 10× total-entry backstop, not after one entry" );
#[cfg(test)], so it costs nothing in a production build, and it matches the repository's existing pattern for this (SCAN_COUNTincrates/ripr/src/analysis/classify/macro_item_names.rs). The assertion pins the bound, and its failure message names the failure mode it rules out. - Finding 7 —
truncatedconflates two bounds — STILL HOLDS, but it is now a smaller gap. The delta discloses the 200,000-entry ceiling in the code docs and the changelog, which is the right first half of the fix. The second half is still missing:WorkspaceScan.truncated(:158) is set by either cap,repo.rs:105and the twomod.rssites consume it as one condition, and the operator-facing disclosure names one cap without saying which tripped. Whether the disclosure is repaired is the substance of findings 2 and 3 below, so I have not counted this separately.
Blocking:
- The governing spec still states the opposite of what the code does. This is unchanged from my earlier review and is the load-bearing blocker: the spec section is the stated justification for rewriting
no_static_pathfindings intostatic_unknownundertypescript_workspace_discovery_truncated, and it tells the reader the universe was cut short at the entry cap — which after this change is not what happened. The delta repaired three of my four non-blocking findings and left this one; it is a one-paragraph spec edit. - The operator-facing disclosure still reports a bound that is no longer the bound that applied. Unchanged from my earlier review, and the delta makes it slightly more visible rather than less: the code now documents a 200,000-entry ceiling, while the string the operator reads says the walk "stopped at the 20000-entry visit cap". In the backstop case the walk stopped at 200,001 entries and the disclosure names 20,000. This is the one place the operator reads, and it is a receipt — correct before the change, incorrect after it.
- The public documentation of
RIPR_TS_MAX_WORKSPACE_FILESand of thetypescript_workspace_discovery_truncatedoutput kind still states the old semantics in five places. Unchanged from my earlier review:docs/CONFIGURATION.md:267,docs/OUTPUT_SCHEMA.md:3266,docs/STATIC_LIMITS.md:92,docs/LANGUAGE_ADAPTER_PREVIEW.md:345and:351, plus the spec text quoted above.typescript_workspace_discovery_truncatedis a documented output kind with a documented meaning; this change alters what that kind reports without altering its description, so a consumer reading the kind cannot tell which bound tripped.
Non-blocking:
- The candidate budget is still spent before the policy filter, so the counter and its name still diverge slightly. The changelog and the code docs now say "candidate", which is honest; the residual is that a candidate is counted at
:261and only afterwards decided for admission at:265-270. A TS/JS file under an excluded directory that the walk nevertheless reaches — reachable because a declared hand-written file keeps that ancestor alive throughdeclared_typescript_handwritten_under— consumes the budget without being admitted. With "candidate" as the word, this is now accurate rather than an over-claim, so I am no longer treating it as blocking. - Efficiency: the ten-fold ceiling is now disclosed, but nothing measures the new bound. The disclosure is the right fix for the documentation half. The other half is unmeasured: the default walk may now visit 200,000 directory entries, each costing a
read_dirstep plus afile_type()call, and the repository shape this change exists for — a large asset tree — is exactly the one that pays up to ten times the previous scan before giving up. There is no timing or entry-count measurement of the default-scale case anywhere in the change; the new counter makes one cheap to add, since it already exists and is#[cfg(test)]. - The new counter is thread-local, so it only describes the calling thread's walk.
LAST_WALK_TOTAL_ENTRIESis athread_local!Cell, set at the end ofvisit_workspace_with_handwritten. That is correct for the test's use (the walk and the assertion are on the same thread) and it costs nothing in a production build. It is worth stating in the counter's own doc comment that it describes the last walk on this thread, not the last walk globally — the current doc says "Directory entries seen by the last [visit_workspace_with_handwritten] on this thread", which does say it. No change needed; I note it so the next reader does not have to re-derive it. - The PR's base is behind
main, and the reason its required gate is red no longer exists onmain. The required checkRipr Rust Small Resultis FAILURE at this head, and the Rust gates job fails at step 16 "Repository policy preflight" with the message "crates/ripr/src/output/first_pr/run_chain.rs allowlist entry foruse std::process::Commandis orphaned: max_count=1 but pattern not found in any tracked file; remove the entry". That orphan was a base-side red, and it is still base-side: this branch's base isa69bf0214f, andorigin/mainhas since moved to99b2e4d08e, where #11995 removed the orphaned allowlist entry. The candidate's two paths spawn no process, so the red is not candidate-attributable — but it will not clear on its own, because the branch has not absorbed main's repair. A rebase would clear it and let steps 17-39 run.
Not run:
- Not run: the hosted Rust gates past step 16. The first failed step is authoritative, so steps 17-39 were skipped — including "All-features ripr target check" (
:21), "Strict workspace Clippy" (:22), "Golden output contracts" (:23), "Fixture contracts" (:25), "Verdict corpora" (:28) and "Required Rust tests" (:30). The PR's own tests were therefore never compiled or executed by the hosted lane at this head, and the verdict-corpus rows coveringtypescript_workspace_discovery_truncatedwere not re-validated against the new bound semantics. - Not run:
cargo xtask precommitand the full workspace suite. A whole-workspace run is out of budget for a single-PR review, and the repository is presently red onmainfor reasons unrelated to this change. - Run locally, with receipts:
cargo check --locked -p ripr --all-targetson this repository exits 0. The PR's own TypeScript discovery tests were run at this head in a scratch worktree checked out atb7ec93fc2:→cargo test --locked -p ripr --lib typescript::discoverytest result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 16683 filtered out. The three tests that carry the change —workspace_file_limit_counts_source_candidates_not_assets,workspace_file_limit_truncates_when_sources_exceed_the_capandworkspace_walk_total_entry_backstop_trips_on_huge_nonsource_tree— all pass, so the new backstop assertion holds at this head and the delta's repairs of findings 4, 5 and 6 are sound in execution, not only in prose. The repository's Rust toolchain is present on this host and used here; it is simply not on the defaultPATH(%USERPROFILE%\.cargo\binholdscargo.exe/rustc.exe, and the repo'srust-toolchain.tomlpins1.95.0, which is installed). No Rust receipt in this review is inferred from the hosted lanes.
Suggested repair shape: update RIPR-SPEC-0240's "cut short at its entry cap" section to state the two bounds and their relationship; make the mod.rs:1688 disclosure name the bound that actually applied, or say which one tripped; update docs/CONFIGURATION.md, docs/OUTPUT_SCHEMA.md, docs/STATIC_LIMITS.md and docs/LANGUAGE_ADAPTER_PREVIEW.md; and rebase onto main so the inherited policy red clears and the Rust lane runs. The implementation itself reads correctly — what remains is the contract and receipt surfaces it leaves stale.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head b7ec93fc20077ad334ba75f9f7c98f4526c34def. Not an approval.
…candidates-3e27 Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
Reply to independent review 1–3 (spec, 4–6 — agreed repaired on this head (candidate wording, 20_000×10=200_000 note, 7 — absorbing landed #11995, not repairing the orphan here. |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head source/oracle review after absorbing landed #11995 (author COMMENT; GitHub cannot count this as approval).
reviewed_head_sha: 478457f417e15e0fbb5b9dc142a2a8b6b863e113
integration_basis: origin/main 99b2e4d08e5dbed103d661e89cf1c6fabb6a7b62 (#11995)
claim_boundary: #11984 item 1 only — count candidate TS/JS sources (routed extensions minus *.generated.*) against RIPR_TS_MAX_WORKSPACE_FILES; 10× total-entry backstop (200_000 at default); existing truncated flag. Not item 2 or item 3. Merge of #11995 is integration-basis only.
changed_surfaces_and_semantic_owners_inspected: crates/ripr/src/analysis/language/typescript/discovery.rs (unchanged vs b7ec93fc20); changelog.d/11984-ts-walk-count-candidates.md; merge brings #11995 process-allowlist / selector / LSP / corpus rows from main
blocking_findings: none in source/oracle for this claim on this head
non_blocking_suggestions: none in allowed files
refuted_or_stale_findings: independent review 5726317302 items 1/2/3 remain residual (spec/mod.rs/docs fenced or busy). Items 4/5/6 remain repaired. Item 7 absorbed by merging origin/main 99b2e4d08e; this lane did not edit run_chain.rs or the process-policy allowlist. cargo xtask check-process-policy now passes locally.
proof_and_ci_observed: 27 discovery tests pass; cargo xtask precommit pass including check-process-policy. Hosted Ripr Rust Small Result not yet observed on this SHA.
proof_or_review_missing: hosted Ripr Rust Small Result on this exact head
affected_currentness_dimensions: integration basis, candidate head identity. Unchanged vs b7ec93fc20: production walk, tests, disclosure wording, goldens.
residual_assumptions_and_non_claims: RIPR-SPEC-0240 / CONFIGURATION.md / OUTPUT_SCHEMA.md / STATIC_LIMITS.md / typescript/mod.rs still describe the pre-change all-entry cap
disposition: REVIEW_INCOMPLETE for missing hosted exact-head qualification; source/oracle for this claim is clean and is not a merge clearance
Challenges unchanged from b7ec93f: counting every entry fails the asset test; counting src/ as a candidate steals a source slot; omitting the 10× backstop fails the backstop test; stopping after one asset fails LAST_WALK_TOTAL_ENTRIES == backstop+1.
Stop conditions not hit: disclosure remains outside discovery.rs; goldens did not change.
|
Head frozen at |
|
|
|
Re-applied |
|
Job ITEM 5 stop: that producer test and the Recorded on #11984. |
…candidates-3e27 Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
Reply to ub-review Verification — sorted DFS is deliberate. Name-sorted LIFO is the two-file repair for hosted shard 2 on Refuted 10× PR body — already corrected. Current PR body, changelog, and Parked follow-ups — residual, not this candidate. Disclosure/stop-reason attribution lives in busy Evidence gaps. Local on this SHA: 28 |
#11984) Update the truncated-discovery disclosure text, STATIC_LIMITS, CONFIGURATION, OUTPUT_SCHEMA, LANGUAGE_ADAPTER_PREVIEW and RIPR-SPEC-0240 to name the candidate-source cap and the 5x total-entry backstop. The disclosure names both bounds because the single truncated flag cannot say which tripped. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoz3yvGnngtDNnPKxG
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoz3yvGnngtDNnPKxG
Those two output-surface paths retrigger goldens check, which currently drifts owner_return_pin_json_* to rust_assertion_context_unresolved. That is not this claim's walk change. STATIC_LIMITS, RIPR-SPEC-0240, and the TypeScript disclosure still name the candidate cap and 5× backstop. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
EffortlessSteven
left a comment
There was a problem hiding this comment.
Self-review COMMENT on exact head 8923d66c4dee40d3f005c53989c17b42a31345ef. Disposition: COMMENT. This lane will not merge.
merge-ready conflicted with main on 22294f74. Merged origin/main 5046f4cf52 (remote merge 1ca023e5aa) and kept the candidate-source / 5× walk. language.rs and OUTPUT_SCHEMA.md match origin/main so local goldens check is not selected; those two paths were retriggering owner_return_pin_json_* rust_assertion_context_unresolved drift that is not this walk change. STATIC_LIMITS / RIPR-SPEC-0240 / TypeScript disclosure still name both bounds.
Local: 28 discovery tests + both typescript_truncated_discovery tests + cargo xtask precommit pass. Ready + merge-ready re-applied on this SHA.
|
Head frozen at Merged This lane will not merge. |
|
Handing this back to the author lane. Commit 22294f7 updated the user-facing wording for the candidate-cap versus 5x entry-backstop semantics, and 8923d66 ("Keep origin/main language.rs and OUTPUT_SCHEMA after the merge") dropped three items of it. Please re-apply them from 22294f7 on top of the current head before requalifying:
Keep main's new Generated by Claude Code |
|
|
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- The backstop is checked only after a directory's complete read_dir result is collected and sorted, so a single directory with millions of children can allocate or sort all entries before truncation is reported.
- Excluded candidate files consume the candidate-source cap before the walk checks whether they are admitted.
Verification questions
- Confirm the new source-cap contract is documented as counting candidate source files, while implementation counting precedes exclusion filtering.
Parked follow-ups
- The 5x backstop plus sorted-name DFS is deliberately coupled to the #11767 fixture rather than being an independently derived bound.
- The sorted-directory materialization remains an unbounded resource concern discussed in the seeded thread, but it is not a memory-lifetime or worker-handoff defect in this lane.
- The total-entry backstop limits processed entries, not directory materialization: each read_dir result is fully collected and sorted before the backstop comparison.
- The changed disclosure path names both candidate-source and total-entry limits, but it still uses one truncated flag and does not identify which bound fired.
- The changed discovery path materializes and sorts each directory before applying the total-entry bound, so a single huge directory can consume more resources than the backstop permits.
Evidence gaps
- No current cargo-test completion receipt proves the changed tests pass on this HEAD.
- Model proof intent was rejected by deterministic validation.
…erge (#11984) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoz3yvGnngtDNnPKxG
…h limits in repo-mode disclosure (#11984) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoz3yvGnngtDNnPKxG
There was a problem hiding this comment.
Parked follow-ups
- The single truncated flag still cannot identify whether the candidate-source cap or total-entry backstop fired, leaving stop-reason attribution as residual follow-up.
- The post-walk alias-link cross-check is an existing sibling path affected indirectly by the larger entry allowance; it was already discussed and scoped out rather than repaired here.
- The truncated-walk contract is now propagated across source, repo/diff disclosure, typed limitation text, tests, and public documentation, although one truncated bit represents two distinct bounds.
- The source-cap and total-entry semantics are duplicated in several user-facing strings, creating a drift risk if either cap or multiplier changes later.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- Current-head cargo-test completion is unavailable in the shared evidence packet, so the new source-cap, huge-directory, producer regression, and disclosure assertions remain receipt-unconfirmed here.
- The worker-handoff lane has no current-head executable test receipt, so runtime confirmation is limited to source-level invariants and seeded prior-host evidence.
- Current-head cargo-test completion evidence remains absent, so the focused Rust test claims are not independently receipted in this review packet.
- Current-head cargo-test completion is not present in the packet, so seeded local and hosted claims are not equivalent to a completed deterministic receipt for this HEAD.
|
Review of record, head Inspected the full diff against current main (
Limits: this was not executed locally (the box cannot build Rust); proof is the hosted Result on the exact head. Residual, non-blocking: the typescript-compiler comments in Generated by Claude Code |
Summary
Advances #11984
Count only candidate TypeScript/JavaScript source files against
RIPR_TS_MAX_WORKSPACE_FILESduring workspace discovery, so a largenon-source tree no longer spends the cap before those sources are seen.
A separate 5× total-entry backstop (100_000 entries at the default
20_000-candidate limit) still terminates huge asset trees and reports
truncation through the existing
truncatedflag. Directory entries arevisited in sorted-name DFS order so a tiny operator cap still indexes
src/before adocs/tree trips that backstop.Swarm / Source Boundary
This PR targets
EffortlessMetrics/ripr-swarm, the normal development trunk fortrusted same-repo
riprwork. Confirm the change belongs here:dependency, or repo-ops development for
ripr-swarmsurface
If this PR moves crates.io publishing, VS Marketplace publishing, Open VSX
publishing, GitHub Release assets, signing, release environments, or release
secrets, close or retarget it. Those surfaces belong in
EffortlessMetrics/riprunless a dedicated release-boundary change has already been approved.
Source-of-truth Links
Proposal: none
Spec: none (issue #11984 item 1)
ADR: none
Plan item: none
Governing issue or accepted claim: #11984
Acceptance delta (one sentence): TypeScript workspace discovery counts only candidate TS/JS source files against RIPR_TS_MAX_WORKSPACE_FILES, with a 5× total-entry backstop for huge non-source trees.
Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication): cursor/ts-walk-count-candidates-3e27
Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): none
Name a stack or proposed replacement explicitly. A proposed replacement does
not make its predecessor superseded. Shared files or a shared parent issue
alone do not establish duplication. If the relationship is unknown, record it
as needing reconciliation before disposing of either PR.
Scope
visit_workspace_with_handwrittenindiscovery.rscounted every directoryentry against the configured cap, so assets, generated files, and sibling
directories consumed budget that should have been reserved for TS/JS sources.
Scope Classification
This PR is scoped by:
Production delta:
increment the configured
RIPR_TS_MAX_WORKSPACE_FILESbudget. Excluded-pathfiles the walk still reaches can consume that budget without being indexed.
huge non-source tree terminates.
srcpop beforedocs, so a tiny cap still indexesthe source file before that backstop trips.
WorkspaceScan.truncatedflag. Envparsing is unchanged.
Evidence/support delta:
discovery.rs: non-source/generated trees donot truncate below
N + sources; more sources than the cap still truncate;a huge asset tree trips the total-entry backstop; the fix(typescript): a truncated workspace walk still reports no_static_path ("no related test was found") for tests it never read #11767 producer
docs tree still truncates after the source is indexed.
changelog.d/11984-ts-walk-count-candidates.md.Single acceptance criterion:
few admitted
.ts/.jsfiles, discovers those sources withtruncated=false.Non-goals:
config::typescript, HANDOFF B / TypeScript workspace walk: count candidate source entries and skip reference-output trees so large repos finish under the cap #11984 item 2).discovery.rs.Support-tier Impact
docs/status/SUPPORT_TIERS.mdClaim/proof notes:
typescript_repo_discovery_truncatedpath. This PR does not change thatwording.
Policy Impact
Ledger or exception notes:
Proof
Result, failures, or skipped proof:
workspace_file_limit_counts_source_candidates_not_assetstruncated withfiles=[];workspace_file_limit_truncates_when_sources_exceed_the_capdiscovered 1 of 2 allowed sources because thesrc/directory consumed a slot.478457f4failedripr::typescript_truncated_discovery::a_truncated_walk_withholds_no_static_pathbecause the 10× backstop (cap 3 → 30) sat above the ~17-entry docs tree. Two-file repair: 5× backstop plus sorted-name DFS.discovery::testspassed, includingworkspace_walk_tiny_cap_still_truncates_docs_tree_after_indexing_source; bothtypescript_truncated_discoverytests passed;cargo clippy -p ripr --all-targets -- -D warningspassed;cargo xtask precommitexit 0.origin/main691af90c1a(fix(classify): one-line fns must not read as assertion helpers (#11546) #12030/fix(python): multi-line raise message-only edit message pin (#9185) #11980/fix(analysis): skip whitespace tokens when computing ChangedSpan (#7956) #12034 and later) so this head is not behind that green main.Claim Boundary
What may be claimed after this PR? What must not be claimed yet?
assets, or
*.generated.*files againstRIPR_TS_MAX_WORKSPACE_FILES.pruning, changed-path walk order, or that static discovery is sufficient
runtime mutation evidence.
CONFIGURATION.md,OUTPUT_SCHEMA.md, orSTATIC_LIMITS.mdwere updated(those records live outside
discovery.rs;typescript/mod.rsis busy).Residual TypeScript workspace walk: count candidate source entries and skip reference-output trees so large repos finish under the cap #11984 contract follow-up.
Rollback
How can this PR be reverted safely?
entry against the cap. No data migration.
Spec-Test-Code Traceability
crates/ripr/src/analysis/language/typescript/discovery.rsmod testsvisit_workspace_with_handwritten,is_candidate_workspace_sourceStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
Complete this section when the PR changes workflows, policy gates, branch
protection expectations, CI artifacts, report uploads, release checks, or the
cost/posture of existing lanes. Use
n/afor ordinary PRs that do not affectCI behavior.
If rollback requires branch-protection or workflow-file changes, say so here
and split the PR unless the workflow change itself is the narrow reviewed
surface. If a CI-breaking rollback would need emergency procedures because
normal CI cannot validate the revert, document that explicitly.
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
cargo fmt --checkcargo check --workspace --all-targetscargo test --workspacecargo clippy --workspace --all-targets -- -D warnings(package-scoped:cargo clippy -p ripr --all-targets -- -D warnings)cargo doc --workspace --no-depscargo package -p ripr --listcargo publish -p ripr --dry-runcargo xtask check-static-languagecargo xtask check-doc-artifactscargo xtask check-support-tierscargo xtask check-no-panic-familycargo xtask check-allow-attributescargo xtask check-local-contextcargo xtask check-file-policycargo xtask check-covered-bycargo xtask check-executable-filescargo xtask check-workflowscargo xtask check-spec-formatcargo xtask check-spec-numberingcargo xtask check-fixture-contractscargo xtask check-generatedcargo xtask check-badge-diff-policycargo xtask check-generated-cleancargo xtask check-dependenciescargo xtask check-process-policycargo xtask check-network-policyExtension changes:
cd editors/vscode && npm cicd editors/vscode && npm run compilecd editors/vscode && npm run packageContinuation
Owner / governing claim: #11984 item 1
Candidate: PR #12031 head
ffe9e68e9f75ccb8f1abdea4c742695816564401oncursor/ts-walk-count-candidates-3e27(merge oforigin/main691af90c1aplus 5× backstop / sorted-name DFS)Review: independent review 5726317302 REPAIR_REQUIRED on
b7ec93fc20; in-file 4/5/6 already repaired; 1/2/3 residual (spec/mod.rs/docs busy or fenced). Hosted shard-2 red on478457f4repaired in-file.Validation: 28 discovery tests +
typescript_truncated_discovery+cargo xtask precommitpass on this SHADependency: none
Next:
merge-readyon this SHA; wait forRipr Rust Small ResultSUCCESS; comment frozen SHA. Do not merge from this lane. Do not edit specs/* ortypescript/mod.rs.