homegraph 1.5.7 → 1.5.10
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/CHANGELOG.md +37 -0
- package/README.md +2 -2
- package/dist/bin/homegraph.js +16 -14
- package/dist/db/index.d.ts +1 -1
- package/dist/db/index.js +11 -25
- package/dist/db/queries.d.ts +5 -1
- package/dist/db/queries.js +31 -2
- package/dist/db/sqlite-adapter.d.ts +6 -12
- package/dist/db/sqlite-adapter.js +13 -41
- package/dist/directory.d.ts +1 -1
- package/dist/directory.js +25 -1
- package/dist/extraction/grammars.d.ts +2 -0
- package/dist/extraction/grammars.js +7 -7
- package/dist/extraction/index.js +17 -12
- package/dist/extraction/languages/arkts.d.ts +40 -7
- package/dist/extraction/languages/arkts.js +290 -84
- package/dist/extraction/tree-sitter.js +12 -3
- package/dist/graph/evidence-paths.d.ts +63 -0
- package/dist/graph/evidence-paths.js +245 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +78 -29
- package/dist/mcp/arkts-evidence-packs.d.ts +67 -0
- package/dist/mcp/arkts-evidence-packs.js +352 -0
- package/dist/mcp/daemon.js +1 -1
- package/dist/mcp/engine.d.ts +20 -7
- package/dist/mcp/engine.js +113 -106
- package/dist/mcp/index-availability.d.ts +31 -0
- package/dist/mcp/index-availability.js +105 -0
- package/dist/mcp/index.js +5 -4
- package/dist/mcp/query-cache.d.ts +1 -1
- package/dist/mcp/query-cache.js +6 -2
- package/dist/mcp/query-worker.d.ts +1 -1
- package/dist/mcp/query-worker.js +1 -1
- package/dist/mcp/server-instructions.d.ts +2 -11
- package/dist/mcp/server-instructions.js +42 -75
- package/dist/mcp/session.js +12 -4
- package/dist/mcp/source-slice-identity.d.ts +3 -0
- package/dist/mcp/source-slice-identity.js +11 -0
- package/dist/mcp/tools.d.ts +29 -6
- package/dist/mcp/tools.js +240 -122
- package/dist/project-map/index.js +2 -42
- package/dist/spec/llm/client.js +3 -15
- package/dist/spec/llm/openai-sdk.d.ts +14 -0
- package/dist/spec/llm/openai-sdk.js +37 -0
- package/dist/spec/llm/retry.js +8 -9
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +24 -0
- package/package.json +4 -6
- package/dist/addons/dynamic-import.d.ts.map +0 -1
- package/dist/addons/dynamic-import.js.map +0 -1
- package/dist/addons/init-template.d.ts.map +0 -1
- package/dist/addons/init-template.js.map +0 -1
- package/dist/addons/loader.d.ts.map +0 -1
- package/dist/addons/loader.js.map +0 -1
- package/dist/addons/manager.d.ts.map +0 -1
- package/dist/addons/manager.js.map +0 -1
- package/dist/addons/paths.d.ts.map +0 -1
- package/dist/addons/paths.js.map +0 -1
- package/dist/addons/registry.d.ts.map +0 -1
- package/dist/addons/registry.js.map +0 -1
- package/dist/addons/semver.d.ts.map +0 -1
- package/dist/addons/semver.js.map +0 -1
- package/dist/addons/types.d.ts.map +0 -1
- package/dist/addons/types.js.map +0 -1
- package/dist/addons/validate.d.ts.map +0 -1
- package/dist/addons/validate.js.map +0 -1
- package/dist/arkui/index.d.ts.map +0 -1
- package/dist/arkui/index.js.map +0 -1
- package/dist/arkui/migrate-passage.d.ts.map +0 -1
- package/dist/arkui/migrate-passage.js.map +0 -1
- package/dist/arkui/migrate-semantics.d.ts.map +0 -1
- package/dist/arkui/migrate-semantics.js.map +0 -1
- package/dist/arkui/migrate-snapshot.d.ts.map +0 -1
- package/dist/arkui/migrate-snapshot.js.map +0 -1
- package/dist/bin/addon-commands.d.ts.map +0 -1
- package/dist/bin/addon-commands.js.map +0 -1
- package/dist/bin/command-supervision.d.ts.map +0 -1
- package/dist/bin/command-supervision.js.map +0 -1
- package/dist/bin/fatal-handler.d.ts.map +0 -1
- package/dist/bin/fatal-handler.js.map +0 -1
- package/dist/bin/homegraph.d.ts.map +0 -1
- package/dist/bin/homegraph.js.map +0 -1
- package/dist/bin/node-version-check.d.ts.map +0 -1
- package/dist/bin/node-version-check.js.map +0 -1
- package/dist/bin/uninstall.d.ts.map +0 -1
- package/dist/bin/uninstall.js.map +0 -1
- package/dist/context/formatter.d.ts.map +0 -1
- package/dist/context/formatter.js.map +0 -1
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js.map +0 -1
- package/dist/context/markers.d.ts.map +0 -1
- package/dist/context/markers.js.map +0 -1
- package/dist/db/index.d.ts.map +0 -1
- package/dist/db/index.js.map +0 -1
- package/dist/db/migrations.d.ts.map +0 -1
- package/dist/db/migrations.js.map +0 -1
- package/dist/db/queries.d.ts.map +0 -1
- package/dist/db/queries.js.map +0 -1
- package/dist/db/sqlite-adapter.d.ts.map +0 -1
- package/dist/db/sqlite-adapter.js.map +0 -1
- package/dist/db/wal-valve.d.ts.map +0 -1
- package/dist/db/wal-valve.js.map +0 -1
- package/dist/directory.d.ts.map +0 -1
- package/dist/directory.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/extraction/arkts-batch-worker.d.ts.map +0 -1
- package/dist/extraction/arkts-batch-worker.js.map +0 -1
- package/dist/extraction/astro-extractor.d.ts.map +0 -1
- package/dist/extraction/astro-extractor.js.map +0 -1
- package/dist/extraction/cfml-extractor.d.ts.map +0 -1
- package/dist/extraction/cfml-extractor.js.map +0 -1
- package/dist/extraction/context.d.ts.map +0 -1
- package/dist/extraction/context.js.map +0 -1
- package/dist/extraction/default-ignore.d.ts.map +0 -1
- package/dist/extraction/default-ignore.js.map +0 -1
- package/dist/extraction/dfm-extractor.d.ts.map +0 -1
- package/dist/extraction/dfm-extractor.js.map +0 -1
- package/dist/extraction/extraction-version.d.ts.map +0 -1
- package/dist/extraction/extraction-version.js.map +0 -1
- package/dist/extraction/function-ref.d.ts.map +0 -1
- package/dist/extraction/function-ref.js.map +0 -1
- package/dist/extraction/generated-detection.d.ts.map +0 -1
- package/dist/extraction/generated-detection.js.map +0 -1
- package/dist/extraction/grammars.d.ts.map +0 -1
- package/dist/extraction/grammars.js.map +0 -1
- package/dist/extraction/index.d.ts.map +0 -1
- package/dist/extraction/index.js.map +0 -1
- package/dist/extraction/languages/arkts.d.ts.map +0 -1
- package/dist/extraction/languages/arkts.js.map +0 -1
- package/dist/extraction/languages/c-cpp.d.ts.map +0 -1
- package/dist/extraction/languages/c-cpp.js.map +0 -1
- package/dist/extraction/languages/cfquery.d.ts.map +0 -1
- package/dist/extraction/languages/cfquery.js.map +0 -1
- package/dist/extraction/languages/cfscript.d.ts.map +0 -1
- package/dist/extraction/languages/cfscript.js.map +0 -1
- package/dist/extraction/languages/cobol.d.ts.map +0 -1
- package/dist/extraction/languages/cobol.js.map +0 -1
- package/dist/extraction/languages/csharp.d.ts.map +0 -1
- package/dist/extraction/languages/csharp.js.map +0 -1
- package/dist/extraction/languages/dart.d.ts.map +0 -1
- package/dist/extraction/languages/dart.js.map +0 -1
- package/dist/extraction/languages/erlang.d.ts.map +0 -1
- package/dist/extraction/languages/erlang.js.map +0 -1
- package/dist/extraction/languages/go.d.ts.map +0 -1
- package/dist/extraction/languages/go.js.map +0 -1
- package/dist/extraction/languages/index.d.ts.map +0 -1
- package/dist/extraction/languages/index.js.map +0 -1
- package/dist/extraction/languages/java.d.ts.map +0 -1
- package/dist/extraction/languages/java.js.map +0 -1
- package/dist/extraction/languages/javascript.d.ts.map +0 -1
- package/dist/extraction/languages/javascript.js.map +0 -1
- package/dist/extraction/languages/kotlin.d.ts.map +0 -1
- package/dist/extraction/languages/kotlin.js.map +0 -1
- package/dist/extraction/languages/lua.d.ts.map +0 -1
- package/dist/extraction/languages/lua.js.map +0 -1
- package/dist/extraction/languages/luau.d.ts.map +0 -1
- package/dist/extraction/languages/luau.js.map +0 -1
- package/dist/extraction/languages/nix.d.ts.map +0 -1
- package/dist/extraction/languages/nix.js.map +0 -1
- package/dist/extraction/languages/objc.d.ts.map +0 -1
- package/dist/extraction/languages/objc.js.map +0 -1
- package/dist/extraction/languages/pascal.d.ts.map +0 -1
- package/dist/extraction/languages/pascal.js.map +0 -1
- package/dist/extraction/languages/php.d.ts.map +0 -1
- package/dist/extraction/languages/php.js.map +0 -1
- package/dist/extraction/languages/python.d.ts.map +0 -1
- package/dist/extraction/languages/python.js.map +0 -1
- package/dist/extraction/languages/r.d.ts.map +0 -1
- package/dist/extraction/languages/r.js.map +0 -1
- package/dist/extraction/languages/ruby.d.ts.map +0 -1
- package/dist/extraction/languages/ruby.js.map +0 -1
- package/dist/extraction/languages/rust.d.ts.map +0 -1
- package/dist/extraction/languages/rust.js.map +0 -1
- package/dist/extraction/languages/scala.d.ts.map +0 -1
- package/dist/extraction/languages/scala.js.map +0 -1
- package/dist/extraction/languages/solidity.d.ts.map +0 -1
- package/dist/extraction/languages/solidity.js.map +0 -1
- package/dist/extraction/languages/swift.d.ts.map +0 -1
- package/dist/extraction/languages/swift.js.map +0 -1
- package/dist/extraction/languages/terraform.d.ts.map +0 -1
- package/dist/extraction/languages/terraform.js.map +0 -1
- package/dist/extraction/languages/typescript.d.ts.map +0 -1
- package/dist/extraction/languages/typescript.js.map +0 -1
- package/dist/extraction/languages/vbnet.d.ts.map +0 -1
- package/dist/extraction/languages/vbnet.js.map +0 -1
- package/dist/extraction/liquid-extractor.d.ts.map +0 -1
- package/dist/extraction/liquid-extractor.js.map +0 -1
- package/dist/extraction/mybatis-extractor.d.ts.map +0 -1
- package/dist/extraction/mybatis-extractor.js.map +0 -1
- package/dist/extraction/parse-pool.d.ts.map +0 -1
- package/dist/extraction/parse-pool.js.map +0 -1
- package/dist/extraction/parse-worker.d.ts.map +0 -1
- package/dist/extraction/parse-worker.js.map +0 -1
- package/dist/extraction/razor-extractor.d.ts.map +0 -1
- package/dist/extraction/razor-extractor.js.map +0 -1
- package/dist/extraction/store-worker.d.ts.map +0 -1
- package/dist/extraction/store-worker.js.map +0 -1
- package/dist/extraction/store-writer.d.ts.map +0 -1
- package/dist/extraction/store-writer.js.map +0 -1
- package/dist/extraction/svelte-extractor.d.ts.map +0 -1
- package/dist/extraction/svelte-extractor.js.map +0 -1
- package/dist/extraction/tree-sitter-helpers.d.ts.map +0 -1
- package/dist/extraction/tree-sitter-helpers.js.map +0 -1
- package/dist/extraction/tree-sitter-types.d.ts.map +0 -1
- package/dist/extraction/tree-sitter-types.js.map +0 -1
- package/dist/extraction/tree-sitter.d.ts.map +0 -1
- package/dist/extraction/tree-sitter.js.map +0 -1
- package/dist/extraction/vue-extractor.d.ts.map +0 -1
- package/dist/extraction/vue-extractor.js.map +0 -1
- package/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts.map +0 -1
- package/dist/extraction/wasm-runtime-flags.js.map +0 -1
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/queries.d.ts.map +0 -1
- package/dist/graph/queries.js.map +0 -1
- package/dist/graph/traversal.d.ts.map +0 -1
- package/dist/graph/traversal.js.map +0 -1
- package/dist/graph-sources.d.ts.map +0 -1
- package/dist/graph-sources.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/installer/config-writer.d.ts.map +0 -1
- package/dist/installer/config-writer.js.map +0 -1
- package/dist/installer/index.d.ts.map +0 -1
- package/dist/installer/index.js.map +0 -1
- package/dist/installer/instructions-template.d.ts.map +0 -1
- package/dist/installer/instructions-template.js.map +0 -1
- package/dist/installer/targets/antigravity.d.ts.map +0 -1
- package/dist/installer/targets/antigravity.js.map +0 -1
- package/dist/installer/targets/claude.d.ts.map +0 -1
- package/dist/installer/targets/claude.js.map +0 -1
- package/dist/installer/targets/codebuddy.d.ts.map +0 -1
- package/dist/installer/targets/codebuddy.js.map +0 -1
- package/dist/installer/targets/codex.d.ts.map +0 -1
- package/dist/installer/targets/codex.js.map +0 -1
- package/dist/installer/targets/cursor.d.ts.map +0 -1
- package/dist/installer/targets/cursor.js.map +0 -1
- package/dist/installer/targets/deveco.d.ts.map +0 -1
- package/dist/installer/targets/deveco.js.map +0 -1
- package/dist/installer/targets/gemini.d.ts.map +0 -1
- package/dist/installer/targets/gemini.js.map +0 -1
- package/dist/installer/targets/hermes.d.ts.map +0 -1
- package/dist/installer/targets/hermes.js.map +0 -1
- package/dist/installer/targets/kiro.d.ts.map +0 -1
- package/dist/installer/targets/kiro.js.map +0 -1
- package/dist/installer/targets/opencode.d.ts.map +0 -1
- package/dist/installer/targets/opencode.js.map +0 -1
- package/dist/installer/targets/registry.d.ts.map +0 -1
- package/dist/installer/targets/registry.js.map +0 -1
- package/dist/installer/targets/shared.d.ts.map +0 -1
- package/dist/installer/targets/shared.js.map +0 -1
- package/dist/installer/targets/toml.d.ts.map +0 -1
- package/dist/installer/targets/toml.js.map +0 -1
- package/dist/installer/targets/types.d.ts.map +0 -1
- package/dist/installer/targets/types.js.map +0 -1
- package/dist/mcp/daemon-manager.d.ts.map +0 -1
- package/dist/mcp/daemon-manager.js.map +0 -1
- package/dist/mcp/daemon-paths.d.ts.map +0 -1
- package/dist/mcp/daemon-paths.js.map +0 -1
- package/dist/mcp/daemon-registry.d.ts.map +0 -1
- package/dist/mcp/daemon-registry.js.map +0 -1
- package/dist/mcp/daemon.d.ts.map +0 -1
- package/dist/mcp/daemon.js.map +0 -1
- package/dist/mcp/diff-impact.d.ts.map +0 -1
- package/dist/mcp/diff-impact.js.map +0 -1
- package/dist/mcp/dynamic-boundaries.d.ts.map +0 -1
- package/dist/mcp/dynamic-boundaries.js.map +0 -1
- package/dist/mcp/early-ppid.d.ts.map +0 -1
- package/dist/mcp/early-ppid.js.map +0 -1
- package/dist/mcp/engine.d.ts.map +0 -1
- package/dist/mcp/engine.js.map +0 -1
- package/dist/mcp/evidence-rendering.d.ts.map +0 -1
- package/dist/mcp/evidence-rendering.js.map +0 -1
- package/dist/mcp/explore-dedup.d.ts.map +0 -1
- package/dist/mcp/explore-dedup.js.map +0 -1
- package/dist/mcp/explore-repeat-guard.d.ts.map +0 -1
- package/dist/mcp/explore-repeat-guard.js.map +0 -1
- package/dist/mcp/explore-session-state.d.ts.map +0 -1
- package/dist/mcp/explore-session-state.js.map +0 -1
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/liveness-watchdog.d.ts.map +0 -1
- package/dist/mcp/liveness-watchdog.js.map +0 -1
- package/dist/mcp/memory-budget.d.ts.map +0 -1
- package/dist/mcp/memory-budget.js.map +0 -1
- package/dist/mcp/ppid-watchdog.d.ts.map +0 -1
- package/dist/mcp/ppid-watchdog.js.map +0 -1
- package/dist/mcp/proxy.d.ts.map +0 -1
- package/dist/mcp/proxy.js.map +0 -1
- package/dist/mcp/query-cache.d.ts.map +0 -1
- package/dist/mcp/query-cache.js.map +0 -1
- package/dist/mcp/query-pool.d.ts.map +0 -1
- package/dist/mcp/query-pool.js.map +0 -1
- package/dist/mcp/query-worker.d.ts.map +0 -1
- package/dist/mcp/query-worker.js.map +0 -1
- package/dist/mcp/server-instructions.d.ts.map +0 -1
- package/dist/mcp/server-instructions.js.map +0 -1
- package/dist/mcp/session.d.ts.map +0 -1
- package/dist/mcp/session.js.map +0 -1
- package/dist/mcp/startup-handshake.d.ts.map +0 -1
- package/dist/mcp/startup-handshake.js.map +0 -1
- package/dist/mcp/stdin-teardown.d.ts.map +0 -1
- package/dist/mcp/stdin-teardown.js.map +0 -1
- package/dist/mcp/tools.d.ts.map +0 -1
- package/dist/mcp/tools.js.map +0 -1
- package/dist/mcp/transport.d.ts.map +0 -1
- package/dist/mcp/transport.js.map +0 -1
- package/dist/mcp/version.d.ts.map +0 -1
- package/dist/mcp/version.js.map +0 -1
- package/dist/project-config.d.ts.map +0 -1
- package/dist/project-config.js.map +0 -1
- package/dist/project-map/index.d.ts.map +0 -1
- package/dist/project-map/index.js.map +0 -1
- package/dist/resolution/c-fnptr-synthesizer.d.ts.map +0 -1
- package/dist/resolution/c-fnptr-synthesizer.js.map +0 -1
- package/dist/resolution/callback-synthesizer.d.ts.map +0 -1
- package/dist/resolution/callback-synthesizer.js.map +0 -1
- package/dist/resolution/cooperative-yield.d.ts.map +0 -1
- package/dist/resolution/cooperative-yield.js.map +0 -1
- package/dist/resolution/frameworks/arkts-entry.d.ts.map +0 -1
- package/dist/resolution/frameworks/arkts-entry.js.map +0 -1
- package/dist/resolution/frameworks/arkts-napi.d.ts.map +0 -1
- package/dist/resolution/frameworks/arkts-napi.js.map +0 -1
- package/dist/resolution/frameworks/astro.d.ts.map +0 -1
- package/dist/resolution/frameworks/astro.js.map +0 -1
- package/dist/resolution/frameworks/cargo-workspace.d.ts.map +0 -1
- package/dist/resolution/frameworks/cargo-workspace.js.map +0 -1
- package/dist/resolution/frameworks/cics.d.ts.map +0 -1
- package/dist/resolution/frameworks/cics.js.map +0 -1
- package/dist/resolution/frameworks/csharp.d.ts.map +0 -1
- package/dist/resolution/frameworks/csharp.js.map +0 -1
- package/dist/resolution/frameworks/drupal.d.ts.map +0 -1
- package/dist/resolution/frameworks/drupal.js.map +0 -1
- package/dist/resolution/frameworks/expo-modules.d.ts.map +0 -1
- package/dist/resolution/frameworks/expo-modules.js.map +0 -1
- package/dist/resolution/frameworks/express.d.ts.map +0 -1
- package/dist/resolution/frameworks/express.js.map +0 -1
- package/dist/resolution/frameworks/fabric.d.ts.map +0 -1
- package/dist/resolution/frameworks/fabric.js.map +0 -1
- package/dist/resolution/frameworks/go.d.ts.map +0 -1
- package/dist/resolution/frameworks/go.js.map +0 -1
- package/dist/resolution/frameworks/goframe.d.ts.map +0 -1
- package/dist/resolution/frameworks/goframe.js.map +0 -1
- package/dist/resolution/frameworks/index.d.ts.map +0 -1
- package/dist/resolution/frameworks/index.js.map +0 -1
- package/dist/resolution/frameworks/java.d.ts.map +0 -1
- package/dist/resolution/frameworks/java.js.map +0 -1
- package/dist/resolution/frameworks/laravel.d.ts.map +0 -1
- package/dist/resolution/frameworks/laravel.js.map +0 -1
- package/dist/resolution/frameworks/nestjs.d.ts.map +0 -1
- package/dist/resolution/frameworks/nestjs.js.map +0 -1
- package/dist/resolution/frameworks/play.d.ts.map +0 -1
- package/dist/resolution/frameworks/play.js.map +0 -1
- package/dist/resolution/frameworks/python.d.ts.map +0 -1
- package/dist/resolution/frameworks/python.js.map +0 -1
- package/dist/resolution/frameworks/react-native.d.ts.map +0 -1
- package/dist/resolution/frameworks/react-native.js.map +0 -1
- package/dist/resolution/frameworks/react.d.ts.map +0 -1
- package/dist/resolution/frameworks/react.js.map +0 -1
- package/dist/resolution/frameworks/ruby.d.ts.map +0 -1
- package/dist/resolution/frameworks/ruby.js.map +0 -1
- package/dist/resolution/frameworks/rust.d.ts.map +0 -1
- package/dist/resolution/frameworks/rust.js.map +0 -1
- package/dist/resolution/frameworks/svelte.d.ts.map +0 -1
- package/dist/resolution/frameworks/svelte.js.map +0 -1
- package/dist/resolution/frameworks/swift-objc.d.ts.map +0 -1
- package/dist/resolution/frameworks/swift-objc.js.map +0 -1
- package/dist/resolution/frameworks/swift.d.ts.map +0 -1
- package/dist/resolution/frameworks/swift.js.map +0 -1
- package/dist/resolution/frameworks/terraform.d.ts.map +0 -1
- package/dist/resolution/frameworks/terraform.js.map +0 -1
- package/dist/resolution/frameworks/vue.d.ts.map +0 -1
- package/dist/resolution/frameworks/vue.js.map +0 -1
- package/dist/resolution/go-module.d.ts.map +0 -1
- package/dist/resolution/go-module.js.map +0 -1
- package/dist/resolution/goframe-synthesizer.d.ts.map +0 -1
- package/dist/resolution/goframe-synthesizer.js.map +0 -1
- package/dist/resolution/import-resolver.d.ts.map +0 -1
- package/dist/resolution/import-resolver.js.map +0 -1
- package/dist/resolution/index.d.ts.map +0 -1
- package/dist/resolution/index.js.map +0 -1
- package/dist/resolution/lru-cache.d.ts.map +0 -1
- package/dist/resolution/lru-cache.js.map +0 -1
- package/dist/resolution/memory-budget.d.ts.map +0 -1
- package/dist/resolution/memory-budget.js.map +0 -1
- package/dist/resolution/name-matcher.d.ts.map +0 -1
- package/dist/resolution/name-matcher.js.map +0 -1
- package/dist/resolution/path-aliases.d.ts.map +0 -1
- package/dist/resolution/path-aliases.js.map +0 -1
- package/dist/resolution/resolver-pool.d.ts.map +0 -1
- package/dist/resolution/resolver-pool.js.map +0 -1
- package/dist/resolution/resolver-worker.d.ts.map +0 -1
- package/dist/resolution/resolver-worker.js.map +0 -1
- package/dist/resolution/strip-comments.d.ts.map +0 -1
- package/dist/resolution/strip-comments.js.map +0 -1
- package/dist/resolution/swift-objc-bridge.d.ts.map +0 -1
- package/dist/resolution/swift-objc-bridge.js.map +0 -1
- package/dist/resolution/types.d.ts.map +0 -1
- package/dist/resolution/types.js.map +0 -1
- package/dist/resolution/workspace-packages.d.ts.map +0 -1
- package/dist/resolution/workspace-packages.js.map +0 -1
- package/dist/search/identifier-segments.d.ts.map +0 -1
- package/dist/search/identifier-segments.js.map +0 -1
- package/dist/search/literal-evidence.d.ts.map +0 -1
- package/dist/search/literal-evidence.js.map +0 -1
- package/dist/search/query-parser.d.ts.map +0 -1
- package/dist/search/query-parser.js.map +0 -1
- package/dist/search/query-plan-provider.d.ts.map +0 -1
- package/dist/search/query-plan-provider.js.map +0 -1
- package/dist/search/query-plan.d.ts.map +0 -1
- package/dist/search/query-plan.js.map +0 -1
- package/dist/search/query-utils.d.ts.map +0 -1
- package/dist/search/query-utils.js.map +0 -1
- package/dist/spec/build/diff-parser.d.ts.map +0 -1
- package/dist/spec/build/diff-parser.js.map +0 -1
- package/dist/spec/build/pipeline.d.ts.map +0 -1
- package/dist/spec/build/pipeline.js.map +0 -1
- package/dist/spec/build/scan.d.ts.map +0 -1
- package/dist/spec/build/scan.js.map +0 -1
- package/dist/spec/build/scope-resolver.d.ts.map +0 -1
- package/dist/spec/build/scope-resolver.js.map +0 -1
- package/dist/spec/build/spec-extractor.d.ts.map +0 -1
- package/dist/spec/build/spec-extractor.js.map +0 -1
- package/dist/spec/config.d.ts.map +0 -1
- package/dist/spec/config.js.map +0 -1
- package/dist/spec/db/commit-node.d.ts.map +0 -1
- package/dist/spec/db/commit-node.js.map +0 -1
- package/dist/spec/db/fragment-node.d.ts.map +0 -1
- package/dist/spec/db/fragment-node.js.map +0 -1
- package/dist/spec/db/fts.d.ts.map +0 -1
- package/dist/spec/db/fts.js.map +0 -1
- package/dist/spec/db/index.d.ts.map +0 -1
- package/dist/spec/db/index.js.map +0 -1
- package/dist/spec/db/persist.d.ts.map +0 -1
- package/dist/spec/db/persist.js.map +0 -1
- package/dist/spec/db/relations.d.ts.map +0 -1
- package/dist/spec/db/relations.js.map +0 -1
- package/dist/spec/db/schema.d.ts.map +0 -1
- package/dist/spec/db/schema.js.map +0 -1
- package/dist/spec/db/spec-node.d.ts.map +0 -1
- package/dist/spec/db/spec-node.js.map +0 -1
- package/dist/spec/db/sql-utils.d.ts.map +0 -1
- package/dist/spec/db/sql-utils.js.map +0 -1
- package/dist/spec/evolve/cluster-context.d.ts.map +0 -1
- package/dist/spec/evolve/cluster-context.js.map +0 -1
- package/dist/spec/evolve/commit-spec-analyzer.d.ts.map +0 -1
- package/dist/spec/evolve/commit-spec-analyzer.js.map +0 -1
- package/dist/spec/evolve/commit-spec-persister.d.ts.map +0 -1
- package/dist/spec/evolve/commit-spec-persister.js.map +0 -1
- package/dist/spec/evolve/impact-locator.d.ts.map +0 -1
- package/dist/spec/evolve/impact-locator.js.map +0 -1
- package/dist/spec/evolve/pipeline.d.ts.map +0 -1
- package/dist/spec/evolve/pipeline.js.map +0 -1
- package/dist/spec/evolve/spec-rewriter.d.ts.map +0 -1
- package/dist/spec/evolve/spec-rewriter.js.map +0 -1
- package/dist/spec/git/commits.d.ts.map +0 -1
- package/dist/spec/git/commits.js.map +0 -1
- package/dist/spec/git/exec.d.ts.map +0 -1
- package/dist/spec/git/exec.js.map +0 -1
- package/dist/spec/git/index.d.ts.map +0 -1
- package/dist/spec/git/index.js.map +0 -1
- package/dist/spec/graph/index.d.ts.map +0 -1
- package/dist/spec/graph/index.js.map +0 -1
- package/dist/spec/graph/queries.d.ts.map +0 -1
- package/dist/spec/graph/queries.js.map +0 -1
- package/dist/spec/llm/agent-client.d.ts.map +0 -1
- package/dist/spec/llm/agent-client.js.map +0 -1
- package/dist/spec/llm/agents/claude-code.d.ts.map +0 -1
- package/dist/spec/llm/agents/claude-code.js.map +0 -1
- package/dist/spec/llm/agents/codex.d.ts.map +0 -1
- package/dist/spec/llm/agents/codex.js.map +0 -1
- package/dist/spec/llm/agents/detect-utils.d.ts.map +0 -1
- package/dist/spec/llm/agents/detect-utils.js.map +0 -1
- package/dist/spec/llm/agents/deveco-code.d.ts.map +0 -1
- package/dist/spec/llm/agents/deveco-code.js.map +0 -1
- package/dist/spec/llm/agents/index.d.ts.map +0 -1
- package/dist/spec/llm/agents/index.js.map +0 -1
- package/dist/spec/llm/agents/types.d.ts.map +0 -1
- package/dist/spec/llm/agents/types.js.map +0 -1
- package/dist/spec/llm/client.d.ts.map +0 -1
- package/dist/spec/llm/client.js.map +0 -1
- package/dist/spec/llm/factory.d.ts.map +0 -1
- package/dist/spec/llm/factory.js.map +0 -1
- package/dist/spec/llm/prompts.d.ts.map +0 -1
- package/dist/spec/llm/prompts.js.map +0 -1
- package/dist/spec/llm/retry.d.ts.map +0 -1
- package/dist/spec/llm/retry.js.map +0 -1
- package/dist/spec/mine/addon/adapter.d.ts.map +0 -1
- package/dist/spec/mine/addon/adapter.js.map +0 -1
- package/dist/spec/mine/addon/render.d.ts.map +0 -1
- package/dist/spec/mine/addon/render.js.map +0 -1
- package/dist/spec/mine/addon/types.d.ts.map +0 -1
- package/dist/spec/mine/addon/types.js.map +0 -1
- package/dist/spec/mine/clustering/features.d.ts.map +0 -1
- package/dist/spec/mine/clustering/features.js.map +0 -1
- package/dist/spec/mine/clustering/index.d.ts.map +0 -1
- package/dist/spec/mine/clustering/index.js.map +0 -1
- package/dist/spec/mine/clustering/leiden.d.ts.map +0 -1
- package/dist/spec/mine/clustering/leiden.js.map +0 -1
- package/dist/spec/mine/clustering/text-similarity.d.ts.map +0 -1
- package/dist/spec/mine/clustering/text-similarity.js.map +0 -1
- package/dist/spec/mine/generator.d.ts.map +0 -1
- package/dist/spec/mine/generator.js.map +0 -1
- package/dist/spec/mine/persist.d.ts.map +0 -1
- package/dist/spec/mine/persist.js.map +0 -1
- package/dist/spec/mine/pipeline.d.ts.map +0 -1
- package/dist/spec/mine/pipeline.js.map +0 -1
- package/dist/spec/mine/scanner.d.ts.map +0 -1
- package/dist/spec/mine/scanner.js.map +0 -1
- package/dist/spec/types.d.ts.map +0 -1
- package/dist/spec/types.js.map +0 -1
- package/dist/spec/ui/index.d.ts.map +0 -1
- package/dist/spec/ui/index.js.map +0 -1
- package/dist/spec/ui/progress-handler.d.ts.map +0 -1
- package/dist/spec/ui/progress-handler.js.map +0 -1
- package/dist/spec/ui/progress.d.ts.map +0 -1
- package/dist/spec/ui/progress.js.map +0 -1
- package/dist/spec/utils/fs.d.ts.map +0 -1
- package/dist/spec/utils/fs.js.map +0 -1
- package/dist/spec/utils/index.d.ts.map +0 -1
- package/dist/spec/utils/index.js.map +0 -1
- package/dist/spec/utils/meta.d.ts.map +0 -1
- package/dist/spec/utils/meta.js.map +0 -1
- package/dist/spec/utils/truncate.d.ts.map +0 -1
- package/dist/spec/utils/truncate.js.map +0 -1
- package/dist/sync/git-hooks.d.ts.map +0 -1
- package/dist/sync/git-hooks.js.map +0 -1
- package/dist/sync/index.d.ts.map +0 -1
- package/dist/sync/index.js.map +0 -1
- package/dist/sync/watch-policy.d.ts.map +0 -1
- package/dist/sync/watch-policy.js.map +0 -1
- package/dist/sync/watcher.d.ts.map +0 -1
- package/dist/sync/watcher.js.map +0 -1
- package/dist/sync/worktree.d.ts.map +0 -1
- package/dist/sync/worktree.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/ui/glyphs.d.ts.map +0 -1
- package/dist/ui/glyphs.js.map +0 -1
- package/dist/ui/shimmer-progress.d.ts.map +0 -1
- package/dist/ui/shimmer-progress.js.map +0 -1
- package/dist/ui/shimmer-worker.d.ts.map +0 -1
- package/dist/ui/shimmer-worker.js.map +0 -1
- package/dist/ui/types.d.ts.map +0 -1
- package/dist/ui/types.js.map +0 -1
- package/dist/upgrade/index.d.ts.map +0 -1
- package/dist/upgrade/index.js.map +0 -1
- package/dist/upgrade/remove-binary.d.ts.map +0 -1
- package/dist/upgrade/remove-binary.js.map +0 -1
- package/dist/upgrade/update-check.d.ts.map +0 -1
- package/dist/upgrade/update-check.js.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js.map +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Edge, EdgeKind, Node } from '../types';
|
|
2
|
+
import type { QueryPlan } from '../search/query-plan';
|
|
3
|
+
export type EvidencePathKind = 'calls' | 'events' | 'state' | 'structure';
|
|
4
|
+
export type EvidenceDirection = 'outgoing' | 'incoming' | 'either';
|
|
5
|
+
export interface EvidencePathGoal {
|
|
6
|
+
kind: EvidencePathKind;
|
|
7
|
+
direction: EvidenceDirection;
|
|
8
|
+
anchorIds: string[];
|
|
9
|
+
ambiguous: string[];
|
|
10
|
+
limited: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface EvidencePath {
|
|
13
|
+
id: string;
|
|
14
|
+
nodeIds: string[];
|
|
15
|
+
edges: Edge[];
|
|
16
|
+
cost: number;
|
|
17
|
+
/** Search orientation only; nodeIds and edges always retain actual graph direction. */
|
|
18
|
+
orientation: 'outgoing' | 'incoming';
|
|
19
|
+
}
|
|
20
|
+
export interface EvidencePathSearch {
|
|
21
|
+
goal: EvidencePathGoal;
|
|
22
|
+
paths: EvidencePath[];
|
|
23
|
+
neighbors: Edge[];
|
|
24
|
+
missing: Array<{
|
|
25
|
+
from: string;
|
|
26
|
+
to: string;
|
|
27
|
+
}>;
|
|
28
|
+
stopReason: 'supported' | 'neighbors_only' | 'no_path_in_scope' | 'budget_exhausted' | 'ambiguous_anchors' | 'insufficient_anchors';
|
|
29
|
+
limitsHit: string[];
|
|
30
|
+
stats: {
|
|
31
|
+
adjacencyReads: number;
|
|
32
|
+
rowsRead: number;
|
|
33
|
+
nodesVisited: number;
|
|
34
|
+
durationMs: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface EvidencePathGraph {
|
|
38
|
+
getNode(id: string): Node | null | undefined;
|
|
39
|
+
getEdges(id: string, direction: 'outgoing' | 'incoming', kinds: EdgeKind[], limit: number, preferred: string[]): Edge[];
|
|
40
|
+
}
|
|
41
|
+
export declare const EVIDENCE_PATH_LIMITS: {
|
|
42
|
+
anchors: number;
|
|
43
|
+
hops: number;
|
|
44
|
+
reads: number;
|
|
45
|
+
perNode: number;
|
|
46
|
+
nodes: number;
|
|
47
|
+
milliseconds: number;
|
|
48
|
+
};
|
|
49
|
+
export declare function isEvidencePathNode(n: Node): boolean;
|
|
50
|
+
/** Exact names may have been removed by generic search stopwords (e.g. Type.start).
|
|
51
|
+
* Resolve through the qualified-name index, never by picking a bare-name overload.
|
|
52
|
+
*/
|
|
53
|
+
export declare function completeEvidencePathCandidates(query: string, nodes: Node[], lookup: (qualifiedName: string, limit: number) => Node[], plan?: QueryPlan): Node[];
|
|
54
|
+
/** Resolve only actual candidate identities; a bare homonym never selects the first hit. */
|
|
55
|
+
export declare function resolveEvidencePathGoal(query: string, nodes: Node[], focusIds: Set<string>, plan?: QueryPlan): EvidencePathGoal;
|
|
56
|
+
export declare function evidenceEdgeCost(edge: Edge, goal: EvidencePathGoal): number | null;
|
|
57
|
+
export declare function evidenceEdgeKey(edge: Edge): string;
|
|
58
|
+
/** One bounded search per request. Each orientation follows directed edges throughout. */
|
|
59
|
+
export declare function searchEvidencePaths(graph: EvidencePathGraph, goal: EvidencePathGoal, options?: {
|
|
60
|
+
now?: () => number;
|
|
61
|
+
limits?: Partial<typeof EVIDENCE_PATH_LIMITS>;
|
|
62
|
+
}): EvidencePathSearch;
|
|
63
|
+
//# sourceMappingURL=evidence-paths.d.ts.map
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EVIDENCE_PATH_LIMITS = void 0;
|
|
4
|
+
exports.isEvidencePathNode = isEvidencePathNode;
|
|
5
|
+
exports.completeEvidencePathCandidates = completeEvidencePathCandidates;
|
|
6
|
+
exports.resolveEvidencePathGoal = resolveEvidencePathGoal;
|
|
7
|
+
exports.evidenceEdgeCost = evidenceEdgeCost;
|
|
8
|
+
exports.evidenceEdgeKey = evidenceEdgeKey;
|
|
9
|
+
exports.searchEvidencePaths = searchEvidencePaths;
|
|
10
|
+
exports.EVIDENCE_PATH_LIMITS = { anchors: 4, hops: 4, reads: 48, perNode: 24, nodes: 128, milliseconds: 60 };
|
|
11
|
+
const CONTAINERS = new Set(['class', 'struct', 'component', 'interface', 'enum']);
|
|
12
|
+
const STATES = new Set(['state-binding', 'Prop', 'Link', 'observed-ref', 'storage-api', 'data-passage']);
|
|
13
|
+
const STRUCTURAL_VIEW = new Set(['child-component', 'builder', 'builder-param', 'states']);
|
|
14
|
+
function isEvidencePathNode(n) {
|
|
15
|
+
return !['file', 'module', 'import', 'export', 'parameter'].includes(n.kind)
|
|
16
|
+
&& !n.filePath.startsWith('ohos-sdk:') && !/\.d\.(?:ts|ets)$/.test(n.filePath)
|
|
17
|
+
&& !n.filePath.includes('@dummy') && !n.name.startsWith('@dummy')
|
|
18
|
+
&& !(n.name === 'constructor' && n.startLine === 1 && n.endLine === 1);
|
|
19
|
+
}
|
|
20
|
+
/** Exact names may have been removed by generic search stopwords (e.g. Type.start).
|
|
21
|
+
* Resolve through the qualified-name index, never by picking a bare-name overload.
|
|
22
|
+
*/
|
|
23
|
+
function completeEvidencePathCandidates(query, nodes, lookup, plan) {
|
|
24
|
+
const named = [...new Set([...(query.match(/[A-Za-z_$][\w$]*(?:(?:::|\.)[A-Za-z_$][\w$]*)+/g) ?? []),
|
|
25
|
+
...(plan?.anchors ?? []).filter(a => /\.|::/.test(a))])].slice(0, exports.EVIDENCE_PATH_LIMITS.anchors);
|
|
26
|
+
const extra = [];
|
|
27
|
+
for (const name of named) {
|
|
28
|
+
for (const alias of new Set([name.replace(/::/g, '.'), name.replace(/\./g, '::')])) {
|
|
29
|
+
extra.push(...lookup(alias, 25).filter(isEvidencePathNode));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return [...new Map([...nodes, ...extra].map(n => [n.id, n])).values()];
|
|
33
|
+
}
|
|
34
|
+
/** Resolve only actual candidate identities; a bare homonym never selects the first hit. */
|
|
35
|
+
function resolveEvidencePathGoal(query, nodes, focusIds, plan) {
|
|
36
|
+
const candidates = [...new Map(nodes.filter(isEvidencePathNode).map(n => [n.id, n])).values()];
|
|
37
|
+
const mentions = [];
|
|
38
|
+
const aliases = new Map();
|
|
39
|
+
const normalize = (s) => s.replace(/::/g, '.');
|
|
40
|
+
for (const node of candidates) {
|
|
41
|
+
for (const alias of new Set([node.name, node.qualifiedName, normalize(node.qualifiedName)])) {
|
|
42
|
+
if (!alias)
|
|
43
|
+
continue;
|
|
44
|
+
aliases.set(alias, [...(aliases.get(alias) ?? []), node]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
for (const [alias, hits] of aliases) {
|
|
48
|
+
let at = query.indexOf(alias);
|
|
49
|
+
while (at >= 0) {
|
|
50
|
+
const before = query[at - 1] ?? '';
|
|
51
|
+
const after = query[at + alias.length] ?? '';
|
|
52
|
+
if (!/[\w$.]/.test(before) && !/[\w$]/.test(after)) {
|
|
53
|
+
mentions.push({ at, length: alias.length, key: alias, nodes: hits });
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
at = query.indexOf(alias, at + 1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Qualified Class.member owns the occurrence, not the nested Class/member words.
|
|
60
|
+
const maximal = mentions.filter(m => !mentions.some(other => other !== m && other.at <= m.at
|
|
61
|
+
&& other.at + other.length >= m.at + m.length && other.length > m.length)).sort((a, b) => a.at - b.at || b.length - a.length);
|
|
62
|
+
const selected = [];
|
|
63
|
+
const ambiguous = [];
|
|
64
|
+
const bound = candidates.filter(n => plan?.bindings?.some(b => n.id === b.id && n.name === b.name && n.filePath === b.filePath
|
|
65
|
+
&& n.startLine === b.startLine && (!b.qualifiedName || n.qualifiedName === b.qualifiedName)));
|
|
66
|
+
const owners = maximal.flatMap(m => m.nodes.length === 1 && CONTAINERS.has(m.nodes[0].kind) ? m.nodes : []);
|
|
67
|
+
for (const mention of maximal) {
|
|
68
|
+
let hits = [...new Map(mention.nodes.map(n => [`${n.filePath}:${n.startLine}:${n.name}`, n])).values()];
|
|
69
|
+
if (hits.length > 1) {
|
|
70
|
+
const scoped = hits.filter(n => query.includes(n.filePath) || owners.some(owner => owner.filePath === n.filePath
|
|
71
|
+
&& owner.startLine <= n.startLine && owner.endLine >= n.endLine));
|
|
72
|
+
if (scoped.length)
|
|
73
|
+
hits = scoped;
|
|
74
|
+
const inherited = hits.filter(n => bound.some(b => b.id === n.id));
|
|
75
|
+
if (inherited.length === 1)
|
|
76
|
+
hits = inherited;
|
|
77
|
+
}
|
|
78
|
+
if (hits.length === 1)
|
|
79
|
+
selected.push(hits[0]);
|
|
80
|
+
else
|
|
81
|
+
ambiguous.push(mention.key);
|
|
82
|
+
}
|
|
83
|
+
// Bindings carry identity from preceding returned source; validate every field.
|
|
84
|
+
for (const node of bound)
|
|
85
|
+
if (!selected.some(n => n.id === node.id))
|
|
86
|
+
selected.push(node);
|
|
87
|
+
const roots = selected.length || ambiguous.length ? selected : candidates.filter(n => focusIds.has(n.id));
|
|
88
|
+
const leaves = [...new Map(roots.filter(n => !CONTAINERS.has(n.kind) || !roots.some(child => child.id !== n.id
|
|
89
|
+
&& child.filePath === n.filePath && child.startLine >= n.startLine && child.endLine <= n.endLine
|
|
90
|
+
&& !CONTAINERS.has(child.kind))).map(n => [n.id, n])).values()];
|
|
91
|
+
const relation = plan?.relation;
|
|
92
|
+
const direction = relation === 'incoming_references' || relation === 'registration_sites' ? 'incoming'
|
|
93
|
+
: relation === 'outgoing_calls' ? 'outgoing' : 'either';
|
|
94
|
+
const kind = relation === 'outgoing_calls' ? 'calls'
|
|
95
|
+
: relation === 'registration_sites' || plan?.features.queryAsEventDispatchSurvey ? 'events'
|
|
96
|
+
: leaves.some(n => n.kind === 'property' || n.kind === 'field') || plan?.features.queryAsAssignedFlagImpactSurvey ? 'state'
|
|
97
|
+
: leaves.length > 0 && leaves.every(n => CONTAINERS.has(n.kind)) ? 'structure' : 'calls';
|
|
98
|
+
return { kind, direction, anchorIds: leaves.slice(0, exports.EVIDENCE_PATH_LIMITS.anchors).map(n => n.id),
|
|
99
|
+
ambiguous: [...new Set(ambiguous)], limited: leaves.length > exports.EVIDENCE_PATH_LIMITS.anchors };
|
|
100
|
+
}
|
|
101
|
+
/** Semantic admissibility is distinct from the non-probabilistic search cost. */
|
|
102
|
+
function edgeSemantics(edge) {
|
|
103
|
+
const via = typeof edge.metadata?.via === 'string' ? edge.metadata.via : '';
|
|
104
|
+
const by = edge.metadata?.synthesizedBy;
|
|
105
|
+
const state = by === 'arkui-state' || ((by === 'viewtree' || by === 'arkui-migrate')
|
|
106
|
+
&& (STATES.has(via) || typeof edge.metadata?.passageType === 'string'));
|
|
107
|
+
const event = (by === 'viewtree' && !!via && !state && !STRUCTURAL_VIEW.has(via))
|
|
108
|
+
|| ['callback', 'event-emitter', 'closure-collection', 'fn-pointer-dispatch', 'arkui-emitter', 'arkui-common-event', 'arkui-taskpool'].includes(String(by));
|
|
109
|
+
return { state, event };
|
|
110
|
+
}
|
|
111
|
+
function evidenceEdgeCost(edge, goal) {
|
|
112
|
+
const { state, event } = edgeSemantics(edge);
|
|
113
|
+
let relevanceCost;
|
|
114
|
+
if (goal.kind === 'structure') {
|
|
115
|
+
if (!['extends', 'implements', 'overrides', 'instantiates'].includes(edge.kind))
|
|
116
|
+
return null;
|
|
117
|
+
relevanceCost = 0;
|
|
118
|
+
}
|
|
119
|
+
else if (goal.kind === 'state' && state && (edge.kind === 'references' || edge.kind === 'calls'))
|
|
120
|
+
relevanceCost = 0;
|
|
121
|
+
else if (edge.kind === 'calls' && !state)
|
|
122
|
+
relevanceCost = goal.kind === 'events' ? 0.4 : goal.kind === 'state' ? 0.5 : 0;
|
|
123
|
+
else if (edge.kind === 'references' && event)
|
|
124
|
+
relevanceCost = goal.kind === 'events' ? 0 : 0.3;
|
|
125
|
+
else
|
|
126
|
+
return null;
|
|
127
|
+
const reliabilityCost = edge.provenance === 'heuristic' ? 0.75
|
|
128
|
+
: edge.provenance === 'tree-sitter' || edge.provenance === 'scip' ? 0 : 1;
|
|
129
|
+
return 1 + relevanceCost + reliabilityCost;
|
|
130
|
+
}
|
|
131
|
+
function evidenceEdgeKey(edge) {
|
|
132
|
+
return JSON.stringify([edge.source, edge.target, edge.kind, edge.line, edge.metadata?.synthesizedBy, edge.metadata?.via, edge.metadata?.registeredAt]);
|
|
133
|
+
}
|
|
134
|
+
/** One bounded search per request. Each orientation follows directed edges throughout. */
|
|
135
|
+
function searchEvidencePaths(graph, goal, options = {}) {
|
|
136
|
+
const limits = { ...exports.EVIDENCE_PATH_LIMITS, ...options.limits };
|
|
137
|
+
const now = options.now ?? Date.now;
|
|
138
|
+
const started = now();
|
|
139
|
+
const hits = new Set();
|
|
140
|
+
const stats = { adjacencyReads: 0, rowsRead: 0, nodesVisited: 0, durationMs: 0 };
|
|
141
|
+
const nodeCache = new Map();
|
|
142
|
+
const adjacency = new Map();
|
|
143
|
+
const neighbors = new Map();
|
|
144
|
+
const paths = [];
|
|
145
|
+
const missing = [];
|
|
146
|
+
const kinds = goal.kind === 'structure' ? ['extends', 'implements', 'overrides', 'instantiates'] : ['calls', 'references'];
|
|
147
|
+
const alive = () => {
|
|
148
|
+
if (now() - started >= limits.milliseconds) {
|
|
149
|
+
hits.add('time');
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
return true;
|
|
153
|
+
};
|
|
154
|
+
const node = (id) => {
|
|
155
|
+
if (nodeCache.has(id))
|
|
156
|
+
return nodeCache.get(id);
|
|
157
|
+
if (nodeCache.size >= limits.nodes) {
|
|
158
|
+
hits.add('nodes');
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
const value = graph.getNode(id);
|
|
162
|
+
const kept = value && isEvidencePathNode(value) ? value : null;
|
|
163
|
+
nodeCache.set(id, kept);
|
|
164
|
+
stats.nodesVisited = nodeCache.size;
|
|
165
|
+
return kept;
|
|
166
|
+
};
|
|
167
|
+
const read = (id, direction) => {
|
|
168
|
+
const key = `${direction}:${id}`;
|
|
169
|
+
if (adjacency.has(key))
|
|
170
|
+
return adjacency.get(key);
|
|
171
|
+
if (!alive())
|
|
172
|
+
return [];
|
|
173
|
+
if (stats.adjacencyReads >= limits.reads) {
|
|
174
|
+
hits.add('reads');
|
|
175
|
+
return [];
|
|
176
|
+
}
|
|
177
|
+
const rows = graph.getEdges(id, direction, kinds, limits.perNode + 1, goal.anchorIds);
|
|
178
|
+
stats.adjacencyReads++;
|
|
179
|
+
stats.rowsRead += rows.length;
|
|
180
|
+
if (rows.length > limits.perNode)
|
|
181
|
+
hits.add('neighbors');
|
|
182
|
+
const valid = rows.slice(0, limits.perNode).filter(e => evidenceEdgeCost(e, goal) !== null
|
|
183
|
+
&& node(e.source) && node(e.target)).sort((a, b) => evidenceEdgeCost(a, goal) - evidenceEdgeCost(b, goal)
|
|
184
|
+
|| evidenceEdgeKey(a).localeCompare(evidenceEdgeKey(b)));
|
|
185
|
+
adjacency.set(key, valid);
|
|
186
|
+
return valid;
|
|
187
|
+
};
|
|
188
|
+
const directions = goal.direction === 'either' ? ['outgoing', 'incoming'] : [goal.direction];
|
|
189
|
+
// Scoped one-hop evidence doubles as the direct-link fast path and bounded fallback.
|
|
190
|
+
for (const id of goal.anchorIds)
|
|
191
|
+
for (const direction of directions) {
|
|
192
|
+
for (const edge of read(id, direction).slice(0, 8))
|
|
193
|
+
neighbors.set(evidenceEdgeKey(edge), edge);
|
|
194
|
+
}
|
|
195
|
+
for (let pair = 1; pair < goal.anchorIds.length; pair++) {
|
|
196
|
+
const from = goal.anchorIds[pair - 1];
|
|
197
|
+
const to = goal.anchorIds[pair];
|
|
198
|
+
const queue = directions.map(direction => ({ id: from, ids: [from], edges: [], cost: 0, direction,
|
|
199
|
+
semantic: goal.kind === 'calls' || goal.kind === 'structure' }));
|
|
200
|
+
const best = new Map();
|
|
201
|
+
let found;
|
|
202
|
+
while (queue.length && alive()) {
|
|
203
|
+
queue.sort((a, b) => a.cost - b.cost || a.edges.length - b.edges.length || a.ids.join('/').localeCompare(b.ids.join('/')));
|
|
204
|
+
const current = queue.shift();
|
|
205
|
+
if (current.id === to && current.semantic) {
|
|
206
|
+
found = { id: `path:${pair}`, nodeIds: current.direction === 'outgoing' ? current.ids : [...current.ids].reverse(),
|
|
207
|
+
edges: current.direction === 'outgoing' ? current.edges : [...current.edges].reverse(), cost: current.cost, orientation: current.direction };
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
if (current.edges.length >= limits.hops) {
|
|
211
|
+
hits.add('hops');
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
for (const edge of read(current.id, current.direction)) {
|
|
215
|
+
const next = current.direction === 'outgoing' ? edge.target : edge.source;
|
|
216
|
+
if (current.ids.includes(next))
|
|
217
|
+
continue;
|
|
218
|
+
const cost = current.cost + evidenceEdgeCost(edge, goal);
|
|
219
|
+
const semantics = edgeSemantics(edge);
|
|
220
|
+
const semantic = current.semantic || (goal.kind === 'state' ? semantics.state : semantics.event);
|
|
221
|
+
const key = `${current.direction}:${next}:${current.edges.length + 1}:${semantic}`;
|
|
222
|
+
if (cost >= (best.get(key) ?? Infinity))
|
|
223
|
+
continue;
|
|
224
|
+
best.set(key, cost);
|
|
225
|
+
queue.push({ id: next, ids: [...current.ids, next], edges: [...current.edges, edge], cost, direction: current.direction, semantic });
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (found)
|
|
229
|
+
paths.push(found);
|
|
230
|
+
else
|
|
231
|
+
missing.push({ from, to });
|
|
232
|
+
}
|
|
233
|
+
if (goal.limited)
|
|
234
|
+
hits.add('anchors');
|
|
235
|
+
stats.durationMs = Math.max(0, now() - started);
|
|
236
|
+
const hasGoalNeighbor = [...neighbors.values()].some(edge => goal.kind === 'state' ? edgeSemantics(edge).state
|
|
237
|
+
: goal.kind === 'events' ? edgeSemantics(edge).event : true);
|
|
238
|
+
const stopReason = goal.ambiguous.length ? 'ambiguous_anchors'
|
|
239
|
+
: !goal.anchorIds.length ? 'insufficient_anchors'
|
|
240
|
+
: missing.length ? hits.size ? 'budget_exhausted' : 'no_path_in_scope'
|
|
241
|
+
: goal.limited || (goal.anchorIds.length === 1 && hits.size) ? 'budget_exhausted'
|
|
242
|
+
: goal.anchorIds.length === 1 ? hasGoalNeighbor ? 'neighbors_only' : 'no_path_in_scope' : 'supported';
|
|
243
|
+
return { goal, paths, neighbors: [...neighbors.values()], missing, stopReason, limitsHit: [...hits], stats };
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=evidence-paths.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -185,6 +185,11 @@ export declare class HomeGraph {
|
|
|
185
185
|
* Check if an indexing operation is currently in progress
|
|
186
186
|
*/
|
|
187
187
|
isIndexing(): boolean;
|
|
188
|
+
/**
|
|
189
|
+
* True when another live process holds `.homegraph/homegraph.lock` (Spec 0032).
|
|
190
|
+
* Used by MCP product-state gating — does not acquire the lock.
|
|
191
|
+
*/
|
|
192
|
+
isWriteLockedByOther(): boolean;
|
|
188
193
|
/**
|
|
189
194
|
* Start watching for file changes and auto-syncing.
|
|
190
195
|
*
|
|
@@ -318,7 +323,7 @@ export declare class HomeGraph {
|
|
|
318
323
|
*/
|
|
319
324
|
getStats(): GraphStats;
|
|
320
325
|
/**
|
|
321
|
-
* Active SQLite backend (`
|
|
326
|
+
* Active SQLite backend (`node-sqlite` or `wasm` fallback).
|
|
322
327
|
* Surfaced via `homegraph status` / `homegraph_status` with journal mode.
|
|
323
328
|
*/
|
|
324
329
|
getBackend(): import('./db').SqliteBackend;
|
package/dist/index.js
CHANGED
|
@@ -247,18 +247,36 @@ class HomeGraph {
|
|
|
247
247
|
if ((0, directory_1.isInitialized)(resolvedRoot)) {
|
|
248
248
|
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
249
249
|
}
|
|
250
|
-
// Create
|
|
250
|
+
// Create .homegraph/ first so the lock file has a home (Spec 0032).
|
|
251
251
|
(0, directory_1.createDirectory)(resolvedRoot);
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
252
|
+
const bootLock = new utils_1.FileLock(path.join((0, directory_2.getHomeGraphDir)(resolvedRoot), 'homegraph.lock'));
|
|
253
|
+
try {
|
|
254
|
+
bootLock.acquire();
|
|
255
|
+
}
|
|
256
|
+
catch {
|
|
257
|
+
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
258
|
+
}
|
|
259
|
+
try {
|
|
260
|
+
// Winner may have finished between createDirectory and acquire.
|
|
261
|
+
if ((0, directory_1.isInitialized)(resolvedRoot)) {
|
|
262
|
+
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
263
|
+
}
|
|
264
|
+
// Initialize database
|
|
265
|
+
const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
|
|
266
|
+
const db = db_1.DatabaseConnection.initialize(dbPath);
|
|
267
|
+
const queries = new queries_1.QueryBuilder(db.getDb());
|
|
268
|
+
const instance = new HomeGraph(db, queries, resolvedRoot);
|
|
269
|
+
// Release before optional indexAll — that path acquires instance.fileLock
|
|
270
|
+
// on the same path (same PID would otherwise look like a foreign holder).
|
|
271
|
+
bootLock.release();
|
|
272
|
+
if (options.index) {
|
|
273
|
+
await instance.indexAll({ onProgress: options.onProgress });
|
|
274
|
+
}
|
|
275
|
+
return instance;
|
|
276
|
+
}
|
|
277
|
+
finally {
|
|
278
|
+
bootLock.release();
|
|
260
279
|
}
|
|
261
|
-
return instance;
|
|
262
280
|
}
|
|
263
281
|
/**
|
|
264
282
|
* Initialize synchronously (without indexing)
|
|
@@ -269,13 +287,26 @@ class HomeGraph {
|
|
|
269
287
|
if ((0, directory_1.isInitialized)(resolvedRoot)) {
|
|
270
288
|
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
271
289
|
}
|
|
272
|
-
// Create directory structure
|
|
273
290
|
(0, directory_1.createDirectory)(resolvedRoot);
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
291
|
+
const bootLock = new utils_1.FileLock(path.join((0, directory_2.getHomeGraphDir)(resolvedRoot), 'homegraph.lock'));
|
|
292
|
+
try {
|
|
293
|
+
bootLock.acquire();
|
|
294
|
+
}
|
|
295
|
+
catch {
|
|
296
|
+
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
297
|
+
}
|
|
298
|
+
try {
|
|
299
|
+
if ((0, directory_1.isInitialized)(resolvedRoot)) {
|
|
300
|
+
throw new Error(`HomeGraph already initialized in ${resolvedRoot}`);
|
|
301
|
+
}
|
|
302
|
+
const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
|
|
303
|
+
const db = db_1.DatabaseConnection.initialize(dbPath);
|
|
304
|
+
const queries = new queries_1.QueryBuilder(db.getDb());
|
|
305
|
+
return new HomeGraph(db, queries, resolvedRoot);
|
|
306
|
+
}
|
|
307
|
+
finally {
|
|
308
|
+
bootLock.release();
|
|
309
|
+
}
|
|
279
310
|
}
|
|
280
311
|
/**
|
|
281
312
|
* Open an existing HomeGraph project
|
|
@@ -420,6 +451,11 @@ class HomeGraph {
|
|
|
420
451
|
catch {
|
|
421
452
|
return { success: false, filesIndexed: 0, filesSkipped: 0, filesErrored: 0, nodesCreated: 0, edgesCreated: 0, errors: [{ message: 'Could not acquire file lock - another process may be indexing', severity: 'error' }], durationMs: 0 };
|
|
422
453
|
}
|
|
454
|
+
// Wall clock for the whole indexAll critical section (extract + FTS rebuild
|
|
455
|
+
// + resolve/link + maintenance + optional ohos API bind). Orchestrator
|
|
456
|
+
// durationMs only covers extract/store — printing that alone under-reports
|
|
457
|
+
// large Harmony repos where resolving dominates the remaining minutes.
|
|
458
|
+
const wallStartedAt = Date.now();
|
|
423
459
|
const freshDb = this.queries.getNodeAndEdgeCount().nodes === 0;
|
|
424
460
|
const fastInit = process.env.HOMEGRAPH_NO_FAST_INIT !== '1' && freshDb;
|
|
425
461
|
if (fastInit) {
|
|
@@ -563,6 +599,7 @@ class HomeGraph {
|
|
|
563
599
|
}
|
|
564
600
|
}
|
|
565
601
|
catch { /* metadata is advisory — never fail an index over it */ }
|
|
602
|
+
result.durationMs = Date.now() - wallStartedAt;
|
|
566
603
|
return result;
|
|
567
604
|
}
|
|
568
605
|
finally {
|
|
@@ -783,6 +820,13 @@ class HomeGraph {
|
|
|
783
820
|
isIndexing() {
|
|
784
821
|
return this.indexMutex.isLocked();
|
|
785
822
|
}
|
|
823
|
+
/**
|
|
824
|
+
* True when another live process holds `.homegraph/homegraph.lock` (Spec 0032).
|
|
825
|
+
* Used by MCP product-state gating — does not acquire the lock.
|
|
826
|
+
*/
|
|
827
|
+
isWriteLockedByOther() {
|
|
828
|
+
return this.fileLock.isHeldByOther();
|
|
829
|
+
}
|
|
786
830
|
// ===========================================================================
|
|
787
831
|
// File Watching
|
|
788
832
|
// ===========================================================================
|
|
@@ -964,18 +1008,23 @@ class HomeGraph {
|
|
|
964
1008
|
* Processes chunks of unresolved refs, persisting results after each batch.
|
|
965
1009
|
*/
|
|
966
1010
|
async resolveReferencesBatched(onProgress, onSynthesisProgress, backpressure) {
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1011
|
+
// Harmony modular repos: skip ResolverPool (Spec 0037). Synthesis then runs
|
|
1012
|
+
// on the main thread with concurrency 1 — same peak profile as Plan D.
|
|
1013
|
+
const parallel = (0, arkts_1.preferHarmonySerialIndexing)(this.projectRoot)
|
|
1014
|
+
? undefined
|
|
1015
|
+
: {
|
|
1016
|
+
dbPath: this.db.getPath(),
|
|
1017
|
+
bulkEdgeLoad: {
|
|
1018
|
+
begin: () => this.db.beginBulkEdgeLoad(),
|
|
1019
|
+
end: () => this.db.endBulkEdgeLoad(),
|
|
1020
|
+
},
|
|
1021
|
+
refIndexLoad: {
|
|
1022
|
+
begin: () => this.db.beginBulkRefLoad(),
|
|
1023
|
+
end: () => this.db.endBulkRefLoad(),
|
|
1024
|
+
},
|
|
1025
|
+
backpressure,
|
|
1026
|
+
};
|
|
1027
|
+
return this.resolver.resolveAndPersistBatched(onProgress, undefined, onSynthesisProgress, parallel);
|
|
979
1028
|
}
|
|
980
1029
|
/**
|
|
981
1030
|
* Get detected frameworks in the project
|
|
@@ -1012,7 +1061,7 @@ class HomeGraph {
|
|
|
1012
1061
|
return stats;
|
|
1013
1062
|
}
|
|
1014
1063
|
/**
|
|
1015
|
-
* Active SQLite backend (`
|
|
1064
|
+
* Active SQLite backend (`node-sqlite` or `wasm` fallback).
|
|
1016
1065
|
* Surfaced via `homegraph status` / `homegraph_status` with journal mode.
|
|
1017
1066
|
*/
|
|
1018
1067
|
getBackend() {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type HomeGraph from '../index';
|
|
2
|
+
import type { Edge, Node } from '../types';
|
|
3
|
+
import type { ExploreEmission } from './explore-session-state';
|
|
4
|
+
import { type EvidencePathSearch } from '../graph/evidence-paths';
|
|
5
|
+
export type EvidenceGapReason = 'budget' | 'unavailable' | 'stale' | 'invalid_range' | 'scope_limit' | 'unindexed_connection' | 'registration_source' | 'ambiguous_anchor';
|
|
6
|
+
export interface EvidenceGap {
|
|
7
|
+
target: string;
|
|
8
|
+
reason: EvidenceGapReason;
|
|
9
|
+
nextAnchor: string;
|
|
10
|
+
}
|
|
11
|
+
interface RelationEvidence {
|
|
12
|
+
source: string;
|
|
13
|
+
target: string;
|
|
14
|
+
kind: Edge['kind'];
|
|
15
|
+
provenance?: Edge['provenance'];
|
|
16
|
+
via?: string;
|
|
17
|
+
site?: string;
|
|
18
|
+
}
|
|
19
|
+
interface EvidencePack {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
sources: string[];
|
|
23
|
+
priority: number;
|
|
24
|
+
gaps: EvidenceGap[];
|
|
25
|
+
relation?: RelationEvidence;
|
|
26
|
+
path?: {
|
|
27
|
+
id: string;
|
|
28
|
+
nodeIds: string[];
|
|
29
|
+
relations: RelationEvidence[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface ArktsEvidenceResult {
|
|
33
|
+
text: string;
|
|
34
|
+
emission: ExploreEmission;
|
|
35
|
+
metadata: {
|
|
36
|
+
version: 1 | 2;
|
|
37
|
+
scope: 'bounded_static_evidence';
|
|
38
|
+
status: 'complete' | 'partial' | 'empty';
|
|
39
|
+
selectedPacks: string[];
|
|
40
|
+
gaps: EvidenceGap[];
|
|
41
|
+
relations: NonNullable<EvidencePack['relation']>[];
|
|
42
|
+
pathSearch?: {
|
|
43
|
+
goal: EvidencePathSearch['goal'];
|
|
44
|
+
stopReason: string;
|
|
45
|
+
limitsHit: string[];
|
|
46
|
+
stats: EvidencePathSearch['stats'];
|
|
47
|
+
paths: Array<{
|
|
48
|
+
id: string;
|
|
49
|
+
nodeIds: string[];
|
|
50
|
+
cost: number;
|
|
51
|
+
evidence: 'provided' | 'partial';
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** Consume already-located nodes. No text search, new planner call or recursive retrieval. */
|
|
57
|
+
export declare function buildArktsEvidencePacks(graph: Pick<HomeGraph, 'getNode' | 'getNodesInFile' | 'getFile' | 'getOutgoingEdges' | 'getIncomingEdges'>, options: {
|
|
58
|
+
projectRoot: string;
|
|
59
|
+
query: string;
|
|
60
|
+
nodes: Node[];
|
|
61
|
+
focusIds: Set<string>;
|
|
62
|
+
maxChars: number;
|
|
63
|
+
maxFiles?: number;
|
|
64
|
+
pathSearch?: EvidencePathSearch;
|
|
65
|
+
}): ArktsEvidenceResult | null;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=arkts-evidence-packs.d.ts.map
|