| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Flip `typescriptResolver` default from `false` to `true`. The pass
already lazy-loads `typescript` and silently skips when the package is
unavailable or no tsconfig.json is found, so JS-only projects and
environments without `typescript` installed are unaffected.
TS projects that have `typescript` installed now automatically get
compiler-verified (1.0 confidence) type resolution instead of heuristic
(0.7–0.9) inference — including this-dispatch via class properties,
typed-parameter call edges, and return-type propagation — without
requiring an explicit config opt-in.
Users who prefer faster builds without the pass can disable it with
`"build": { "typescriptResolver": false }` in `.codegraphrc.json`.
Closes #1460
|
Claude finished @carlos-alm's task —— View job PR Review: feat(config): auto-enable TypeScript compiler resolver for TS projects
Phase 1: Root Cause AnalysisProblem being solved: The TypeScript compiler resolver pass (ts-resolver.ts, introduced in #1278) was gated behind typescriptResolver: false (opt-in). TS project owners had to explicitly discover and enable it — which is poor UX for a feature that is the highest-ROI resolution improvement for TS projects. Why this approach: The ts-resolver is already designed for silent opt-out: it lazy-imports typescript, silently skips if the package is unavailable, and silently skips if no tsconfig.json is found (src/domain/graph/resolver/ts-resolver.ts). Flipping the default to true is the minimal safe change — the guard rails already exist. Risk assessment: Low. The feature is production-hardened (21 unit tests, gated on tsconfig.json presence, lazy-loaded optional import). JS-only projects, environments without typescript installed, and explicit opt-out configs are all unaffected. Phase 2: Configuration Change DetectionThe single changed default is typescriptResolver: false → true at src/infrastructure/config.ts:27. This is a behavioral change, not a silencing of warnings or a relaxation of quality rules:
The change is exactly one meaningful boolean flip — within-scope for a single PR. Phase 3: Test Integrity ✓The regression-guard.test.ts change is a comment-only update (line 244): "gated behind \typescriptResolver: false` (default)"→"gated behind `typescriptResolver: false` (was the default at the time)"`. Zero functional test logic is changed — no thresholds, no assertions, no exemptions added. No assertions were weakened. The KNOWN_REGRESSIONS set is unchanged. One concern: the PR test plan mentions npx vitest run tests/unit/ts-resolver.test.ts but no evidence that this runs in CI automatically on this PR. The test file exists at tests/unit/ts-resolver.test.ts. Since npm test runs vitest run (which discovers all tests), this would run automatically — no action needed. Phase 4: Code Qualitysrc/infrastructure/config.ts:27 — Clean. typescript is in devDependencies (not dependencies or peerDependencies), so it is not bundled with the published package. The lazy-load guard in ts-resolver.ts (try { _ts = (await import('typescript')).default } catch { _ts = null }) correctly handles the case where typescript is absent at runtime in downstream consumer projects. The skip-if-no-tsconfig logic also handles JS-only monorepos. Missing test coverage concern: There is no integration test that explicitly verifies the new default fires on a TS project without a .codegraphrc.json. The existing 21 unit tests in ts-resolver.test.ts test the resolver logic in isolation. A failing test (e.g., a build integration test that asserts typescriptResolver is not called by default) would reveal unexpected side-effects of this flip — worth adding, but not a blocker given the safety of the guard rails. Performance concern: Enabling this by default will increase build time for all TS projects. The regression-guard exemptions for 3.12.0:Full build and 3.12.0:1-file rebuild are already documented as post-Phase-8.x feature cost in the test file comment. The PR does not update benchmark data, so the actual cost delta of enabling by default is unmeasured. This is a follow-up concern, not a blocker. Phase 5: Backlog Compliance
Critical Concerns
Final Assessment## Root Cause Analysis Problem Being Solved: TS projects got no benefit from the compiler resolver pass unless users explicitly added `"typescriptResolver": true` to their config — poor discoverability for the highest-ROI resolution feature for TS codebases. Why This Approach: Minimal-change; all opt-out safety guards (lazy-load, tsconfig check) already exist in ts-resolver.ts. No new risk introduced. Risk Assessment: Low. JS-only projects and envs without typescript are provably unaffected. ## Backlog Compliance - Zero-dep: ✓ — typescript is a devDep, lazy-loaded, not bundled - Foundation-aligned: ✓ — local-only, no cloud, no new infrastructure - Problem-fit: 5 — directly improves agent accuracy on TS codebases (most common target) - Breaking: Soft behavioral — more edges produced for TS projects; no API/CLI/MCP break - Tier: 1 ## Critical Concerns None blocking. Minor: no updated benchmark data for the default-on cost. No integration test explicitly exercises the new default path end-to-end. ## Final Recommendation - Rating: ⭐⭐⭐⭐ (4/5) - Action: APPROVE - Reasoning: Single-line config change with well-tested, well-guarded implementation. The feature is production-ready (21 unit tests, lazy-load, tsconfig guard). Docs and regression-guard comment updated correctly. Problem-fit is 5 — this is the right default for the tool's primary use case. Withholding the 5th star: benchmark impact of the new default is unmeasured, and there's no integration test asserting the new default fires correctly end-to-end. |
Sorry, something went wrong.
Greptile SummaryThis PR flips the typescriptResolver default from false to true in src/infrastructure/config.ts, auto-enabling the TypeScript compiler API pass for any project where typescript is installed and a tsconfig.json is present. Documentation in README.md and ROADMAP.md is updated to match, and a historical comment in the regression-guard test is amended for accuracy.
Confidence Score: 5/5Safe to merge — the change is a single boolean flip behind an already-battle-tested lazy-load guard that silently no-ops on JS-only projects and missing tsconfig.json environments. The code change is minimal and low-risk: one constant value flipped, no new code paths, no schema changes, and the resolver pass has its own safety net (lazy-loads typescript, skips when tsconfig.json is absent). Documentation and comments are consistent with the new behavior. No files require special attention. The benchmark regression risk (noted in the existing outside-diff comment) is the only follow-up item and is already tracked. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[loadConfig called] --> B{.codegraphrc.json found?}
B -- Yes --> C[mergeConfig DEFAULTS + user config]
B -- No --> D[Use DEFAULTS as-is]
C --> E{user set typescriptResolver?}
E -- Yes --> F[Use user value true/false]
E -- No --> G[Default: true ← changed in this PR]
D --> G
F --> H{typescriptResolver === true?}
G --> H
H -- No --> I[Skip TS compiler pass]
H -- Yes --> J{typescript installed AND tsconfig.json found?}
J -- No --> K[Silently skip pass]
J -- Yes --> L[Run ts.createProgram + type-checker enrichment]
L --> M[Confidence 1.0 call edges written to graph]
Reviews (3): Last reviewed commit: "Merge branch 'main' into feat/auto-enabl..." | Re-trigger Greptile |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Users who want to opt out can set "build": { "typescriptResolver": false } in .codegraphrc.json.
Closes #1460
Test plan