Repository navigation
fix(typescript): resolve tsconfig paths aliases by default (#8346) - #8347
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGSS8c2jNy1Ch29DmsEkfX
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
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. View limit details
Comment |
…ls (#8346) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGSS8c2jNy1Ch29DmsEkfX
…pawn (#8346) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGSS8c2jNy1Ch29DmsEkfX
|
Local results on head 17a4260: Generated by Claude Code |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
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
extendsis 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 andextends, 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 falseexposedcredit for an unrelated test, which is already covered by thetypescript_path_alias_unresolveddisclosure 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.
|
Independent review (Sonnet 5.5 subagent) of exact head What checks out:
To fix before merge (the spec README is parity-checked):
One residual that predates this PR: Generated by Claude Code |
|
CI note: the only red test on 17a4260 was Generated by Claude Code |
…escript (#8346) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGSS8c2jNy1Ch29DmsEkfX
|
"Rust-only feature lane" failed on this PR's own new test: Generated by Claude Code |
…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
…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>
Requested by Steven · project thread
Before: a TypeScript project using a tsconfig
pathsalias such as@/pricinggotno_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_pathfindings to 3 correctly relatedweakly_exposedfindings with the right test and verify command.resolve_tsconfig_paths = falsekeeps the old behavior.Closes #8346. Resolution is unchanged: one explicit alias hop to a unique workspace file, and the
typescript_path_alias_unresolveddisclosure still fires when it cannot resolve.How:
TypescriptConfig::default()and the parser fallback now yieldtrue; RIPR-SPEC-0099,docs/CONFIGURATION.md,ripr.toml.exampleand the init template are updated. Newtypescript_tsconfig_alias_defaultintegration test runs the binary with default config (related,exposed) and with explicitfalse(stillno_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 aftermerge-ready).Generated by Claude Code