Skip to content

Implement tracked correctness fixes#134

Open
lzehrung wants to merge 4 commits into
mainfrom
correctness-ops
Open

Implement tracked correctness fixes#134
lzehrung wants to merge 4 commits into
mainfrom
correctness-ops

Conversation

@lzehrung

@lzehrung lzehrung commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • index enums and anonymous JS/TS default exports for navigation
  • make JS/TS shorthand nodes navigable through real bindings/imports
  • detect multiline exported function arity changes in breaking-change suggestions
  • clarify JS fallback install docs and mark tracked correctness items complete

Verification

  • npm run check
  • npx vitest run tests/goto.test.ts tests/references.test.ts tests/impact-suggestions.test.ts tests/languages/typescript.test.ts tests/package-metadata.test.ts

@kilo-code-bot

kilo-code-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
src/indexer/scope.ts 204 C++ enumerators are double-indexed in scope results
Resolved Issues

The following previous observations were addressed in this incremental diff:

File Line Issue
src/indexer/scope.ts 152 addUnsupportedRequirePatternDecls now handles non-pair object-pattern children
src/indexer/scope.ts N/A Dynamic requires are now correctly kept as locals via isStaticRequireCall
src/indexer/scope.ts N/A Enum case declarations are now indexed via the enum case block
tests/samples/java/pkg/PackageTypes.java N/A Mode enum moved to its own file
docs/plans/2026-06-06-performance-and-cache-opportunities.md N/A Checklist text updated to reflect current install guidance
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
src/indexer/locals-and-exports.ts N/A anon_default handling relies on map["anon_default"].text
Files Reviewed in Increment (14 files)
  • src/indexer/scope.ts - 1 issue
  • src/languages/definitions/c.ts
  • src/languages/definitions/cpp.ts
  • src/languages/definitions/rust.ts
  • tests/languages/c.test.ts
  • tests/languages/cpp.test.ts
  • tests/languages/java.test.ts
  • tests/languages/rust.test.ts
  • tests/samples/java/pkg/Mode.java
  • tests/samples/java/pkg/PackageTypes.java
  • tests/scope-quality.test.ts
  • docs/plans/2026-06-06-performance-and-cache-opportunities.md
  • docs/scenario-catalog.md

Fix these issues in Kilo Cloud

Previous Review Summaries (3 snapshots, latest commit 8d99c99)

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

Previous review (commit 8d99c99)

Status: No Issues Found | Recommendation: Merge

Incremental Review

Previous review at a9fcb0ecc8c901cbfe5f4eec735f6aeaa1275090. No new issues in commits since then.

Carried-Forward Observations

2 previous observations on unchanged files remain active (see existing inline comments).

Files Reviewed in Increment (16 files)
  • src/languages/definitions/c.ts - added C enumerator to export/local queries
  • src/languages/definitions/cpp.ts - added C++ enumerator to export/local queries
  • src/languages/definitions/csharp.ts - added enum_declaration block and enum_member_declaration queries
  • src/languages/definitions/java.ts - added enum_declaration block and enum_constant queries
  • src/languages/definitions/php.ts - added enum_case queries, changed enum kind to type
  • src/languages/definitions/rust.ts - added enum_item block and enum_variant queries
  • src/languages/definitions/swift.ts - added struct/enum class_declaration variants with declaration_kind
  • docs/scenario-catalog.md - updated language parity docs with enum coverage
  • tests/languages/c.test.ts - added enumerator symbol expectations
  • tests/languages/cpp.test.ts - added enumerator symbol expectations
  • tests/languages/csharp.test.ts - added enum chunk and symbol expectations
  • tests/languages/java.test.ts - added enum chunk/symbol and wildcard-import goto test
  • tests/languages/php.test.ts - added enum chunk and symbol expectations
  • tests/languages/rust.test.ts - added enum variant symbol expectations
  • tests/languages/swift.test.ts - added struct/enum chunk and symbol expectations
  • tests/goto.test.ts - updated PHP line numbers after enum insertion in fixture
  • tests/references.test.ts - updated PHP line numbers after enum insertion in fixture
  • Various sample fixture files - added enum declarations for test coverage

