homegraph 1.2.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -11
- package/dist/bin/homegraph.js +298 -72
- package/dist/bin/homegraph.js.map +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +117 -11
- package/dist/context/index.js.map +1 -1
- package/dist/db/index.d.ts +207 -6
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +461 -20
- package/dist/db/index.js.map +1 -1
- package/dist/db/migrations.d.ts +1 -1
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +19 -1
- package/dist/db/migrations.js.map +1 -1
- package/dist/db/queries.d.ts +157 -3
- package/dist/db/queries.d.ts.map +1 -1
- package/dist/db/queries.js +426 -9
- package/dist/db/queries.js.map +1 -1
- package/dist/db/schema.sql +32 -1
- package/dist/db/sqlite-adapter.d.ts +24 -17
- package/dist/db/sqlite-adapter.d.ts.map +1 -1
- package/dist/db/sqlite-adapter.js +292 -36
- package/dist/db/sqlite-adapter.js.map +1 -1
- package/dist/db/wal-valve.d.ts +119 -0
- package/dist/db/wal-valve.d.ts.map +1 -0
- package/dist/db/wal-valve.js +290 -0
- package/dist/db/wal-valve.js.map +1 -0
- package/dist/directory.d.ts +9 -5
- package/dist/directory.d.ts.map +1 -1
- package/dist/directory.js +210 -19
- package/dist/directory.js.map +1 -1
- package/dist/extraction/arkts-batch-worker.js +3 -2
- package/dist/extraction/arkts-batch-worker.js.map +1 -1
- package/dist/extraction/cfml-extractor.d.ts +107 -0
- package/dist/extraction/cfml-extractor.d.ts.map +1 -0
- package/dist/extraction/cfml-extractor.js +494 -0
- package/dist/extraction/cfml-extractor.js.map +1 -0
- package/dist/extraction/default-ignore.d.ts +39 -0
- package/dist/extraction/default-ignore.d.ts.map +1 -0
- package/dist/extraction/default-ignore.js +221 -0
- package/dist/extraction/default-ignore.js.map +1 -0
- package/dist/extraction/grammars.d.ts +25 -1
- package/dist/extraction/grammars.d.ts.map +1 -1
- package/dist/extraction/grammars.js +177 -24
- package/dist/extraction/grammars.js.map +1 -1
- package/dist/extraction/index.d.ts +52 -14
- package/dist/extraction/index.d.ts.map +1 -1
- package/dist/extraction/index.js +521 -314
- package/dist/extraction/index.js.map +1 -1
- package/dist/extraction/languages/arkts.d.ts +90 -6
- package/dist/extraction/languages/arkts.d.ts.map +1 -1
- package/dist/extraction/languages/arkts.js +1579 -128
- package/dist/extraction/languages/arkts.js.map +1 -1
- package/dist/extraction/languages/c-cpp.d.ts +42 -0
- package/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/dist/extraction/languages/c-cpp.js +369 -4
- package/dist/extraction/languages/c-cpp.js.map +1 -1
- package/dist/extraction/languages/cfquery.d.ts +12 -0
- package/dist/extraction/languages/cfquery.d.ts.map +1 -0
- package/dist/extraction/languages/cfquery.js +28 -0
- package/dist/extraction/languages/cfquery.js.map +1 -0
- package/dist/extraction/languages/cfscript.d.ts +3 -0
- package/dist/extraction/languages/cfscript.d.ts.map +1 -0
- package/dist/extraction/languages/cfscript.js +73 -0
- package/dist/extraction/languages/cfscript.js.map +1 -0
- package/dist/extraction/languages/cobol.d.ts +33 -0
- package/dist/extraction/languages/cobol.d.ts.map +1 -0
- package/dist/extraction/languages/cobol.js +499 -0
- package/dist/extraction/languages/cobol.js.map +1 -0
- package/dist/extraction/languages/erlang.d.ts +3 -0
- package/dist/extraction/languages/erlang.d.ts.map +1 -0
- package/dist/extraction/languages/erlang.js +350 -0
- package/dist/extraction/languages/erlang.js.map +1 -0
- package/dist/extraction/languages/index.d.ts.map +1 -1
- package/dist/extraction/languages/index.js +16 -0
- package/dist/extraction/languages/index.js.map +1 -1
- package/dist/extraction/languages/nix.d.ts +3 -0
- package/dist/extraction/languages/nix.d.ts.map +1 -0
- package/dist/extraction/languages/nix.js +294 -0
- package/dist/extraction/languages/nix.js.map +1 -0
- package/dist/extraction/languages/solidity.d.ts +3 -0
- package/dist/extraction/languages/solidity.d.ts.map +1 -0
- package/dist/extraction/languages/solidity.js +293 -0
- package/dist/extraction/languages/solidity.js.map +1 -0
- package/dist/extraction/languages/terraform.d.ts +3 -0
- package/dist/extraction/languages/terraform.d.ts.map +1 -0
- package/dist/extraction/languages/terraform.js +641 -0
- package/dist/extraction/languages/terraform.js.map +1 -0
- package/dist/extraction/languages/vbnet.d.ts +11 -0
- package/dist/extraction/languages/vbnet.d.ts.map +1 -0
- package/dist/extraction/languages/vbnet.js +141 -0
- package/dist/extraction/languages/vbnet.js.map +1 -0
- package/dist/extraction/mybatis-extractor.d.ts +30 -10
- package/dist/extraction/mybatis-extractor.d.ts.map +1 -1
- package/dist/extraction/mybatis-extractor.js +140 -38
- package/dist/extraction/mybatis-extractor.js.map +1 -1
- package/dist/extraction/parse-pool.d.ts +27 -1
- package/dist/extraction/parse-pool.d.ts.map +1 -1
- package/dist/extraction/parse-pool.js +75 -7
- package/dist/extraction/parse-pool.js.map +1 -1
- package/dist/extraction/parse-worker.js +9 -2
- package/dist/extraction/parse-worker.js.map +1 -1
- package/dist/extraction/store-worker.d.ts +20 -0
- package/dist/extraction/store-worker.d.ts.map +1 -0
- package/dist/extraction/store-worker.js +102 -0
- package/dist/extraction/store-worker.js.map +1 -0
- package/dist/extraction/store-writer.d.ts +48 -0
- package/dist/extraction/store-writer.d.ts.map +1 -0
- package/dist/extraction/store-writer.js +167 -0
- package/dist/extraction/store-writer.js.map +1 -0
- package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
- package/dist/extraction/tree-sitter-helpers.js +1 -0
- package/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/dist/extraction/tree-sitter-types.d.ts +3 -1
- package/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/dist/extraction/tree-sitter.d.ts +38 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/dist/extraction/tree-sitter.js +801 -10
- package/dist/extraction/tree-sitter.js.map +1 -1
- package/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-terraform.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts +14 -4
- package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
- package/dist/extraction/wasm-runtime-flags.js +55 -7
- package/dist/extraction/wasm-runtime-flags.js.map +1 -1
- package/dist/graph/traversal.d.ts.map +1 -1
- package/dist/graph/traversal.js +1 -1
- package/dist/graph/traversal.js.map +1 -1
- package/dist/index.d.ts +74 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +436 -55
- package/dist/index.js.map +1 -1
- package/dist/installer/index.d.ts +42 -0
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +97 -2
- package/dist/installer/index.js.map +1 -1
- package/dist/mcp/daemon.d.ts +25 -3
- package/dist/mcp/daemon.d.ts.map +1 -1
- package/dist/mcp/daemon.js +62 -8
- package/dist/mcp/daemon.js.map +1 -1
- package/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
- package/dist/mcp/dynamic-boundaries.js +2 -1
- package/dist/mcp/dynamic-boundaries.js.map +1 -1
- package/dist/mcp/early-ppid.d.ts +26 -0
- package/dist/mcp/early-ppid.d.ts.map +1 -0
- package/dist/mcp/early-ppid.js +29 -0
- package/dist/mcp/early-ppid.js.map +1 -0
- package/dist/mcp/engine.d.ts +4 -5
- package/dist/mcp/engine.d.ts.map +1 -1
- package/dist/mcp/engine.js +27 -1
- package/dist/mcp/engine.js.map +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +41 -6
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/liveness-watchdog.d.ts +18 -1
- package/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/dist/mcp/liveness-watchdog.js +73 -13
- package/dist/mcp/liveness-watchdog.js.map +1 -1
- package/dist/mcp/memory-budget.d.ts +30 -0
- package/dist/mcp/memory-budget.d.ts.map +1 -0
- package/dist/mcp/memory-budget.js +123 -0
- package/dist/mcp/memory-budget.js.map +1 -0
- package/dist/mcp/proxy.d.ts.map +1 -1
- package/dist/mcp/proxy.js +88 -4
- package/dist/mcp/proxy.js.map +1 -1
- package/dist/mcp/query-cache.d.ts +35 -4
- package/dist/mcp/query-cache.d.ts.map +1 -1
- package/dist/mcp/query-cache.js +89 -19
- package/dist/mcp/query-cache.js.map +1 -1
- package/dist/mcp/query-pool.d.ts +46 -12
- package/dist/mcp/query-pool.d.ts.map +1 -1
- package/dist/mcp/query-pool.js +100 -23
- package/dist/mcp/query-pool.js.map +1 -1
- package/dist/mcp/query-worker.d.ts +2 -2
- package/dist/mcp/query-worker.js +2 -2
- package/dist/mcp/server-instructions.d.ts +4 -27
- package/dist/mcp/server-instructions.d.ts.map +1 -1
- package/dist/mcp/server-instructions.js +39 -84
- package/dist/mcp/server-instructions.js.map +1 -1
- package/dist/mcp/session.d.ts +14 -0
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +28 -1
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/startup-handshake.d.ts +44 -0
- package/dist/mcp/startup-handshake.d.ts.map +1 -0
- package/dist/mcp/startup-handshake.js +73 -0
- package/dist/mcp/startup-handshake.js.map +1 -0
- package/dist/mcp/tools.d.ts +104 -4
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +2432 -217
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/transport.d.ts.map +1 -1
- package/dist/mcp/transport.js +18 -0
- package/dist/mcp/transport.js.map +1 -1
- package/dist/project-config.d.ts +38 -0
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +101 -2
- package/dist/project-config.js.map +1 -1
- package/dist/resolution/c-fnptr-synthesizer.d.ts +2 -1
- package/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
- package/dist/resolution/c-fnptr-synthesizer.js +178 -146
- package/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
- package/dist/resolution/callback-synthesizer.d.ts +54 -10
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/dist/resolution/callback-synthesizer.js +1299 -257
- package/dist/resolution/callback-synthesizer.js.map +1 -1
- package/dist/resolution/cooperative-yield.d.ts +10 -2
- package/dist/resolution/cooperative-yield.d.ts.map +1 -1
- package/dist/resolution/cooperative-yield.js +6 -4
- package/dist/resolution/cooperative-yield.js.map +1 -1
- package/dist/resolution/frameworks/cics.d.ts +20 -0
- package/dist/resolution/frameworks/cics.d.ts.map +1 -0
- package/dist/resolution/frameworks/cics.js +90 -0
- package/dist/resolution/frameworks/cics.js.map +1 -0
- package/dist/resolution/frameworks/go.d.ts.map +1 -1
- package/dist/resolution/frameworks/go.js +29 -6
- package/dist/resolution/frameworks/go.js.map +1 -1
- package/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/dist/resolution/frameworks/index.js +3 -0
- package/dist/resolution/frameworks/index.js.map +1 -1
- package/dist/resolution/frameworks/java.d.ts.map +1 -1
- package/dist/resolution/frameworks/java.js +14 -6
- package/dist/resolution/frameworks/java.js.map +1 -1
- package/dist/resolution/frameworks/terraform.d.ts +38 -0
- package/dist/resolution/frameworks/terraform.d.ts.map +1 -0
- package/dist/resolution/frameworks/terraform.js +277 -0
- package/dist/resolution/frameworks/terraform.js.map +1 -0
- package/dist/resolution/goframe-synthesizer.d.ts +2 -1
- package/dist/resolution/goframe-synthesizer.d.ts.map +1 -1
- package/dist/resolution/goframe-synthesizer.js +8 -3
- package/dist/resolution/goframe-synthesizer.js.map +1 -1
- package/dist/resolution/import-resolver.d.ts +9 -3
- package/dist/resolution/import-resolver.d.ts.map +1 -1
- package/dist/resolution/import-resolver.js +295 -11
- package/dist/resolution/import-resolver.js.map +1 -1
- package/dist/resolution/index.d.ts +146 -8
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +1089 -131
- package/dist/resolution/index.js.map +1 -1
- package/dist/resolution/memory-budget.d.ts +48 -0
- package/dist/resolution/memory-budget.d.ts.map +1 -0
- package/dist/resolution/memory-budget.js +162 -0
- package/dist/resolution/memory-budget.js.map +1 -0
- package/dist/resolution/name-matcher.d.ts +12 -4
- package/dist/resolution/name-matcher.d.ts.map +1 -1
- package/dist/resolution/name-matcher.js +793 -130
- package/dist/resolution/name-matcher.js.map +1 -1
- package/dist/resolution/resolver-pool.d.ts +106 -0
- package/dist/resolution/resolver-pool.d.ts.map +1 -0
- package/dist/resolution/resolver-pool.js +344 -0
- package/dist/resolution/resolver-pool.js.map +1 -0
- package/dist/resolution/resolver-worker.d.ts +17 -0
- package/dist/resolution/resolver-worker.d.ts.map +1 -0
- package/dist/resolution/resolver-worker.js +141 -0
- package/dist/resolution/resolver-worker.js.map +1 -0
- package/dist/resolution/strip-comments.d.ts +1 -1
- package/dist/resolution/strip-comments.d.ts.map +1 -1
- package/dist/resolution/strip-comments.js +49 -0
- package/dist/resolution/strip-comments.js.map +1 -1
- package/dist/resolution/types.d.ts +32 -0
- package/dist/resolution/types.d.ts.map +1 -1
- package/dist/resolution/workspace-packages.d.ts +10 -0
- package/dist/resolution/workspace-packages.d.ts.map +1 -1
- package/dist/resolution/workspace-packages.js +142 -4
- package/dist/resolution/workspace-packages.js.map +1 -1
- package/dist/search/identifier-segments.d.ts +60 -0
- package/dist/search/identifier-segments.d.ts.map +1 -0
- package/dist/search/identifier-segments.js +176 -0
- package/dist/search/identifier-segments.js.map +1 -0
- package/dist/search/query-utils.d.ts +201 -0
- package/dist/search/query-utils.d.ts.map +1 -1
- package/dist/search/query-utils.js +919 -2
- package/dist/search/query-utils.js.map +1 -1
- package/dist/spec/build/diff-parser.d.ts +55 -0
- package/dist/spec/build/diff-parser.d.ts.map +1 -0
- package/dist/spec/build/diff-parser.js +205 -0
- package/dist/spec/build/diff-parser.js.map +1 -0
- package/dist/spec/build/git-scanner.d.ts +93 -0
- package/dist/spec/build/git-scanner.d.ts.map +1 -0
- package/dist/spec/build/git-scanner.js +254 -0
- package/dist/spec/build/git-scanner.js.map +1 -0
- package/dist/spec/build/pipeline.d.ts +54 -0
- package/dist/spec/build/pipeline.d.ts.map +1 -0
- package/dist/spec/build/pipeline.js +170 -0
- package/dist/spec/build/pipeline.js.map +1 -0
- package/dist/spec/build/scan.d.ts +48 -0
- package/dist/spec/build/scan.d.ts.map +1 -0
- package/dist/spec/build/scan.js +89 -0
- package/dist/spec/build/scan.js.map +1 -0
- package/dist/spec/build/scope-resolver.d.ts +50 -0
- package/dist/spec/build/scope-resolver.d.ts.map +1 -0
- package/dist/spec/build/scope-resolver.js +105 -0
- package/dist/spec/build/scope-resolver.js.map +1 -0
- package/dist/spec/build/spec-extractor.d.ts +74 -0
- package/dist/spec/build/spec-extractor.d.ts.map +1 -0
- package/dist/spec/build/spec-extractor.js +344 -0
- package/dist/spec/build/spec-extractor.js.map +1 -0
- package/dist/spec/config.d.ts +35 -1
- package/dist/spec/config.d.ts.map +1 -1
- package/dist/spec/config.js +30 -5
- package/dist/spec/config.js.map +1 -1
- package/dist/spec/db/fts.d.ts.map +1 -1
- package/dist/spec/db/fts.js +19 -50
- package/dist/spec/db/fts.js.map +1 -1
- package/dist/spec/db/index.d.ts +5 -3
- package/dist/spec/db/index.d.ts.map +1 -1
- package/dist/spec/db/index.js +16 -1
- package/dist/spec/db/index.js.map +1 -1
- package/dist/spec/db/persist.d.ts +45 -0
- package/dist/spec/db/persist.d.ts.map +1 -0
- package/dist/spec/db/persist.js +66 -0
- package/dist/spec/db/persist.js.map +1 -0
- package/dist/spec/db/relations.d.ts +80 -1
- package/dist/spec/db/relations.d.ts.map +1 -1
- package/dist/spec/db/relations.js +175 -4
- package/dist/spec/db/relations.js.map +1 -1
- package/dist/spec/db/schema.d.ts +4 -0
- package/dist/spec/db/schema.d.ts.map +1 -1
- package/dist/spec/db/schema.js +4 -0
- package/dist/spec/db/schema.js.map +1 -1
- package/dist/spec/db/schema.sql +5 -1
- package/dist/spec/db/spec-node.d.ts +5 -0
- package/dist/spec/db/spec-node.d.ts.map +1 -1
- package/dist/spec/db/spec-node.js +11 -5
- package/dist/spec/db/spec-node.js.map +1 -1
- package/dist/spec/db/sql-utils.d.ts +11 -0
- package/dist/spec/db/sql-utils.d.ts.map +1 -0
- package/dist/spec/db/sql-utils.js +19 -0
- package/dist/spec/db/sql-utils.js.map +1 -0
- package/dist/spec/evolve/cluster-context.d.ts +30 -0
- package/dist/spec/evolve/cluster-context.d.ts.map +1 -0
- package/dist/spec/evolve/cluster-context.js +78 -0
- package/dist/spec/evolve/cluster-context.js.map +1 -0
- package/dist/spec/evolve/commit-spec-analyzer.d.ts +51 -0
- package/dist/spec/evolve/commit-spec-analyzer.d.ts.map +1 -0
- package/dist/spec/evolve/commit-spec-analyzer.js +88 -0
- package/dist/spec/evolve/commit-spec-analyzer.js.map +1 -0
- package/dist/spec/evolve/commit-spec-persister.d.ts +53 -0
- package/dist/spec/evolve/commit-spec-persister.d.ts.map +1 -0
- package/dist/spec/evolve/commit-spec-persister.js +93 -0
- package/dist/spec/evolve/commit-spec-persister.js.map +1 -0
- package/dist/spec/evolve/impact-locator.d.ts +23 -7
- package/dist/spec/evolve/impact-locator.d.ts.map +1 -1
- package/dist/spec/evolve/impact-locator.js +58 -14
- package/dist/spec/evolve/impact-locator.js.map +1 -1
- package/dist/spec/evolve/pipeline.d.ts +62 -25
- package/dist/spec/evolve/pipeline.d.ts.map +1 -1
- package/dist/spec/evolve/pipeline.js +436 -457
- package/dist/spec/evolve/pipeline.js.map +1 -1
- package/dist/spec/evolve/spec-rewriter.d.ts +13 -13
- package/dist/spec/evolve/spec-rewriter.d.ts.map +1 -1
- package/dist/spec/evolve/spec-rewriter.js +45 -45
- package/dist/spec/evolve/spec-rewriter.js.map +1 -1
- package/dist/spec/git/commits.d.ts +85 -0
- package/dist/spec/git/commits.d.ts.map +1 -0
- package/dist/spec/git/commits.js +218 -0
- package/dist/spec/git/commits.js.map +1 -0
- package/dist/spec/git/exec.d.ts +13 -0
- package/dist/spec/git/exec.d.ts.map +1 -0
- package/dist/spec/git/exec.js +19 -0
- package/dist/spec/git/exec.js.map +1 -0
- package/dist/spec/git/index.d.ts +9 -0
- package/dist/spec/git/index.d.ts.map +1 -0
- package/dist/spec/git/index.js +22 -0
- package/dist/spec/git/index.js.map +1 -0
- package/dist/spec/git-utils.d.ts +8 -0
- package/dist/spec/git-utils.d.ts.map +1 -0
- package/dist/spec/git-utils.js +14 -0
- package/dist/spec/git-utils.js.map +1 -0
- package/dist/spec/graph/index.d.ts +8 -0
- package/dist/spec/graph/index.d.ts.map +1 -0
- package/dist/spec/graph/index.js +17 -0
- package/dist/spec/graph/index.js.map +1 -0
- package/dist/spec/graph/queries.d.ts +6 -35
- package/dist/spec/graph/queries.d.ts.map +1 -1
- package/dist/spec/graph/queries.js +71 -248
- package/dist/spec/graph/queries.js.map +1 -1
- package/dist/spec/llm/agent-client.d.ts +59 -0
- package/dist/spec/llm/agent-client.d.ts.map +1 -0
- package/dist/spec/llm/agent-client.js +213 -0
- package/dist/spec/llm/agent-client.js.map +1 -0
- package/dist/spec/llm/agents/claude-code.d.ts +32 -0
- package/dist/spec/llm/agents/claude-code.d.ts.map +1 -0
- package/dist/spec/llm/agents/claude-code.js +125 -0
- package/dist/spec/llm/agents/claude-code.js.map +1 -0
- package/dist/spec/llm/agents/codex.d.ts +32 -0
- package/dist/spec/llm/agents/codex.d.ts.map +1 -0
- package/dist/spec/llm/agents/codex.js +145 -0
- package/dist/spec/llm/agents/codex.js.map +1 -0
- package/dist/spec/llm/agents/detect-utils.d.ts +28 -0
- package/dist/spec/llm/agents/detect-utils.d.ts.map +1 -0
- package/dist/spec/llm/agents/detect-utils.js +91 -0
- package/dist/spec/llm/agents/detect-utils.js.map +1 -0
- package/dist/spec/llm/agents/deveco-code.d.ts +33 -0
- package/dist/spec/llm/agents/deveco-code.d.ts.map +1 -0
- package/dist/spec/llm/agents/deveco-code.js +165 -0
- package/dist/spec/llm/agents/deveco-code.js.map +1 -0
- package/dist/spec/llm/agents/index.d.ts +31 -0
- package/dist/spec/llm/agents/index.d.ts.map +1 -0
- package/dist/spec/llm/agents/index.js +65 -0
- package/dist/spec/llm/agents/index.js.map +1 -0
- package/dist/spec/llm/agents/types.d.ts +76 -0
- package/dist/spec/llm/agents/types.d.ts.map +1 -0
- package/dist/spec/llm/agents/types.js +15 -0
- package/dist/spec/llm/agents/types.js.map +1 -0
- package/dist/spec/llm/client.d.ts +31 -11
- package/dist/spec/llm/client.d.ts.map +1 -1
- package/dist/spec/llm/client.js +143 -81
- package/dist/spec/llm/client.js.map +1 -1
- package/dist/spec/llm/factory.d.ts +41 -0
- package/dist/spec/llm/factory.d.ts.map +1 -0
- package/dist/spec/llm/factory.js +80 -0
- package/dist/spec/llm/factory.js.map +1 -0
- package/dist/spec/llm/prompts.d.ts +24 -8
- package/dist/spec/llm/prompts.d.ts.map +1 -1
- package/dist/spec/llm/prompts.js +100 -50
- package/dist/spec/llm/prompts.js.map +1 -1
- package/dist/spec/llm/retry.d.ts +53 -0
- package/dist/spec/llm/retry.d.ts.map +1 -0
- package/dist/spec/llm/retry.js +153 -0
- package/dist/spec/llm/retry.js.map +1 -0
- package/dist/spec/mine/clusterer.d.ts +63 -0
- package/dist/spec/mine/clusterer.d.ts.map +1 -0
- package/dist/spec/mine/clusterer.js +904 -0
- package/dist/spec/mine/clusterer.js.map +1 -0
- package/dist/spec/mine/clustering/features.d.ts +38 -0
- package/dist/spec/mine/clustering/features.d.ts.map +1 -0
- package/dist/spec/mine/clustering/features.js +108 -0
- package/dist/spec/mine/clustering/features.js.map +1 -0
- package/dist/spec/mine/clustering/index.d.ts +62 -0
- package/dist/spec/mine/clustering/index.d.ts.map +1 -0
- package/dist/spec/mine/clustering/index.js +259 -0
- package/dist/spec/mine/clustering/index.js.map +1 -0
- package/dist/spec/mine/clustering/leiden.d.ts +61 -0
- package/dist/spec/mine/clustering/leiden.d.ts.map +1 -0
- package/dist/spec/mine/clustering/leiden.js +489 -0
- package/dist/spec/mine/clustering/leiden.js.map +1 -0
- package/dist/spec/mine/clustering/text-similarity.d.ts +22 -0
- package/dist/spec/mine/clustering/text-similarity.d.ts.map +1 -0
- package/dist/spec/mine/clustering/text-similarity.js +98 -0
- package/dist/spec/mine/clustering/text-similarity.js.map +1 -0
- package/dist/spec/mine/generator.d.ts +54 -0
- package/dist/spec/mine/generator.d.ts.map +1 -0
- package/dist/spec/mine/generator.js +267 -0
- package/dist/spec/mine/generator.js.map +1 -0
- package/dist/spec/mine/persist.d.ts +37 -0
- package/dist/spec/mine/persist.d.ts.map +1 -0
- package/dist/spec/mine/persist.js +170 -0
- package/dist/spec/mine/persist.js.map +1 -0
- package/dist/spec/mine/pipeline.d.ts +41 -0
- package/dist/spec/mine/pipeline.d.ts.map +1 -0
- package/dist/spec/mine/pipeline.js +236 -0
- package/dist/spec/mine/pipeline.js.map +1 -0
- package/dist/spec/mine/progress-handler.d.ts +22 -0
- package/dist/spec/mine/progress-handler.d.ts.map +1 -0
- package/dist/spec/mine/progress-handler.js +108 -0
- package/dist/spec/mine/progress-handler.js.map +1 -0
- package/dist/spec/mine/progress.d.ts +23 -0
- package/dist/spec/mine/progress.d.ts.map +1 -0
- package/dist/spec/mine/progress.js +12 -0
- package/dist/spec/mine/progress.js.map +1 -0
- package/dist/spec/mine/scanner.d.ts +59 -0
- package/dist/spec/mine/scanner.d.ts.map +1 -0
- package/dist/spec/mine/scanner.js +383 -0
- package/dist/spec/mine/scanner.js.map +1 -0
- package/dist/spec/types.d.ts +32 -0
- package/dist/spec/types.d.ts.map +1 -1
- package/dist/spec/ui/index.d.ts +9 -0
- package/dist/spec/ui/index.d.ts.map +1 -0
- package/dist/spec/ui/index.js +16 -0
- package/dist/spec/ui/index.js.map +1 -0
- package/dist/spec/ui/progress-handler.d.ts +33 -0
- package/dist/spec/ui/progress-handler.d.ts.map +1 -0
- package/dist/spec/ui/progress-handler.js +132 -0
- package/dist/spec/ui/progress-handler.js.map +1 -0
- package/dist/spec/ui/progress.d.ts +24 -0
- package/dist/spec/ui/progress.d.ts.map +1 -0
- package/dist/spec/ui/progress.js +13 -0
- package/dist/spec/ui/progress.js.map +1 -0
- package/dist/spec/utils/fs.d.ts +45 -0
- package/dist/spec/utils/fs.d.ts.map +1 -0
- package/dist/spec/utils/fs.js +163 -0
- package/dist/spec/utils/fs.js.map +1 -0
- package/dist/spec/utils/index.d.ts +12 -0
- package/dist/spec/utils/index.d.ts.map +1 -0
- package/dist/spec/utils/index.js +26 -0
- package/dist/spec/utils/index.js.map +1 -0
- package/dist/spec/utils/meta.d.ts +32 -0
- package/dist/spec/utils/meta.d.ts.map +1 -0
- package/dist/spec/utils/meta.js +122 -0
- package/dist/spec/utils/meta.js.map +1 -0
- package/dist/spec/utils/truncate.d.ts +86 -0
- package/dist/spec/utils/truncate.d.ts.map +1 -0
- package/dist/spec/utils/truncate.js +172 -0
- package/dist/spec/utils/truncate.js.map +1 -0
- package/dist/spec/utils.d.ts +4 -16
- package/dist/spec/utils.d.ts.map +1 -1
- package/dist/spec/utils.js +6 -58
- package/dist/spec/utils.js.map +1 -1
- package/dist/sync/git-hooks.d.ts.map +1 -1
- package/dist/sync/git-hooks.js +2 -0
- package/dist/sync/git-hooks.js.map +1 -1
- package/dist/sync/watcher.d.ts +35 -6
- package/dist/sync/watcher.d.ts.map +1 -1
- package/dist/sync/watcher.js +127 -17
- package/dist/sync/watcher.js.map +1 -1
- package/dist/sync/worktree.d.ts.map +1 -1
- package/dist/sync/worktree.js +5 -0
- package/dist/sync/worktree.js.map +1 -1
- package/dist/telemetry/index.js +3 -3
- package/dist/telemetry/index.js.map +1 -1
- package/dist/types.d.ts +22 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -1
- package/dist/upgrade/index.d.ts +32 -0
- package/dist/upgrade/index.d.ts.map +1 -1
- package/dist/upgrade/index.js +162 -14
- package/dist/upgrade/index.js.map +1 -1
- package/dist/upgrade/remove-binary.d.ts +87 -0
- package/dist/upgrade/remove-binary.d.ts.map +1 -0
- package/dist/upgrade/remove-binary.js +289 -0
- package/dist/upgrade/remove-binary.js.map +1 -0
- package/dist/upgrade/update-check.d.ts +92 -0
- package/dist/upgrade/update-check.d.ts.map +1 -0
- package/dist/upgrade/update-check.js +258 -0
- package/dist/upgrade/update-check.js.map +1 -0
- package/package.json +6 -2
- package/scripts/agent-eval/run-all.sh +6 -0
- package/scripts/build-bundle.sh +5 -0
- package/scripts/npm-shim.js +8 -1
- package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/deveco_arm.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/setup.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/data/agents.json +0 -109
- package/scripts/exp_boundary_eval/data/experiments.json +0 -140
- package/scripts/qa_eval/README.md +0 -407
- package/scripts/qa_eval/_test_deveco_probe.py +0 -41
- package/scripts/qa_eval/agent_runner.py +0 -526
- package/scripts/qa_eval/data/.gitignore +0 -4
- package/scripts/qa_eval/data/test-set.jsonl +0 -2
- package/scripts/qa_eval/eval_metrics.py +0 -274
- package/scripts/qa_eval/external_agent.py +0 -976
- package/scripts/qa_eval/llm_config.py +0 -92
- package/scripts/qa_eval/memory_monitor.py +0 -132
- package/scripts/qa_eval/my_answer_accuracy.py +0 -187
- package/scripts/qa_eval/requirements.txt +0 -2
- package/scripts/qa_eval/run_pipeline.py +0 -804
- package/scripts/qa_eval/stats_efficiency.py +0 -279
- package/scripts/qa_eval/stats_scores.py +0 -207
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commits.js","sourceRoot":"","sources":["../../../src/spec/git/commits.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAmFH,8BAOC;AAMD,kCAMC;AAMD,gCAeC;AAYD,sCAEC;AAYD,wCAMC;AAMD,wCAEC;AAQD,sCA2BC;AAUD,0CAWC;AAaD,sCA+BC;AArQD,iDAA6C;AAC7C,iCAAwC;AAiBxC,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E,mFAAmF;AACnF,MAAM,cAAc,GAAG,qCAAqC,CAAC;AAE7D;;;GAGG;AACH,SAAS,iBAAiB,CAAC,SAAiB;IAC1C,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC;IACzC,OAAO,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAiB,EAAE,CAAC;IAEjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,IAAI;YAAE,SAAS;QAEpB,OAAO,CAAC,IAAI,CAAC;YACX,IAAI;YACJ,SAAS,EAAE,i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C7B,IAAI,CAAC;oBACH,KAAK,CAAC,IAAI,CACR,IAAA,4BAAY,EACV,KAAK,EACL,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAC5B,IAAA,qBAAc,EAAC,QAAQ,CAAC,CACzB,CACF,CAAC;gBACJ,CAAC;gBAAC,MAAM,CAAC;oBACP,gDAAgD;gBAClD,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAED,8BAA8B;QAC9B,OAAO,IAAA,4BAAY,EACjB,KAAK,EACL,CAAC,MAAM,EAAE,UAAU,CAAC,EACpB,IAAA,qBAAc,EAAC,QAAQ,CAAC,CACzB,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared `execFileSync` options for all Git calls across the spec module.
|
|
3
|
+
*
|
|
4
|
+
* @module spec/git/exec
|
|
5
|
+
*/
|
|
6
|
+
/** Shared options for all `execFileSync` Git calls across the spec module. */
|
|
7
|
+
export declare function gitExecOptions(repoPath: string): {
|
|
8
|
+
cwd: string;
|
|
9
|
+
encoding: "utf8";
|
|
10
|
+
stdio: (number | import("stream") | import("child_process").IOType | "ipc" | null | undefined)[];
|
|
11
|
+
windowsHide: boolean;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=exec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../src/spec/git/exec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM;;;;;EAQ9C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared `execFileSync` options for all Git calls across the spec module.
|
|
4
|
+
*
|
|
5
|
+
* @module spec/git/exec
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.gitExecOptions = gitExecOptions;
|
|
9
|
+
/** Shared options for all `execFileSync` Git calls across the spec module. */
|
|
10
|
+
function gitExecOptions(repoPath) {
|
|
11
|
+
const stdio = ['ignore', 'pipe', 'ignore'];
|
|
12
|
+
return {
|
|
13
|
+
cwd: repoPath,
|
|
14
|
+
encoding: 'utf8',
|
|
15
|
+
stdio,
|
|
16
|
+
windowsHide: true,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=exec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../src/spec/git/exec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAKH,wCAQC;AATD,8EAA8E;AAC9E,SAAgB,cAAc,CAAC,QAAgB;IAC7C,MAAM,KAAK,GAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACzD,OAAO;QACL,GAAG,EAAE,QAAQ;QACb,QAAQ,EAAE,MAAe;QACzB,KAAK;QACL,WAAW,EAAE,IAAI;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git layer for the spec module — barrel export.
|
|
3
|
+
*
|
|
4
|
+
* Low-level, spec-agnostic Git access shared by the build, mine, and evolve
|
|
5
|
+
* pipelines.
|
|
6
|
+
*/
|
|
7
|
+
export { gitExecOptions } from './exec';
|
|
8
|
+
export { CommitInfo, isGitRepo, getHeadHash, isAncestor, getAllCommits, getCommitRange, getCommitsUpTo, getCommitInfo, getParentHashes, getCommitDiff, } from './commits';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/spec/git/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,EACf,aAAa,GACd,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Git layer for the spec module — barrel export.
|
|
4
|
+
*
|
|
5
|
+
* Low-level, spec-agnostic Git access shared by the build, mine, and evolve
|
|
6
|
+
* pipelines.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.getCommitDiff = exports.getParentHashes = exports.getCommitInfo = exports.getCommitsUpTo = exports.getCommitRange = exports.getAllCommits = exports.isAncestor = exports.getHeadHash = exports.isGitRepo = exports.gitExecOptions = void 0;
|
|
10
|
+
var exec_1 = require("./exec");
|
|
11
|
+
Object.defineProperty(exports, "gitExecOptions", { enumerable: true, get: function () { return exec_1.gitExecOptions; } });
|
|
12
|
+
var commits_1 = require("./commits");
|
|
13
|
+
Object.defineProperty(exports, "isGitRepo", { enumerable: true, get: function () { return commits_1.isGitRepo; } });
|
|
14
|
+
Object.defineProperty(exports, "getHeadHash", { enumerable: true, get: function () { return commits_1.getHeadHash; } });
|
|
15
|
+
Object.defineProperty(exports, "isAncestor", { enumerable: true, get: function () { return commits_1.isAncestor; } });
|
|
16
|
+
Object.defineProperty(exports, "getAllCommits", { enumerable: true, get: function () { return commits_1.getAllCommits; } });
|
|
17
|
+
Object.defineProperty(exports, "getCommitRange", { enumerable: true, get: function () { return commits_1.getCommitRange; } });
|
|
18
|
+
Object.defineProperty(exports, "getCommitsUpTo", { enumerable: true, get: function () { return commits_1.getCommitsUpTo; } });
|
|
19
|
+
Object.defineProperty(exports, "getCommitInfo", { enumerable: true, get: function () { return commits_1.getCommitInfo; } });
|
|
20
|
+
Object.defineProperty(exports, "getParentHashes", { enumerable: true, get: function () { return commits_1.getParentHashes; } });
|
|
21
|
+
Object.defineProperty(exports, "getCommitDiff", { enumerable: true, get: function () { return commits_1.getCommitDiff; } });
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/spec/git/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAAwC;AAA/B,sGAAA,cAAc,OAAA;AACvB,qCAWmB;AATjB,oGAAA,SAAS,OAAA;AACT,sGAAA,WAAW,OAAA;AACX,qGAAA,UAAU,OAAA;AACV,wGAAA,aAAa,OAAA;AACb,yGAAA,cAAc,OAAA;AACd,yGAAA,cAAc,OAAA;AACd,wGAAA,aAAa,OAAA;AACb,0GAAA,eAAe,OAAA;AACf,wGAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Shared options for all `execFileSync` Git calls across the spec module. */
|
|
2
|
+
export declare function gitExecOptions(repoPath: string): {
|
|
3
|
+
cwd: string;
|
|
4
|
+
encoding: "utf8";
|
|
5
|
+
stdio: (number | import("stream") | import("child_process").IOType | "ipc" | null | undefined)[];
|
|
6
|
+
windowsHide: boolean;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=git-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-utils.d.ts","sourceRoot":"","sources":["../../src/spec/git-utils.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM;;;;;EAQ9C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gitExecOptions = gitExecOptions;
|
|
4
|
+
/** Shared options for all `execFileSync` Git calls across the spec module. */
|
|
5
|
+
function gitExecOptions(repoPath) {
|
|
6
|
+
const stdio = ['ignore', 'pipe', 'ignore'];
|
|
7
|
+
return {
|
|
8
|
+
cwd: repoPath,
|
|
9
|
+
encoding: 'utf8',
|
|
10
|
+
stdio,
|
|
11
|
+
windowsHide: true,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=git-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-utils.js","sourceRoot":"","sources":["../../src/spec/git-utils.ts"],"names":[],"mappings":";;AAGA,wCAQC;AATD,8EAA8E;AAC9E,SAAgB,cAAc,CAAC,QAAgB;IAC7C,MAAM,KAAK,GAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACzD,OAAO;QACL,GAAG,EAAE,QAAQ;QACb,QAAQ,EAAE,MAAe;QACzB,KAAK;QACL,WAAW,EAAE,IAAI;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec Graph Layer — Barrel Export
|
|
3
|
+
*
|
|
4
|
+
* Composition-layer queries over the Spec→Commit→CodeFragment knowledge
|
|
5
|
+
* graph. Consumers can `import { ... } from '../spec/graph'`.
|
|
6
|
+
*/
|
|
7
|
+
export { getSpecContext, findSpecsByFragmentPath, findSpecsByFilePath, FindSpecsByFilePathResult, getSpecStats, searchAndGetContext, findSpecsByCodeSymbol, CodeEntityInfo, CodeEntitySpecMatch, FindSpecsByCodeSymbolResult, } from './queries';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/spec/graph/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Spec Graph Layer — Barrel Export
|
|
4
|
+
*
|
|
5
|
+
* Composition-layer queries over the Spec→Commit→CodeFragment knowledge
|
|
6
|
+
* graph. Consumers can `import { ... } from '../spec/graph'`.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.findSpecsByCodeSymbol = exports.searchAndGetContext = exports.getSpecStats = exports.findSpecsByFilePath = exports.findSpecsByFragmentPath = exports.getSpecContext = void 0;
|
|
10
|
+
var queries_1 = require("./queries");
|
|
11
|
+
Object.defineProperty(exports, "getSpecContext", { enumerable: true, get: function () { return queries_1.getSpecContext; } });
|
|
12
|
+
Object.defineProperty(exports, "findSpecsByFragmentPath", { enumerable: true, get: function () { return queries_1.findSpecsByFragmentPath; } });
|
|
13
|
+
Object.defineProperty(exports, "findSpecsByFilePath", { enumerable: true, get: function () { return queries_1.findSpecsByFilePath; } });
|
|
14
|
+
Object.defineProperty(exports, "getSpecStats", { enumerable: true, get: function () { return queries_1.getSpecStats; } });
|
|
15
|
+
Object.defineProperty(exports, "searchAndGetContext", { enumerable: true, get: function () { return queries_1.searchAndGetContext; } });
|
|
16
|
+
Object.defineProperty(exports, "findSpecsByCodeSymbol", { enumerable: true, get: function () { return queries_1.findSpecsByCodeSymbol; } });
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/spec/graph/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,qCAWmB;AAVjB,yGAAA,cAAc,OAAA;AACd,kHAAA,uBAAuB,OAAA;AACvB,8GAAA,mBAAmB,OAAA;AAEnB,uGAAA,YAAY,OAAA;AACZ,8GAAA,mBAAmB,OAAA;AACnB,gHAAA,qBAAqB,OAAA"}
|
|
@@ -3,9 +3,15 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Replaces `commit4spec/graph/queries.py`. Provides spec context retrieval,
|
|
5
5
|
* stats, and search+traverse functionality.
|
|
6
|
+
*
|
|
7
|
+
* This is a pure COMPOSITION layer — following the HomeGraph convention of
|
|
8
|
+
* `src/graph` (zero SQL outside the db layer), every function here is built
|
|
9
|
+
* by composing the primitives in `../db`. Scoring, sorting, and result
|
|
10
|
+
* assembly live here; data access does not.
|
|
6
11
|
*/
|
|
7
12
|
import { SqliteDatabase } from '../../db/sqlite-adapter';
|
|
8
13
|
import { SpecContext, SpecStats } from '../types';
|
|
14
|
+
export { findSpecsByFilePath, FindSpecsByFilePathResult, } from '../db/relations';
|
|
9
15
|
/**
|
|
10
16
|
* Retrieve full context for a Spec — the spec node itself, all linked
|
|
11
17
|
* commits (with their relation types), and optionally the code fragments
|
|
@@ -31,41 +37,6 @@ export declare function getSpecContext(db: SqliteDatabase, specId: string, maxCo
|
|
|
31
37
|
* @returns Array of distinct spec IDs.
|
|
32
38
|
*/
|
|
33
39
|
export declare function findSpecsByFragmentPath(db: SqliteDatabase, filePath: string): string[];
|
|
34
|
-
/** Result container returned by findSpecsByFilePath. */
|
|
35
|
-
export interface FindSpecsByFilePathResult {
|
|
36
|
-
/** Matching spec entries (capped at maxResults). */
|
|
37
|
-
results: Array<{
|
|
38
|
-
id: string;
|
|
39
|
-
title: string;
|
|
40
|
-
status: string;
|
|
41
|
-
version: number;
|
|
42
|
-
filePath: string;
|
|
43
|
-
}>;
|
|
44
|
-
/** Number of results actually returned (<= maxResults). */
|
|
45
|
-
matched_count: number;
|
|
46
|
-
/** True when more results exist beyond the cap. */
|
|
47
|
-
truncated: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Find specs whose code fragments reference the given file path.
|
|
51
|
-
*
|
|
52
|
-
* Traverses: filePath -> code_fragment_nodes -> commit_fragment_relations
|
|
53
|
-
* -> commit_nodes -> spec_commit_relations -> spec_nodes.
|
|
54
|
-
*
|
|
55
|
-
* Uses LIKE matching against code_fragment_nodes.file_path, so partial
|
|
56
|
-
* paths work (e.g. `src/auth.ts` matches `src/auth/login.ts` and
|
|
57
|
-
* `app/src/auth.ts`). LIKE metacharacters (`%`, `_`, `\`) in the
|
|
58
|
-
* filePath are automatically escaped.
|
|
59
|
-
*
|
|
60
|
-
* An empty or whitespace-only filePath is rejected with an error
|
|
61
|
-
* (it would match every spec in the graph).
|
|
62
|
-
*
|
|
63
|
-
* @param db Active SQLite database handle.
|
|
64
|
-
* @param filePath File path to search for (substring LIKE match).
|
|
65
|
-
* @param maxResults Maximum number of results to return (default 100).
|
|
66
|
-
* @returns FindSpecsByFilePathResult with .results, .matched_count, and .truncated.
|
|
67
|
-
*/
|
|
68
|
-
export declare function findSpecsByFilePath(db: SqliteDatabase, filePath: string, maxResults?: number): FindSpecsByFilePathResult;
|
|
69
40
|
/**
|
|
70
41
|
* Compute statistics about the Spec knowledge graph.
|
|
71
42
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/spec/graph/queries.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/spec/graph/queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAEL,WAAW,EAEX,SAAS,EAEV,MAAM,UAAU,CAAC;AAclB,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAazB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,cAAc,EAClB,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,MAAU,EACtB,gBAAgB,GAAE,OAAc,GAC/B,WAAW,GAAG,IAAI,CA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EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;CACzB;AAcD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,IAAI,GAAE,MAAW,GAChB,2BAA2B,CA4F7B"}
|
|
@@ -4,46 +4,38 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Replaces `commit4spec/graph/queries.py`. Provides spec context retrieval,
|
|
6
6
|
* stats, and search+traverse functionality.
|
|
7
|
+
*
|
|
8
|
+
* This is a pure COMPOSITION layer — following the HomeGraph convention of
|
|
9
|
+
* `src/graph` (zero SQL outside the db layer), every function here is built
|
|
10
|
+
* by composing the primitives in `../db`. Scoring, sorting, and result
|
|
11
|
+
* assembly live here; data access does not.
|
|
7
12
|
*/
|
|
8
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.findSpecsByFilePath = void 0;
|
|
9
15
|
exports.getSpecContext = getSpecContext;
|
|
10
16
|
exports.findSpecsByFragmentPath = findSpecsByFragmentPath;
|
|
11
|
-
exports.findSpecsByFilePath = findSpecsByFilePath;
|
|
12
17
|
exports.getSpecStats = getSpecStats;
|
|
13
18
|
exports.searchAndGetContext = searchAndGetContext;
|
|
14
19
|
exports.findSpecsByCodeSymbol = findSpecsByCodeSymbol;
|
|
20
|
+
const spec_node_1 = require("../db/spec-node");
|
|
21
|
+
const commit_node_1 = require("../db/commit-node");
|
|
22
|
+
const fragment_node_1 = require("../db/fragment-node");
|
|
23
|
+
const relations_1 = require("../db/relations");
|
|
15
24
|
const fts_1 = require("../db/fts");
|
|
25
|
+
// Re-export so existing consumers of the graph layer keep their imports.
|
|
26
|
+
var relations_2 = require("../db/relations");
|
|
27
|
+
Object.defineProperty(exports, "findSpecsByFilePath", { enumerable: true, get: function () { return relations_2.findSpecsByFilePath; } });
|
|
16
28
|
// ===========================================================================
|
|
17
|
-
//
|
|
29
|
+
// getSpecContext
|
|
18
30
|
// ===========================================================================
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
catch {
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Convert a DB row (snake_case keys) to a SpecNode (camelCase).
|
|
32
|
-
*/
|
|
33
|
-
function _rowToSpecNode(row) {
|
|
34
|
-
return {
|
|
35
|
-
id: row.id,
|
|
36
|
-
title: row.title,
|
|
37
|
-
subtitles: _parseSubtitles(row.subtitles),
|
|
38
|
-
status: row.status,
|
|
39
|
-
version: row.version,
|
|
40
|
-
filePath: row.file_path,
|
|
41
|
-
timestamp: row.timestamp,
|
|
42
|
-
};
|
|
31
|
+
/** Relation-type priority for commit ordering (lower = earlier). */
|
|
32
|
+
function relationPriority(relationType) {
|
|
33
|
+
if (relationType === 'GENERATE')
|
|
34
|
+
return 0;
|
|
35
|
+
if (relationType === 'SUMMARIZED_FROM')
|
|
36
|
+
return 1;
|
|
37
|
+
return 2;
|
|
43
38
|
}
|
|
44
|
-
// ===========================================================================
|
|
45
|
-
// Public API
|
|
46
|
-
// ===========================================================================
|
|
47
39
|
/**
|
|
48
40
|
* Retrieve full context for a Spec — the spec node itself, all linked
|
|
49
41
|
* commits (with their relation types), and optionally the code fragments
|
|
@@ -60,66 +52,33 @@ function _rowToSpecNode(row) {
|
|
|
60
52
|
* @returns SpecContext on success, or null when the spec is not found.
|
|
61
53
|
*/
|
|
62
54
|
function getSpecContext(db, specId, maxCommits = 5, includeFragments = true) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
.prepare(`SELECT id, title, subtitles, status, version, file_path, timestamp
|
|
66
|
-
FROM spec_nodes
|
|
67
|
-
WHERE id = ?`)
|
|
68
|
-
.get(specId);
|
|
69
|
-
if (!specRow)
|
|
55
|
+
const spec = (0, spec_node_1.findSpecById)(db, specId);
|
|
56
|
+
if (!spec)
|
|
70
57
|
return null;
|
|
71
|
-
const
|
|
72
|
-
//
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const commit = {
|
|
91
|
-
hash: crow.hash,
|
|
92
|
-
message: crow.message,
|
|
93
|
-
author: crow.author,
|
|
94
|
-
timestamp: crow.timestamp,
|
|
95
|
-
};
|
|
96
|
-
let fragments = [];
|
|
97
|
-
if (includeFragments) {
|
|
98
|
-
const fragRows = db
|
|
99
|
-
.prepare(`SELECT f.id, f.change_type, f.file_path, f.start_line,
|
|
100
|
-
f.end_line, f.code_diff
|
|
101
|
-
FROM commit_fragment_relations r
|
|
102
|
-
JOIN code_fragment_nodes f ON f.id = r.fragment_id
|
|
103
|
-
WHERE r.commit_hash = ?
|
|
104
|
-
ORDER BY f.file_path, f.start_line`)
|
|
105
|
-
.all(crow.hash);
|
|
106
|
-
fragments = fragRows.map((fr) => ({
|
|
107
|
-
id: fr.id,
|
|
108
|
-
changeType: fr.change_type,
|
|
109
|
-
filePath: fr.file_path,
|
|
110
|
-
startLine: fr.start_line,
|
|
111
|
-
endLine: fr.end_line,
|
|
112
|
-
codeDiff: fr.code_diff,
|
|
113
|
-
}));
|
|
114
|
-
}
|
|
115
|
-
commits.push({
|
|
116
|
-
commit,
|
|
117
|
-
relationType: crow.relation_type,
|
|
118
|
-
fragments,
|
|
119
|
-
});
|
|
120
|
-
}
|
|
58
|
+
const linked = (0, relations_1.findCommitsBySpec)(db, specId);
|
|
59
|
+
// Order by relation-type priority, then timestamp descending.
|
|
60
|
+
const sorted = [...linked].sort((a, b) => {
|
|
61
|
+
const pa = relationPriority(a.relationType);
|
|
62
|
+
const pb = relationPriority(b.relationType);
|
|
63
|
+
if (pa !== pb)
|
|
64
|
+
return pa - pb;
|
|
65
|
+
return b.timestamp - a.timestamp;
|
|
66
|
+
});
|
|
67
|
+
const commits = sorted.slice(0, maxCommits).map((row) => ({
|
|
68
|
+
commit: {
|
|
69
|
+
hash: row.commitHash,
|
|
70
|
+
message: row.message,
|
|
71
|
+
author: row.author,
|
|
72
|
+
timestamp: row.timestamp,
|
|
73
|
+
},
|
|
74
|
+
relationType: row.relationType,
|
|
75
|
+
fragments: includeFragments ? (0, fragment_node_1.findFragmentsByCommit)(db, row.commitHash) : [],
|
|
76
|
+
}));
|
|
121
77
|
return { spec, commits };
|
|
122
78
|
}
|
|
79
|
+
// ===========================================================================
|
|
80
|
+
// findSpecsByFragmentPath
|
|
81
|
+
// ===========================================================================
|
|
123
82
|
/**
|
|
124
83
|
* Find all spec IDs related to code fragments whose file path matches
|
|
125
84
|
* the given substring.
|
|
@@ -129,76 +88,11 @@ function getSpecContext(db, specId, maxCommits = 5, includeFragments = true) {
|
|
|
129
88
|
* @returns Array of distinct spec IDs.
|
|
130
89
|
*/
|
|
131
90
|
function findSpecsByFragmentPath(db, filePath) {
|
|
132
|
-
|
|
133
|
-
const rows = db
|
|
134
|
-
.prepare(`SELECT DISTINCT r.spec_id
|
|
135
|
-
FROM spec_commit_relations r
|
|
136
|
-
JOIN commit_fragment_relations cfr ON cfr.commit_hash = r.commit_hash
|
|
137
|
-
JOIN code_fragment_nodes cf ON cf.id = cfr.fragment_id
|
|
138
|
-
WHERE cf.file_path LIKE ?`)
|
|
139
|
-
.all(pattern);
|
|
140
|
-
return rows.map((r) => r.spec_id);
|
|
91
|
+
return (0, relations_1.findSpecIdsByFragmentPath)(db, filePath);
|
|
141
92
|
}
|
|
142
93
|
// ===========================================================================
|
|
143
|
-
//
|
|
94
|
+
// getSpecStats
|
|
144
95
|
// ===========================================================================
|
|
145
|
-
/** Default max results returned by findSpecsByFilePath. */
|
|
146
|
-
const DEFAULT_MAX_SPEC_FIND_RESULTS = 100;
|
|
147
|
-
/**
|
|
148
|
-
* Find specs whose code fragments reference the given file path.
|
|
149
|
-
*
|
|
150
|
-
* Traverses: filePath -> code_fragment_nodes -> commit_fragment_relations
|
|
151
|
-
* -> commit_nodes -> spec_commit_relations -> spec_nodes.
|
|
152
|
-
*
|
|
153
|
-
* Uses LIKE matching against code_fragment_nodes.file_path, so partial
|
|
154
|
-
* paths work (e.g. `src/auth.ts` matches `src/auth/login.ts` and
|
|
155
|
-
* `app/src/auth.ts`). LIKE metacharacters (`%`, `_`, `\`) in the
|
|
156
|
-
* filePath are automatically escaped.
|
|
157
|
-
*
|
|
158
|
-
* An empty or whitespace-only filePath is rejected with an error
|
|
159
|
-
* (it would match every spec in the graph).
|
|
160
|
-
*
|
|
161
|
-
* @param db Active SQLite database handle.
|
|
162
|
-
* @param filePath File path to search for (substring LIKE match).
|
|
163
|
-
* @param maxResults Maximum number of results to return (default 100).
|
|
164
|
-
* @returns FindSpecsByFilePathResult with .results, .matched_count, and .truncated.
|
|
165
|
-
*/
|
|
166
|
-
function findSpecsByFilePath(db, filePath, maxResults = DEFAULT_MAX_SPEC_FIND_RESULTS) {
|
|
167
|
-
// Guard against empty input that would match every spec
|
|
168
|
-
if (!filePath || filePath.trim().length === 0) {
|
|
169
|
-
throw new Error('Empty file path is not allowed -- it would match every spec in the knowledge graph. ' +
|
|
170
|
-
'Provide a concrete file path (e.g. "src/auth.ts") or a partial path (e.g. "src/auth").');
|
|
171
|
-
}
|
|
172
|
-
// Escape LIKE metacharacters (SQLite ESCAPE '\' is used in the query)
|
|
173
|
-
const escaped = filePath
|
|
174
|
-
.replace(/\\/g, '\\\\') // literal backslash
|
|
175
|
-
.replace(/%/g, '\\%') // percent wildcard
|
|
176
|
-
.replace(/_/g, '\\_'); // underscore wildcard
|
|
177
|
-
const pattern = `%${escaped}%`;
|
|
178
|
-
const rows = db
|
|
179
|
-
.prepare(`SELECT DISTINCT s.id, s.title, s.status, s.version, s.file_path
|
|
180
|
-
FROM spec_nodes s
|
|
181
|
-
JOIN spec_commit_relations scr ON scr.spec_id = s.id
|
|
182
|
-
JOIN commit_fragment_relations cfr ON cfr.commit_hash = scr.commit_hash
|
|
183
|
-
JOIN code_fragment_nodes cf ON cf.id = cfr.fragment_id
|
|
184
|
-
WHERE cf.file_path LIKE ? ESCAPE '\\'
|
|
185
|
-
ORDER BY s.id
|
|
186
|
-
LIMIT ?`)
|
|
187
|
-
.all(pattern, maxResults + 1);
|
|
188
|
-
const truncated = rows.length > maxResults;
|
|
189
|
-
const slice = truncated ? rows.slice(0, maxResults) : rows;
|
|
190
|
-
return {
|
|
191
|
-
results: slice.map((r) => ({
|
|
192
|
-
id: r.id,
|
|
193
|
-
title: r.title,
|
|
194
|
-
status: r.status,
|
|
195
|
-
version: r.version,
|
|
196
|
-
filePath: r.file_path,
|
|
197
|
-
})),
|
|
198
|
-
matched_count: slice.length,
|
|
199
|
-
truncated,
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
96
|
/**
|
|
203
97
|
* Compute statistics about the Spec knowledge graph.
|
|
204
98
|
*
|
|
@@ -206,35 +100,19 @@ function findSpecsByFilePath(db, filePath, maxResults = DEFAULT_MAX_SPEC_FIND_RE
|
|
|
206
100
|
* @returns SpecStats with entity counts and relation totals.
|
|
207
101
|
*/
|
|
208
102
|
function getSpecStats(db) {
|
|
209
|
-
const
|
|
210
|
-
const commitCount = db.prepare('SELECT COUNT(*) as cnt FROM commit_nodes').get().cnt;
|
|
211
|
-
const fragmentCount = db
|
|
212
|
-
.prepare('SELECT COUNT(*) as cnt FROM code_fragment_nodes')
|
|
213
|
-
.get().cnt;
|
|
214
|
-
const scrCount = db
|
|
215
|
-
.prepare('SELECT COUNT(*) as cnt FROM spec_commit_relations')
|
|
216
|
-
.get().cnt;
|
|
217
|
-
const cfrCount = db
|
|
218
|
-
.prepare('SELECT COUNT(*) as cnt FROM commit_fragment_relations')
|
|
219
|
-
.get().cnt;
|
|
220
|
-
const ssrCount = db
|
|
221
|
-
.prepare('SELECT COUNT(*) as cnt FROM spec_spec_relations')
|
|
222
|
-
.get().cnt;
|
|
223
|
-
const activeSpecCount = db
|
|
224
|
-
.prepare("SELECT COUNT(*) as cnt FROM spec_nodes WHERE status = 'active'")
|
|
225
|
-
.get().cnt;
|
|
226
|
-
const deprecatedSpecCount = db
|
|
227
|
-
.prepare("SELECT COUNT(*) as cnt FROM spec_nodes WHERE status = 'deprecated'")
|
|
228
|
-
.get().cnt;
|
|
103
|
+
const { active, deprecated } = (0, spec_node_1.countSpecsByStatus)(db);
|
|
229
104
|
return {
|
|
230
|
-
specCount,
|
|
231
|
-
commitCount,
|
|
232
|
-
fragmentCount,
|
|
233
|
-
relationCount:
|
|
234
|
-
activeSpecCount,
|
|
235
|
-
deprecatedSpecCount,
|
|
105
|
+
specCount: active + deprecated,
|
|
106
|
+
commitCount: (0, commit_node_1.countCommits)(db),
|
|
107
|
+
fragmentCount: (0, fragment_node_1.countFragments)(db),
|
|
108
|
+
relationCount: (0, relations_1.countAllRelations)(db),
|
|
109
|
+
activeSpecCount: active,
|
|
110
|
+
deprecatedSpecCount: deprecated,
|
|
236
111
|
};
|
|
237
112
|
}
|
|
113
|
+
// ===========================================================================
|
|
114
|
+
// searchAndGetContext
|
|
115
|
+
// ===========================================================================
|
|
238
116
|
/**
|
|
239
117
|
* Full-text search for specs and return full context for each match.
|
|
240
118
|
*
|
|
@@ -284,15 +162,6 @@ const WEIGHTS = {
|
|
|
284
162
|
};
|
|
285
163
|
/** Maximum candidates to consider from the initial file-path JOIN. */
|
|
286
164
|
const MAX_CANDIDATES = 200;
|
|
287
|
-
/**
|
|
288
|
-
* Escape LIKE metacharacters in a string, also escaping the escape character.
|
|
289
|
-
*/
|
|
290
|
-
function escapeLike(str) {
|
|
291
|
-
return str
|
|
292
|
-
.replace(/\\/g, '\\\\')
|
|
293
|
-
.replace(/%/g, '\\%')
|
|
294
|
-
.replace(/_/g, '\\_');
|
|
295
|
-
}
|
|
296
165
|
/**
|
|
297
166
|
* Find Specs associated with a code entity by multi-dimensional scoring:
|
|
298
167
|
*
|
|
@@ -312,65 +181,20 @@ function escapeLike(str) {
|
|
|
312
181
|
* @returns Ranked, scored matches with score breakdowns
|
|
313
182
|
*/
|
|
314
183
|
function findSpecsByCodeSymbol(specDb, entity, topK = 10) {
|
|
315
|
-
const pathEscaped = escapeLike(entity.filePath);
|
|
316
|
-
const likePattern = `%${pathEscaped}%`;
|
|
317
|
-
const suffixLikePattern = `%${pathEscaped}`; // cf.file_path ends with entity's path
|
|
318
184
|
// -----------------------------------------------------------------------
|
|
319
185
|
// 1. Gather candidates: all specs whose fragments touch the entity's file
|
|
320
186
|
// -----------------------------------------------------------------------
|
|
321
|
-
const candidateRows = specDb
|
|
322
|
-
.
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
MAX(
|
|
326
|
-
MIN(cf.end_line, @entityEnd) - MAX(cf.start_line, @entityStart) + 1,
|
|
327
|
-
0
|
|
328
|
-
) AS overlap_lines,
|
|
329
|
-
COUNT(DISTINCT cf.id) AS fragment_count,
|
|
330
|
-
COUNT(DISTINCT scr.commit_hash) AS commit_count,
|
|
331
|
-
MAX(CASE
|
|
332
|
-
WHEN cf.file_path = @exactFilePath THEN 3
|
|
333
|
-
WHEN cf.file_path LIKE @suffixLikePattern ESCAPE '\\' THEN 2
|
|
334
|
-
ELSE 1
|
|
335
|
-
END) AS file_path_match_level
|
|
336
|
-
FROM spec_nodes s
|
|
337
|
-
JOIN spec_commit_relations scr ON scr.spec_id = s.id
|
|
338
|
-
JOIN commit_fragment_relations cfr ON cfr.commit_hash = scr.commit_hash
|
|
339
|
-
JOIN code_fragment_nodes cf ON cf.id = cfr.fragment_id
|
|
340
|
-
WHERE s.status = 'active'
|
|
341
|
-
AND cf.file_path LIKE @likePattern ESCAPE '\\'
|
|
342
|
-
GROUP BY s.id
|
|
343
|
-
ORDER BY s.timestamp DESC
|
|
344
|
-
LIMIT @maxCandidates
|
|
345
|
-
`)
|
|
346
|
-
.all({
|
|
347
|
-
entityEnd: entity.endLine,
|
|
348
|
-
entityStart: entity.startLine,
|
|
349
|
-
exactFilePath: entity.filePath,
|
|
350
|
-
suffixLikePattern,
|
|
351
|
-
likePattern,
|
|
187
|
+
const candidateRows = (0, relations_1.findSpecCandidatesByFilePath)(specDb, {
|
|
188
|
+
filePath: entity.filePath,
|
|
189
|
+
startLine: entity.startLine,
|
|
190
|
+
endLine: entity.endLine,
|
|
352
191
|
maxCandidates: MAX_CANDIDATES,
|
|
353
192
|
});
|
|
354
193
|
// -----------------------------------------------------------------------
|
|
355
194
|
// 2. Content-match signal: search code_fragments_fts for the entity name
|
|
356
195
|
// -----------------------------------------------------------------------
|
|
357
|
-
const contentFragmentIds =
|
|
358
|
-
|
|
359
|
-
const contentSpecIds = new Set();
|
|
360
|
-
if (contentFragmentIds.size > 0) {
|
|
361
|
-
const fragsIn = [...contentFragmentIds].map(() => '?').join(',');
|
|
362
|
-
const contentSpecRows = specDb
|
|
363
|
-
.prepare(`
|
|
364
|
-
SELECT DISTINCT scr.spec_id
|
|
365
|
-
FROM commit_fragment_relations cfr
|
|
366
|
-
JOIN spec_commit_relations scr ON scr.commit_hash = cfr.commit_hash
|
|
367
|
-
WHERE cfr.fragment_id IN (${fragsIn})
|
|
368
|
-
`)
|
|
369
|
-
.all(...contentFragmentIds);
|
|
370
|
-
for (const r of contentSpecRows) {
|
|
371
|
-
contentSpecIds.add(r.spec_id);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
196
|
+
const contentFragmentIds = (0, fts_1.searchCodeFragments)(specDb, entity.name, 50);
|
|
197
|
+
const contentSpecIds = new Set((0, relations_1.findSpecIdsByFragmentIds)(specDb, contentFragmentIds));
|
|
374
198
|
// -----------------------------------------------------------------------
|
|
375
199
|
// 3. Name-match signal: search specs_fts for the entity name
|
|
376
200
|
// -----------------------------------------------------------------------
|
|
@@ -387,20 +211,19 @@ function findSpecsByCodeSymbol(specDb, entity, topK = 10) {
|
|
|
387
211
|
const entityLength = Math.max(1, entity.endLine - entity.startLine + 1);
|
|
388
212
|
const scored = candidateRows.map((row) => {
|
|
389
213
|
// 4a. File-path score — derived from the best-matching fragment's file_path
|
|
390
|
-
// (computed in SQL as
|
|
391
|
-
const filePathScore = row.
|
|
392
|
-
: row.
|
|
214
|
+
// (computed in SQL as filePathMatchLevel: 3=exact, 2=suffix, 1=LIKE)
|
|
215
|
+
const filePathScore = row.filePathMatchLevel === 3 ? 1.0
|
|
216
|
+
: row.filePathMatchLevel === 2 ? 0.8
|
|
393
217
|
: 0.6;
|
|
394
218
|
// 4b. Content score
|
|
395
219
|
const contentScore = contentSpecIds.has(row.id) ? 1.0 : 0;
|
|
396
220
|
// 4c. Name score
|
|
397
221
|
const nameScore = nameScoreMap.get(row.id) ?? 0;
|
|
398
|
-
// 4d. Recency score
|
|
222
|
+
// 4d. Recency score — decays to 0.5 after ~180 days
|
|
399
223
|
const daysSinceUpdate = (now - row.timestamp) / (1000 * 60 * 60 * 24);
|
|
400
224
|
const recencyScore = 1 / (1 + Math.max(0, daysSinceUpdate) / 180);
|
|
401
225
|
// 4e. Overlap score
|
|
402
|
-
const
|
|
403
|
-
const overlapScore = overlapRatio;
|
|
226
|
+
const overlapScore = Math.min(1.0, row.overlapLines / entityLength);
|
|
404
227
|
const score = filePathScore * WEIGHTS.filePath +
|
|
405
228
|
contentScore * WEIGHTS.content +
|
|
406
229
|
nameScore * WEIGHTS.name +
|
|
@@ -412,7 +235,7 @@ function findSpecsByCodeSymbol(specDb, entity, topK = 10) {
|
|
|
412
235
|
title: row.title,
|
|
413
236
|
status: row.status,
|
|
414
237
|
version: row.version,
|
|
415
|
-
filePath: row.
|
|
238
|
+
filePath: row.filePath,
|
|
416
239
|
timestamp: row.timestamp,
|
|
417
240
|
},
|
|
418
241
|
score,
|
|
@@ -423,8 +246,8 @@ function findSpecsByCodeSymbol(specDb, entity, topK = 10) {
|
|
|
423
246
|
recencyScore,
|
|
424
247
|
overlapScore,
|
|
425
248
|
},
|
|
426
|
-
fragmentCount: row.
|
|
427
|
-
commitCount: row.
|
|
249
|
+
fragmentCount: row.fragmentCount,
|
|
250
|
+
commitCount: row.commitCount,
|
|
428
251
|
};
|
|
429
252
|
});
|
|
430
253
|
// -----------------------------------------------------------------------
|