Skip to content

fix(typescript): resolve tsconfig paths aliases by default (#8346) - #8347

Merged
EffortlessSteven merged 5 commits into
mainfrom
claude/project-thread-g1yvyc
Oct 17, 2026
Merged

EffortlessSteven merged 5 commits into
mainfrom
claude/project-thread-g1yvyc

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Before: a TypeScript project using a tsconfig paths alias such as @/pricing got no_static_path ("no related test was found") for every owner its tests reach through the alias, unless the user found and set [typescript] resolve_tsconfig_paths = true.

After: aliases resolve by default. On a realistic vitest project the same diff goes from 3 false no_static_path findings to 3 correctly related weakly_exposed findings with the right test and verify command. resolve_tsconfig_paths = false keeps the old behavior.

Closes #8346. Resolution is unchanged: one explicit alias hop to a unique workspace file, and the typescript_path_alias_unresolved disclosure still fires when it cannot resolve.

How: TypescriptConfig::default() and the parser fallback now yield true; RIPR-SPEC-0099, docs/CONFIGURATION.md, ripr.toml.example and the init template are updated. New typescript_tsconfig_alias_default integration test runs the binary with default config (related, exposed) and with explicit false (still no_static_path); a config unit test pins the default and opt-out.

Verified locally: cargo xtask precommit, cargo test -p ripr --lib typescript, --lib config::, the new integration test. Not verified: full cli_smoke/verdict-corpus runs (hosted CI after merge-ready).


Generated by Claude Code

@gemini-code-assist

Copy link
Copy Markdown

Warning

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

@EffortlessSteven EffortlessSteven self-assigned this Oct 17, 2026
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

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

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 38 minutes.

Check out review usage here.

View limit details

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: a7e9e519-ac89-4713-b204-313803e7ef8a
📥 Commits

Reviewing files that changed from the base of the PR and between 67a8bb4 and 6c58330.

📒 Files selected for processing: 13
  • changelog.d/8346-tsconfig-paths-default-on.md
  • crates/ripr/src/agent/artifact.rs
  • crates/ripr/src/analysis/language/typescript/related_tests.rs
  • crates/ripr/src/analysis/language/typescript/tests.rs
  • crates/ripr/src/analysis/language/typescript/tsconfig.rs
  • crates/ripr/src/config.rs
  • crates/ripr/src/config/model.rs
  • crates/ripr/src/config/tests.rs
  • crates/ripr/tests/typescript_tsconfig_alias_default.rs
  • docs/CONFIGURATION.md
  • docs/specs/RIPR-SPEC-0099-typescript-tsconfig-path-aliases.md
  • policy/process_allowlist.txt
  • ripr.toml.example
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Copy link
Copy Markdown
Member Author

Local results on head 17a4260: cargo xtask precommit clean; cargo test -p ripr --lib for typescript, config::, agent::artifact pass; new typescript_tsconfig_alias_default integration test passes (default → exposed, explicit false → no_static_path + disclosure); cargo xtask verdict-corpus check on the first commit: 486 cases, 0 contradictions, spec coverage 131/131. Independent Sonnet review found one missed identity test (agent/artifact.rs) and stale default-off wording, both fixed in this head; it found no wrong-credit path in the resolver (single hop, requires baseUrl, exactly one existing file, extends fails closed). Not run locally: full cli_smoke, vscode job. Adding merge-ready for hosted CI.


Generated by Claude Code

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

Copy link
Copy Markdown

Warning

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • resolve_tsconfig_paths = true is the new default but a non-trivial number of users may rely on the previous fail-closed default for sandboxed/CI runs where reading tsconfig files is undesired. Worth a release-notes callout so users with strict file-read policies can opt out before upgrading.

Refuted

  • PR introduces resizable-buffer/ArrayBuffer/detach/transfer semantics that could leave a stale length snapshot in tsconfig alias resolution.; refuted because: Rust source diff contains no ResizableBuffer, ArrayBuffer, TypedArray, detach, transfer, or length-snapshot state. TsAliasMap is rebuilt per run from owned strings (tsconfig.rs builder pattern). Disclosure strings are static &'static str. No active-view hazard.
  • Flipping the default to true could expose a worker-handoff UB if alias-resolved owners are shared across detached tasks or postMessage boundaries.; refuted because: No async runtime, JS engine, transferable handle, or detached worker exists in the call path. TsAliasMap is a synchronous HashMap<String, Vec> built once per analysis run; related_test_candidates and find_related_tests consume it on the same thread with no CloneInto/Detach/Transfer involvement.
  • Flipping the default to true could quietly enable a broader resolver than spec section 2 (extends/jsconfig/workspace globs/baseUrl-relative) and credit wrong owners even when users opt out.; refuted because: tsconfig.rs:123 still requires baseUrl and an explicit alias entry, requires exactly one existing file (multi-entry fails closed per the asserted unit test), and extends is not implemented; the only consumer of alias_map is related_tests.rs and it short-circuits to TsAliasMap::empty() when resolve_tsconfig_paths is false. Resolver surface is unchanged by the default flip.
  • default-on tsconfig alias resolution could be turned into a file-existence oracle or path-traversal primitive via a hostile tsconfig.json (wildcard @/* keys, absolute baseUrl, extends chains, multi-entry mappings); refuted because: the resolver is single-hop, requires a literal (non-glob) key, requires baseUrl, fails closed on multi-entry values and extends, and the credit decision only checks existence+uniqueness against the bounded analysis root; no file contents are read for alias mapping, so the worst observable side effect of a hostile tsconfig is a false exposed credit for an unrelated test, which is already covered by the typescript_path_alias_unresolved disclosure on.

Parked follow-ups

  • Park for hosted CI only: full cli_smoke and verdict-corpus reruns; not broadened on reviewer's plate (no broadening of fix scope).

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

Copy link
Copy Markdown
Member Author

Independent review (Sonnet 5.5 subagent) of exact head 17a42605: findings, all doc/comment drift, none blocking on behavior. It was a static read; the reviewer did not build or run the tests.

What checks out:

  • The default flips in both config.rs:710 and TypescriptConfig::default().
  • No other AnalysisOptions construction path keeps false.
  • Path escape is rejected before any filesystem probe (tsconfig.rs:384), so default-on has the same surface as opt-in.
  • The new integration test discriminates in both directions, and the explicit-false proof (ex29) is preserved.

To fix before merge (the spec README is parity-checked):

  1. RIPR-SPEC-0099 still has resolve_tsconfig_paths = false (default) around line 342. The same spec has other stale lines near 111-113, 137/158 and 169. Say "explicit opt-out" instead.
  2. docs/specs/README.md:118 still says "opt-in".
  3. Source docs say the flag is opt-in: analysis/mod.rs:679 ("Default: false"), typescript/mod.rs:374, the tsconfig.rs MapUnavailable doc, and static_limit.rs.
  4. The tsconfig.rs:~125 advice should say "set to false" rather than "unset or false".
  5. jest-spec0234-ex28.json:36 says "stays off", but that subject sets no explicit false. Either add an explicit false or reword. SPEC-0243:851 should note that ex29 is flag-off only because its subject sets false.
  6. Document, in the changelog or spec, the new default-visible gaps: ConfigMissing when a TS project has no tsconfig, and ExtendsUnsupported. Please also confirm that cargo xtask goldens check and fixtures show no golden drift.

One residual that predates this PR: is_file() follows symlinks, so a symlink inside the workspace can point outside it. It now applies by default, so I suggest a follow-up issue.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

CI note: the only red test on 17a4260 was cli_smoke::check_python_finding_with_repair_card_points_at_the_card (Python, unrelated to this diff). It passes locally both on the old head and after merging current main, and its printed output matches the expected line, so I'm treating it as a hosted-run flake. I merged main into the branch (no history rewrite) and pushed, which re-runs CI once; if it fails again I'll root-cause it.


Generated by Claude Code

…escript (#8346)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QGSS8c2jNy1Ch29DmsEkfX

Copy link
Copy Markdown
Member Author

"Rust-only feature lane" failed on this PR's own new test: typescript_tsconfig_alias_default runs the binary with a TypeScript config, which a lang-rust-only build rightly refuses. Fixed by gating the test on the lang-typescript feature (verified it compiles to zero tests under --no-default-features --features lang-rust); pushed.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven merged commit 42354f6 into main Oct 17, 2026
27 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-g1yvyc branch October 17, 2026 06:09
EffortlessSteven pushed a commit that referenced this pull request Oct 17, 2026
…ig_paths default flip (#8347)

Comment and doc wording only; no behavior or verdict change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1CWfJWkHKTCRQnqGf3tnJ
EffortlessSteven added a commit that referenced this pull request Oct 17, 2026
…on tsconfig aliases (#8346) (#8410)

* docs(typescript): fix opt-in/default-false drift after resolve_tsconfig_paths default flip (#8347)

Comment and doc wording only; no behavior or verdict change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1CWfJWkHKTCRQnqGf3tnJ

* docs(typescript): fix the last stale opt-in wording and ex28 reasoning (#8346)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1CWfJWkHKTCRQnqGf3tnJ

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

typescript: tsconfig paths aliases are unresolved by default, so aliased tests read as false no_static_path

2 participants