@optave/codegraph 3.1.5 → 3.3.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 +50 -56
- package/dist/ast-analysis/engine.d.ts +17 -0
- package/dist/ast-analysis/engine.d.ts.map +1 -0
- package/dist/ast-analysis/engine.js +328 -0
- package/dist/ast-analysis/engine.js.map +1 -0
- package/dist/ast-analysis/metrics.d.ts +51 -0
- package/dist/ast-analysis/metrics.d.ts.map +1 -0
- package/dist/ast-analysis/metrics.js +106 -0
- package/dist/ast-analysis/metrics.js.map +1 -0
- package/dist/ast-analysis/rules/csharp.d.ts +24 -0
- package/dist/ast-analysis/rules/csharp.d.ts.map +1 -0
- package/dist/ast-analysis/rules/csharp.js +192 -0
- package/dist/ast-analysis/rules/csharp.js.map +1 -0
- package/dist/ast-analysis/rules/go.d.ts +24 -0
- package/dist/ast-analysis/rules/go.d.ts.map +1 -0
- package/dist/ast-analysis/rules/go.js +173 -0
- package/dist/ast-analysis/rules/go.js.map +1 -0
- package/dist/ast-analysis/rules/index.d.ts +31 -0
- package/dist/ast-analysis/rules/index.d.ts.map +1 -0
- package/dist/ast-analysis/rules/index.js +72 -0
- package/dist/ast-analysis/rules/index.js.map +1 -0
- package/dist/ast-analysis/rules/java.d.ts +24 -0
- package/dist/ast-analysis/rules/java.d.ts.map +1 -0
- package/dist/ast-analysis/rules/java.js +166 -0
- package/dist/ast-analysis/rules/java.js.map +1 -0
- package/dist/ast-analysis/rules/javascript.d.ts +31 -0
- package/dist/ast-analysis/rules/javascript.d.ts.map +1 -0
- package/dist/ast-analysis/rules/javascript.js +235 -0
- package/dist/ast-analysis/rules/javascript.js.map +1 -0
- package/dist/ast-analysis/rules/php.d.ts +24 -0
- package/dist/ast-analysis/rules/php.d.ts.map +1 -0
- package/dist/ast-analysis/rules/php.js +210 -0
- package/dist/ast-analysis/rules/php.js.map +1 -0
- package/dist/ast-analysis/rules/python.d.ts +24 -0
- package/dist/ast-analysis/rules/python.d.ts.map +1 -0
- package/dist/ast-analysis/rules/python.js +188 -0
- package/dist/ast-analysis/rules/python.js.map +1 -0
- package/dist/ast-analysis/rules/ruby.d.ts +24 -0
- package/dist/ast-analysis/rules/ruby.d.ts.map +1 -0
- package/dist/ast-analysis/rules/ruby.js +193 -0
- package/dist/ast-analysis/rules/ruby.js.map +1 -0
- package/dist/ast-analysis/rules/rust.d.ts +24 -0
- package/dist/ast-analysis/rules/rust.d.ts.map +1 -0
- package/dist/ast-analysis/rules/rust.js +165 -0
- package/dist/ast-analysis/rules/rust.js.map +1 -0
- package/dist/ast-analysis/shared.d.ts +106 -0
- package/dist/ast-analysis/shared.d.ts.map +1 -0
- package/dist/ast-analysis/shared.js +186 -0
- package/dist/ast-analysis/shared.js.map +1 -0
- package/dist/ast-analysis/visitor-utils.d.ts +41 -0
- package/dist/ast-analysis/visitor-utils.d.ts.map +1 -0
- package/dist/ast-analysis/visitor-utils.js +180 -0
- package/dist/ast-analysis/visitor-utils.js.map +1 -0
- package/dist/ast-analysis/visitor.d.ts +119 -0
- package/dist/ast-analysis/visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitor.js +146 -0
- package/dist/ast-analysis/visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts +11 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js +147 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts +8 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js +660 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts +17 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js +216 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts +8 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js +321 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js.map +1 -0
- package/dist/cli/commands/ast.d.ts +9 -0
- package/dist/cli/commands/ast.d.ts.map +1 -0
- package/dist/cli/commands/ast.js +23 -0
- package/dist/cli/commands/ast.js.map +1 -0
- package/dist/cli/commands/audit.d.ts +9 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +46 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +9 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +70 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/branch-compare.d.ts +7 -0
- package/dist/cli/commands/branch-compare.d.ts.map +1 -0
- package/dist/cli/commands/branch-compare.js +22 -0
- package/dist/cli/commands/branch-compare.js.map +1 -0
- package/dist/cli/commands/brief.d.ts +7 -0
- package/dist/cli/commands/brief.d.ts.map +1 -0
- package/dist/cli/commands/brief.js +12 -0
- package/dist/cli/commands/brief.js.map +1 -0
- package/dist/cli/commands/build.d.ts +7 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +26 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/cfg.d.ts +10 -0
- package/dist/cli/commands/cfg.d.ts.map +1 -0
- package/dist/cli/commands/cfg.js +27 -0
- package/dist/cli/commands/cfg.js.map +1 -0
- package/dist/cli/commands/check.d.ts +8 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +65 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/children.d.ts +9 -0
- package/dist/cli/commands/children.d.ts.map +1 -0
- package/dist/cli/commands/children.js +33 -0
- package/dist/cli/commands/children.js.map +1 -0
- package/dist/cli/commands/co-change.d.ts +7 -0
- package/dist/cli/commands/co-change.d.ts.map +1 -0
- package/dist/cli/commands/co-change.js +62 -0
- package/dist/cli/commands/co-change.js.map +1 -0
- package/dist/cli/commands/communities.d.ts +8 -0
- package/dist/cli/commands/communities.d.ts.map +1 -0
- package/dist/cli/commands/communities.js +20 -0
- package/dist/cli/commands/communities.js.map +1 -0
- package/dist/cli/commands/complexity.d.ts +9 -0
- package/dist/cli/commands/complexity.d.ts.map +1 -0
- package/dist/cli/commands/complexity.js +47 -0
- package/dist/cli/commands/complexity.js.map +1 -0
- package/dist/cli/commands/context.d.ts +10 -0
- package/dist/cli/commands/context.d.ts.map +1 -0
- package/dist/cli/commands/context.js +35 -0
- package/dist/cli/commands/context.js.map +1 -0
- package/dist/cli/commands/cycles.d.ts +7 -0
- package/dist/cli/commands/cycles.d.ts.map +1 -0
- package/dist/cli/commands/cycles.js +33 -0
- package/dist/cli/commands/cycles.js.map +1 -0
- package/dist/cli/commands/dataflow.d.ts +10 -0
- package/dist/cli/commands/dataflow.d.ts.map +1 -0
- package/dist/cli/commands/dataflow.js +29 -0
- package/dist/cli/commands/dataflow.js.map +1 -0
- package/dist/cli/commands/deps.d.ts +8 -0
- package/dist/cli/commands/deps.d.ts.map +1 -0
- package/dist/cli/commands/deps.js +18 -0
- package/dist/cli/commands/deps.js.map +1 -0
- package/dist/cli/commands/diff-impact.d.ts +7 -0
- package/dist/cli/commands/diff-impact.d.ts.map +1 -0
- package/dist/cli/commands/diff-impact.js +28 -0
- package/dist/cli/commands/diff-impact.js.map +1 -0
- package/dist/cli/commands/embed.d.ts +8 -0
- package/dist/cli/commands/embed.d.ts.map +1 -0
- package/dist/cli/commands/embed.js +29 -0
- package/dist/cli/commands/embed.js.map +1 -0
- package/dist/cli/commands/export.d.ts +7 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +72 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/exports.d.ts +8 -0
- package/dist/cli/commands/exports.d.ts.map +1 -0
- package/dist/cli/commands/exports.js +14 -0
- package/dist/cli/commands/exports.js.map +1 -0
- package/dist/cli/commands/flow.d.ts +10 -0
- package/dist/cli/commands/flow.d.ts.map +1 -0
- package/dist/cli/commands/flow.js +32 -0
- package/dist/cli/commands/flow.js.map +1 -0
- package/dist/cli/commands/fn-impact.d.ts +10 -0
- package/dist/cli/commands/fn-impact.d.ts.map +1 -0
- package/dist/cli/commands/fn-impact.js +33 -0
- package/dist/cli/commands/fn-impact.js.map +1 -0
- package/dist/cli/commands/impact.d.ts +7 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +12 -0
- package/dist/cli/commands/impact.js.map +1 -0
- package/dist/cli/commands/implementations.d.ts +10 -0
- package/dist/cli/commands/implementations.d.ts.map +1 -0
- package/dist/cli/commands/implementations.js +29 -0
- package/dist/cli/commands/implementations.js.map +1 -0
- package/dist/cli/commands/info.d.ts +6 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +66 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/interfaces.d.ts +10 -0
- package/dist/cli/commands/interfaces.d.ts.map +1 -0
- package/dist/cli/commands/interfaces.js +29 -0
- package/dist/cli/commands/interfaces.js.map +1 -0
- package/dist/cli/commands/map.d.ts +7 -0
- package/dist/cli/commands/map.d.ts.map +1 -0
- package/dist/cli/commands/map.js +19 -0
- package/dist/cli/commands/map.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +7 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +19 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/models.d.ts +6 -0
- package/dist/cli/commands/models.d.ts.map +1 -0
- package/dist/cli/commands/models.js +17 -0
- package/dist/cli/commands/models.js.map +1 -0
- package/dist/cli/commands/owners.d.ts +8 -0
- package/dist/cli/commands/owners.d.ts.map +1 -0
- package/dist/cli/commands/owners.js +27 -0
- package/dist/cli/commands/owners.js.map +1 -0
- package/dist/cli/commands/path.d.ts +8 -0
- package/dist/cli/commands/path.d.ts.map +1 -0
- package/dist/cli/commands/path.js +36 -0
- package/dist/cli/commands/path.js.map +1 -0
- package/dist/cli/commands/plot.d.ts +7 -0
- package/dist/cli/commands/plot.d.ts.map +1 -0
- package/dist/cli/commands/plot.js +94 -0
- package/dist/cli/commands/plot.js.map +1 -0
- package/dist/cli/commands/query.d.ts +10 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +51 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/registry.d.ts +16 -0
- package/dist/cli/commands/registry.d.ts.map +1 -0
- package/dist/cli/commands/registry.js +95 -0
- package/dist/cli/commands/registry.js.map +1 -0
- package/dist/cli/commands/roles.d.ts +9 -0
- package/dist/cli/commands/roles.d.ts.map +1 -0
- package/dist/cli/commands/roles.js +31 -0
- package/dist/cli/commands/roles.js.map +1 -0
- package/dist/cli/commands/search.d.ts +9 -0
- package/dist/cli/commands/search.d.ts.map +1 -0
- package/dist/cli/commands/search.js +47 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/commands/sequence.d.ts +10 -0
- package/dist/cli/commands/sequence.d.ts.map +1 -0
- package/dist/cli/commands/sequence.js +29 -0
- package/dist/cli/commands/sequence.js.map +1 -0
- package/dist/cli/commands/snapshot.d.ts +11 -0
- package/dist/cli/commands/snapshot.d.ts.map +1 -0
- package/dist/cli/commands/snapshot.js +61 -0
- package/dist/cli/commands/snapshot.js.map +1 -0
- package/dist/cli/commands/stats.d.ts +7 -0
- package/dist/cli/commands/stats.d.ts.map +1 -0
- package/dist/cli/commands/stats.js +15 -0
- package/dist/cli/commands/stats.js.map +1 -0
- package/dist/cli/commands/structure.d.ts +7 -0
- package/dist/cli/commands/structure.d.ts.map +1 -0
- package/dist/cli/commands/structure.js +33 -0
- package/dist/cli/commands/structure.js.map +1 -0
- package/dist/cli/commands/triage.d.ts +8 -0
- package/dist/cli/commands/triage.d.ts.map +1 -0
- package/dist/cli/commands/triage.js +89 -0
- package/dist/cli/commands/triage.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +6 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +12 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/commands/where.d.ts +9 -0
- package/dist/cli/commands/where.d.ts.map +1 -0
- package/dist/cli/commands/where.js +20 -0
- package/dist/cli/commands/where.js.map +1 -0
- package/dist/cli/index.d.ts +31 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +109 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/shared/open-graph.d.ts +14 -0
- package/dist/cli/shared/open-graph.d.ts.map +1 -0
- package/dist/cli/shared/open-graph.js +13 -0
- package/dist/cli/shared/open-graph.js.map +1 -0
- package/dist/cli/shared/options.d.ts +31 -0
- package/dist/cli/shared/options.d.ts.map +1 -0
- package/dist/cli/shared/options.js +58 -0
- package/dist/cli/shared/options.js.map +1 -0
- package/dist/cli/shared/output.d.ts +2 -0
- package/dist/cli/shared/output.d.ts.map +1 -0
- package/dist/cli/shared/output.js +2 -0
- package/dist/cli/shared/output.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +15 -0
- package/dist/cli.js.map +1 -0
- package/dist/db/connection.d.ts +39 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +217 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/index.d.ts +5 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +6 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +8 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +323 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/query-builder.d.ts +106 -0
- package/dist/db/query-builder.d.ts.map +1 -0
- package/dist/db/query-builder.js +313 -0
- package/dist/db/query-builder.js.map +1 -0
- package/dist/db/repository/base.d.ts +115 -0
- package/dist/db/repository/base.d.ts.map +1 -0
- package/dist/db/repository/base.js +165 -0
- package/dist/db/repository/base.js.map +1 -0
- package/dist/db/repository/build-stmts.d.ts +25 -0
- package/dist/db/repository/build-stmts.d.ts.map +1 -0
- package/dist/db/repository/build-stmts.js +86 -0
- package/dist/db/repository/build-stmts.js.map +1 -0
- package/dist/db/repository/cached-stmt.d.ts +13 -0
- package/dist/db/repository/cached-stmt.d.ts.map +1 -0
- package/dist/db/repository/cached-stmt.js +20 -0
- package/dist/db/repository/cached-stmt.js.map +1 -0
- package/dist/db/repository/cfg.d.ts +27 -0
- package/dist/db/repository/cfg.d.ts.map +1 -0
- package/dist/db/repository/cfg.js +57 -0
- package/dist/db/repository/cfg.js.map +1 -0
- package/dist/db/repository/cochange.d.ts +20 -0
- package/dist/db/repository/cochange.d.ts.map +1 -0
- package/dist/db/repository/cochange.js +45 -0
- package/dist/db/repository/cochange.js.map +1 -0
- package/dist/db/repository/complexity.d.ts +15 -0
- package/dist/db/repository/complexity.d.ts.map +1 -0
- package/dist/db/repository/complexity.js +15 -0
- package/dist/db/repository/complexity.js.map +1 -0
- package/dist/db/repository/dataflow.d.ts +7 -0
- package/dist/db/repository/dataflow.d.ts.map +1 -0
- package/dist/db/repository/dataflow.js +17 -0
- package/dist/db/repository/dataflow.js.map +1 -0
- package/dist/db/repository/edges.d.ts +173 -0
- package/dist/db/repository/edges.d.ts.map +1 -0
- package/dist/db/repository/edges.js +231 -0
- package/dist/db/repository/edges.js.map +1 -0
- package/dist/db/repository/embeddings.d.ts +20 -0
- package/dist/db/repository/embeddings.d.ts.map +1 -0
- package/dist/db/repository/embeddings.js +47 -0
- package/dist/db/repository/embeddings.js.map +1 -0
- package/dist/db/repository/graph-read.d.ts +41 -0
- package/dist/db/repository/graph-read.d.ts.map +1 -0
- package/dist/db/repository/graph-read.js +41 -0
- package/dist/db/repository/graph-read.js.map +1 -0
- package/dist/db/repository/in-memory-repository.d.ts +156 -0
- package/dist/db/repository/in-memory-repository.d.ts.map +1 -0
- package/dist/db/repository/in-memory-repository.js +533 -0
- package/dist/db/repository/in-memory-repository.js.map +1 -0
- package/dist/db/repository/index.d.ts +14 -0
- package/dist/db/repository/index.d.ts.map +1 -0
- package/dist/db/repository/index.js +15 -0
- package/dist/db/repository/index.js.map +1 -0
- package/dist/db/repository/nodes.d.ts +151 -0
- package/dist/db/repository/nodes.d.ts.map +1 -0
- package/dist/db/repository/nodes.js +244 -0
- package/dist/db/repository/nodes.js.map +1 -0
- package/dist/db/repository/sqlite-repository.d.ts +100 -0
- package/dist/db/repository/sqlite-repository.d.ts.map +1 -0
- package/dist/db/repository/sqlite-repository.js +143 -0
- package/dist/db/repository/sqlite-repository.js.map +1 -0
- package/dist/domain/analysis/brief.d.ts +16 -0
- package/dist/domain/analysis/brief.d.ts.map +1 -0
- package/dist/domain/analysis/brief.js +147 -0
- package/dist/domain/analysis/brief.js.map +1 -0
- package/dist/domain/analysis/context.d.ts +3 -0
- package/dist/domain/analysis/context.d.ts.map +1 -0
- package/dist/domain/analysis/context.js +378 -0
- package/dist/domain/analysis/context.js.map +1 -0
- package/dist/domain/analysis/dependencies.d.ts +60 -0
- package/dist/domain/analysis/dependencies.d.ts.map +1 -0
- package/dist/domain/analysis/dependencies.js +359 -0
- package/dist/domain/analysis/dependencies.js.map +1 -0
- package/dist/domain/analysis/exports.d.ts +2 -0
- package/dist/domain/analysis/exports.d.ts.map +1 -0
- package/dist/domain/analysis/exports.js +168 -0
- package/dist/domain/analysis/exports.js.map +1 -0
- package/dist/domain/analysis/impact.d.ts +39 -0
- package/dist/domain/analysis/impact.d.ts.map +1 -0
- package/dist/domain/analysis/impact.js +596 -0
- package/dist/domain/analysis/impact.js.map +1 -0
- package/dist/domain/analysis/implementations.d.ts +59 -0
- package/dist/domain/analysis/implementations.d.ts.map +1 -0
- package/dist/domain/analysis/implementations.js +93 -0
- package/dist/domain/analysis/implementations.js.map +1 -0
- package/dist/domain/analysis/module-map.d.ts +64 -0
- package/dist/domain/analysis/module-map.d.ts.map +1 -0
- package/dist/domain/analysis/module-map.js +334 -0
- package/dist/domain/analysis/module-map.js.map +1 -0
- package/dist/domain/analysis/roles.d.ts +2 -0
- package/dist/domain/analysis/roles.d.ts.map +1 -0
- package/dist/domain/analysis/roles.js +50 -0
- package/dist/domain/analysis/roles.js.map +1 -0
- package/dist/domain/analysis/symbol-lookup.d.ts +12 -0
- package/dist/domain/analysis/symbol-lookup.d.ts.map +1 -0
- package/dist/domain/analysis/symbol-lookup.js +202 -0
- package/dist/domain/analysis/symbol-lookup.js.map +1 -0
- package/dist/domain/graph/builder/context.d.ts +91 -0
- package/dist/domain/graph/builder/context.d.ts.map +1 -0
- package/dist/domain/graph/builder/context.js +78 -0
- package/dist/domain/graph/builder/context.js.map +1 -0
- package/dist/domain/graph/builder/helpers.d.ts +43 -0
- package/dist/domain/graph/builder/helpers.d.ts.map +1 -0
- package/dist/domain/graph/builder/helpers.js +209 -0
- package/dist/domain/graph/builder/helpers.js.map +1 -0
- package/dist/domain/graph/builder/incremental.d.ts +17 -0
- package/dist/domain/graph/builder/incremental.d.ts.map +1 -0
- package/dist/domain/graph/builder/incremental.js +191 -0
- package/dist/domain/graph/builder/incremental.js.map +1 -0
- package/dist/domain/graph/builder/pipeline.d.ts +13 -0
- package/dist/domain/graph/builder/pipeline.d.ts.map +1 -0
- package/dist/domain/graph/builder/pipeline.js +146 -0
- package/dist/domain/graph/builder/pipeline.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts +5 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.js +387 -0
- package/dist/domain/graph/builder/stages/build-edges.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts +5 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.js +107 -0
- package/dist/domain/graph/builder/stages/build-structure.js.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts +5 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.js +45 -0
- package/dist/domain/graph/builder/stages/collect-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts +5 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.js +358 -0
- package/dist/domain/graph/builder/stages/detect-changes.js.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts +5 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.js +123 -0
- package/dist/domain/graph/builder/stages/finalize.js.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts +5 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js +183 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts +5 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.js +25 -0
- package/dist/domain/graph/builder/stages/parse-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts +18 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js +139 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts +5 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.js +39 -0
- package/dist/domain/graph/builder/stages/run-analyses.js.map +1 -0
- package/dist/domain/graph/builder.d.ts +4 -0
- package/dist/domain/graph/builder.d.ts.map +1 -0
- package/dist/domain/graph/builder.js +6 -0
- package/dist/domain/graph/builder.js.map +1 -0
- package/dist/domain/graph/change-journal.d.ts +57 -0
- package/dist/domain/graph/change-journal.d.ts.map +1 -0
- package/dist/domain/graph/change-journal.js +120 -0
- package/dist/domain/graph/change-journal.js.map +1 -0
- package/dist/domain/graph/cycles.d.ts +18 -0
- package/dist/domain/graph/cycles.d.ts.map +1 -0
- package/dist/domain/graph/cycles.js +75 -0
- package/dist/domain/graph/cycles.js.map +1 -0
- package/dist/domain/graph/journal.d.ts +27 -0
- package/dist/domain/graph/journal.d.ts.map +1 -0
- package/dist/domain/graph/journal.js +100 -0
- package/dist/domain/graph/journal.js.map +1 -0
- package/dist/domain/graph/resolve.d.ts +76 -0
- package/dist/domain/graph/resolve.d.ts.map +1 -0
- package/dist/domain/graph/resolve.js +482 -0
- package/dist/domain/graph/resolve.js.map +1 -0
- package/dist/domain/graph/watcher.d.ts +2 -0
- package/dist/domain/graph/watcher.d.ts.map +1 -0
- package/dist/domain/graph/watcher.js +140 -0
- package/dist/domain/graph/watcher.js.map +1 -0
- package/dist/domain/parser.d.ts +104 -0
- package/dist/domain/parser.d.ts.map +1 -0
- package/dist/domain/parser.js +557 -0
- package/dist/domain/parser.js.map +1 -0
- package/dist/domain/queries.d.ts +14 -0
- package/dist/domain/queries.d.ts.map +1 -0
- package/dist/domain/queries.js +25 -0
- package/dist/domain/queries.js.map +1 -0
- package/dist/domain/search/generator.d.ts +17 -0
- package/dist/domain/search/generator.d.ts.map +1 -0
- package/dist/domain/search/generator.js +135 -0
- package/dist/domain/search/generator.js.map +1 -0
- package/dist/domain/search/index.d.ts +8 -0
- package/dist/domain/search/index.d.ts.map +1 -0
- package/dist/domain/search/index.js +13 -0
- package/dist/domain/search/index.js.map +1 -0
- package/dist/domain/search/models.d.ts +82 -0
- package/dist/domain/search/models.d.ts.map +1 -0
- package/dist/domain/search/models.js +198 -0
- package/dist/domain/search/models.js.map +1 -0
- package/dist/domain/search/search/cli-formatter.d.ts +6 -0
- package/dist/domain/search/search/cli-formatter.d.ts.map +1 -0
- package/dist/domain/search/search/cli-formatter.js +135 -0
- package/dist/domain/search/search/cli-formatter.js.map +1 -0
- package/dist/domain/search/search/filters.d.ts +19 -0
- package/dist/domain/search/search/filters.d.ts.map +1 -0
- package/dist/domain/search/search/filters.js +48 -0
- package/dist/domain/search/search/filters.js.map +1 -0
- package/dist/domain/search/search/hybrid.d.ts +22 -0
- package/dist/domain/search/search/hybrid.d.ts.map +1 -0
- package/dist/domain/search/search/hybrid.js +113 -0
- package/dist/domain/search/search/hybrid.js.map +1 -0
- package/dist/domain/search/search/keyword.d.ts +17 -0
- package/dist/domain/search/search/keyword.d.ts.map +1 -0
- package/dist/domain/search/search/keyword.js +66 -0
- package/dist/domain/search/search/keyword.js.map +1 -0
- package/dist/domain/search/search/prepare.d.ts +13 -0
- package/dist/domain/search/search/prepare.d.ts.map +1 -0
- package/dist/domain/search/search/prepare.js +70 -0
- package/dist/domain/search/search/prepare.js.map +1 -0
- package/dist/domain/search/search/semantic.d.ts +34 -0
- package/dist/domain/search/search/semantic.d.ts.map +1 -0
- package/dist/domain/search/search/semantic.js +129 -0
- package/dist/domain/search/search/semantic.js.map +1 -0
- package/dist/domain/search/stores/fts5.d.ts +11 -0
- package/dist/domain/search/stores/fts5.d.ts.map +1 -0
- package/dist/domain/search/stores/fts5.js +31 -0
- package/dist/domain/search/stores/fts5.js.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts +27 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.js +22 -0
- package/dist/domain/search/stores/sqlite-blob.js.map +1 -0
- package/dist/domain/search/strategies/source.d.ts +5 -0
- package/dist/domain/search/strategies/source.d.ts.map +1 -0
- package/dist/domain/search/strategies/source.js +14 -0
- package/dist/domain/search/strategies/source.js.map +1 -0
- package/dist/domain/search/strategies/structured.d.ts +6 -0
- package/dist/domain/search/strategies/structured.d.ts.map +1 -0
- package/dist/domain/search/strategies/structured.js +40 -0
- package/dist/domain/search/strategies/structured.js.map +1 -0
- package/dist/domain/search/strategies/text-utils.d.ts +11 -0
- package/dist/domain/search/strategies/text-utils.d.ts.map +1 -0
- package/dist/domain/search/strategies/text-utils.js +47 -0
- package/dist/domain/search/strategies/text-utils.js.map +1 -0
- package/dist/extractors/csharp.d.ts +12 -0
- package/dist/extractors/csharp.d.ts.map +1 -0
- package/dist/extractors/csharp.js +402 -0
- package/dist/extractors/csharp.js.map +1 -0
- package/dist/extractors/go.d.ts +12 -0
- package/dist/extractors/go.d.ts.map +1 -0
- package/dist/extractors/go.js +381 -0
- package/dist/extractors/go.js.map +1 -0
- package/dist/extractors/hcl.d.ts +11 -0
- package/dist/extractors/hcl.d.ts.map +1 -0
- package/dist/extractors/hcl.js +105 -0
- package/dist/extractors/hcl.js.map +1 -0
- package/dist/extractors/helpers.d.ts +16 -0
- package/dist/extractors/helpers.d.ts.map +1 -0
- package/dist/extractors/helpers.js +88 -0
- package/dist/extractors/helpers.js.map +1 -0
- package/dist/extractors/index.d.ts +10 -0
- package/dist/extractors/index.d.ts.map +1 -0
- package/dist/extractors/index.js +10 -0
- package/dist/extractors/index.js.map +1 -0
- package/dist/extractors/java.d.ts +12 -0
- package/dist/extractors/java.d.ts.map +1 -0
- package/dist/extractors/java.js +325 -0
- package/dist/extractors/java.js.map +1 -0
- package/dist/extractors/javascript.d.ts +81 -0
- package/dist/extractors/javascript.d.ts.map +1 -0
- package/dist/extractors/javascript.js +1232 -0
- package/dist/extractors/javascript.js.map +1 -0
- package/dist/extractors/php.d.ts +12 -0
- package/dist/extractors/php.d.ts.map +1 -0
- package/dist/extractors/php.js +380 -0
- package/dist/extractors/php.js.map +1 -0
- package/dist/extractors/python.d.ts +12 -0
- package/dist/extractors/python.d.ts.map +1 -0
- package/dist/extractors/python.js +426 -0
- package/dist/extractors/python.js.map +1 -0
- package/dist/extractors/ruby.d.ts +11 -0
- package/dist/extractors/ruby.d.ts.map +1 -0
- package/dist/extractors/ruby.js +284 -0
- package/dist/extractors/ruby.js.map +1 -0
- package/dist/extractors/rust.d.ts +12 -0
- package/dist/extractors/rust.d.ts.map +1 -0
- package/dist/extractors/rust.js +366 -0
- package/dist/extractors/rust.js.map +1 -0
- package/dist/features/ast.d.ts +30 -0
- package/dist/features/ast.d.ts.map +1 -0
- package/dist/features/ast.js +242 -0
- package/dist/features/ast.js.map +1 -0
- package/dist/features/audit.d.ts +6 -0
- package/dist/features/audit.d.ts.map +1 -0
- package/dist/features/audit.js +283 -0
- package/dist/features/audit.js.map +1 -0
- package/dist/features/batch.d.ts +110 -0
- package/dist/features/batch.d.ts.map +1 -0
- package/dist/features/batch.js +138 -0
- package/dist/features/batch.js.map +1 -0
- package/dist/features/boundaries.d.ts +69 -0
- package/dist/features/boundaries.d.ts.map +1 -0
- package/dist/features/boundaries.js +344 -0
- package/dist/features/boundaries.js.map +1 -0
- package/dist/features/branch-compare.d.ts +52 -0
- package/dist/features/branch-compare.d.ts.map +1 -0
- package/dist/features/branch-compare.js +425 -0
- package/dist/features/branch-compare.js.map +1 -0
- package/dist/features/cfg.d.ts +51 -0
- package/dist/features/cfg.d.ts.map +1 -0
- package/dist/features/cfg.js +372 -0
- package/dist/features/cfg.js.map +1 -0
- package/dist/features/check.d.ts +99 -0
- package/dist/features/check.d.ts.map +1 -0
- package/dist/features/check.js +296 -0
- package/dist/features/check.js.map +1 -0
- package/dist/features/cochange.d.ts +119 -0
- package/dist/features/cochange.d.ts.map +1 -0
- package/dist/features/cochange.js +425 -0
- package/dist/features/cochange.js.map +1 -0
- package/dist/features/communities.d.ts +40 -0
- package/dist/features/communities.d.ts.map +1 -0
- package/dist/features/communities.js +163 -0
- package/dist/features/communities.js.map +1 -0
- package/dist/features/complexity.d.ts +127 -0
- package/dist/features/complexity.d.ts.map +1 -0
- package/dist/features/complexity.js +683 -0
- package/dist/features/complexity.js.map +1 -0
- package/dist/features/dataflow.d.ts +72 -0
- package/dist/features/dataflow.d.ts.map +1 -0
- package/dist/features/dataflow.js +483 -0
- package/dist/features/dataflow.js.map +1 -0
- package/dist/features/export.d.ts +29 -0
- package/dist/features/export.d.ts.map +1 -0
- package/dist/features/export.js +336 -0
- package/dist/features/export.js.map +1 -0
- package/dist/features/flow.d.ts +49 -0
- package/dist/features/flow.d.ts.map +1 -0
- package/dist/features/flow.js +203 -0
- package/dist/features/flow.js.map +1 -0
- package/dist/features/graph-enrichment.d.ts +54 -0
- package/dist/features/graph-enrichment.d.ts.map +1 -0
- package/dist/features/graph-enrichment.js +297 -0
- package/dist/features/graph-enrichment.js.map +1 -0
- package/dist/features/manifesto.d.ts +46 -0
- package/dist/features/manifesto.d.ts.map +1 -0
- package/dist/features/manifesto.js +398 -0
- package/dist/features/manifesto.js.map +1 -0
- package/dist/features/owners.d.ts +123 -0
- package/dist/features/owners.d.ts.map +1 -0
- package/dist/features/owners.js +289 -0
- package/dist/features/owners.js.map +1 -0
- package/dist/features/sequence.d.ts +33 -0
- package/dist/features/sequence.d.ts.map +1 -0
- package/dist/features/sequence.js +269 -0
- package/dist/features/sequence.js.map +1 -0
- package/dist/features/shared/find-nodes.d.ts +11 -0
- package/dist/features/shared/find-nodes.d.ts.map +1 -0
- package/dist/features/shared/find-nodes.js +27 -0
- package/dist/features/shared/find-nodes.js.map +1 -0
- package/dist/features/snapshot.d.ts +64 -0
- package/dist/features/snapshot.d.ts.map +1 -0
- package/dist/features/snapshot.js +132 -0
- package/dist/features/snapshot.js.map +1 -0
- package/dist/features/structure.d.ts +42 -0
- package/dist/features/structure.d.ts.map +1 -0
- package/dist/features/structure.js +596 -0
- package/dist/features/structure.js.map +1 -0
- package/dist/features/triage.d.ts +13 -0
- package/dist/features/triage.d.ts.map +1 -0
- package/dist/features/triage.js +133 -0
- package/dist/features/triage.js.map +1 -0
- package/dist/graph/algorithms/bfs.d.ts +13 -0
- package/dist/graph/algorithms/bfs.d.ts.map +1 -0
- package/dist/graph/algorithms/bfs.js +47 -0
- package/dist/graph/algorithms/bfs.js.map +1 -0
- package/dist/graph/algorithms/centrality.d.ts +11 -0
- package/dist/graph/algorithms/centrality.d.ts.map +1 -0
- package/dist/graph/algorithms/centrality.js +17 -0
- package/dist/graph/algorithms/centrality.js.map +1 -0
- package/dist/graph/algorithms/index.d.ts +6 -0
- package/dist/graph/algorithms/index.d.ts.map +1 -0
- package/dist/graph/algorithms/index.js +6 -0
- package/dist/graph/algorithms/index.js.map +1 -0
- package/dist/graph/algorithms/louvain.d.ts +5 -0
- package/dist/graph/algorithms/louvain.d.ts.map +1 -0
- package/dist/graph/algorithms/louvain.js +22 -0
- package/dist/graph/algorithms/louvain.js.map +1 -0
- package/dist/graph/algorithms/shortest-path.d.ts +10 -0
- package/dist/graph/algorithms/shortest-path.d.ts.map +1 -0
- package/dist/graph/algorithms/shortest-path.js +41 -0
- package/dist/graph/algorithms/shortest-path.js.map +1 -0
- package/dist/graph/algorithms/tarjan.d.ts +9 -0
- package/dist/graph/algorithms/tarjan.d.ts.map +1 -0
- package/dist/graph/algorithms/tarjan.js +48 -0
- package/dist/graph/algorithms/tarjan.js.map +1 -0
- package/dist/graph/builders/dependency.d.ts +15 -0
- package/dist/graph/builders/dependency.d.ts.map +1 -0
- package/dist/graph/builders/dependency.js +99 -0
- package/dist/graph/builders/dependency.js.map +1 -0
- package/dist/graph/builders/index.d.ts +4 -0
- package/dist/graph/builders/index.d.ts.map +1 -0
- package/dist/graph/builders/index.js +4 -0
- package/dist/graph/builders/index.js.map +1 -0
- package/dist/graph/builders/structure.d.ts +7 -0
- package/dist/graph/builders/structure.d.ts.map +1 -0
- package/dist/graph/builders/structure.js +32 -0
- package/dist/graph/builders/structure.js.map +1 -0
- package/dist/graph/builders/temporal.d.ts +10 -0
- package/dist/graph/builders/temporal.d.ts.map +1 -0
- package/dist/graph/builders/temporal.js +31 -0
- package/dist/graph/builders/temporal.js.map +1 -0
- package/dist/graph/classifiers/index.d.ts +3 -0
- package/dist/graph/classifiers/index.d.ts.map +1 -0
- package/dist/graph/classifiers/index.js +3 -0
- package/dist/graph/classifiers/index.js.map +1 -0
- package/dist/graph/classifiers/risk.d.ts +49 -0
- package/dist/graph/classifiers/risk.d.ts.map +1 -0
- package/dist/graph/classifiers/risk.js +84 -0
- package/dist/graph/classifiers/risk.js.map +1 -0
- package/dist/graph/classifiers/roles.d.ts +29 -0
- package/dist/graph/classifiers/roles.d.ts.map +1 -0
- package/dist/graph/classifiers/roles.js +109 -0
- package/dist/graph/classifiers/roles.js.map +1 -0
- package/dist/graph/index.d.ts +5 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +6 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/model.d.ts +53 -0
- package/dist/graph/model.d.ts.map +1 -0
- package/dist/graph/model.js +210 -0
- package/dist/graph/model.js.map +1 -0
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/config.d.ts +222 -0
- package/dist/infrastructure/config.d.ts.map +1 -0
- package/dist/infrastructure/config.js +386 -0
- package/dist/infrastructure/config.js.map +1 -0
- package/dist/infrastructure/logger.d.ts +7 -0
- package/dist/infrastructure/logger.d.ts.map +1 -0
- package/dist/infrastructure/logger.js +21 -0
- package/dist/infrastructure/logger.js.map +1 -0
- package/dist/infrastructure/native.d.ts +19 -0
- package/dist/infrastructure/native.d.ts.map +1 -0
- package/dist/infrastructure/native.js +105 -0
- package/dist/infrastructure/native.js.map +1 -0
- package/dist/infrastructure/registry.d.ts +57 -0
- package/dist/infrastructure/registry.d.ts.map +1 -0
- package/dist/infrastructure/registry.js +157 -0
- package/dist/infrastructure/registry.js.map +1 -0
- package/dist/infrastructure/result-formatter.d.ts +2 -0
- package/dist/infrastructure/result-formatter.d.ts.map +1 -0
- package/dist/infrastructure/result-formatter.js +3 -0
- package/dist/infrastructure/result-formatter.js.map +1 -0
- package/dist/infrastructure/test-filter.d.ts +5 -0
- package/dist/infrastructure/test-filter.d.ts.map +1 -0
- package/dist/infrastructure/test-filter.js +7 -0
- package/dist/infrastructure/test-filter.js.map +1 -0
- package/dist/infrastructure/update-check.d.ts +24 -0
- package/dist/infrastructure/update-check.d.ts.map +1 -0
- package/dist/infrastructure/update-check.js +150 -0
- package/dist/infrastructure/update-check.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/middleware.d.ts +26 -0
- package/dist/mcp/middleware.d.ts.map +1 -0
- package/dist/mcp/middleware.js +38 -0
- package/dist/mcp/middleware.js.map +1 -0
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +120 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-registry.d.ts +8 -0
- package/dist/mcp/tool-registry.d.ts.map +1 -0
- package/dist/mcp/tool-registry.js +819 -0
- package/dist/mcp/tool-registry.js.map +1 -0
- package/dist/mcp/tools/ast-query.d.ts +9 -0
- package/dist/mcp/tools/ast-query.d.ts.map +1 -0
- package/dist/mcp/tools/ast-query.js +13 -0
- package/dist/mcp/tools/ast-query.js.map +1 -0
- package/dist/mcp/tools/audit.d.ts +3 -0
- package/dist/mcp/tools/audit.d.ts.map +1 -0
- package/dist/mcp/tools/audit.js +20 -0
- package/dist/mcp/tools/audit.js.map +1 -0
- package/dist/mcp/tools/batch-query.d.ts +9 -0
- package/dist/mcp/tools/batch-query.d.ts.map +1 -0
- package/dist/mcp/tools/batch-query.js +11 -0
- package/dist/mcp/tools/batch-query.js.map +1 -0
- package/dist/mcp/tools/branch-compare.d.ts +3 -0
- package/dist/mcp/tools/branch-compare.d.ts.map +1 -0
- package/dist/mcp/tools/branch-compare.js +10 -0
- package/dist/mcp/tools/branch-compare.js.map +1 -0
- package/dist/mcp/tools/brief.d.ts +3 -0
- package/dist/mcp/tools/brief.d.ts.map +1 -0
- package/dist/mcp/tools/brief.js +8 -0
- package/dist/mcp/tools/brief.js.map +1 -0
- package/dist/mcp/tools/cfg.d.ts +10 -0
- package/dist/mcp/tools/cfg.d.ts.map +1 -0
- package/dist/mcp/tools/cfg.js +20 -0
- package/dist/mcp/tools/cfg.js.map +1 -0
- package/dist/mcp/tools/check.d.ts +24 -0
- package/dist/mcp/tools/check.d.ts.map +1 -0
- package/dist/mcp/tools/check.js +39 -0
- package/dist/mcp/tools/check.js.map +1 -0
- package/dist/mcp/tools/co-changes.d.ts +10 -0
- package/dist/mcp/tools/co-changes.d.ts.map +1 -0
- package/dist/mcp/tools/co-changes.js +19 -0
- package/dist/mcp/tools/co-changes.js.map +1 -0
- package/dist/mcp/tools/code-owners.d.ts +48 -0
- package/dist/mcp/tools/code-owners.d.ts.map +1 -0
- package/dist/mcp/tools/code-owners.js +12 -0
- package/dist/mcp/tools/code-owners.js.map +1 -0
- package/dist/mcp/tools/communities.d.ts +8 -0
- package/dist/mcp/tools/communities.d.ts.map +1 -0
- package/dist/mcp/tools/communities.js +14 -0
- package/dist/mcp/tools/communities.js.map +1 -0
- package/dist/mcp/tools/complexity.d.ts +7 -0
- package/dist/mcp/tools/complexity.d.ts.map +1 -0
- package/dist/mcp/tools/complexity.js +17 -0
- package/dist/mcp/tools/complexity.js.map +1 -0
- package/dist/mcp/tools/context.d.ts +3 -0
- package/dist/mcp/tools/context.d.ts.map +1 -0
- package/dist/mcp/tools/context.js +16 -0
- package/dist/mcp/tools/context.js.map +1 -0
- package/dist/mcp/tools/dataflow.d.ts +6 -0
- package/dist/mcp/tools/dataflow.d.ts.map +1 -0
- package/dist/mcp/tools/dataflow.js +25 -0
- package/dist/mcp/tools/dataflow.js.map +1 -0
- package/dist/mcp/tools/diff-impact.d.ts +3 -0
- package/dist/mcp/tools/diff-impact.d.ts.map +1 -0
- package/dist/mcp/tools/diff-impact.js +23 -0
- package/dist/mcp/tools/diff-impact.js.map +1 -0
- package/dist/mcp/tools/execution-flow.d.ts +17 -0
- package/dist/mcp/tools/execution-flow.d.ts.map +1 -0
- package/dist/mcp/tools/execution-flow.js +25 -0
- package/dist/mcp/tools/execution-flow.js.map +1 -0
- package/dist/mcp/tools/export-graph.d.ts +3 -0
- package/dist/mcp/tools/export-graph.d.ts.map +1 -0
- package/dist/mcp/tools/export-graph.js +55 -0
- package/dist/mcp/tools/export-graph.js.map +1 -0
- package/dist/mcp/tools/file-deps.d.ts +3 -0
- package/dist/mcp/tools/file-deps.d.ts.map +1 -0
- package/dist/mcp/tools/file-deps.js +11 -0
- package/dist/mcp/tools/file-deps.js.map +1 -0
- package/dist/mcp/tools/file-exports.d.ts +3 -0
- package/dist/mcp/tools/file-exports.d.ts.map +1 -0
- package/dist/mcp/tools/file-exports.js +12 -0
- package/dist/mcp/tools/file-exports.js.map +1 -0
- package/dist/mcp/tools/find-cycles.d.ts +6 -0
- package/dist/mcp/tools/find-cycles.d.ts.map +1 -0
- package/dist/mcp/tools/find-cycles.js +15 -0
- package/dist/mcp/tools/find-cycles.js.map +1 -0
- package/dist/mcp/tools/fn-impact.d.ts +3 -0
- package/dist/mcp/tools/fn-impact.d.ts.map +1 -0
- package/dist/mcp/tools/fn-impact.js +14 -0
- package/dist/mcp/tools/fn-impact.js.map +1 -0
- package/dist/mcp/tools/impact-analysis.d.ts +3 -0
- package/dist/mcp/tools/impact-analysis.d.ts.map +1 -0
- package/dist/mcp/tools/impact-analysis.js +11 -0
- package/dist/mcp/tools/impact-analysis.js.map +1 -0
- package/dist/mcp/tools/implementations.d.ts +3 -0
- package/dist/mcp/tools/implementations.d.ts.map +1 -0
- package/dist/mcp/tools/implementations.js +13 -0
- package/dist/mcp/tools/implementations.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +3 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +76 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/interfaces.d.ts +3 -0
- package/dist/mcp/tools/interfaces.d.ts.map +1 -0
- package/dist/mcp/tools/interfaces.js +13 -0
- package/dist/mcp/tools/interfaces.js.map +1 -0
- package/dist/mcp/tools/list-functions.d.ts +3 -0
- package/dist/mcp/tools/list-functions.d.ts.map +1 -0
- package/dist/mcp/tools/list-functions.js +13 -0
- package/dist/mcp/tools/list-functions.js.map +1 -0
- package/dist/mcp/tools/list-repos.d.ts +11 -0
- package/dist/mcp/tools/list-repos.d.ts.map +1 -0
- package/dist/mcp/tools/list-repos.js +11 -0
- package/dist/mcp/tools/list-repos.js.map +1 -0
- package/dist/mcp/tools/module-map.d.ts +3 -0
- package/dist/mcp/tools/module-map.d.ts.map +1 -0
- package/dist/mcp/tools/module-map.js +6 -0
- package/dist/mcp/tools/module-map.js.map +1 -0
- package/dist/mcp/tools/node-roles.d.ts +3 -0
- package/dist/mcp/tools/node-roles.d.ts.map +1 -0
- package/dist/mcp/tools/node-roles.js +13 -0
- package/dist/mcp/tools/node-roles.js.map +1 -0
- package/dist/mcp/tools/path.d.ts +3 -0
- package/dist/mcp/tools/path.d.ts.map +1 -0
- package/dist/mcp/tools/path.js +12 -0
- package/dist/mcp/tools/path.js.map +1 -0
- package/dist/mcp/tools/query.d.ts +3 -0
- package/dist/mcp/tools/query.d.ts.map +1 -0
- package/dist/mcp/tools/query.js +29 -0
- package/dist/mcp/tools/query.js.map +1 -0
- package/dist/mcp/tools/semantic-search.d.ts +3 -0
- package/dist/mcp/tools/semantic-search.d.ts.map +1 -0
- package/dist/mcp/tools/semantic-search.js +61 -0
- package/dist/mcp/tools/semantic-search.js.map +1 -0
- package/dist/mcp/tools/sequence.d.ts +18 -0
- package/dist/mcp/tools/sequence.d.ts.map +1 -0
- package/dist/mcp/tools/sequence.js +16 -0
- package/dist/mcp/tools/sequence.js.map +1 -0
- package/dist/mcp/tools/structure.d.ts +3 -0
- package/dist/mcp/tools/structure.d.ts.map +1 -0
- package/dist/mcp/tools/structure.js +14 -0
- package/dist/mcp/tools/structure.js.map +1 -0
- package/dist/mcp/tools/symbol-children.d.ts +3 -0
- package/dist/mcp/tools/symbol-children.d.ts.map +1 -0
- package/dist/mcp/tools/symbol-children.js +13 -0
- package/dist/mcp/tools/symbol-children.js.map +1 -0
- package/dist/mcp/tools/triage.d.ts +3 -0
- package/dist/mcp/tools/triage.d.ts.map +1 -0
- package/dist/mcp/tools/triage.js +34 -0
- package/dist/mcp/tools/triage.js.map +1 -0
- package/dist/mcp/tools/where.d.ts +3 -0
- package/dist/mcp/tools/where.d.ts.map +1 -0
- package/dist/mcp/tools/where.js +12 -0
- package/dist/mcp/tools/where.js.map +1 -0
- package/dist/presentation/audit.d.ts +5 -0
- package/dist/presentation/audit.d.ts.map +1 -0
- package/dist/presentation/audit.js +77 -0
- package/dist/presentation/audit.js.map +1 -0
- package/dist/presentation/batch.d.ts +10 -0
- package/dist/presentation/batch.d.ts.map +1 -0
- package/dist/presentation/batch.js +25 -0
- package/dist/presentation/batch.js.map +1 -0
- package/dist/presentation/branch-compare.d.ts +2 -0
- package/dist/presentation/branch-compare.d.ts.map +1 -0
- package/dist/presentation/branch-compare.js +75 -0
- package/dist/presentation/branch-compare.js.map +1 -0
- package/dist/presentation/brief.d.ts +12 -0
- package/dist/presentation/brief.d.ts.map +1 -0
- package/dist/presentation/brief.js +49 -0
- package/dist/presentation/brief.js.map +1 -0
- package/dist/presentation/cfg.d.ts +5 -0
- package/dist/presentation/cfg.d.ts.map +1 -0
- package/dist/presentation/cfg.js +50 -0
- package/dist/presentation/cfg.js.map +1 -0
- package/dist/presentation/check.d.ts +5 -0
- package/dist/presentation/check.d.ts.map +1 -0
- package/dist/presentation/check.js +70 -0
- package/dist/presentation/check.js.map +1 -0
- package/dist/presentation/cochange.d.ts +9 -0
- package/dist/presentation/cochange.d.ts.map +1 -0
- package/dist/presentation/cochange.js +39 -0
- package/dist/presentation/cochange.js.map +1 -0
- package/dist/presentation/colors.d.ts +26 -0
- package/dist/presentation/colors.d.ts.map +1 -0
- package/dist/presentation/colors.js +42 -0
- package/dist/presentation/colors.js.map +1 -0
- package/dist/presentation/communities.d.ts +5 -0
- package/dist/presentation/communities.d.ts.map +1 -0
- package/dist/presentation/communities.js +56 -0
- package/dist/presentation/communities.js.map +1 -0
- package/dist/presentation/complexity.d.ts +5 -0
- package/dist/presentation/complexity.d.ts.map +1 -0
- package/dist/presentation/complexity.js +56 -0
- package/dist/presentation/complexity.js.map +1 -0
- package/dist/presentation/dataflow.d.ts +5 -0
- package/dist/presentation/dataflow.d.ts.map +1 -0
- package/dist/presentation/dataflow.js +96 -0
- package/dist/presentation/dataflow.js.map +1 -0
- package/dist/presentation/export.d.ts +137 -0
- package/dist/presentation/export.d.ts.map +1 -0
- package/dist/presentation/export.js +374 -0
- package/dist/presentation/export.js.map +1 -0
- package/dist/presentation/flow.d.ts +5 -0
- package/dist/presentation/flow.d.ts.map +1 -0
- package/dist/presentation/flow.js +64 -0
- package/dist/presentation/flow.js.map +1 -0
- package/dist/presentation/manifesto.d.ts +5 -0
- package/dist/presentation/manifesto.d.ts.map +1 -0
- package/dist/presentation/manifesto.js +56 -0
- package/dist/presentation/manifesto.js.map +1 -0
- package/dist/presentation/owners.d.ts +5 -0
- package/dist/presentation/owners.d.ts.map +1 -0
- package/dist/presentation/owners.js +45 -0
- package/dist/presentation/owners.js.map +1 -0
- package/dist/presentation/queries-cli/exports.d.ts +2 -0
- package/dist/presentation/queries-cli/exports.d.ts.map +1 -0
- package/dist/presentation/queries-cli/exports.js +94 -0
- package/dist/presentation/queries-cli/exports.js.map +1 -0
- package/dist/presentation/queries-cli/impact.d.ts +6 -0
- package/dist/presentation/queries-cli/impact.d.ts.map +1 -0
- package/dist/presentation/queries-cli/impact.js +196 -0
- package/dist/presentation/queries-cli/impact.js.map +1 -0
- package/dist/presentation/queries-cli/index.d.ts +6 -0
- package/dist/presentation/queries-cli/index.d.ts.map +1 -0
- package/dist/presentation/queries-cli/index.js +6 -0
- package/dist/presentation/queries-cli/index.js.map +1 -0
- package/dist/presentation/queries-cli/inspect.d.ts +8 -0
- package/dist/presentation/queries-cli/inspect.d.ts.map +1 -0
- package/dist/presentation/queries-cli/inspect.js +353 -0
- package/dist/presentation/queries-cli/inspect.js.map +1 -0
- package/dist/presentation/queries-cli/overview.d.ts +4 -0
- package/dist/presentation/queries-cli/overview.d.ts.map +1 -0
- package/dist/presentation/queries-cli/overview.js +163 -0
- package/dist/presentation/queries-cli/overview.js.map +1 -0
- package/dist/presentation/queries-cli/path.d.ts +2 -0
- package/dist/presentation/queries-cli/path.d.ts.map +1 -0
- package/dist/presentation/queries-cli/path.js +51 -0
- package/dist/presentation/queries-cli/path.js.map +1 -0
- package/dist/presentation/queries-cli.d.ts +2 -0
- package/dist/presentation/queries-cli.d.ts.map +1 -0
- package/dist/presentation/queries-cli.js +12 -0
- package/dist/presentation/queries-cli.js.map +1 -0
- package/dist/presentation/query.d.ts +2 -0
- package/dist/presentation/query.d.ts.map +1 -0
- package/dist/presentation/query.js +6 -0
- package/dist/presentation/query.js.map +1 -0
- package/dist/presentation/result-formatter.d.ts +10 -0
- package/dist/presentation/result-formatter.d.ts.map +1 -0
- package/dist/presentation/result-formatter.js +134 -0
- package/dist/presentation/result-formatter.js.map +1 -0
- package/dist/presentation/sequence-renderer.d.ts +12 -0
- package/dist/presentation/sequence-renderer.d.ts.map +1 -0
- package/dist/presentation/sequence-renderer.js +36 -0
- package/dist/presentation/sequence-renderer.js.map +1 -0
- package/dist/presentation/sequence.d.ts +5 -0
- package/dist/presentation/sequence.d.ts.map +1 -0
- package/dist/presentation/sequence.js +29 -0
- package/dist/presentation/sequence.js.map +1 -0
- package/dist/presentation/structure.d.ts +8 -0
- package/dist/presentation/structure.d.ts.map +1 -0
- package/dist/presentation/structure.js +50 -0
- package/dist/presentation/structure.js.map +1 -0
- package/dist/presentation/table.d.ts +28 -0
- package/dist/presentation/table.d.ts.map +1 -0
- package/dist/presentation/table.js +39 -0
- package/dist/presentation/table.js.map +1 -0
- package/dist/presentation/triage.d.ts +5 -0
- package/dist/presentation/triage.d.ts.map +1 -0
- package/dist/presentation/triage.js +37 -0
- package/dist/presentation/triage.js.map +1 -0
- package/dist/presentation/viewer.d.ts +85 -0
- package/dist/presentation/viewer.d.ts.map +1 -0
- package/dist/presentation/viewer.js +621 -0
- package/dist/presentation/viewer.js.map +1 -0
- package/dist/shared/constants.d.ts +11 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +35 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/errors.d.ts +47 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +69 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/file-utils.d.ts +14 -0
- package/dist/shared/file-utils.d.ts.map +1 -0
- package/dist/shared/file-utils.js +165 -0
- package/dist/shared/file-utils.js.map +1 -0
- package/dist/shared/generators.d.ts +62 -0
- package/dist/shared/generators.d.ts.map +1 -0
- package/dist/shared/generators.js +120 -0
- package/dist/shared/generators.js.map +1 -0
- package/dist/shared/hierarchy.d.ts +2 -0
- package/dist/shared/hierarchy.d.ts.map +1 -0
- package/dist/shared/hierarchy.js +27 -0
- package/dist/shared/hierarchy.js.map +1 -0
- package/dist/shared/kinds.d.ts +11 -0
- package/dist/shared/kinds.d.ts.map +1 -0
- package/dist/shared/kinds.js +56 -0
- package/dist/shared/kinds.js.map +1 -0
- package/dist/shared/normalize.d.ts +19 -0
- package/dist/shared/normalize.d.ts.map +1 -0
- package/dist/shared/normalize.js +59 -0
- package/dist/shared/normalize.js.map +1 -0
- package/dist/shared/paginate.d.ts +80 -0
- package/dist/shared/paginate.d.ts.map +1 -0
- package/dist/shared/paginate.js +111 -0
- package/dist/shared/paginate.js.map +1 -0
- package/dist/types.d.ts +1322 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/package.json +21 -15
- package/src/ast-analysis/engine.js +252 -258
- package/src/ast-analysis/shared.js +0 -12
- package/src/ast-analysis/visitors/cfg-visitor.js +635 -649
- package/src/ast-analysis/visitors/complexity-visitor.js +135 -139
- package/src/ast-analysis/visitors/dataflow-visitor.js +230 -224
- package/src/cli/commands/ast.js +2 -1
- package/src/cli/commands/audit.js +2 -1
- package/src/cli/commands/batch.js +2 -1
- package/src/cli/commands/brief.js +12 -0
- package/src/cli/commands/cfg.js +2 -1
- package/src/cli/commands/check.js +20 -23
- package/src/cli/commands/children.js +6 -1
- package/src/cli/commands/complexity.js +2 -1
- package/src/cli/commands/context.js +6 -1
- package/src/cli/commands/dataflow.js +2 -1
- package/src/cli/commands/deps.js +8 -3
- package/src/cli/commands/diff-impact.js +2 -0
- package/src/cli/commands/flow.js +2 -1
- package/src/cli/commands/fn-impact.js +8 -1
- package/src/cli/commands/implementations.js +29 -0
- package/src/cli/commands/info.js +1 -1
- package/src/cli/commands/interfaces.js +29 -0
- package/src/cli/commands/owners.js +4 -2
- package/src/cli/commands/query.js +6 -1
- package/src/cli/commands/roles.js +4 -2
- package/src/cli/commands/search.js +8 -2
- package/src/cli/commands/sequence.js +2 -1
- package/src/cli/commands/triage.js +42 -28
- package/src/db/connection.js +18 -12
- package/src/db/index.js +2 -0
- package/src/db/migrations.js +41 -64
- package/src/db/query-builder.js +69 -8
- package/src/db/repository/edges.js +38 -0
- package/src/db/repository/in-memory-repository.js +38 -18
- package/src/db/repository/index.js +2 -0
- package/src/db/repository/nodes.js +8 -10
- package/src/domain/analysis/brief.js +161 -0
- package/src/domain/analysis/context.js +237 -199
- package/src/domain/analysis/dependencies.js +200 -146
- package/src/domain/analysis/exports.js +84 -12
- package/src/domain/analysis/impact.js +350 -157
- package/src/domain/analysis/implementations.js +98 -0
- package/src/domain/analysis/module-map.js +256 -221
- package/src/domain/analysis/roles.js +16 -7
- package/src/domain/analysis/symbol-lookup.js +7 -5
- package/src/domain/graph/builder/helpers.js +1 -1
- package/src/domain/graph/builder/incremental.js +136 -90
- package/src/domain/graph/builder/pipeline.js +114 -80
- package/src/domain/graph/builder/stages/build-edges.js +413 -237
- package/src/domain/graph/builder/stages/detect-changes.js +198 -177
- package/src/domain/graph/builder/stages/insert-nodes.js +147 -139
- package/src/domain/graph/resolve.js +315 -1
- package/src/domain/graph/watcher.js +2 -2
- package/src/domain/parser.js +90 -17
- package/src/domain/queries.js +2 -0
- package/src/domain/search/search/filters.js +9 -5
- package/src/domain/search/search/hybrid.js +7 -4
- package/src/domain/search/search/keyword.js +12 -5
- package/src/domain/search/search/prepare.js +13 -5
- package/src/domain/search/search/semantic.js +11 -6
- package/src/extractors/csharp.js +286 -207
- package/src/extractors/go.js +304 -159
- package/src/extractors/hcl.js +94 -78
- package/src/extractors/java.js +239 -207
- package/src/extractors/javascript.js +437 -305
- package/src/extractors/php.js +276 -220
- package/src/extractors/python.js +379 -247
- package/src/extractors/ruby.js +192 -185
- package/src/extractors/rust.js +243 -168
- package/src/features/ast.js +5 -3
- package/src/features/audit.js +6 -3
- package/src/features/boundaries.js +98 -83
- package/src/features/cfg.js +134 -143
- package/src/features/communities.js +70 -53
- package/src/features/complexity.js +143 -132
- package/src/features/dataflow.js +146 -149
- package/src/features/export.js +3 -3
- package/src/features/graph-enrichment.js +3 -3
- package/src/features/manifesto.js +9 -6
- package/src/features/owners.js +4 -3
- package/src/features/sequence.js +155 -142
- package/src/features/shared/find-nodes.js +31 -0
- package/src/features/structure.js +161 -101
- package/src/features/triage.js +93 -71
- package/src/graph/classifiers/risk.js +12 -4
- package/src/graph/classifiers/roles.js +54 -3
- package/src/index.js +1 -0
- package/src/infrastructure/config.js +255 -4
- package/src/mcp/middleware.js +20 -2
- package/src/mcp/server.js +71 -56
- package/src/mcp/tool-registry.js +53 -1
- package/src/mcp/tools/brief.js +8 -0
- package/src/mcp/tools/implementations.js +14 -0
- package/src/mcp/tools/index.js +6 -0
- package/src/mcp/tools/interfaces.js +14 -0
- package/src/presentation/brief.js +51 -0
- package/src/presentation/queries-cli/exports.js +72 -15
- package/src/presentation/queries-cli/impact.js +55 -39
- package/src/presentation/queries-cli/index.js +9 -1
- package/src/presentation/queries-cli/inspect.js +241 -182
- package/src/presentation/queries-cli/overview.js +57 -58
- package/src/presentation/queries-cli/path.js +36 -29
- package/src/presentation/queries-cli.js +3 -1
- package/src/presentation/result-formatter.js +9 -5
- package/src/presentation/table.js +0 -8
- package/src/shared/file-utils.js +20 -11
- package/src/shared/generators.js +7 -3
- package/src/shared/kinds.js +14 -1
- package/src/shared/paginate.js +10 -2
- package/src/types.ts +1609 -0
|
@@ -1,77 +1,46 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { getNodeId, openReadonlyOrFail, testFilterSQL } from '../db/index.js';
|
|
3
|
+
import { loadConfig } from '../infrastructure/config.js';
|
|
3
4
|
import { debug } from '../infrastructure/logger.js';
|
|
4
5
|
import { isTestFile } from '../infrastructure/test-filter.js';
|
|
5
6
|
import { normalizePath } from '../shared/constants.js';
|
|
6
7
|
import { paginateResult } from '../shared/paginate.js';
|
|
7
8
|
|
|
8
|
-
// ─── Build-time
|
|
9
|
+
// ─── Build-time helpers ───────────────────────────────────────────────
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const insertNode = db.prepare(
|
|
22
|
-
'INSERT OR IGNORE INTO nodes (name, kind, file, line, end_line) VALUES (?, ?, ?, ?, ?)',
|
|
23
|
-
);
|
|
24
|
-
const getNodeIdStmt = {
|
|
25
|
-
get: (name, kind, file, line) => {
|
|
26
|
-
const id = getNodeId(db, name, kind, file, line);
|
|
27
|
-
return id != null ? { id } : undefined;
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
const insertEdge = db.prepare(
|
|
31
|
-
'INSERT INTO edges (source_id, target_id, kind, confidence, dynamic) VALUES (?, ?, ?, ?, ?)',
|
|
32
|
-
);
|
|
33
|
-
const upsertMetric = db.prepare(`
|
|
34
|
-
INSERT OR REPLACE INTO node_metrics
|
|
35
|
-
(node_id, line_count, symbol_count, import_count, export_count, fan_in, fan_out, cohesion, file_count)
|
|
36
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
37
|
-
`);
|
|
38
|
-
|
|
39
|
-
const isIncremental = changedFiles != null && changedFiles.length > 0;
|
|
11
|
+
function getAncestorDirs(filePaths) {
|
|
12
|
+
const dirs = new Set();
|
|
13
|
+
for (const f of filePaths) {
|
|
14
|
+
let d = normalizePath(path.dirname(f));
|
|
15
|
+
while (d && d !== '.') {
|
|
16
|
+
dirs.add(d);
|
|
17
|
+
d = normalizePath(path.dirname(d));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return dirs;
|
|
21
|
+
}
|
|
40
22
|
|
|
23
|
+
function cleanupPreviousData(db, getNodeIdStmt, isIncremental, changedFiles) {
|
|
41
24
|
if (isIncremental) {
|
|
42
|
-
|
|
43
|
-
const affectedDirs = new Set();
|
|
44
|
-
for (const f of changedFiles) {
|
|
45
|
-
let d = normalizePath(path.dirname(f));
|
|
46
|
-
while (d && d !== '.') {
|
|
47
|
-
affectedDirs.add(d);
|
|
48
|
-
d = normalizePath(path.dirname(d));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
25
|
+
const affectedDirs = getAncestorDirs(changedFiles);
|
|
51
26
|
const deleteContainsForDir = db.prepare(
|
|
52
27
|
"DELETE FROM edges WHERE kind = 'contains' AND source_id IN (SELECT id FROM nodes WHERE name = ? AND kind = 'directory')",
|
|
53
28
|
);
|
|
54
29
|
const deleteMetricForNode = db.prepare('DELETE FROM node_metrics WHERE node_id = ?');
|
|
55
30
|
db.transaction(() => {
|
|
56
|
-
// Delete contains edges only from affected directories
|
|
57
31
|
for (const dir of affectedDirs) {
|
|
58
32
|
deleteContainsForDir.run(dir);
|
|
59
33
|
}
|
|
60
|
-
// Delete metrics for changed files
|
|
61
34
|
for (const f of changedFiles) {
|
|
62
35
|
const fileRow = getNodeIdStmt.get(f, 'file', f, 0);
|
|
63
36
|
if (fileRow) deleteMetricForNode.run(fileRow.id);
|
|
64
37
|
}
|
|
65
|
-
// Delete metrics for affected directories
|
|
66
38
|
for (const dir of affectedDirs) {
|
|
67
39
|
const dirRow = getNodeIdStmt.get(dir, 'directory', dir, 0);
|
|
68
40
|
if (dirRow) deleteMetricForNode.run(dirRow.id);
|
|
69
41
|
}
|
|
70
42
|
})();
|
|
71
43
|
} else {
|
|
72
|
-
// Full rebuild: clean previous directory nodes/edges (idempotent)
|
|
73
|
-
// Scope contains-edge delete to directory-sourced edges only,
|
|
74
|
-
// preserving symbol-level contains edges (file→def, class→method, etc.)
|
|
75
44
|
db.exec(`
|
|
76
45
|
DELETE FROM edges WHERE kind = 'contains'
|
|
77
46
|
AND source_id IN (SELECT id FROM nodes WHERE kind = 'directory');
|
|
@@ -79,8 +48,9 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
79
48
|
DELETE FROM nodes WHERE kind = 'directory';
|
|
80
49
|
`);
|
|
81
50
|
}
|
|
51
|
+
}
|
|
82
52
|
|
|
83
|
-
|
|
53
|
+
function collectAllDirectories(directories, fileSymbols) {
|
|
84
54
|
const allDirs = new Set();
|
|
85
55
|
for (const dir of directories) {
|
|
86
56
|
let d = dir;
|
|
@@ -89,7 +59,6 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
89
59
|
d = normalizePath(path.dirname(d));
|
|
90
60
|
}
|
|
91
61
|
}
|
|
92
|
-
// Also add dirs derived from file paths
|
|
93
62
|
for (const relPath of fileSymbols.keys()) {
|
|
94
63
|
let d = normalizePath(path.dirname(relPath));
|
|
95
64
|
while (d && d !== '.') {
|
|
@@ -97,37 +66,17 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
97
66
|
d = normalizePath(path.dirname(d));
|
|
98
67
|
}
|
|
99
68
|
}
|
|
69
|
+
return allDirs;
|
|
70
|
+
}
|
|
100
71
|
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
insertNode.run(dir, 'directory', dir, 0, null);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
insertDirs();
|
|
108
|
-
|
|
109
|
-
// Step 3: Insert 'contains' edges (dir → file, dir → subdirectory)
|
|
110
|
-
// On incremental, only re-insert for affected directories (others are intact)
|
|
111
|
-
const affectedDirs = isIncremental
|
|
112
|
-
? (() => {
|
|
113
|
-
const dirs = new Set();
|
|
114
|
-
for (const f of changedFiles) {
|
|
115
|
-
let d = normalizePath(path.dirname(f));
|
|
116
|
-
while (d && d !== '.') {
|
|
117
|
-
dirs.add(d);
|
|
118
|
-
d = normalizePath(path.dirname(d));
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return dirs;
|
|
122
|
-
})()
|
|
123
|
-
: null;
|
|
72
|
+
function insertContainsEdges(db, insertEdge, getNodeIdStmt, fileSymbols, allDirs, changedFiles) {
|
|
73
|
+
const isIncremental = changedFiles != null && changedFiles.length > 0;
|
|
74
|
+
const affectedDirs = isIncremental ? getAncestorDirs(changedFiles) : null;
|
|
124
75
|
|
|
125
|
-
|
|
126
|
-
// dir → file
|
|
76
|
+
db.transaction(() => {
|
|
127
77
|
for (const relPath of fileSymbols.keys()) {
|
|
128
78
|
const dir = normalizePath(path.dirname(relPath));
|
|
129
79
|
if (!dir || dir === '.') continue;
|
|
130
|
-
// On incremental, skip dirs whose contains edges are intact
|
|
131
80
|
if (affectedDirs && !affectedDirs.has(dir)) continue;
|
|
132
81
|
const dirRow = getNodeIdStmt.get(dir, 'directory', dir, 0);
|
|
133
82
|
const fileRow = getNodeIdStmt.get(relPath, 'file', relPath, 0);
|
|
@@ -135,11 +84,9 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
135
84
|
insertEdge.run(dirRow.id, fileRow.id, 'contains', 1.0, 0);
|
|
136
85
|
}
|
|
137
86
|
}
|
|
138
|
-
// dir → subdirectory
|
|
139
87
|
for (const dir of allDirs) {
|
|
140
88
|
const parent = normalizePath(path.dirname(dir));
|
|
141
89
|
if (!parent || parent === '.' || parent === dir) continue;
|
|
142
|
-
// On incremental, skip parent dirs whose contains edges are intact
|
|
143
90
|
if (affectedDirs && !affectedDirs.has(parent)) continue;
|
|
144
91
|
const parentRow = getNodeIdStmt.get(parent, 'directory', parent, 0);
|
|
145
92
|
const childRow = getNodeIdStmt.get(dir, 'directory', dir, 0);
|
|
@@ -147,11 +94,10 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
147
94
|
insertEdge.run(parentRow.id, childRow.id, 'contains', 1.0, 0);
|
|
148
95
|
}
|
|
149
96
|
}
|
|
150
|
-
});
|
|
151
|
-
|
|
97
|
+
})();
|
|
98
|
+
}
|
|
152
99
|
|
|
153
|
-
|
|
154
|
-
// Pre-compute fan-in/fan-out per file from import edges
|
|
100
|
+
function computeImportEdgeMaps(db) {
|
|
155
101
|
const fanInMap = new Map();
|
|
156
102
|
const fanOutMap = new Map();
|
|
157
103
|
const importEdges = db
|
|
@@ -169,14 +115,24 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
169
115
|
fanOutMap.set(source_file, (fanOutMap.get(source_file) || 0) + 1);
|
|
170
116
|
fanInMap.set(target_file, (fanInMap.get(target_file) || 0) + 1);
|
|
171
117
|
}
|
|
118
|
+
return { fanInMap, fanOutMap, importEdges };
|
|
119
|
+
}
|
|
172
120
|
|
|
173
|
-
|
|
121
|
+
function computeFileMetrics(
|
|
122
|
+
db,
|
|
123
|
+
upsertMetric,
|
|
124
|
+
getNodeIdStmt,
|
|
125
|
+
fileSymbols,
|
|
126
|
+
lineCountMap,
|
|
127
|
+
fanInMap,
|
|
128
|
+
fanOutMap,
|
|
129
|
+
) {
|
|
130
|
+
db.transaction(() => {
|
|
174
131
|
for (const [relPath, symbols] of fileSymbols) {
|
|
175
132
|
const fileRow = getNodeIdStmt.get(relPath, 'file', relPath, 0);
|
|
176
133
|
if (!fileRow) continue;
|
|
177
134
|
|
|
178
135
|
const lineCount = lineCountMap.get(relPath) || 0;
|
|
179
|
-
// Deduplicate definitions by name+kind+line
|
|
180
136
|
const seen = new Set();
|
|
181
137
|
let symbolCount = 0;
|
|
182
138
|
for (const d of symbols.definitions) {
|
|
@@ -203,11 +159,17 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
203
159
|
null,
|
|
204
160
|
);
|
|
205
161
|
}
|
|
206
|
-
});
|
|
207
|
-
|
|
162
|
+
})();
|
|
163
|
+
}
|
|
208
164
|
|
|
209
|
-
|
|
210
|
-
|
|
165
|
+
function computeDirectoryMetrics(
|
|
166
|
+
db,
|
|
167
|
+
upsertMetric,
|
|
168
|
+
getNodeIdStmt,
|
|
169
|
+
fileSymbols,
|
|
170
|
+
allDirs,
|
|
171
|
+
importEdges,
|
|
172
|
+
) {
|
|
211
173
|
const dirFiles = new Map();
|
|
212
174
|
for (const dir of allDirs) {
|
|
213
175
|
dirFiles.set(dir, []);
|
|
@@ -222,7 +184,6 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
222
184
|
}
|
|
223
185
|
}
|
|
224
186
|
|
|
225
|
-
// Build reverse index: file → set of ancestor directories (O(files × depth))
|
|
226
187
|
const fileToAncestorDirs = new Map();
|
|
227
188
|
for (const [dir, files] of dirFiles) {
|
|
228
189
|
for (const f of files) {
|
|
@@ -231,7 +192,6 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
231
192
|
}
|
|
232
193
|
}
|
|
233
194
|
|
|
234
|
-
// Single O(E) pass: pre-aggregate edge counts per directory
|
|
235
195
|
const dirEdgeCounts = new Map();
|
|
236
196
|
for (const dir of allDirs) {
|
|
237
197
|
dirEdgeCounts.set(dir, { intra: 0, fanIn: 0, fanOut: 0 });
|
|
@@ -241,7 +201,6 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
241
201
|
const tgtDirs = fileToAncestorDirs.get(target_file);
|
|
242
202
|
if (!srcDirs && !tgtDirs) continue;
|
|
243
203
|
|
|
244
|
-
// For each directory that contains the source file
|
|
245
204
|
if (srcDirs) {
|
|
246
205
|
for (const dir of srcDirs) {
|
|
247
206
|
const counts = dirEdgeCounts.get(dir);
|
|
@@ -253,10 +212,9 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
253
212
|
}
|
|
254
213
|
}
|
|
255
214
|
}
|
|
256
|
-
// For each directory that contains the target but NOT the source
|
|
257
215
|
if (tgtDirs) {
|
|
258
216
|
for (const dir of tgtDirs) {
|
|
259
|
-
if (srcDirs?.has(dir)) continue;
|
|
217
|
+
if (srcDirs?.has(dir)) continue;
|
|
260
218
|
const counts = dirEdgeCounts.get(dir);
|
|
261
219
|
if (!counts) continue;
|
|
262
220
|
counts.fanIn++;
|
|
@@ -264,7 +222,7 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
264
222
|
}
|
|
265
223
|
}
|
|
266
224
|
|
|
267
|
-
|
|
225
|
+
db.transaction(() => {
|
|
268
226
|
for (const [dir, files] of dirFiles) {
|
|
269
227
|
const dirRow = getNodeIdStmt.get(dir, 'directory', dir, 0);
|
|
270
228
|
if (!dirRow) continue;
|
|
@@ -286,7 +244,6 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
286
244
|
}
|
|
287
245
|
}
|
|
288
246
|
|
|
289
|
-
// O(1) lookup from pre-aggregated edge counts
|
|
290
247
|
const counts = dirEdgeCounts.get(dir) || { intra: 0, fanIn: 0, fanOut: 0 };
|
|
291
248
|
const totalEdges = counts.intra + counts.fanIn + counts.fanOut;
|
|
292
249
|
const cohesion = totalEdges > 0 ? counts.intra / totalEdges : null;
|
|
@@ -303,11 +260,69 @@ export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, director
|
|
|
303
260
|
fileCount,
|
|
304
261
|
);
|
|
305
262
|
}
|
|
306
|
-
});
|
|
307
|
-
|
|
263
|
+
})();
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// ─── Build-time: insert directory nodes, contains edges, and metrics ────
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Build directory structure nodes, containment edges, and compute metrics.
|
|
270
|
+
* Called from builder.js after edge building.
|
|
271
|
+
*
|
|
272
|
+
* @param {import('better-sqlite3').Database} db - Open read-write database
|
|
273
|
+
* @param {Map<string, object>} fileSymbols - Map of relPath → { definitions, imports, exports, calls }
|
|
274
|
+
* @param {string} rootDir - Absolute root directory
|
|
275
|
+
* @param {Map<string, number>} lineCountMap - Map of relPath → line count
|
|
276
|
+
* @param {Set<string>} directories - Set of relative directory paths
|
|
277
|
+
*/
|
|
278
|
+
export function buildStructure(db, fileSymbols, _rootDir, lineCountMap, directories, changedFiles) {
|
|
279
|
+
const insertNode = db.prepare(
|
|
280
|
+
'INSERT OR IGNORE INTO nodes (name, kind, file, line, end_line) VALUES (?, ?, ?, ?, ?)',
|
|
281
|
+
);
|
|
282
|
+
const getNodeIdStmt = {
|
|
283
|
+
get: (name, kind, file, line) => {
|
|
284
|
+
const id = getNodeId(db, name, kind, file, line);
|
|
285
|
+
return id != null ? { id } : undefined;
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
const insertEdge = db.prepare(
|
|
289
|
+
'INSERT INTO edges (source_id, target_id, kind, confidence, dynamic) VALUES (?, ?, ?, ?, ?)',
|
|
290
|
+
);
|
|
291
|
+
const upsertMetric = db.prepare(`
|
|
292
|
+
INSERT OR REPLACE INTO node_metrics
|
|
293
|
+
(node_id, line_count, symbol_count, import_count, export_count, fan_in, fan_out, cohesion, file_count)
|
|
294
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
295
|
+
`);
|
|
296
|
+
|
|
297
|
+
const isIncremental = changedFiles != null && changedFiles.length > 0;
|
|
298
|
+
|
|
299
|
+
cleanupPreviousData(db, getNodeIdStmt, isIncremental, changedFiles);
|
|
300
|
+
|
|
301
|
+
const allDirs = collectAllDirectories(directories, fileSymbols);
|
|
302
|
+
|
|
303
|
+
db.transaction(() => {
|
|
304
|
+
for (const dir of allDirs) {
|
|
305
|
+
insertNode.run(dir, 'directory', dir, 0, null);
|
|
306
|
+
}
|
|
307
|
+
})();
|
|
308
308
|
|
|
309
|
-
|
|
310
|
-
|
|
309
|
+
insertContainsEdges(db, insertEdge, getNodeIdStmt, fileSymbols, allDirs, changedFiles);
|
|
310
|
+
|
|
311
|
+
const { fanInMap, fanOutMap, importEdges } = computeImportEdgeMaps(db);
|
|
312
|
+
|
|
313
|
+
computeFileMetrics(
|
|
314
|
+
db,
|
|
315
|
+
upsertMetric,
|
|
316
|
+
getNodeIdStmt,
|
|
317
|
+
fileSymbols,
|
|
318
|
+
lineCountMap,
|
|
319
|
+
fanInMap,
|
|
320
|
+
fanOutMap,
|
|
321
|
+
);
|
|
322
|
+
|
|
323
|
+
computeDirectoryMetrics(db, upsertMetric, getNodeIdStmt, fileSymbols, allDirs, importEdges);
|
|
324
|
+
|
|
325
|
+
debug(`Structure: ${allDirs.size} directories, ${fileSymbols.size} files with metrics`);
|
|
311
326
|
}
|
|
312
327
|
|
|
313
328
|
// ─── Node role classification ─────────────────────────────────────────
|
|
@@ -335,7 +350,19 @@ export function classifyNodeRoles(db) {
|
|
|
335
350
|
.all();
|
|
336
351
|
|
|
337
352
|
if (rows.length === 0) {
|
|
338
|
-
return {
|
|
353
|
+
return {
|
|
354
|
+
entry: 0,
|
|
355
|
+
core: 0,
|
|
356
|
+
utility: 0,
|
|
357
|
+
adapter: 0,
|
|
358
|
+
dead: 0,
|
|
359
|
+
'dead-leaf': 0,
|
|
360
|
+
'dead-entry': 0,
|
|
361
|
+
'dead-ffi': 0,
|
|
362
|
+
'dead-unresolved': 0,
|
|
363
|
+
'test-only': 0,
|
|
364
|
+
leaf: 0,
|
|
365
|
+
};
|
|
339
366
|
}
|
|
340
367
|
|
|
341
368
|
const exportedIds = new Set(
|
|
@@ -351,24 +378,56 @@ export function classifyNodeRoles(db) {
|
|
|
351
378
|
.map((r) => r.target_id),
|
|
352
379
|
);
|
|
353
380
|
|
|
381
|
+
// Compute production fan-in (excluding callers in test files)
|
|
382
|
+
const prodFanInMap = new Map();
|
|
383
|
+
const prodRows = db
|
|
384
|
+
.prepare(
|
|
385
|
+
`SELECT e.target_id, COUNT(*) AS cnt
|
|
386
|
+
FROM edges e
|
|
387
|
+
JOIN nodes caller ON e.source_id = caller.id
|
|
388
|
+
WHERE e.kind = 'calls'
|
|
389
|
+
${testFilterSQL('caller.file')}
|
|
390
|
+
GROUP BY e.target_id`,
|
|
391
|
+
)
|
|
392
|
+
.all();
|
|
393
|
+
for (const r of prodRows) {
|
|
394
|
+
prodFanInMap.set(r.target_id, r.cnt);
|
|
395
|
+
}
|
|
396
|
+
|
|
354
397
|
// Delegate classification to the pure-logic classifier
|
|
355
398
|
const classifierInput = rows.map((r) => ({
|
|
356
399
|
id: String(r.id),
|
|
357
400
|
name: r.name,
|
|
401
|
+
kind: r.kind,
|
|
402
|
+
file: r.file,
|
|
358
403
|
fanIn: r.fan_in,
|
|
359
404
|
fanOut: r.fan_out,
|
|
360
405
|
isExported: exportedIds.has(r.id),
|
|
406
|
+
productionFanIn: prodFanInMap.get(r.id) || 0,
|
|
361
407
|
}));
|
|
362
408
|
|
|
363
409
|
const roleMap = classifyRoles(classifierInput);
|
|
364
410
|
|
|
365
411
|
// Build summary and updates
|
|
366
|
-
const summary = {
|
|
412
|
+
const summary = {
|
|
413
|
+
entry: 0,
|
|
414
|
+
core: 0,
|
|
415
|
+
utility: 0,
|
|
416
|
+
adapter: 0,
|
|
417
|
+
dead: 0,
|
|
418
|
+
'dead-leaf': 0,
|
|
419
|
+
'dead-entry': 0,
|
|
420
|
+
'dead-ffi': 0,
|
|
421
|
+
'dead-unresolved': 0,
|
|
422
|
+
'test-only': 0,
|
|
423
|
+
leaf: 0,
|
|
424
|
+
};
|
|
367
425
|
const updates = [];
|
|
368
426
|
for (const row of rows) {
|
|
369
427
|
const role = roleMap.get(String(row.id)) || 'leaf';
|
|
370
428
|
updates.push({ id: row.id, role });
|
|
371
|
-
summary
|
|
429
|
+
if (role.startsWith('dead')) summary.dead++;
|
|
430
|
+
summary[role] = (summary[role] || 0) + 1;
|
|
372
431
|
}
|
|
373
432
|
|
|
374
433
|
const clearRoles = db.prepare('UPDATE nodes SET role = NULL');
|
|
@@ -578,7 +637,8 @@ export function hotspotsData(customDbPath, opts = {}) {
|
|
|
578
637
|
export function moduleBoundariesData(customDbPath, opts = {}) {
|
|
579
638
|
const db = openReadonlyOrFail(customDbPath);
|
|
580
639
|
try {
|
|
581
|
-
const
|
|
640
|
+
const config = opts.config || loadConfig();
|
|
641
|
+
const threshold = opts.threshold ?? config.structure?.cohesionThreshold ?? 0.3;
|
|
582
642
|
|
|
583
643
|
const dirs = db
|
|
584
644
|
.prepare(`
|
package/src/features/triage.js
CHANGED
|
@@ -1,11 +1,87 @@
|
|
|
1
1
|
import { openRepo } from '../db/index.js';
|
|
2
2
|
import { DEFAULT_WEIGHTS, scoreRisk } from '../graph/classifiers/risk.js';
|
|
3
|
+
import { loadConfig } from '../infrastructure/config.js';
|
|
3
4
|
import { warn } from '../infrastructure/logger.js';
|
|
4
5
|
import { isTestFile } from '../infrastructure/test-filter.js';
|
|
5
6
|
import { paginateResult } from '../shared/paginate.js';
|
|
6
7
|
|
|
8
|
+
// ─── Scoring ─────────────────────────────────────────────────────────
|
|
9
|
+
|
|
10
|
+
const SORT_FNS = {
|
|
11
|
+
risk: (a, b) => b.riskScore - a.riskScore,
|
|
12
|
+
complexity: (a, b) => b.cognitive - a.cognitive,
|
|
13
|
+
churn: (a, b) => b.churn - a.churn,
|
|
14
|
+
'fan-in': (a, b) => b.fanIn - a.fanIn,
|
|
15
|
+
mi: (a, b) => a.maintainabilityIndex - b.maintainabilityIndex,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Build scored triage items from raw rows and risk metrics.
|
|
20
|
+
* @param {object[]} rows - Raw DB rows
|
|
21
|
+
* @param {object[]} riskMetrics - Per-row risk metric objects from scoreRisk
|
|
22
|
+
* @returns {object[]}
|
|
23
|
+
*/
|
|
24
|
+
function buildTriageItems(rows, riskMetrics) {
|
|
25
|
+
return rows.map((r, i) => ({
|
|
26
|
+
name: r.name,
|
|
27
|
+
kind: r.kind,
|
|
28
|
+
file: r.file,
|
|
29
|
+
line: r.line,
|
|
30
|
+
role: r.role || null,
|
|
31
|
+
fanIn: r.fan_in,
|
|
32
|
+
cognitive: r.cognitive,
|
|
33
|
+
churn: r.churn,
|
|
34
|
+
maintainabilityIndex: r.mi,
|
|
35
|
+
normFanIn: riskMetrics[i].normFanIn,
|
|
36
|
+
normComplexity: riskMetrics[i].normComplexity,
|
|
37
|
+
normChurn: riskMetrics[i].normChurn,
|
|
38
|
+
normMI: riskMetrics[i].normMI,
|
|
39
|
+
roleWeight: riskMetrics[i].roleWeight,
|
|
40
|
+
riskScore: riskMetrics[i].riskScore,
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Compute signal coverage and summary statistics.
|
|
46
|
+
* @param {object[]} filtered - All filtered rows
|
|
47
|
+
* @param {object[]} scored - Scored and filtered items
|
|
48
|
+
* @param {object} weights - Active weights
|
|
49
|
+
* @returns {object}
|
|
50
|
+
*/
|
|
51
|
+
function computeTriageSummary(filtered, scored, weights) {
|
|
52
|
+
const signalCoverage = {
|
|
53
|
+
complexity: round4(filtered.filter((r) => r.cognitive > 0).length / filtered.length),
|
|
54
|
+
churn: round4(filtered.filter((r) => r.churn > 0).length / filtered.length),
|
|
55
|
+
fanIn: round4(filtered.filter((r) => r.fan_in > 0).length / filtered.length),
|
|
56
|
+
mi: round4(filtered.filter((r) => r.mi > 0).length / filtered.length),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const scores = scored.map((it) => it.riskScore);
|
|
60
|
+
const avgScore =
|
|
61
|
+
scores.length > 0 ? round4(scores.reduce((a, b) => a + b, 0) / scores.length) : 0;
|
|
62
|
+
const maxScore = scores.length > 0 ? round4(Math.max(...scores)) : 0;
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
total: filtered.length,
|
|
66
|
+
analyzed: scored.length,
|
|
67
|
+
avgScore,
|
|
68
|
+
maxScore,
|
|
69
|
+
weights,
|
|
70
|
+
signalCoverage,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
7
74
|
// ─── Data Function ────────────────────────────────────────────────────
|
|
8
75
|
|
|
76
|
+
const EMPTY_SUMMARY = (weights) => ({
|
|
77
|
+
total: 0,
|
|
78
|
+
analyzed: 0,
|
|
79
|
+
avgScore: 0,
|
|
80
|
+
maxScore: 0,
|
|
81
|
+
weights,
|
|
82
|
+
signalCoverage: {},
|
|
83
|
+
});
|
|
84
|
+
|
|
9
85
|
/**
|
|
10
86
|
* Compute composite risk scores for all symbols.
|
|
11
87
|
*
|
|
@@ -17,97 +93,43 @@ export function triageData(customDbPath, opts = {}) {
|
|
|
17
93
|
const { repo, close } = openRepo(customDbPath, opts);
|
|
18
94
|
try {
|
|
19
95
|
const noTests = opts.noTests || false;
|
|
20
|
-
const fileFilter = opts.file || null;
|
|
21
|
-
const kindFilter = opts.kind || null;
|
|
22
|
-
const roleFilter = opts.role || null;
|
|
23
96
|
const minScore = opts.minScore != null ? Number(opts.minScore) : null;
|
|
24
97
|
const sort = opts.sort || 'risk';
|
|
25
|
-
const
|
|
98
|
+
const config = opts.config || loadConfig();
|
|
99
|
+
const riskConfig = config.risk || {};
|
|
100
|
+
const weights = { ...DEFAULT_WEIGHTS, ...(riskConfig.weights || {}), ...(opts.weights || {}) };
|
|
101
|
+
const riskOpts = {
|
|
102
|
+
roleWeights: riskConfig.roleWeights,
|
|
103
|
+
defaultRoleWeight: riskConfig.defaultRoleWeight,
|
|
104
|
+
};
|
|
26
105
|
|
|
27
106
|
let rows;
|
|
28
107
|
try {
|
|
29
108
|
rows = repo.findNodesForTriage({
|
|
30
109
|
noTests,
|
|
31
|
-
file:
|
|
32
|
-
kind:
|
|
33
|
-
role:
|
|
110
|
+
file: opts.file || null,
|
|
111
|
+
kind: opts.kind || null,
|
|
112
|
+
role: opts.role || null,
|
|
34
113
|
});
|
|
35
114
|
} catch (err) {
|
|
36
115
|
warn(`triage query failed: ${err.message}`);
|
|
37
|
-
return {
|
|
38
|
-
items: [],
|
|
39
|
-
summary: { total: 0, analyzed: 0, avgScore: 0, maxScore: 0, weights, signalCoverage: {} },
|
|
40
|
-
};
|
|
116
|
+
return { items: [], summary: EMPTY_SUMMARY(weights) };
|
|
41
117
|
}
|
|
42
118
|
|
|
43
|
-
// Post-filter test files (belt-and-suspenders)
|
|
44
119
|
const filtered = noTests ? rows.filter((r) => !isTestFile(r.file)) : rows;
|
|
45
|
-
|
|
46
120
|
if (filtered.length === 0) {
|
|
47
|
-
return {
|
|
48
|
-
items: [],
|
|
49
|
-
summary: { total: 0, analyzed: 0, avgScore: 0, maxScore: 0, weights, signalCoverage: {} },
|
|
50
|
-
};
|
|
121
|
+
return { items: [], summary: EMPTY_SUMMARY(weights) };
|
|
51
122
|
}
|
|
52
123
|
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
// Compute risk scores
|
|
57
|
-
const items = filtered.map((r, i) => ({
|
|
58
|
-
name: r.name,
|
|
59
|
-
kind: r.kind,
|
|
60
|
-
file: r.file,
|
|
61
|
-
line: r.line,
|
|
62
|
-
role: r.role || null,
|
|
63
|
-
fanIn: r.fan_in,
|
|
64
|
-
cognitive: r.cognitive,
|
|
65
|
-
churn: r.churn,
|
|
66
|
-
maintainabilityIndex: r.mi,
|
|
67
|
-
normFanIn: riskMetrics[i].normFanIn,
|
|
68
|
-
normComplexity: riskMetrics[i].normComplexity,
|
|
69
|
-
normChurn: riskMetrics[i].normChurn,
|
|
70
|
-
normMI: riskMetrics[i].normMI,
|
|
71
|
-
roleWeight: riskMetrics[i].roleWeight,
|
|
72
|
-
riskScore: riskMetrics[i].riskScore,
|
|
73
|
-
}));
|
|
74
|
-
|
|
75
|
-
// Apply minScore filter
|
|
76
|
-
const scored = minScore != null ? items.filter((it) => it.riskScore >= minScore) : items;
|
|
124
|
+
const riskMetrics = scoreRisk(filtered, weights, riskOpts);
|
|
125
|
+
const items = buildTriageItems(filtered, riskMetrics);
|
|
77
126
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
risk: (a, b) => b.riskScore - a.riskScore,
|
|
81
|
-
complexity: (a, b) => b.cognitive - a.cognitive,
|
|
82
|
-
churn: (a, b) => b.churn - a.churn,
|
|
83
|
-
'fan-in': (a, b) => b.fanIn - a.fanIn,
|
|
84
|
-
mi: (a, b) => a.maintainabilityIndex - b.maintainabilityIndex,
|
|
85
|
-
};
|
|
86
|
-
scored.sort(sortFns[sort] || sortFns.risk);
|
|
87
|
-
|
|
88
|
-
// Signal coverage: % of items with non-zero signal
|
|
89
|
-
const signalCoverage = {
|
|
90
|
-
complexity: round4(filtered.filter((r) => r.cognitive > 0).length / filtered.length),
|
|
91
|
-
churn: round4(filtered.filter((r) => r.churn > 0).length / filtered.length),
|
|
92
|
-
fanIn: round4(filtered.filter((r) => r.fan_in > 0).length / filtered.length),
|
|
93
|
-
mi: round4(filtered.filter((r) => r.mi > 0).length / filtered.length),
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const scores = scored.map((it) => it.riskScore);
|
|
97
|
-
const avgScore =
|
|
98
|
-
scores.length > 0 ? round4(scores.reduce((a, b) => a + b, 0) / scores.length) : 0;
|
|
99
|
-
const maxScore = scores.length > 0 ? round4(Math.max(...scores)) : 0;
|
|
127
|
+
const scored = minScore != null ? items.filter((it) => it.riskScore >= minScore) : items;
|
|
128
|
+
scored.sort(SORT_FNS[sort] || SORT_FNS.risk);
|
|
100
129
|
|
|
101
130
|
const result = {
|
|
102
131
|
items: scored,
|
|
103
|
-
summary:
|
|
104
|
-
total: filtered.length,
|
|
105
|
-
analyzed: scored.length,
|
|
106
|
-
avgScore,
|
|
107
|
-
maxScore,
|
|
108
|
-
weights,
|
|
109
|
-
signalCoverage,
|
|
110
|
-
},
|
|
132
|
+
summary: computeTriageSummary(filtered, scored, weights),
|
|
111
133
|
};
|
|
112
134
|
|
|
113
135
|
return paginateResult(result, 'items', {
|
|
@@ -16,15 +16,20 @@ export const DEFAULT_WEIGHTS = {
|
|
|
16
16
|
|
|
17
17
|
// Role weights reflect structural importance: core modules are central to the
|
|
18
18
|
// dependency graph, utilities are widely imported, entry points are API
|
|
19
|
-
// surfaces. Adapters bridge subsystems but are replaceable. Leaves
|
|
20
|
-
// code have minimal downstream impact.
|
|
19
|
+
// surfaces. Adapters bridge subsystems but are replaceable. Leaves, dead
|
|
20
|
+
// code, and test-only symbols have minimal downstream impact.
|
|
21
21
|
export const ROLE_WEIGHTS = {
|
|
22
22
|
core: 1.0,
|
|
23
23
|
utility: 0.9,
|
|
24
24
|
entry: 0.8,
|
|
25
25
|
adapter: 0.5,
|
|
26
26
|
leaf: 0.2,
|
|
27
|
+
'test-only': 0.1,
|
|
27
28
|
dead: 0.1,
|
|
29
|
+
'dead-leaf': 0.0,
|
|
30
|
+
'dead-entry': 0.3,
|
|
31
|
+
'dead-ffi': 0.05,
|
|
32
|
+
'dead-unresolved': 0.15,
|
|
28
33
|
};
|
|
29
34
|
|
|
30
35
|
const DEFAULT_ROLE_WEIGHT = 0.5;
|
|
@@ -47,11 +52,14 @@ function round4(n) {
|
|
|
47
52
|
*
|
|
48
53
|
* @param {{ fan_in: number, cognitive: number, churn: number, mi: number, role: string|null }[]} items
|
|
49
54
|
* @param {object} [weights] - Override DEFAULT_WEIGHTS
|
|
55
|
+
* @param {{ roleWeights?: object, defaultRoleWeight?: number }} [opts] - Optional role weight overrides
|
|
50
56
|
* @returns {{ normFanIn: number, normComplexity: number, normChurn: number, normMI: number, roleWeight: number, riskScore: number }[]}
|
|
51
57
|
* Parallel array with risk metrics for each input item.
|
|
52
58
|
*/
|
|
53
|
-
export function scoreRisk(items, weights = {}) {
|
|
59
|
+
export function scoreRisk(items, weights = {}, opts = {}) {
|
|
54
60
|
const w = { ...DEFAULT_WEIGHTS, ...weights };
|
|
61
|
+
const rw = opts.roleWeights || ROLE_WEIGHTS;
|
|
62
|
+
const drw = opts.defaultRoleWeight ?? DEFAULT_ROLE_WEIGHT;
|
|
55
63
|
|
|
56
64
|
const fanIns = items.map((r) => r.fan_in);
|
|
57
65
|
const cognitives = items.map((r) => r.cognitive);
|
|
@@ -65,7 +73,7 @@ export function scoreRisk(items, weights = {}) {
|
|
|
65
73
|
const normMIs = normMIsRaw.map((v) => round4(1 - v));
|
|
66
74
|
|
|
67
75
|
return items.map((r, i) => {
|
|
68
|
-
const roleWeight =
|
|
76
|
+
const roleWeight = rw[r.role] ?? drw;
|
|
69
77
|
const riskScore =
|
|
70
78
|
w.fanIn * normFanIns[i] +
|
|
71
79
|
w.complexity * normCognitives[i] +
|