Skip to content

Comments

Fix/java constants#20

Merged
mars167 merged 7 commits intomainfrom
fix/java-constants
Feb 6, 2026
Merged

Fix/java constants#20
mars167 merged 7 commits intomainfrom
fix/java-constants

Conversation

@mars167
Copy link
Owner

@mars167 mars167 commented Feb 6, 2026

No description provided.

mars167 and others added 7 commits February 6, 2026 00:23
BREAKING CHANGE: Completely remove DSR (Deterministic Semantic Record) feature

Changes:
- Remove src/core/dsr/ directory and all DSR-related code
- Remove CLI DSR commands (dsr:context, dsr:generate, dsr:rebuild-index, dsr:symbol-evolution)
- Remove MCP DSR tools and handlers
- Move snapshotParser to src/core/parser/

Performance improvements for repo_map:
- Add depth parameter for PageRank iteration control (default: 5, range: 1-20)
- Add maxNodes parameter to limit symbol processing (default: 5000)
- Optimize for large repositories (6000+ files)

New features:
- Add git-ai ai repo-map CLI command
- Support --depth, --max-nodes, --max-files, --max-symbols options
- Add comprehensive test coverage for repo_map

Updates:
- Remove DSR-related types from retrieval system
- Adjust retrieval weights (remove dsrWeight)
- Update MCP schemas and tool definitions
Move maxNodes limit from post-query slice to Cozo query itself
to prevent loading all symbols into memory on large repos.

- Update symbolsQuery with { limit: maxNodes } params
- Add LIMIT clause to relationsQuery (maxNodes * 10)
- Reduces initial data load significantly for 6000+ file repos

Fixes review comment P2 on PR #19
移除LIMIT子句避免Cozo parser错误
改用params: { limit: maxNodes }传递
- Add 'field' to SymbolKind type for Java field declarations
- Parse field_declaration nodes in Java parser to extract constants
- Support for public static final constants and instance fields
- Fixes search_symbol not finding Java constants like MAX_VALUE
@mars167 mars167 requested a review from Copilot February 6, 2026 03:31
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request removes the DSR (Deterministic Semantic Record) functionality from the codebase and adds support for parsing Java field declarations (including constants). The PR involves significant refactoring across multiple layers of the application.

Changes:

  • Removes DSR tools, handlers, schemas, and core functionality (~600+ lines of DSR-related code)
  • Adds Java field declaration parsing support to capture constants and other field members
  • Replaces DSR commands with a new repo-map command
  • Removes DSR as a retrieval source from the multi-dimensional retrieval system
  • Moves snapshotParser from a (removed) dsr directory to the parser directory and updates all import paths
  • Adds depth and maxNodes parameters to repo map functionality for better control over PageRank iterations and performance
  • Updates test suite to remove DSR-related tests and add comprehensive repo map tests

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/retrieval.test.ts Removes DSR weight assertions and source references from retrieval tests
test/repoMap.test.ts Adds comprehensive test coverage for new repo map functionality
src/mcp/tools/searchTools.ts Adds depth and maxNodes parameters to repo_map tool definition
src/mcp/tools/index.ts Removes DSR tool imports and exports
src/mcp/tools/dsrTools.ts Deletes entire file (DSR tool definitions)
src/mcp/server.ts Removes DSR schema registrations from MCP server
src/mcp/schemas/searchSchemas.ts Adds validation for depth and maxNodes parameters
src/mcp/schemas/index.ts Removes DSR schema exports
src/mcp/schemas/dsrSchemas.ts Deletes entire file (DSR Zod schemas)
src/mcp/handlers/searchHandlers.ts Passes depth and maxNodes parameters to generateRepoMap
src/mcp/handlers/index.ts Removes DSR handler exports
src/mcp/handlers/dsrHandlers.ts Deletes entire file (DSR handler implementations)
src/core/types.ts Adds 'field' to SymbolKind type for Java field support
src/core/retrieval/weights.ts Removes dsrWeight from weight calculations and feedback
src/core/retrieval/types.ts Removes dsrWeight from RetrievalWeights and 'dsr' from RetrievalSource
src/core/retrieval/fuser.ts Removes DSR source handling from fusion logic
src/core/retrieval/expander.ts Removes 'dsr' from DOMAIN_VOCAB
src/core/retrieval/classifier.ts Removes 'dsr' from HISTORICAL_HINTS
src/core/repoMap.ts Adds depth/maxNodes parameters and implements limits for performance
src/core/parser/snapshotParser.ts Corrects import paths from '../dsr/' to './'
src/core/parser/java.ts Adds field_declaration parsing to capture Java constants and fields
src/core/indexing/parallel.ts Updates import path for SnapshotCodeParser
src/core/indexerIncremental.ts Updates import path for SnapshotCodeParser
src/core/dsr/* Deletes entire dsr directory with types, state, query, paths, indexMaterialize, gitContext, and generate modules
src/commands/ai.ts Replaces dsrCommand with repoMapCommand
src/cli/schemas/repoMapSchema.ts Adds schema for new repo-map command
src/cli/schemas/dsrSchemas.ts Deletes entire file
src/cli/registry.ts Removes DSR handler registrations and adds repo-map handler
src/cli/handlers/repoMapHandler.ts Adds handler implementation for repo-map command
src/cli/handlers/dsrHandlers.ts Deletes entire file
src/cli/commands/repoMapCommand.ts Adds CLI command definition for repo-map
src/cli/commands/dsrCommands.ts Deletes entire file
package.json Adds index rebuild step to test script to support repo map tests
.git-ai/lancedb.tar.gz Binary artifact update (expected with index changes)

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

Comment on lines 41 to 46
test('computeWeights emphasizes historical queries', () => {
const queryType: QueryType = { primary: 'historical', confidence: 0.8, entities: [] };
const weights = computeWeights(queryType);
assert.ok(weights.dsrWeight > weights.graphWeight);
const sum = weights.vectorWeight + weights.graphWeight + weights.dsrWeight + weights.symbolWeight;
assert.ok(weights.vectorWeight >= weights.graphWeight);
const sum = weights.vectorWeight + weights.graphWeight + weights.symbolWeight;
assert.ok(Math.abs(sum - 1) < 1e-6);
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test assertion and weights appear inconsistent with the test name 'computeWeights emphasizes historical queries'. For historical queries, the weights are vectorWeight: 0.4, graphWeight: 0.3, symbolWeight: 0.3. The assertion checks vectorWeight >= graphWeight, which is true, but this doesn't meaningfully "emphasize historical" since vector weight is actually the highest weight. Consider either: (1) adjusting the historical weights to give more emphasis to symbolWeight (which could track symbol changes over time), or (2) updating the test name to better reflect what's being tested.

Copilot uses AI. Check for mistakes.
@mars167 mars167 merged commit 3c73ba8 into main Feb 6, 2026
7 checks passed
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.

1 participant