Skip to content

Remove JS fallback shim package#135

Merged
lzehrung merged 3 commits into
mainfrom
remove-js-fallback-shim
Jun 20, 2026
Merged

Remove JS fallback shim package#135
lzehrung merged 3 commits into
mainfrom
remove-js-fallback-shim

Conversation

@lzehrung

Copy link
Copy Markdown
Owner

Summary

  • remove the standalone @lzehrung/codegraph-js-fallback workspace package and publish path
  • rename internal parser-unavailable shims away from jsFallback terminology
  • update docs, skill guidance, release workflow, and tests for root/native-only releases

Verification

  • 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 tests/parser-backend-unavailable.test.ts
  • npx vitest run tests/detailed-symbol-native-only.test.ts tests/native-parser-ownership.test.ts tests/native-query-scope.test.ts tests/native-parse-tree.test.ts tests/native-runtime-mode.test.ts tests/native-tree-sitter.test.ts tests/esm-language-loading.test.ts tests/languages/sql.test.ts
  • npm run check
  • node ./dist/cli.js doctor
  • node ./dist/cli.js orient --root . --budget small --json

@kilo-code-bot

kilo-code-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Previous Issues Resolved

File Issue Status
src/parserBackend.ts Unavailable-error message format was inconsistent with test helpers Fixed
src/indexer/imports/nativeCaptures.ts pushTreeObjectPatternBindings() and collectJsQueryCaptureImportBindings() were unused dead code Fixed
Files Reviewed (2 files)
  • tests/native-parse-tree.test.ts — Variable renames: jsTreetree, jsScopenonNativeScope; consistent with the parser-backend terminology migration.
  • tests/native-tree-sitter.test.ts — Function and variable renames: parseWithJsTreeSitterparseWithNonNativeParser, jsParsednonNativeParsed, jsImportsnonNativeImports, jsSpecifiersreducedModeSpecifiers; all mechanical renames with no logic changes.
Previous Review Summaries (2 snapshots, latest commit 5d67465)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 5d67465)

Status: No Issues Found | Recommendation: Merge

Previous Issues Resolved

File Issue Status
src/parserBackend.ts Unavailable-error message format was inconsistent with test helpers Fixed
src/indexer/imports/nativeCaptures.ts pushTreeObjectPatternBindings() and collectJsQueryCaptureImportBindings() were unused dead code Fixed
Files Reviewed (2 files)
  • src/parserBackend.ts — Error message format now uses a stable prefix (Non-native Tree-sitter parser is unavailable) and suffix (native parser is the only grammar backend) consistent with tests/helpers/native.ts; isNonNativeParserUnavailableError() detection is now robust.
  • src/indexer/imports/nativeCaptures.ts — Removed unused pushTreeObjectPatternBindings() and collectJsQueryCaptureImportBindings() functions and their now-unnecessary imports (ParserSyntaxTree, rangeFromNativeCapture, sliceText).

