Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ npm i -g @lzehrung/codegraph
npm i -g https://github.com/lzehrung/codegraph/releases/download/vVERSION/lzehrung-codegraph-VERSION.tgz
```

Replace `VERSION` with the release you want. The root tarball does not bundle the native addon; source-language parsing still needs the scoped native package path via the `@lzehrung` GitHub Packages registry. Without it, Codegraph runs in reduced graph-only mode.
Replace `VERSION` with the release you want. The root tarball does not bundle the native addon; source-language parsing still needs the scoped native package path via the `@lzehrung` GitHub Packages registry. Without it, Codegraph runs in reduced graph-only mode. The `@lzehrung/codegraph-js-fallback` package is a compatibility shim, not an alternate parser bundle.

## FAQ

Expand Down
2 changes: 2 additions & 0 deletions codegraph-skill/codegraph/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ Use the scoped packages only:
- native backend: `@lzehrung/codegraph-native`
- compatibility shim: `@lzehrung/codegraph-js-fallback`

The compatibility shim is not a grammar fallback. Do not suggest installing it to restore source-language parsing when the native backend is unavailable.

Registry:

```bash
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Requirements and install paths for local source checkouts, published packages, r
- Published installs do not require Rust or a manual native setup step on supported targets.
- Local source checkouts do not require Rust just to build `dist/`, but the native workspace addon only builds when Cargo is available.
- If no compatible native artifact is available, Codegraph drops to reduced graph-only and regex recovery mode instead of loading JS grammars.
- Published installs do not need a separate grammar bundle for supported source-language parsing.
- The root package does not install a JavaScript grammar fallback. `@lzehrung/codegraph-js-fallback` is only a compatibility shim package and does not provide parser recovery unless a future release documents that capability explicitly.

## Option 1: Local source checkout

Expand Down Expand Up @@ -84,7 +84,7 @@ Explicit CLI, library, and tool `native` options take precedence over `CODEGRAPH

- `@lzehrung/codegraph`: main library and CLI
- `@lzehrung/codegraph-native`: optional native runtime package that resolves the matching binary artifact
- `@lzehrung/codegraph-js-fallback`: compatibility shim package with no grammar bundle
- `@lzehrung/codegraph-js-fallback`: compatibility shim package with no grammar bundle; installing it separately does not restore non-native Tree-sitter parsing

Reduced mode preserves graph-only and regex-backed recovery where available; it does not provide a non-native Tree-sitter parser.

Expand Down
8 changes: 4 additions & 4 deletions docs/language-parity.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ Notes:
- Native parity coverage includes both extraction parity and end-to-end semantic parity on the current source-language fixture set (`TypeScript`, `TSX`, `JavaScript`, `Python`, `PHP`, `Go`, `Java`, `C#`, `Rust`, `Kotlin`, `Swift`, `Zig`, `C`, `C++`, `Ruby`) plus graph/specifier parity for `HTML`, `CSS`, `Less`, `SCSS`, `Vue`, and `Svelte`.
- Deeper hardening coverage includes Go aliases and interface-typed uses.
- Deeper hardening coverage includes Kotlin aliases, wildcard imports, package-wide wildcard graph expansion, and native-owned import-binding recovery.
- Deeper hardening coverage includes Java wildcard package fixtures, package-wide graph expansion, and static wildcard imports.
- Deeper hardening coverage includes Rust aliased `use` imports and `extern crate` graph fixtures.
- Deeper hardening coverage includes C# aliases, Swift static members, Zig `@import` namespace members, C function-pointer typedefs, C++ namespace/templates, and Ruby nested modules.
- Deeper hardening coverage includes Java wildcard package fixtures, package-wide graph expansion, static wildcard imports, and enum type navigation.
- Deeper hardening coverage includes Rust aliased `use` imports, `extern crate` graph fixtures, and enum variant extraction.
- Deeper hardening coverage includes C# aliases/enums, Swift enums/static members, Zig `@import` namespace members, C/C++ enum constants, and Ruby nested modules.
- Deeper hardening coverage includes Python `from __future__ import ...` extraction.
- Deeper hardening coverage includes PHP grouped `use` imports, bracketed namespaces, `__DIR__` includes, fully-qualified Composer-backed references, function/class basename collisions, and Composer classmap-boundary coverage.
- Deeper hardening coverage includes PHP grouped `use` imports, bracketed namespaces, `__DIR__` includes, fully-qualified Composer-backed references, enum cases, function/class basename collisions, and Composer classmap-boundary coverage.
- JavaScript graphing now includes an isolated AngularJS heuristic layer for `templateUrl`, controller-name, and DI-token file/external edges when a file explicitly uses `angular.module(...)`. This coverage lives in dedicated framework tests, not in the generic JavaScript fixture set, and it is not a general claim that arbitrary `controller` or `templateUrl` config objects are Angular-aware.
- Call compatibility hints compare changed callable arity with resolved callsites when parsing is high confidence. They are not type checking, overload resolution, trait dispatch, function-pointer analysis, macro expansion, or data-flow inference.
- Call compatibility skips same-file overload sets unless a future resolver can prove the exact overload target.
Expand Down
12 changes: 6 additions & 6 deletions docs/plans/2026-06-06-performance-and-cache-opportunities.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,12 @@ These are not primarily performance work, but they remained confirmed high-value

Checklist:

- [ ] TypeScript enum declarations should be indexed as real symbols for goto/refs.
- [ ] Anonymous JS/TS default exports should resolve through default imports.
- [ ] JS/TS shorthand binding nodes should navigate to the actual binding/import.
- [ ] Breaking-change suggestions should handle multiline exported signatures.
- [ ] Publishing/install docs should clarify that JS fallback is only available when `@lzehrung/codegraph-js-fallback` is installed.
- [ ] Consider stable subpath exports before narrowing the broad root API.
- [x] TypeScript enum declarations should be indexed as real symbols for goto/refs.
- [x] Anonymous JS/TS default exports should resolve through default imports.
- [x] JS/TS shorthand binding nodes should navigate to the actual binding/import.
- [x] Breaking-change suggestions should handle multiline exported signatures.
- [x] Publishing/install docs should clarify that the JS fallback package is only a compatibility shim and does not provide parser recovery.
- [x] Consider stable subpath exports before narrowing the broad root API.

## Suggested Execution Order

Expand Down
112 changes: 112 additions & 0 deletions docs/plans/2026-06-18-remove-js-fallback-shim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Remove JS Fallback Shim Plan

This plan removes `@lzehrung/codegraph-js-fallback` as a published compatibility package. The package no longer provides parser recovery, is not a runtime dependency of the root package, and only preserves an old import path with throwing stubs.

Do not remove internal reduced-mode behavior. Codegraph should continue to degrade to graph-only and regex-backed recovery when the native backend is unavailable.

## Current State

Observed package facts:

- `@lzehrung/codegraph` does not depend on `@lzehrung/codegraph-js-fallback`.
- The root package does not export `./js-fallback`.
- `packages/codegraph-js-fallback` ships only `js-fallback.cjs`, `js-fallback.d.ts`, and no grammar dependencies.
- `src/jsFallback.ts` is still used internally for type-compatible parser stubs and unavailable-error detection.
- Release tooling still treats `js-fallback` as a third publishable package.

Decision:

- Remove the standalone compatibility package.
- Keep internal `src/jsFallback.ts` for now unless the implementation pass proves every internal type/use can be deleted safely.
- Keep reduced-mode regex recovery and native fallback reporting intact.

## Phase 1: Package Boundary Cleanup

Implementation checklist:

- [ ] Delete `packages/codegraph-js-fallback/`.
- [ ] Remove package-specific release metadata for `js-fallback` from `scripts/release-lib.mjs`.
- [ ] Remove `js-fallback` version planning, manifest normalization, package selection, and publish handling from `scripts/release.mjs`.
- [ ] Remove `js-fallback` from `.github/workflows/release.yml` publish commands and release notes.
- [ ] Remove package-specific checks from `tests/package-metadata.test.ts`.
- [ ] Confirm root `package.json` workspaces remain correct after deleting the package.

Acceptance:

- Release package selection accepts only `root`, `native`, `@lzehrung/codegraph`, and `@lzehrung/codegraph-native`.
- No publish path references `@lzehrung/codegraph-js-fallback`.
- No workspace package remains under `packages/codegraph-js-fallback`.

## Phase 2: Internal Shim Review

Implementation checklist:

- [ ] Audit every import from `src/jsFallback.ts`.
- [ ] Keep `JsSyntaxTree`, `JsSyntaxNode`, and related structural types only if native query/result adapters still need them.
- [ ] Rename internal-only concepts if useful so `jsFallback` does not imply an external parser backend.
- [ ] Preserve `isJsFallbackUnavailableError()` behavior if build/index fallback diagnostics still depend on it.
- [ ] Do not reintroduce any JS Tree-sitter grammar dependency.

Acceptance:

- Internal names no longer suggest users can install a parser fallback package.
- Native-unavailable behavior still reports reduced mode, not a missing package instruction.
- TypeScript build proves no stale external shim imports remain.

## Phase 3: Documentation Cleanup

Implementation checklist:

- [ ] Remove `@lzehrung/codegraph-js-fallback` from `README.md` install/release guidance.
- [ ] Remove fallback shim package role from `docs/installation.md`.
- [ ] Remove fallback shim release guidance from `PUBLISHING.md`.
- [ ] Remove fallback shim mention from `codegraph-skill/codegraph/SKILL.md`.
- [ ] Update any release examples that mention `--package js-fallback`.
- [ ] Keep reduced-mode documentation explicit: without native, Codegraph has graph-only and regex recovery, not parser recovery.

Acceptance:

- User-facing docs list only root and native packages.
- Docs do not imply installing another package can restore non-native Tree-sitter parsing.
- Skill guidance matches current CLI/package surface.

## Phase 4: Test Updates

Implementation checklist:

- [ ] Replace package metadata tests that assert shim properties with tests asserting the shim package is absent.
- [ ] Update release-script tests to cover the two-package release model.
- [ ] Keep native fallback contract tests focused on reduced mode and native package absence.
- [ ] Add a regression test that release commands reject `--package js-fallback` with a clear unknown-selector error.

Acceptance:

- Tests prove `js-fallback` is not publishable.
- Tests prove root/native release flow still works.
- Tests prove reduced-mode fallback still works without the deleted package.

## Phase 5: Validation

Run focused checks during implementation:

- [ ] `npx vitest run tests/package-metadata.test.ts tests/release-script.test.ts tests/native-fallback-contract.test.ts tests/native-fallback-reporting.test.ts`
- [ ] `npx vitest run tests/js-fallback-loader.test.ts` if the file still exists; otherwise delete or replace it with reduced-mode coverage.
- [ ] `npm run check`

Manual verification:

- [ ] `node ./dist/cli.js doctor` reports native status without mentioning a JS fallback package.
- [ ] `node ./dist/cli.js orient --root . --budget small --json` still works with native available.

## Risks and Non-Goals

Risks:

- Existing external consumers importing `@lzehrung/codegraph-js-fallback` will break after removal.
- Release automation has several references to all publishable packages; partial cleanup can leave CI publishing stale package notes or invalid selectors.

Non-goals:

- Do not remove reduced-mode regex recovery.
- Do not add a new JS parser fallback.
- Do not change native package loading or native target publication except where release package enumeration currently includes `js-fallback`.
Loading