Previous review (commit a5b4fbf)

Status: No Issues Found | Recommendation: Merge

Incremental Review

Previous review at a9fcb0ecc8c901cbfe5f4eec735f6aeaa1275090. No new issues in commits since then.

Carried-Forward Observations

2 previous observations on unchanged files remain active (see existing inline comments).

Files Reviewed in Increment (16 files)
  • src/languages/definitions/c.ts - added C enumerator to export/local queries
  • src/languages/definitions/cpp.ts - added C++ enumerator to export/local queries
  • src/languages/definitions/csharp.ts - added enum_declaration block and enum_member_declaration queries
  • src/languages/definitions/java.ts - added enum_declaration block and enum_constant queries
  • src/languages/definitions/php.ts - added enum_case queries, changed enum kind to type
  • src/languages/definitions/rust.ts - added enum_item block and enum_variant queries
  • src/languages/definitions/swift.ts - added struct/enum class_declaration variants with declaration_kind
  • docs/scenario-catalog.md - updated language parity docs with enum coverage
  • tests/languages/c.test.ts - added enumerator symbol expectations
  • tests/languages/cpp.test.ts - added enumerator symbol expectations
  • tests/languages/csharp.test.ts - added enum chunk and symbol expectations
  • tests/languages/java.test.ts - added enum chunk/symbol and wildcard-import goto test
  • tests/languages/php.test.ts - added enum chunk and symbol expectations
  • tests/languages/rust.test.ts - added enum variant symbol expectations
  • tests/languages/swift.test.ts - added struct/enum chunk and symbol expectations
  • tests/goto.test.ts - updated PHP line numbers after enum insertion in fixture
  • tests/references.test.ts - updated PHP line numbers after enum insertion in fixture
  • Various sample fixture files - added enum declarations for test coverage

Previous review (commit a9fcb0e)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (13 files)
  • README.md - docs clarification
  • codegraph-skill/codegraph/SKILL.md - docs clarification
  • docs/installation.md - docs clarification
  • docs/plans/2026-06-06-performance-and-cache-opportunities.md - checklist updates
  • src/impact/report-suggestions.ts - multiline export signature detection
  • src/indexer/locals-and-exports.ts - enum/default export/shorthand indexing
  • src/indexer/navigation.ts - shorthand property identifier support
  • src/indexer/scope.ts - enum declarations, pattern destructuring, require() handling
  • src/languages/definitions/javascript.ts - grammar captures and node types
  • src/languages/definitions/typescript.ts - grammar captures and node types
  • tests/goto.test.ts - new test cases
  • tests/impact-suggestions.test.ts - new test case
  • tests/references.test.ts - new test case

Reviewed by kimi-k2.6-20260420 · Input: 535.1K · Output: 46.2K · Cached: 1.4M

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

Implements a set of “tracked correctness” fixes across the JS/TS indexer and impact suggestion pipeline, with accompanying tests and documentation updates to reflect the intended installation/runtime behavior.

Changes:

  • Improve JS/TS semantic navigation by indexing TypeScript enums, anonymous default exports, and shorthand-property bindings for goto/refs.
  • Enhance breaking-change suggestions by detecting multiline exported function arity changes from diffs.
  • Clarify installation/runtime docs around the JS fallback shim and mark tracked items complete.

Reviewed changes

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

Show a summary per file
File Description
tests/references.test.ts Adds coverage for finding references to exported TypeScript enums.
tests/impact-suggestions.test.ts Adds a regression test for multiline exported function arity change detection.
tests/goto.test.ts Adds goto-definition coverage for TS enums, anonymous default exports, and shorthand properties.
src/languages/definitions/typescript.ts Extends TS queries/node-types to index enums, anonymous default exports, and shorthand-property identifier patterns.
src/languages/definitions/javascript.ts Extends JS queries/node-types to capture anonymous default exports and shorthand-property identifier patterns.
src/indexer/scope.ts Improves scope binding collection for destructuring/shorthand patterns and treats enums as type bindings.
src/indexer/navigation.ts Treats shorthand-property identifier nodes as navigable identifiers for goto-definition.
src/indexer/locals-and-exports.ts Improves default-export symbol extraction (including anonymous defaults) and TSX default-export fallback behavior.
src/impact/report-suggestions.ts Reworks exported-signature parsing to detect multiline signatures within diff hunks.
README.md Clarifies that @lzehrung/codegraph-js-fallback is a compatibility shim (not a parser bundle).
docs/plans/2026-06-06-performance-and-cache-opportunities.md Checks off the tracked correctness items addressed by this PR.
docs/installation.md Clarifies reduced-mode behavior and that the JS fallback package does not restore parsing.
codegraph-skill/codegraph/SKILL.md Updates agent guidance to avoid recommending the shim as a grammar fallback.

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