Previous review (commit cefa0c7)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (49 files)
  • .github/workflows/release.yml
  • PUBLISHING.md
  • README.md
  • codegraph-skill/codegraph/SKILL.md
  • docs/installation.md
  • docs/plans/2026-05-12-graph-first-language-expansion.md
  • docs/plans/2026-06-06-performance-and-cache-opportunities.md
  • docs/scenario-catalog.md
  • package-lock.json
  • scripts/release-lib.mjs
  • scripts/release.mjs
  • src/graph-edge-collector.ts
  • src/indexer.ts
  • src/indexer/build-index.ts
  • src/indexer/imports.ts
  • src/indexer/imports/nativeCaptures.ts
  • src/indexer/locals-and-exports.ts
  • src/indexer/navigation-local.ts
  • src/indexer/navigation-provenance.ts
  • src/indexer/navigation-references.ts
  • src/indexer/parse-context.ts
  • src/indexer/scope.ts
  • src/indexer/types.ts
  • src/languages.ts
  • src/languages/definitions/loadLanguage.ts
  • src/languages/filePrep.ts
  • src/languages/types.ts
  • src/parserBackend.ts (new)
  • tests/detailed-symbol-native-only.test.ts
  • tests/esm-language-loading.test.ts
  • tests/helpers/native.ts
  • tests/languages/sql.test.ts
  • tests/native-parse-tree.test.ts
  • tests/native-parser-ownership.test.ts
  • tests/native-query-scope.test.ts
  • tests/native-runtime-mode.test.ts
  • tests/native-tree-sitter.test.ts
  • tests/package-metadata.test.ts
  • tests/parser-backend-unavailable.test.ts (new)
  • tests/release-script.test.ts
  • Deleted: packages/codegraph-js-fallback/*
  • Deleted: scripts/patch-tree-sitter-node24-lib.mjs
  • Deleted: scripts/patch-tree-sitter-node24.mjs
  • Deleted: tests/js-fallback-loader.test.ts
  • Deleted: tests/patch-tree-sitter-node24.test.ts
  • Deleted: src/jsFallback.ts

Reviewed by kimi-k2.6-20260420 · Input: 36K · Output: 5.5K · Cached: 141.8K

@kilo-code-bot

kilo-code-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (49 files)
  • .github/workflows/release.yml
  • PUBLISHING.md
  • README.md
  • codegraph-skill/codegraph/SKILL.md
  • docs/installation.md
  • docs/plans/2026-05-12-graph-first-language-expansion.md
  • docs/plans/2026-06-06-performance-and-cache-opportunities.md
  • docs/scenario-catalog.md
  • package-lock.json
  • scripts/release-lib.mjs
  • scripts/release.mjs
  • src/graph-edge-collector.ts
  • src/indexer.ts
  • src/indexer/build-index.ts
  • src/indexer/imports.ts
  • src/indexer/imports/nativeCaptures.ts
  • src/indexer/locals-and-exports.ts
  • src/indexer/navigation-local.ts
  • src/indexer/navigation-provenance.ts
  • src/indexer/navigation-references.ts
  • src/indexer/parse-context.ts
  • src/indexer/scope.ts
  • src/indexer/types.ts
  • src/languages.ts
  • src/languages/definitions/loadLanguage.ts
  • src/languages/filePrep.ts
  • src/languages/types.ts
  • src/parserBackend.ts (new)
  • tests/detailed-symbol-native-only.test.ts
  • tests/esm-language-loading.test.ts
  • tests/helpers/native.ts
  • tests/languages/sql.test.ts
  • tests/native-parse-tree.test.ts
  • tests/native-parser-ownership.test.ts
  • tests/native-query-scope.test.ts
  • tests/native-runtime-mode.test.ts
  • tests/native-tree-sitter.test.ts
  • tests/package-metadata.test.ts
  • tests/parser-backend-unavailable.test.ts (new)
  • tests/release-script.test.ts
  • Deleted: packages/codegraph-js-fallback/*
  • Deleted: scripts/patch-tree-sitter-node24-lib.mjs
  • Deleted: scripts/patch-tree-sitter-node24.mjs
  • Deleted: tests/js-fallback-loader.test.ts
  • Deleted: tests/patch-tree-sitter-node24.test.ts
  • Deleted: src/jsFallback.ts

Copilot AI 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.

Pull request overview

Removes the standalone @lzehrung/codegraph-js-fallback workspace/publish path and renames internal “fallback shim” concepts to a native-first “parser backend unavailable” contract, aligning release tooling and docs with root+native-only publishing.

Changes:

  • Deletes the packages/codegraph-js-fallback workspace package and removes it from release planning/publishing (scripts, workflow, tests).
  • Replaces the internal JS fallback shim module with a parserBackend unavailable-stub, updating language/indexer types and native-only/reduced-mode tests accordingly.
  • Reworks reduced-mode import recovery to use a JS/TS text-based extractor (jsTextImports) instead of “jsFallback” terminology.

Reviewed changes

Copilot reviewed 46 out of 49 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/release-script.test.ts Updates release helper expectations for root+native-only publishing and selector validation.
tests/patch-tree-sitter-node24.test.ts Removes tests for the Node 24 tree-sitter patcher.
tests/parser-backend-unavailable.test.ts Adds contract test asserting the non-native parser backend always reports unavailable.
tests/package-metadata.test.ts Removes shim-package metadata assertions and adds “package is absent” checks; updates workflow assertions.
tests/native-tree-sitter.test.ts Renames JS fallback integration gating to non-native parser backend gating.
tests/native-runtime-mode.test.ts Updates reduced-mode gating checks from isJsFallbackAvailable to isNonNativeParserAvailable.
tests/native-query-scope.test.ts Updates mocks/spies and test wording from JS fallback to non-native parser backend.
tests/native-parser-ownership.test.ts Updates mocks/spies/helpers to validate native ownership without any non-native parser backend.
tests/native-parse-tree.test.ts Renames JS fallback tree-walker references to non-native parser backend equivalents.
tests/languages/sql.test.ts Updates reduced-mode SQL expectations/mocks to remove js-fallback wording and package install guidance.
tests/js-fallback-loader.test.ts Removes the old JS fallback shim loader contract test.
tests/helpers/native.ts Renames helper spies/assertions to parserBackend terminology and updates messages.
tests/esm-language-loading.test.ts Updates ESM contract test to use parserBackend unavailable exports.
tests/detailed-symbol-native-only.test.ts Updates native-only tests to mock/validate behavior without non-native parser backend.
src/parserBackend.ts Introduces the new “non-native parser backend unavailable” stub module and structural types.
src/languages/types.ts Replaces JsLanguage/JsSyntaxNode aliases with ParserLanguage/ParserSyntaxNode.
src/languages/filePrep.ts Updates parser input typing to use ParserLanguage.
src/languages/definitions/loadLanguage.ts Switches language loader re-exports from jsFallback to parserBackend.
src/languages.ts Updates language typing and languageForFile() return type to ParserLanguage.
src/jsFallback.ts Removes the old internal JS fallback shim module.
src/indexer/types.ts Removes js-fallback from ResolutionProvenance.backend union.
src/indexer/scope.ts Updates scope builder typing to use ParserLanguage.
src/indexer/parse-context.ts Updates parse context typing to use ParserLanguage.
src/indexer/navigation-references.ts Updates navigation typing to use ParserLanguage.
src/indexer/navigation-provenance.ts Maps nativeMode: off provenance backend to graph-only (previously js-fallback).
src/indexer/navigation-local.ts Updates navigation local typing to use ParserLanguage.
src/indexer/locals-and-exports.ts Updates locals/exports typing to use ParserLanguage.
src/indexer/imports/nativeCaptures.ts Updates tree type references to ParserSyntaxTree.
src/indexer/imports/jsTextImports.ts Adds the new JS/TS text-based import extraction implementation for reduced mode.
src/indexer/imports.ts Wires reduced-mode import fallback to jsTextImports instead of the old js-fallback module.
src/indexer/build-index.ts Updates unavailable-parser error handling and parser-tree type checks to parserBackend.
src/indexer.ts Updates exported API typing from JsLanguage/JsSyntaxTree to parser-backend equivalents.
src/graph-edge-collector.ts Updates parser language typing to ParserLanguage.
scripts/release.mjs Removes js-fallback manifest normalization, tagging, staging, and publish steps.
scripts/release-lib.mjs Removes js-fallback from releasePackages and publish execution step planning.
scripts/patch-tree-sitter-node24.mjs Removes the Node 24 tree-sitter patch script.
scripts/patch-tree-sitter-node24-lib.mjs Removes the Node 24 tree-sitter patch library.
README.md Removes references to the js-fallback shim package; clarifies reduced-mode behavior.
PUBLISHING.md Updates publishing model to only root+native and removes js-fallback steps/notes.
packages/codegraph-js-fallback/package.json Deletes the workspace/package manifest for the removed shim package.
packages/codegraph-js-fallback/js-fallback.d.ts Deletes the shim package type declarations.
packages/codegraph-js-fallback/js-fallback.cjs Deletes the shim package CommonJS entrypoint.
package-lock.json Removes workspace links for the deleted package and updates dependency lock state.
docs/scenario-catalog.md Updates scenario catalog entry to reflect removal of the js-fallback package.
docs/plans/2026-06-06-performance-and-cache-opportunities.md Updates plan language from JS fallback parity to reduced-mode parity.
docs/plans/2026-05-12-graph-first-language-expansion.md Updates plan language to native-first + reduced-mode behavior; removes js-fallback workspace references.
docs/installation.md Removes js-fallback package mention; clarifies reduced-mode behavior.
codegraph-skill/codegraph/SKILL.md Removes js-fallback shim guidance from the skill definition.
.github/workflows/release.yml Removes js-fallback publishing and release-notes lines; updates descriptions accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/parserBackend.ts Outdated
Comment on lines +53 to +70
const NON_NATIVE_PARSER_UNAVAILABLE_MESSAGE =
"Non-native Tree-sitter parser is unavailable; native parser is the only grammar backend";

function createUnavailableError(feature: string): Error {
return new Error(`${NON_NATIVE_PARSER_UNAVAILABLE_MESSAGE} for ${feature}`);
}

export function __resetParserBackendModuleForTests(): void {
// Kept for tests that reset parser backends between cases.
}

export function isNonNativeParserAvailable(): boolean {
return false;
}

export function isNonNativeParserUnavailableError(error: unknown): boolean {
return error instanceof Error && error.message.includes(NON_NATIVE_PARSER_UNAVAILABLE_MESSAGE);
}
Comment thread src/indexer/imports/nativeCaptures.ts Outdated
Comment on lines 65 to 68
async function pushTreeObjectPatternBindings(
context: ImportCaptureExtractionContext,
tree: JsSyntaxTree,
tree: ParserSyntaxTree,
patterns: NativeCapture[],
@lzehrung

Copy link
Copy Markdown
Owner Author

Addressed review comments in 5d67465:

  • parser backend unavailable errors now use the stable prefix Non-native Tree-sitter parser is unavailable and format thrown messages as ... unavailable for <feature>; native parser is the only grammar backend.
  • removed the unused tree-based JS query import binding helpers from src/indexer/imports/nativeCaptures.ts.

Verification:

  • npx vitest run tests/parser-backend-unavailable.test.ts tests/native-query-scope.test.ts tests/native-fallback-contract.test.ts tests/native-fallback-reporting.test.ts
  • npm run check

Copilot AI 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.

Pull request overview

Copilot reviewed 46 out of 49 changed files in this pull request and generated 2 comments.

Comment thread tests/native-tree-sitter.test.ts Outdated
Comment on lines 32 to 36
async function parseWithJsTreeSitter(file: string) {
const parsed = await parseFile(file);
const lang = languageForFile(file);
const tree = parseWithJsLanguage(parsed.source, lang);
const tree = parseWithLanguage(parsed.source, lang);
return {
Comment thread tests/native-parse-tree.test.ts Outdated
const file = "scope.ts";
const lang = languageForFile(file);
const jsTree = parseWithJsLanguage(source, lang);
const jsTree = parseWithLanguage(source, lang);
@lzehrung

Copy link
Copy Markdown
Owner Author

Addressed the latest naming feedback in b43b6df:

  • renamed parseWithJsTreeSitter to parseWithNonNativeParser.
  • renamed jsParsed, jsImports, jsIndex, and jsSpecifiers to non-native/reduced-mode names.
  • changed the jsTree local in tests/native-parse-tree.test.ts to plain tree, matching the review note.

Verification:

  • npx vitest run tests/native-tree-sitter.test.ts tests/native-parse-tree.test.ts
  • npm run build

@lzehrung lzehrung merged commit bca3ead into main Jun 20, 2026
2 checks passed
@lzehrung

Copy link
Copy Markdown
Owner Author

Updated coverage reports in d80b9c9.

Verification:

  • npm run test:coverage:all

Updated summaries:

  • JS/TS lines: 90.05%, branches: 77.21%, functions: 93.67%
  • Rust native lines: 96.49%, functions: 88.24%

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.

2 participants