Comment thread src/indexer/locals-and-exports.ts Outdated
Comment thread src/indexer/scope.ts Outdated

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 38 out of 38 changed files in this pull request and generated 1 comment.

Comment thread src/indexer/scope.ts Outdated

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 40 out of 40 changed files in this pull request and generated 4 comments.

Comment thread src/indexer/scope.ts
Comment thread src/indexer/scope.ts Outdated
Comment on lines +179 to +183
node.type === "interface_declaration" ||
node.type === "type_alias_declaration" ||
node.type === "type_spec" ||
node.type === "trait_item"
node.type === "trait_item" ||
node.type === "enum_declaration"
Comment on lines +11 to +14
public enum Mode {
FAST,
SLOW
}
- [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 JS fallback is only available when `@lzehrung/codegraph-js-fallback` is installed.

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 40 out of 40 changed files in this pull request and generated 4 comments.

Comment thread src/indexer/scope.ts
Comment on lines +129 to +152
const addUnsupportedRequirePatternDecls = (pattern: SyntaxNodeLike): void => {
if (idSet.has(pattern.type)) return;
if (pattern.type !== "object_pattern") {
addPatternDecls(pattern, "local");
return;
}
for (const child of pattern.namedChildren) {
if (child.type === "shorthand_property_identifier" || child.type === "shorthand_property_identifier_pattern") {
continue;
}
if (child.type === "pair_pattern") {
const key = child.childForFieldName("key");
const value = child.childForFieldName("value");
if (key && value && key.type === "property_identifier" && value.type === "identifier") {
continue;
}
if (value) {
addPatternDecls(value, "local");
}
continue;
}
addPatternDecls(child, "local");
}
};
Comment on lines 778 to +783
const defIdent = source.match(/\bexport\s+default\s+([A-Za-z_$][\w$]*)\b/);
const name = defFn?.[1] ?? defCls?.[1] ?? defIdent?.[1];
const identName =
defIdent && defIdent[1] !== "function" && defIdent[1] !== "class" && defIdent[1] !== "abstract"
? defIdent[1]
: undefined;
const name = defFn?.[1] ?? defCls?.[1] ?? identName;
Comment on lines +610 to +612
const functionRe =
/^\s*export\s+(?:default\s+)?(?:async\s+)?function(?:\s+([A-Za-z_$][\w$]*))?(?:\s*<[^>]+>)?\s*\(([\s\S]*?)\)/gm;
for (let match; (match = functionRe.exec(text)); ) {
Comment thread src/indexer/scope.ts
Comment on lines 209 to 210
let pushed = false;
if (support.createsFunctionScope(node)) {
Comment thread src/indexer/scope.ts
) {
const name = node.childForFieldName("name");
if (name) {
if (node.type === "enumerator" && support.id === "c") addDecl(name, "local");

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.

WARNING: C++ enumerators are double-indexed in scope results

C++ (support.id === "cpp") is a customDeclLanguage; its isDeclarationName already treats enumerator names as declarations, so the custom declaration path (lines 289-291) adds C++ enum constants to the scope map. Without including "cpp" here, the else branch also pushes them to extraBindings, causing duplicate entries in the final bindings map.

Suggested change
if (node.type === "enumerator" && support.id === "c") addDecl(name, "local");
if (node.type === "enumerator" && (support.id === "c" || support.id === "cpp")) addDecl(name, "local");

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

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