@monoes/monograph 1.5.6 → 1.5.7
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 +25 -9
- package/dist/src/mcp-tools/impact.d.ts.map +1 -1
- package/dist/src/mcp-tools/impact.js +1 -10
- package/dist/src/mcp-tools/impact.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -9
- package/.monomind/data/ranked-context.json +0 -5
- package/.monomind/loops/mastermind-review-1782162423447.json +0 -16
- package/.monomind/sessions/session-1777578175215.json +0 -15
- package/.monomind/sessions/session-1777823684507.json +0 -15
- package/.monomind/sessions/session-1777928944749.json +0 -15
- package/.monomind/sessions/session-1778052902210.json +0 -15
- package/.monomind/sessions/session-1778056744636.json +0 -15
- package/.monomind/sessions/session-1778061077599.json +0 -15
- package/.monomind/sessions/session-1778102154764.json +0 -15
- package/__tests__/analysis/shape-extractor.test.ts +0 -124
- package/__tests__/analysis/surprise-scorer.test.ts +0 -154
- package/__tests__/cache/extraction-cache.test.ts +0 -45
- package/__tests__/cli/ai-context.test.ts +0 -175
- package/__tests__/cli/augment.test.ts +0 -128
- package/__tests__/cli/doctor.test.ts +0 -125
- package/__tests__/cli/eval-server.test.ts +0 -89
- package/__tests__/cli/setup.test.ts +0 -178
- package/__tests__/cli/skill-gen.test.ts +0 -280
- package/__tests__/export/formats.test.ts +0 -82
- package/__tests__/fixtures/sample.c +0 -25
- package/__tests__/fixtures/sample.cpp +0 -32
- package/__tests__/fixtures/sample.dart +0 -34
- package/__tests__/fixtures/sample.kt +0 -30
- package/__tests__/fixtures/sample.php +0 -30
- package/__tests__/fixtures/sample.py +0 -11
- package/__tests__/fixtures/sample.rb +0 -26
- package/__tests__/fixtures/sample.swift +0 -42
- package/__tests__/fixtures/sample.ts +0 -17
- package/__tests__/fixtures/sample.vue +0 -40
- package/__tests__/groups/group-search.test.ts +0 -221
- package/__tests__/groups/group-sync.test.ts +0 -336
- package/__tests__/integration/build-atomicity.test.ts +0 -61
- package/__tests__/integration/call-attribution.test.ts +0 -116
- package/__tests__/integration/full-pipeline.test.ts +0 -64
- package/__tests__/integration/graph-report-freshness.test.ts +0 -53
- package/__tests__/integration/incremental-build.test.ts +0 -103
- package/__tests__/mcp-resources/resources.test.ts +0 -256
- package/__tests__/mcp-tools/api-impact.test.ts +0 -188
- package/__tests__/mcp-tools/context.test.ts +0 -130
- package/__tests__/mcp-tools/cypher.test.ts +0 -258
- package/__tests__/mcp-tools/detect-changes.test.ts +0 -114
- package/__tests__/mcp-tools/impact.test.ts +0 -133
- package/__tests__/mcp-tools/rename.test.ts +0 -117
- package/__tests__/mcp-tools/route-map.test.ts +0 -237
- package/__tests__/mcp-tools/shape-check.test.ts +0 -202
- package/__tests__/mcp-tools/tool-map.test.ts +0 -135
- package/__tests__/parsers/c.test.ts +0 -28
- package/__tests__/parsers/cpp.test.ts +0 -28
- package/__tests__/parsers/csharp.test.ts +0 -62
- package/__tests__/parsers/dart.test.ts +0 -28
- package/__tests__/parsers/kotlin.test.ts +0 -28
- package/__tests__/parsers/loader.test.ts +0 -14
- package/__tests__/parsers/php.test.ts +0 -28
- package/__tests__/parsers/python.test.ts +0 -32
- package/__tests__/parsers/ruby.test.ts +0 -33
- package/__tests__/parsers/swift.test.ts +0 -28
- package/__tests__/parsers/typescript.test.ts +0 -45
- package/__tests__/parsers/vue.test.ts +0 -28
- package/__tests__/pipeline/analysis.test.ts +0 -58
- package/__tests__/pipeline/phases/corpus-check.test.ts +0 -26
- package/__tests__/pipeline/phases/evidence.test.ts +0 -41
- package/__tests__/pipeline/phases/field-access.test.ts +0 -22
- package/__tests__/pipeline/phases/leiden.test.ts +0 -72
- package/__tests__/pipeline/phases/markdown.test.ts +0 -84
- package/__tests__/pipeline/phases/middleware-extractor.test.ts +0 -131
- package/__tests__/pipeline/phases/orm.test.ts +0 -379
- package/__tests__/pipeline/phases/processes.test.ts +0 -191
- package/__tests__/pipeline/phases/routes.test.ts +0 -195
- package/__tests__/pipeline/phases/scope-resolution.test.ts +0 -133
- package/__tests__/pipeline/phases/tools.test.ts +0 -161
- package/__tests__/pipeline/phases/variables.test.ts +0 -30
- package/__tests__/pipeline/phases/wildcard-synthesis.test.ts +0 -207
- package/__tests__/pipeline/phases.test.ts +0 -41
- package/__tests__/pipeline/runner.test.ts +0 -28
- package/__tests__/registry/repo-registry.test.ts +0 -127
- package/__tests__/reporting/graph-report.suggest.test.ts +0 -36
- package/__tests__/reporting/graph-report.test.ts +0 -165
- package/__tests__/search/ast-chunker.test.ts +0 -63
- package/__tests__/search/rrf.test.ts +0 -95
- package/__tests__/security/safe-fetch.test.ts +0 -41
- package/__tests__/security/sensitive-files.test.ts +0 -32
- package/__tests__/setup.ts +0 -1
- package/__tests__/skills/platform-skills.test.ts +0 -63
- package/__tests__/staleness/git-staleness.test.ts +0 -107
- package/__tests__/storage/db.test.ts +0 -37
- package/__tests__/storage/evidence-roundtrip.test.ts +0 -89
- package/__tests__/storage/stores.test.ts +0 -165
- package/__tests__/types.test.ts +0 -13
- package/__tests__/validation/extraction-validator.test.ts +0 -48
- package/__tests__/watch/watcher.test.ts +0 -31
- package/__tests__/web/analyze-api.test.ts +0 -66
- package/__tests__/web/api.test.ts +0 -210
- package/__tests__/web/mcp-http.test.ts +0 -67
- package/__tests__/web/react-ui.test.ts +0 -43
- package/__tests__/wiki/gist-publisher.test.ts +0 -66
- package/__tests__/wiki/providers.test.ts +0 -69
- package/__tests__/wiki/wiki-generator.test.ts +0 -260
- package/src/__tests__/analysis/benchmark.test.ts +0 -59
- package/src/__tests__/analysis/cluster-quality.test.ts +0 -106
- package/src/__tests__/analysis/corpus-health.test.ts +0 -33
- package/src/__tests__/analysis/dependency-health.test.ts +0 -105
- package/src/__tests__/analysis/file-classifier.test.ts +0 -50
- package/src/__tests__/analysis/node-similarity.test.ts +0 -81
- package/src/__tests__/cache/augment-cache.test.ts +0 -55
- package/src/__tests__/cli/check-update.test.ts +0 -42
- package/src/__tests__/cli/hooks-install.test.ts +0 -56
- package/src/__tests__/cli/hooks-marker.test.ts +0 -138
- package/src/__tests__/cli/hooks-status.test.ts +0 -42
- package/src/__tests__/export/adjacency-matrix.test.ts +0 -116
- package/src/__tests__/export/csv.test.ts +0 -39
- package/src/__tests__/export/dot.test.ts +0 -86
- package/src/__tests__/export/gexf.test.ts +0 -78
- package/src/__tests__/export/graphml.test.ts +0 -57
- package/src/__tests__/export/mermaid.test.ts +0 -89
- package/src/__tests__/graph/betweenness.test.ts +0 -89
- package/src/__tests__/graph/cycles.test.ts +0 -131
- package/src/__tests__/graph/dead-code.test.ts +0 -174
- package/src/__tests__/graph/dfs.test.ts +0 -62
- package/src/__tests__/graph/diff-summary.test.ts +0 -83
- package/src/__tests__/graph/edge-filter.test.ts +0 -129
- package/src/__tests__/graph/import-chain.test.ts +0 -111
- package/src/__tests__/graph/merge.test.ts +0 -151
- package/src/__tests__/graph/node-search.test.ts +0 -167
- package/src/__tests__/graph/normalize-id.test.ts +0 -102
- package/src/__tests__/graph/pagerank.test.ts +0 -96
- package/src/__tests__/graph/prune.test.ts +0 -110
- package/src/__tests__/graph/regex-search.test.ts +0 -166
- package/src/__tests__/graph/ripple-impact.test.ts +0 -73
- package/src/__tests__/graph/scc.test.ts +0 -85
- package/src/__tests__/graph/statistics.test.ts +0 -219
- package/src/__tests__/graph/subgraph.test.ts +0 -127
- package/src/__tests__/graph/topo-sort.test.ts +0 -110
- package/src/__tests__/graph/wcc.test.ts +0 -101
- package/src/__tests__/groups/grpc-extractor.test.ts +0 -47
- package/src/__tests__/groups/service-boundary.test.ts +0 -86
- package/src/__tests__/groups/topic-extractor.test.ts +0 -43
- package/src/__tests__/ingest/git-clone.test.ts +0 -128
- package/src/__tests__/ingest/query-memory.test.ts +0 -123
- package/src/__tests__/ingest/transcribe.test.ts +0 -58
- package/src/__tests__/ingest/url-ingest.test.ts +0 -48
- package/src/__tests__/mcp-resources/repo-context-resource.test.ts +0 -37
- package/src/__tests__/mcp-resources/repos-resource.test.ts +0 -71
- package/src/__tests__/mcp-resources/wiki-resource.test.ts +0 -52
- package/src/__tests__/mcp-tools/explain.test.ts +0 -46
- package/src/__tests__/mcp-tools/graph-query.test.ts +0 -45
- package/src/__tests__/mcp-tools/group-sync.test.ts +0 -8
- package/src/__tests__/mcp-tools/impact-filtering.test.ts +0 -48
- package/src/__tests__/mcp-tools/impact.risk.test.ts +0 -24
- package/src/__tests__/mcp-tools/list-repos.test.ts +0 -24
- package/src/__tests__/mcp-tools/neighbors.test.ts +0 -48
- package/src/__tests__/mcp-tools/query.test.ts +0 -42
- package/src/__tests__/parsers/language-parsers.test.ts +0 -52
- package/src/__tests__/parsers/named-bindings.test.ts +0 -73
- package/src/__tests__/pipeline/cluster-only.test.ts +0 -33
- package/src/__tests__/pipeline/phases/bridge-adapters/electron-ipc.test.ts +0 -87
- package/src/__tests__/pipeline/phases/bridge-adapters/tauri.test.ts +0 -116
- package/src/__tests__/pipeline/phases/bridge-adapters/wails.test.ts +0 -81
- package/src/__tests__/pipeline/phases/bridge-resolver.test.ts +0 -110
- package/src/__tests__/pipeline/phases/communities.cohesion.test.ts +0 -43
- package/src/__tests__/pipeline/phases/community-split.test.ts +0 -30
- package/src/__tests__/pipeline/phases/framework-detect.test.ts +0 -65
- package/src/__tests__/pipeline/phases/import-resolver.test.ts +0 -64
- package/src/__tests__/pipeline/phases/parse-arrow.test.ts +0 -33
- package/src/__tests__/pipeline/phases/parse-csharp.test.ts +0 -33
- package/src/__tests__/pipeline/phases/scan.monographignore.test.ts +0 -53
- package/src/__tests__/pipeline/phases/scan.negation.test.ts +0 -40
- package/src/__tests__/pipeline/phases/scope-resolution.go.test.ts +0 -34
- package/src/__tests__/pipeline/phases/scope-resolution.java.test.ts +0 -30
- package/src/__tests__/pipeline/phases/scope-resolution.rust.test.ts +0 -31
- package/src/__tests__/pipeline/phases/suggest-questions.test.ts +0 -46
- package/src/__tests__/pipeline/phases/surprises-scoring.test.ts +0 -46
- package/src/__tests__/pipeline/phases/variables-phase.test.ts +0 -78
- package/src/__tests__/pipeline/phases/wildcard-phase.test.ts +0 -99
- package/src/__tests__/pipeline/runner.parallel.test.ts +0 -78
- package/src/__tests__/reporting/graph-report-confidence.test.ts +0 -43
- package/src/__tests__/reporting/graph-report-gaps.test.ts +0 -41
- package/src/__tests__/scope-resolution/call-sites.test.ts +0 -89
- package/src/__tests__/scope-resolution/evidence-weights.test.ts +0 -49
- package/src/__tests__/search/diacritic.test.ts +0 -23
- package/src/__tests__/security/safe-fetch.test.ts +0 -125
- package/src/__tests__/skills/platform-skills.extra.test.ts +0 -36
- package/src/__tests__/web/api.clusters.test.ts +0 -65
- package/src/__tests__/web/api.file.test.ts +0 -44
- package/src/__tests__/web/api.grep.test.ts +0 -47
- package/src/__tests__/web/api.info.test.ts +0 -18
- package/src/__tests__/web/api.jobs.test.ts +0 -47
- package/src/__tests__/web/api.progress.test.ts +0 -25
- package/src/__tests__/web/api.stream.test.ts +0 -35
- package/src/__tests__/wiki/providers-reasoning.test.ts +0 -46
- package/src/__tests__/wiki/wiki-review-mode.test.ts +0 -22
- package/src/analysis/benchmark.ts +0 -132
- package/src/analysis/changed-files.ts +0 -73
- package/src/analysis/changed-workspaces.ts +0 -94
- package/src/analysis/churn-cache.ts +0 -179
- package/src/analysis/churn-trend.ts +0 -57
- package/src/analysis/churn.ts +0 -263
- package/src/analysis/cluster-quality.ts +0 -142
- package/src/analysis/combined.ts +0 -41
- package/src/analysis/corpus-health.ts +0 -41
- package/src/analysis/coverage-gaps.ts +0 -246
- package/src/analysis/dep-classification.ts +0 -167
- package/src/analysis/dependency-health.ts +0 -146
- package/src/analysis/duplicate-exports.ts +0 -110
- package/src/analysis/fallow-suppression.ts +0 -98
- package/src/analysis/feature-flags-config.ts +0 -47
- package/src/analysis/feature-flags.ts +0 -223
- package/src/analysis/file-classifier.ts +0 -87
- package/src/analysis/git-changed-files.ts +0 -62
- package/src/analysis/health-baseline.ts +0 -80
- package/src/analysis/issue-filters.ts +0 -56
- package/src/analysis/list.ts +0 -74
- package/src/analysis/node-similarity.ts +0 -115
- package/src/analysis/private-type-leaks.ts +0 -119
- package/src/analysis/progress.ts +0 -43
- package/src/analysis/project-state.ts +0 -95
- package/src/analysis/regression-config.ts +0 -36
- package/src/analysis/rule-overrides.ts +0 -81
- package/src/analysis/scripts.ts +0 -95
- package/src/analysis/shape-extractor.ts +0 -202
- package/src/analysis/since-duration.ts +0 -42
- package/src/analysis/suppression-context.ts +0 -95
- package/src/analysis/suppressions.ts +0 -80
- package/src/analysis/surprise-scorer.ts +0 -74
- package/src/analysis/targets.ts +0 -237
- package/src/analysis/unused-class-members.ts +0 -79
- package/src/analysis/workspace-filter.ts +0 -89
- package/src/analyze/boundary-analysis.ts +0 -129
- package/src/analyze/predicates/file.ts +0 -86
- package/src/analyze/predicates/import.ts +0 -90
- package/src/analyze/predicates/lifecycle.ts +0 -55
- package/src/analyze/unused-deps.ts +0 -70
- package/src/analyze/unused-exports.ts +0 -145
- package/src/analyze/unused-files.ts +0 -46
- package/src/api/production-override.ts +0 -63
- package/src/api/programmatic.ts +0 -118
- package/src/audit.ts +0 -234
- package/src/cache/augment-cache.ts +0 -63
- package/src/cache/extraction-cache.ts +0 -141
- package/src/check/filtering.ts +0 -78
- package/src/check/index.ts +0 -99
- package/src/check/output.ts +0 -79
- package/src/check/rules.ts +0 -61
- package/src/ci-template.ts +0 -84
- package/src/claude-cli.ts +0 -59
- package/src/cli/ai-context.ts +0 -193
- package/src/cli/augment.ts +0 -114
- package/src/cli/check-update.ts +0 -40
- package/src/cli/doctor.ts +0 -182
- package/src/cli/eval-server.ts +0 -126
- package/src/cli/hooks-install.ts +0 -202
- package/src/cli/setup.ts +0 -197
- package/src/cli/skill-gen.ts +0 -347
- package/src/commands/flags.ts +0 -72
- package/src/config/boundary-config.ts +0 -183
- package/src/config/cli-schema.ts +0 -81
- package/src/config/config-parsing.ts +0 -102
- package/src/config/duplicates-config.ts +0 -62
- package/src/config/external-plugin.ts +0 -77
- package/src/config/health-config.ts +0 -42
- package/src/config/ignore-exports-used-in-file.ts +0 -46
- package/src/config/migration-types.ts +0 -73
- package/src/config/output-format.ts +0 -24
- package/src/config/plugins/builtin.ts +0 -411
- package/src/config/plugins/registry.ts +0 -77
- package/src/config/plugins/types.ts +0 -14
- package/src/config/resolution.ts +0 -102
- package/src/config/rules.ts +0 -70
- package/src/config/schema-gen.ts +0 -115
- package/src/config/types.ts +0 -149
- package/src/config/used-class-members.ts +0 -53
- package/src/config/validate.ts +0 -108
- package/src/config/workspace.ts +0 -137
- package/src/coverage/cloud-client.ts +0 -111
- package/src/coverage/upload-inventory.ts +0 -84
- package/src/coverage/upload-source-maps.ts +0 -97
- package/src/discover/entry-points.ts +0 -51
- package/src/discover/infrastructure-entries.ts +0 -175
- package/src/duplicates/detect/concatenation.ts +0 -37
- package/src/duplicates/detect/extraction.ts +0 -107
- package/src/duplicates/detect/filtering.ts +0 -112
- package/src/duplicates/detect/lcp.ts +0 -27
- package/src/duplicates/detect/ranking.ts +0 -16
- package/src/duplicates/detect/statistics.ts +0 -69
- package/src/duplicates/detect/suffix-array.ts +0 -88
- package/src/duplicates/families.ts +0 -95
- package/src/duplicates/normalize.ts +0 -58
- package/src/duplicates/shingle-filter.ts +0 -37
- package/src/duplicates/token-types.ts +0 -62
- package/src/duplicates/tokenize/index.ts +0 -104
- package/src/error/fallow-error.ts +0 -94
- package/src/error.ts +0 -47
- package/src/export/adjacency-matrix.ts +0 -127
- package/src/export/analysis-json.ts +0 -87
- package/src/export/badge.ts +0 -105
- package/src/export/canvas.ts +0 -42
- package/src/export/codeclimate.ts +0 -201
- package/src/export/compact-health.ts +0 -119
- package/src/export/compact.ts +0 -83
- package/src/export/csv.ts +0 -33
- package/src/export/cypher.ts +0 -33
- package/src/export/dot.ts +0 -52
- package/src/export/gexf.ts +0 -59
- package/src/export/graphml.ts +0 -50
- package/src/export/html.ts +0 -548
- package/src/export/index.ts +0 -9
- package/src/export/json.ts +0 -36
- package/src/export/markdown.ts +0 -290
- package/src/export/mermaid.ts +0 -100
- package/src/export/obsidian.ts +0 -44
- package/src/export/sarif.ts +0 -245
- package/src/export/svg.ts +0 -68
- package/src/fix/deps.ts +0 -70
- package/src/fix/enum-members.ts +0 -103
- package/src/fix/export-surgery.ts +0 -197
- package/src/fix/exports.ts +0 -93
- package/src/fix/orchestrator.ts +0 -67
- package/src/graph/analyzer.ts +0 -69
- package/src/graph/author-analytics.ts +0 -217
- package/src/graph/baseline.ts +0 -432
- package/src/graph/clone-families.ts +0 -132
- package/src/graph/codeowners-extended.ts +0 -114
- package/src/graph/codeowners-gitlab.ts +0 -150
- package/src/graph/codeowners.ts +0 -217
- package/src/graph/complexity.ts +0 -200
- package/src/graph/cross-reference-findings.ts +0 -85
- package/src/graph/cross-reference.ts +0 -139
- package/src/graph/cycle-detection.ts +0 -311
- package/src/graph/cycles.ts +0 -222
- package/src/graph/dead-code.ts +0 -128
- package/src/graph/dependency-closure.ts +0 -126
- package/src/graph/dfs.ts +0 -118
- package/src/graph/diff.ts +0 -92
- package/src/graph/duplication-stats.ts +0 -79
- package/src/graph/edge-filter.ts +0 -117
- package/src/graph/explain.ts +0 -133
- package/src/graph/external-style-usage.ts +0 -81
- package/src/graph/health-score.ts +0 -179
- package/src/graph/hotspots.ts +0 -219
- package/src/graph/import-chain.ts +0 -148
- package/src/graph/loader.ts +0 -44
- package/src/graph/maintainability.ts +0 -156
- package/src/graph/merge.ts +0 -174
- package/src/graph/mirrored-dirs.ts +0 -202
- package/src/graph/narrowing.ts +0 -92
- package/src/graph/node-search.ts +0 -201
- package/src/graph/node-types.ts +0 -67
- package/src/graph/normalize-id.ts +0 -138
- package/src/graph/pagerank.ts +0 -165
- package/src/graph/prune.ts +0 -95
- package/src/graph/re-exports/propagate.ts +0 -95
- package/src/graph/reachability.ts +0 -99
- package/src/graph/regex-search.ts +0 -232
- package/src/graph/regression.ts +0 -199
- package/src/graph/resolve/discover-types.ts +0 -45
- package/src/graph/resolve/dynamic-imports.ts +0 -102
- package/src/graph/resolve/fallbacks.ts +0 -79
- package/src/graph/resolve/index.ts +0 -68
- package/src/graph/resolve/path-info.ts +0 -41
- package/src/graph/resolve/re-exports.ts +0 -14
- package/src/graph/resolve/react-native.ts +0 -27
- package/src/graph/resolve/require-imports.ts +0 -18
- package/src/graph/resolve/specifier.ts +0 -120
- package/src/graph/resolve/static-imports.ts +0 -14
- package/src/graph/resolve/types.ts +0 -108
- package/src/graph/resolve/upgrades.ts +0 -32
- package/src/graph/ripple-impact.ts +0 -131
- package/src/graph/risk-profile.ts +0 -179
- package/src/graph/statistics.ts +0 -165
- package/src/graph/stats.ts +0 -157
- package/src/graph/subgraph.ts +0 -162
- package/src/graph/topo-sort.ts +0 -171
- package/src/graph/wcc.ts +0 -187
- package/src/groups/contract-bridge.ts +0 -103
- package/src/groups/contract-registry.ts +0 -263
- package/src/groups/group-config.ts +0 -108
- package/src/groups/group-search.ts +0 -139
- package/src/groups/group-sync.ts +0 -82
- package/src/groups/grpc-extractor.ts +0 -64
- package/src/groups/service-boundary.ts +0 -119
- package/src/groups/topic-extractor.ts +0 -90
- package/src/health/analysis-counts-snapshot.ts +0 -57
- package/src/health/analysis-counts.ts +0 -70
- package/src/health/complexity-findings.ts +0 -115
- package/src/health/distribution-thresholds.ts +0 -54
- package/src/health/grouping.ts +0 -138
- package/src/health/health-grouping.ts +0 -86
- package/src/health/health-report-types.ts +0 -165
- package/src/health/health-report.ts +0 -81
- package/src/health/health-score.ts +0 -65
- package/src/health/hotspot-utils.ts +0 -55
- package/src/health/hotspots.ts +0 -104
- package/src/health/large-functions.ts +0 -34
- package/src/health/ownership-metrics.ts +0 -61
- package/src/health/ownership-risk.ts +0 -98
- package/src/health/ownership.ts +0 -174
- package/src/health/quality-gate.ts +0 -57
- package/src/health/risk-profile.ts +0 -39
- package/src/health/runtime-coverage-report.ts +0 -101
- package/src/health/runtime-coverage.ts +0 -71
- package/src/health/scores.ts +0 -72
- package/src/health/scoring-types.ts +0 -48
- package/src/health/target-thresholds.ts +0 -92
- package/src/health/target-types.ts +0 -54
- package/src/health/targets.ts +0 -151
- package/src/health/timings.ts +0 -86
- package/src/health/trend-types.ts +0 -57
- package/src/health/trends.ts +0 -86
- package/src/health/vital-signs-compute.ts +0 -108
- package/src/health/vital-signs-snapshot.ts +0 -72
- package/src/health/vital-signs.ts +0 -101
- package/src/index.ts +0 -111
- package/src/ingest/git-clone.ts +0 -246
- package/src/ingest/query-memory.ts +0 -132
- package/src/ingest/transcribe.ts +0 -254
- package/src/ingest/url-ingest.ts +0 -87
- package/src/init/agent-hooks.ts +0 -86
- package/src/init/git-hooks.ts +0 -71
- package/src/init/project-detection.ts +0 -105
- package/src/license/manager.ts +0 -120
- package/src/lsp/code-actions.ts +0 -127
- package/src/lsp/code-lens.ts +0 -56
- package/src/lsp/diagnostics-ext.ts +0 -150
- package/src/lsp/diagnostics-push.ts +0 -103
- package/src/lsp/diagnostics.ts +0 -98
- package/src/lsp/hover.ts +0 -64
- package/src/lsp/server.ts +0 -254
- package/src/mcp/params.ts +0 -201
- package/src/mcp/resources.ts +0 -124
- package/src/mcp/tool-builders.ts +0 -203
- package/src/mcp-resources/communities-resource.ts +0 -72
- package/src/mcp-resources/graph-resource.ts +0 -14
- package/src/mcp-resources/index.ts +0 -9
- package/src/mcp-resources/named-cluster-resource.ts +0 -35
- package/src/mcp-resources/named-process-resource.ts +0 -26
- package/src/mcp-resources/processes-resource.ts +0 -67
- package/src/mcp-resources/repo-context-resource.ts +0 -36
- package/src/mcp-resources/repos-resource.ts +0 -21
- package/src/mcp-resources/schema-resource.ts +0 -46
- package/src/mcp-resources/wiki-resource.ts +0 -23
- package/src/mcp-tools/api-impact.ts +0 -181
- package/src/mcp-tools/context.ts +0 -111
- package/src/mcp-tools/cypher.ts +0 -29
- package/src/mcp-tools/detect-changes.ts +0 -116
- package/src/mcp-tools/explain.ts +0 -65
- package/src/mcp-tools/graph-query.ts +0 -128
- package/src/mcp-tools/group-list.ts +0 -88
- package/src/mcp-tools/group-query.ts +0 -26
- package/src/mcp-tools/group-sync.ts +0 -32
- package/src/mcp-tools/impact.ts +0 -202
- package/src/mcp-tools/index.ts +0 -21
- package/src/mcp-tools/list-repos.ts +0 -38
- package/src/mcp-tools/neighbors.ts +0 -80
- package/src/mcp-tools/query.ts +0 -86
- package/src/mcp-tools/rename.ts +0 -118
- package/src/mcp-tools/route-map.ts +0 -98
- package/src/mcp-tools/serve.ts +0 -41
- package/src/mcp-tools/shape-check.ts +0 -182
- package/src/mcp-tools/staleness.ts +0 -13
- package/src/mcp-tools/tool-map.ts +0 -66
- package/src/mcp-tools/wiki-build.ts +0 -37
- package/src/mcp-tools/wiki.ts +0 -28
- package/src/migrate/jscpd.ts +0 -78
- package/src/migrate/jsonc-gen.ts +0 -38
- package/src/migrate/knip.ts +0 -126
- package/src/migrate/toml-gen.ts +0 -48
- package/src/parsers/c.ts +0 -31
- package/src/parsers/cpp.ts +0 -29
- package/src/parsers/csharp.ts +0 -43
- package/src/parsers/dart.ts +0 -39
- package/src/parsers/extractor.ts +0 -202
- package/src/parsers/go.ts +0 -27
- package/src/parsers/java.ts +0 -27
- package/src/parsers/kotlin.ts +0 -36
- package/src/parsers/language-config.ts +0 -28
- package/src/parsers/language-parsers.ts +0 -120
- package/src/parsers/loader.ts +0 -149
- package/src/parsers/named-bindings.ts +0 -63
- package/src/parsers/php.ts +0 -37
- package/src/parsers/python.ts +0 -26
- package/src/parsers/ruby.ts +0 -39
- package/src/parsers/rust.ts +0 -25
- package/src/parsers/swift.ts +0 -28
- package/src/parsers/typescript.ts +0 -41
- package/src/parsers/vue.ts +0 -79
- package/src/pipeline/cluster-only.ts +0 -64
- package/src/pipeline/effort.ts +0 -50
- package/src/pipeline/orchestrator.ts +0 -384
- package/src/pipeline/phases/boundary.ts +0 -151
- package/src/pipeline/phases/bridge-adapters/electron-ipc.ts +0 -91
- package/src/pipeline/phases/bridge-adapters/registry.ts +0 -14
- package/src/pipeline/phases/bridge-adapters/tauri.ts +0 -103
- package/src/pipeline/phases/bridge-adapters/types.ts +0 -31
- package/src/pipeline/phases/bridge-adapters/wails.ts +0 -33
- package/src/pipeline/phases/bridge-resolver.ts +0 -77
- package/src/pipeline/phases/call-site-extractors.ts +0 -177
- package/src/pipeline/phases/communities.ts +0 -183
- package/src/pipeline/phases/contextual-proximity.ts +0 -88
- package/src/pipeline/phases/cross-file.ts +0 -116
- package/src/pipeline/phases/docs-parse.ts +0 -307
- package/src/pipeline/phases/evidence.ts +0 -9
- package/src/pipeline/phases/field-access.ts +0 -49
- package/src/pipeline/phases/framework-detect.ts +0 -109
- package/src/pipeline/phases/god-nodes.ts +0 -163
- package/src/pipeline/phases/import-resolver.ts +0 -114
- package/src/pipeline/phases/leiden.ts +0 -77
- package/src/pipeline/phases/llm-extract.ts +0 -178
- package/src/pipeline/phases/markdown.ts +0 -121
- package/src/pipeline/phases/middleware-extractor.ts +0 -127
- package/src/pipeline/phases/module-resolution.ts +0 -294
- package/src/pipeline/phases/mro.ts +0 -56
- package/src/pipeline/phases/orm.ts +0 -503
- package/src/pipeline/phases/parse.ts +0 -222
- package/src/pipeline/phases/pdf-parse.ts +0 -133
- package/src/pipeline/phases/processes.ts +0 -249
- package/src/pipeline/phases/re-export-propagation.ts +0 -160
- package/src/pipeline/phases/reachability.ts +0 -156
- package/src/pipeline/phases/routes.ts +0 -350
- package/src/pipeline/phases/scan.ts +0 -133
- package/src/pipeline/phases/scope-resolution.ts +0 -442
- package/src/pipeline/phases/structure.ts +0 -68
- package/src/pipeline/phases/suggest.ts +0 -92
- package/src/pipeline/phases/surprises.ts +0 -83
- package/src/pipeline/phases/tools.ts +0 -180
- package/src/pipeline/phases/variables-phase.ts +0 -37
- package/src/pipeline/phases/variables.ts +0 -67
- package/src/pipeline/phases/wildcard-phase.ts +0 -50
- package/src/pipeline/phases/wildcard-synthesis.ts +0 -214
- package/src/pipeline/progress.ts +0 -58
- package/src/pipeline/runner.ts +0 -88
- package/src/pipeline/types.ts +0 -41
- package/src/query/cypher-parser.ts +0 -450
- package/src/registry/repo-registry.ts +0 -125
- package/src/regression/baseline-deltas.ts +0 -215
- package/src/regression/baseline.ts +0 -76
- package/src/regression/counts.ts +0 -87
- package/src/regression/outcome.ts +0 -78
- package/src/regression/tolerance.ts +0 -35
- package/src/report/attributed-duplication.ts +0 -112
- package/src/report/badge-svg.ts +0 -100
- package/src/report/cross-ref-human.ts +0 -50
- package/src/report/duplication-grouping.ts +0 -74
- package/src/report/grouping.ts +0 -137
- package/src/report/human-check.ts +0 -291
- package/src/report/human-dupes.ts +0 -142
- package/src/report/human-health.ts +0 -195
- package/src/report/human.ts +0 -120
- package/src/report/json-actions.ts +0 -91
- package/src/report/json-builders.ts +0 -70
- package/src/report/json-schema.ts +0 -75
- package/src/report/number-format.ts +0 -91
- package/src/report/output-grouped.ts +0 -102
- package/src/report/pipeline-perf.ts +0 -56
- package/src/report/trace-human.ts +0 -127
- package/src/reporting/graph-report.ts +0 -431
- package/src/results/fallow-results.ts +0 -152
- package/src/results/types.ts +0 -149
- package/src/scope-resolution/evidence-weights.ts +0 -41
- package/src/search/ast-chunker.ts +0 -206
- package/src/search/diacritic.ts +0 -7
- package/src/search/hybrid-query.ts +0 -65
- package/src/search/rrf.ts +0 -51
- package/src/security/safe-fetch.ts +0 -113
- package/src/security/sensitive-files.ts +0 -24
- package/src/skills/platform-skills.ts +0 -233
- package/src/staleness/git-staleness.ts +0 -66
- package/src/storage/db.ts +0 -110
- package/src/storage/edge-store.ts +0 -103
- package/src/storage/file-cache.ts +0 -78
- package/src/storage/fts-store.ts +0 -385
- package/src/storage/node-store.ts +0 -209
- package/src/storage/schema.ts +0 -171
- package/src/storage/suppressions.ts +0 -145
- package/src/storage/unlinked-refs.ts +0 -117
- package/src/types.ts +0 -197
- package/src/validation/extraction-validator.ts +0 -54
- package/src/watch/watcher.ts +0 -160
- package/src/web/analyze-api.ts +0 -146
- package/src/web/api.ts +0 -584
- package/src/web/async-jobs.ts +0 -109
- package/src/web/mcp-http.ts +0 -227
- package/src/web/react-ui.ts +0 -78
- package/src/web/server.ts +0 -90
- package/src/web/ui/index.html +0 -204
- package/src/wiki/gist-publisher.ts +0 -76
- package/src/wiki/prompt-builder.ts +0 -35
- package/src/wiki/providers.ts +0 -134
- package/src/wiki/wiki-generator.ts +0 -223
- package/src/wiki/wiki-store.ts +0 -49
- package/tsconfig.json +0 -11
- package/vitest.config.ts +0 -20
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export interface HealthGroup {
|
|
2
|
-
name: string;
|
|
3
|
-
files: string[];
|
|
4
|
-
fileCount: number;
|
|
5
|
-
score: number;
|
|
6
|
-
grade: string;
|
|
7
|
-
totalLines: number;
|
|
8
|
-
unusedExports: number;
|
|
9
|
-
circularDeps: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface HealthGrouping {
|
|
13
|
-
groups: HealthGroup[];
|
|
14
|
-
totalFiles: number;
|
|
15
|
-
averageScore: number;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function groupFilesByOwner(
|
|
19
|
-
files: Array<{ filePath: string }>,
|
|
20
|
-
resolveOwner: (filePath: string) => string,
|
|
21
|
-
): Map<string, string[]> {
|
|
22
|
-
const result = new Map<string, string[]>();
|
|
23
|
-
for (const { filePath } of files) {
|
|
24
|
-
const owner = resolveOwner(filePath);
|
|
25
|
-
const list = result.get(owner);
|
|
26
|
-
if (list != null) {
|
|
27
|
-
list.push(filePath);
|
|
28
|
-
} else {
|
|
29
|
-
result.set(owner, [filePath]);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function computeGroupScore(
|
|
36
|
-
files: string[],
|
|
37
|
-
scoreMap: Map<string, number>,
|
|
38
|
-
): number {
|
|
39
|
-
const known = files.filter(f => scoreMap.has(f));
|
|
40
|
-
if (known.length === 0) return 100;
|
|
41
|
-
const sum = known.reduce((acc, f) => acc + scoreMap.get(f)!, 0);
|
|
42
|
-
return sum / known.length;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function gradeFromScore(score: number): string {
|
|
46
|
-
if (score >= 90) return 'A';
|
|
47
|
-
if (score >= 75) return 'B';
|
|
48
|
-
if (score >= 60) return 'C';
|
|
49
|
-
if (score >= 40) return 'D';
|
|
50
|
-
return 'F';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function buildHealthGrouping(
|
|
54
|
-
files: string[],
|
|
55
|
-
resolveOwner: (filePath: string) => string,
|
|
56
|
-
scoreMap: Map<string, number>,
|
|
57
|
-
lineCountMap: Map<string, number>,
|
|
58
|
-
): HealthGrouping {
|
|
59
|
-
const grouped = groupFilesByOwner(files.map(f => ({ filePath: f })), resolveOwner);
|
|
60
|
-
|
|
61
|
-
const groups: HealthGroup[] = [];
|
|
62
|
-
for (const [owner, ownerFiles] of grouped.entries()) {
|
|
63
|
-
const score = computeGroupScore(ownerFiles, scoreMap);
|
|
64
|
-
const totalLines = ownerFiles.reduce((sum, f) => sum + (lineCountMap.get(f) ?? 0), 0);
|
|
65
|
-
groups.push({
|
|
66
|
-
name: owner,
|
|
67
|
-
files: ownerFiles,
|
|
68
|
-
fileCount: ownerFiles.length,
|
|
69
|
-
score,
|
|
70
|
-
grade: gradeFromScore(score),
|
|
71
|
-
totalLines,
|
|
72
|
-
unusedExports: 0,
|
|
73
|
-
circularDeps: 0,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
groups.sort((a, b) => b.score - a.score);
|
|
78
|
-
|
|
79
|
-
const totalFiles = files.length;
|
|
80
|
-
const averageScore =
|
|
81
|
-
groups.length > 0
|
|
82
|
-
? groups.reduce((sum, g) => sum + g.score * g.fileCount, 0) / Math.max(totalFiles, 1)
|
|
83
|
-
: 100;
|
|
84
|
-
|
|
85
|
-
return { groups, totalFiles, averageScore };
|
|
86
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import type { ExceededThreshold, FindingSeverity } from './scores.js';
|
|
2
|
-
import type { TrendDirection, TrendMetric, TrendPoint } from './trend-types.js';
|
|
3
|
-
|
|
4
|
-
export type HealthGradeLetter = 'A' | 'B' | 'C' | 'D' | 'F';
|
|
5
|
-
|
|
6
|
-
export const HOTSPOT_SCORE_THRESHOLD = 50.0;
|
|
7
|
-
|
|
8
|
-
export function letterGrade(score: number): HealthGradeLetter {
|
|
9
|
-
if (score >= 90) return 'A';
|
|
10
|
-
if (score >= 75) return 'B';
|
|
11
|
-
if (score >= 60) return 'C';
|
|
12
|
-
if (score >= 40) return 'D';
|
|
13
|
-
return 'F';
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface HealthScorePenalties {
|
|
17
|
-
complexity: number;
|
|
18
|
-
duplication: number;
|
|
19
|
-
deadCode: number;
|
|
20
|
-
coupling: number;
|
|
21
|
-
maintainability: number;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface HealthScore {
|
|
25
|
-
score: number;
|
|
26
|
-
grade: HealthGradeLetter;
|
|
27
|
-
penalties: HealthScorePenalties;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface HealthFinding {
|
|
31
|
-
path: string;
|
|
32
|
-
name: string;
|
|
33
|
-
line?: number;
|
|
34
|
-
col?: number;
|
|
35
|
-
cyclomatic?: number;
|
|
36
|
-
cognitive?: number;
|
|
37
|
-
lineCount?: number;
|
|
38
|
-
paramCount?: number;
|
|
39
|
-
exceeded?: ExceededThreshold;
|
|
40
|
-
severity?: FindingSeverity;
|
|
41
|
-
crap?: number;
|
|
42
|
-
coveragePct?: number;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface FileScore {
|
|
46
|
-
path: string;
|
|
47
|
-
maintainabilityIndex?: number;
|
|
48
|
-
fanIn?: number;
|
|
49
|
-
fanOut?: number;
|
|
50
|
-
deadCodeRatio?: number;
|
|
51
|
-
complexityDensity?: number;
|
|
52
|
-
crapMax?: number;
|
|
53
|
-
crapAboveThreshold?: number;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface UnitSizeProfile {
|
|
57
|
-
tiny: number;
|
|
58
|
-
small: number;
|
|
59
|
-
medium: number;
|
|
60
|
-
large: number;
|
|
61
|
-
huge: number;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface IssueCounts {
|
|
65
|
-
unusedFiles: number;
|
|
66
|
-
unusedExports: number;
|
|
67
|
-
unusedTypes: number;
|
|
68
|
-
privateTypeLeaks: number;
|
|
69
|
-
unusedDependencies: number;
|
|
70
|
-
unresolvedImports: number;
|
|
71
|
-
circularDependencies: number;
|
|
72
|
-
boundaryViolations: number;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface VitalSigns {
|
|
76
|
-
deadFilePct: number;
|
|
77
|
-
deadExportPct: number;
|
|
78
|
-
avgCyclomatic: number;
|
|
79
|
-
p90Cyclomatic: number;
|
|
80
|
-
duplicationPct: number;
|
|
81
|
-
hotspotCount: number;
|
|
82
|
-
maintainabilityAvg: number;
|
|
83
|
-
unusedDepCount: number;
|
|
84
|
-
circularDepCount: number;
|
|
85
|
-
counts: IssueCounts;
|
|
86
|
-
unitSizeProfile: UnitSizeProfile;
|
|
87
|
-
couplingHighPct: number;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface RuntimeCoverageEvidence {
|
|
91
|
-
triggeredFiles: number;
|
|
92
|
-
totalFiles: number;
|
|
93
|
-
pct: number;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export type RuntimeCoverageVerdict = 'Sufficient' | 'Low' | 'Missing' | 'Unknown';
|
|
97
|
-
|
|
98
|
-
export interface RuntimeCoverageSummary {
|
|
99
|
-
verdict: RuntimeCoverageVerdict;
|
|
100
|
-
evidence?: RuntimeCoverageEvidence;
|
|
101
|
-
message?: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface HealthTrend {
|
|
105
|
-
comparedTo: TrendPoint;
|
|
106
|
-
metrics: TrendMetric[];
|
|
107
|
-
overallDirection: TrendDirection;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export interface HealthReport {
|
|
111
|
-
score: HealthScore;
|
|
112
|
-
findings: HealthFinding[];
|
|
113
|
-
fileScores: FileScore[];
|
|
114
|
-
vitalSigns?: VitalSigns;
|
|
115
|
-
hotspots: HealthFinding[];
|
|
116
|
-
trend?: HealthTrend;
|
|
117
|
-
runtimeCoverage?: RuntimeCoverageSummary;
|
|
118
|
-
generatedAt: string;
|
|
119
|
-
root: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export function makeHealthScore(score: number, penalties: Partial<HealthScorePenalties> = {}): HealthScore {
|
|
123
|
-
return {
|
|
124
|
-
score: Math.max(0, Math.min(100, score)),
|
|
125
|
-
grade: letterGrade(score),
|
|
126
|
-
penalties: {
|
|
127
|
-
complexity: penalties.complexity ?? 0,
|
|
128
|
-
duplication: penalties.duplication ?? 0,
|
|
129
|
-
deadCode: penalties.deadCode ?? 0,
|
|
130
|
-
coupling: penalties.coupling ?? 0,
|
|
131
|
-
maintainability: penalties.maintainability ?? 0,
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export function computeVitalSigns(partial: Partial<VitalSigns>): VitalSigns {
|
|
137
|
-
return {
|
|
138
|
-
deadFilePct: partial.deadFilePct ?? 0,
|
|
139
|
-
deadExportPct: partial.deadExportPct ?? 0,
|
|
140
|
-
avgCyclomatic: partial.avgCyclomatic ?? 0,
|
|
141
|
-
p90Cyclomatic: partial.p90Cyclomatic ?? 0,
|
|
142
|
-
duplicationPct: partial.duplicationPct ?? 0,
|
|
143
|
-
hotspotCount: partial.hotspotCount ?? 0,
|
|
144
|
-
maintainabilityAvg: partial.maintainabilityAvg ?? 100,
|
|
145
|
-
unusedDepCount: partial.unusedDepCount ?? 0,
|
|
146
|
-
circularDepCount: partial.circularDepCount ?? 0,
|
|
147
|
-
counts: partial.counts ?? { unusedFiles: 0, unusedExports: 0, unusedTypes: 0, privateTypeLeaks: 0, unusedDependencies: 0, unresolvedImports: 0, circularDependencies: 0, boundaryViolations: 0 },
|
|
148
|
-
unitSizeProfile: partial.unitSizeProfile ?? { tiny: 0, small: 0, medium: 0, large: 0, huge: 0 },
|
|
149
|
-
couplingHighPct: partial.couplingHighPct ?? 0,
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export function formatVitalSigns(vs: VitalSigns): string[] {
|
|
154
|
-
return [
|
|
155
|
-
`Dead files: ${vs.counts.unusedFiles} (${vs.deadFilePct.toFixed(1)}%)`,
|
|
156
|
-
`Dead exports: ${vs.counts.unusedExports} (${vs.deadExportPct.toFixed(1)}%)`,
|
|
157
|
-
`Avg cyclomatic: ${vs.avgCyclomatic.toFixed(1)} (p90: ${vs.p90Cyclomatic.toFixed(1)})`,
|
|
158
|
-
`Duplication: ${vs.duplicationPct.toFixed(1)}%`,
|
|
159
|
-
`Hotspots: ${vs.hotspotCount}`,
|
|
160
|
-
`Maintainability: ${vs.maintainabilityAvg.toFixed(1)}/100`,
|
|
161
|
-
`Unused deps: ${vs.unusedDepCount}`,
|
|
162
|
-
`Circular deps: ${vs.circularDepCount}`,
|
|
163
|
-
`High coupling: ${vs.couplingHighPct.toFixed(1)}%`,
|
|
164
|
-
];
|
|
165
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// Top-level container that bundles every health-pipeline output into a
|
|
2
|
-
// single serializable object for LSP, CI, and dashboard consumers.
|
|
3
|
-
|
|
4
|
-
export interface HealthReportSummary {
|
|
5
|
-
healthScore: number;
|
|
6
|
-
healthGrade: 'A' | 'B' | 'C' | 'D' | 'F';
|
|
7
|
-
totalFiles: number;
|
|
8
|
-
totalLoc: number;
|
|
9
|
-
issueCount: number;
|
|
10
|
-
coverageModel: string;
|
|
11
|
-
generatedAt: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface HealthReport {
|
|
15
|
-
summary: HealthReportSummary;
|
|
16
|
-
|
|
17
|
-
// Core analysis outputs (all optional — skipped-when-absent for partial runs)
|
|
18
|
-
findings?: unknown[];
|
|
19
|
-
fileScores?: unknown[];
|
|
20
|
-
coverageGaps?: unknown;
|
|
21
|
-
hotspots?: unknown[];
|
|
22
|
-
hotspotSummary?: unknown;
|
|
23
|
-
runtimeCoverage?: unknown;
|
|
24
|
-
largeFunctions?: unknown[];
|
|
25
|
-
targets?: unknown[];
|
|
26
|
-
targetThresholds?: unknown;
|
|
27
|
-
healthTrend?: unknown;
|
|
28
|
-
vitalSigns?: unknown;
|
|
29
|
-
distributionThresholds?: unknown;
|
|
30
|
-
analysisCounts?: unknown;
|
|
31
|
-
timings?: unknown;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function createHealthReport(
|
|
35
|
-
summary: HealthReportSummary,
|
|
36
|
-
partials: Omit<HealthReport, 'summary'> = {},
|
|
37
|
-
): HealthReport {
|
|
38
|
-
const report: HealthReport = { summary };
|
|
39
|
-
for (const [key, value] of Object.entries(partials) as [keyof Omit<HealthReport, 'summary'>, unknown][]) {
|
|
40
|
-
if (value !== undefined && value !== null) {
|
|
41
|
-
(report as unknown as Record<string, unknown>)[key] = value;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return report;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function createHealthReportSummary(
|
|
48
|
-
healthScore: number,
|
|
49
|
-
totalFiles: number,
|
|
50
|
-
totalLoc: number,
|
|
51
|
-
coverageModel = 'none',
|
|
52
|
-
): HealthReportSummary {
|
|
53
|
-
// Use canonical thresholds from health-report-types.ts (A≥90, B≥75, C≥60, D≥40)
|
|
54
|
-
const grade: HealthReportSummary['healthGrade'] =
|
|
55
|
-
healthScore >= 90 ? 'A' :
|
|
56
|
-
healthScore >= 75 ? 'B' :
|
|
57
|
-
healthScore >= 60 ? 'C' :
|
|
58
|
-
healthScore >= 40 ? 'D' : 'F';
|
|
59
|
-
return {
|
|
60
|
-
healthScore,
|
|
61
|
-
healthGrade: grade,
|
|
62
|
-
totalFiles,
|
|
63
|
-
totalLoc,
|
|
64
|
-
issueCount: 0,
|
|
65
|
-
coverageModel,
|
|
66
|
-
generatedAt: new Date().toISOString(),
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function formatHealthReportSummary(s: HealthReportSummary): string {
|
|
71
|
-
return [
|
|
72
|
-
`Health: ${s.healthGrade} (${s.healthScore.toFixed(1)}/100)`,
|
|
73
|
-
`Files: ${s.totalFiles} LOC: ${s.totalLoc}`,
|
|
74
|
-
`Coverage model: ${s.coverageModel}`,
|
|
75
|
-
`Generated: ${s.generatedAt}`,
|
|
76
|
-
].join('\n');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export function healthReportToJson(report: HealthReport): string {
|
|
80
|
-
return JSON.stringify(report, null, 2);
|
|
81
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export const HOTSPOT_SCORE_THRESHOLD = 50;
|
|
2
|
-
export const MI_DENSITY_MIN_LINES = 50;
|
|
3
|
-
|
|
4
|
-
export type HealthGrade = 'A' | 'B' | 'C' | 'D' | 'F';
|
|
5
|
-
|
|
6
|
-
export interface HealthScorePenalties {
|
|
7
|
-
deadCode: number;
|
|
8
|
-
duplication: number;
|
|
9
|
-
complexityHigh: number;
|
|
10
|
-
complexityCritical: number;
|
|
11
|
-
crapHigh: number;
|
|
12
|
-
crapCritical: number;
|
|
13
|
-
hotspotDensity: number;
|
|
14
|
-
couplingConcentration: number;
|
|
15
|
-
busFactor: number;
|
|
16
|
-
largeFunctions: number;
|
|
17
|
-
unusedDeps: number;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface HealthScore {
|
|
21
|
-
value: number; // 0–100
|
|
22
|
-
grade: HealthGrade;
|
|
23
|
-
penalties: HealthScorePenalties;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface VitalSignsInput {
|
|
27
|
-
deadCodePct: number; // 0–100
|
|
28
|
-
duplicationPct: number; // 0–100
|
|
29
|
-
complexityHighPct: number; // 0–100
|
|
30
|
-
complexityCriticalPct: number;
|
|
31
|
-
crapHighPct: number;
|
|
32
|
-
crapCriticalPct: number;
|
|
33
|
-
hotspotDensity: number; // 0–100 normalised hotspot score
|
|
34
|
-
couplingHighPct: number;
|
|
35
|
-
busFactorRisk: number; // 0–1 (1 = bus factor of 1)
|
|
36
|
-
largeFunctionsPct: number;
|
|
37
|
-
unusedDepCount: number;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function computeHealthScore(vs: VitalSignsInput, totalFiles: number): HealthScore {
|
|
41
|
-
const p: HealthScorePenalties = {
|
|
42
|
-
deadCode: Math.min(15, vs.deadCodePct * 0.15),
|
|
43
|
-
duplication: Math.min(15, vs.duplicationPct * 0.15),
|
|
44
|
-
complexityHigh: Math.min(10, vs.complexityHighPct * 0.10),
|
|
45
|
-
complexityCritical: Math.min(10, vs.complexityCriticalPct * 0.20),
|
|
46
|
-
crapHigh: Math.min(10, vs.crapHighPct * 0.10),
|
|
47
|
-
crapCritical: Math.min(10, vs.crapCriticalPct * 0.20),
|
|
48
|
-
hotspotDensity: Math.min(10, vs.hotspotDensity * 0.10),
|
|
49
|
-
couplingConcentration:Math.min(5, vs.couplingHighPct * 0.05),
|
|
50
|
-
busFactor: Math.min(10, vs.busFactorRisk * 10),
|
|
51
|
-
largeFunctions: Math.min(5, vs.largeFunctionsPct * 0.10),
|
|
52
|
-
unusedDeps: Math.min(5, Math.min(vs.unusedDepCount, 10) * 0.5),
|
|
53
|
-
};
|
|
54
|
-
const total = Object.values(p).reduce((a, b) => a + b, 0);
|
|
55
|
-
const value = Math.max(0, Math.round(100 - total));
|
|
56
|
-
return { value, grade: letterGradeFromScore(value), penalties: p };
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function letterGradeFromScore(score: number): HealthGrade {
|
|
60
|
-
if (score >= 90) return 'A';
|
|
61
|
-
if (score >= 75) return 'B';
|
|
62
|
-
if (score >= 60) return 'C';
|
|
63
|
-
if (score >= 40) return 'D';
|
|
64
|
-
return 'F';
|
|
65
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export function isTestPath(filePath: string): boolean {
|
|
2
|
-
const normalized = filePath.replace(/\\/g, '/');
|
|
3
|
-
return (
|
|
4
|
-
normalized.includes('/__tests__/') ||
|
|
5
|
-
normalized.includes('/__mocks__/') ||
|
|
6
|
-
normalized.includes('/test/') ||
|
|
7
|
-
normalized.includes('/tests/') ||
|
|
8
|
-
normalized.includes('/e2e/') ||
|
|
9
|
-
normalized.includes('.test.') ||
|
|
10
|
-
normalized.includes('.spec.')
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface NormalizationMaxima {
|
|
15
|
-
maxWeightedCommits: number;
|
|
16
|
-
maxComplexityDensity: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function computeNormalizationMaxima(
|
|
20
|
-
files: Array<{ weightedCommits: number; complexityDensity: number }>,
|
|
21
|
-
percentile = 0.95,
|
|
22
|
-
): NormalizationMaxima {
|
|
23
|
-
if (files.length < 2) {
|
|
24
|
-
const maxWeightedCommits = files.length === 1 ? files[0].weightedCommits : 0;
|
|
25
|
-
const maxComplexityDensity = files.length === 1 ? files[0].complexityDensity : 0;
|
|
26
|
-
return { maxWeightedCommits, maxComplexityDensity };
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const sortedWeighted = [...files.map(f => f.weightedCommits)].sort((a, b) => a - b);
|
|
30
|
-
const sortedDensity = [...files.map(f => f.complexityDensity)].sort((a, b) => a - b);
|
|
31
|
-
|
|
32
|
-
const idx = Math.min(
|
|
33
|
-
Math.ceil(percentile * files.length) - 1,
|
|
34
|
-
files.length - 1,
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
maxWeightedCommits: sortedWeighted[idx],
|
|
39
|
-
maxComplexityDensity: sortedDensity[idx],
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function normalizeHotspotScore(
|
|
44
|
-
rawChurn: number,
|
|
45
|
-
rawComplexity: number,
|
|
46
|
-
maxima: NormalizationMaxima,
|
|
47
|
-
): number {
|
|
48
|
-
const normChurn = maxima.maxWeightedCommits > 0
|
|
49
|
-
? rawChurn / maxima.maxWeightedCommits
|
|
50
|
-
: 0;
|
|
51
|
-
const normComplexity = maxima.maxComplexityDensity > 0
|
|
52
|
-
? rawComplexity / maxima.maxComplexityDensity
|
|
53
|
-
: 0;
|
|
54
|
-
return Math.round((normChurn * 0.6 + normComplexity * 0.4) * 100 * 10) / 10;
|
|
55
|
-
}
|
package/src/health/hotspots.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import type { ChurnResult, FileChurn } from '../analysis/churn.js';
|
|
2
|
-
|
|
3
|
-
export interface HotspotEntry {
|
|
4
|
-
path: string;
|
|
5
|
-
score: number;
|
|
6
|
-
weightedCommits: number;
|
|
7
|
-
complexityDensity: number;
|
|
8
|
-
rank: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface HotspotSummary {
|
|
12
|
-
count: number;
|
|
13
|
-
topScore: number;
|
|
14
|
-
meanScore: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const TEST_PATH_PATTERNS = [
|
|
18
|
-
'/__tests__/',
|
|
19
|
-
'.test.',
|
|
20
|
-
'.spec.',
|
|
21
|
-
'_test.',
|
|
22
|
-
'_spec.',
|
|
23
|
-
'/test/',
|
|
24
|
-
'/tests/',
|
|
25
|
-
'/spec/',
|
|
26
|
-
'/specs/',
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
export function isTestPath(path: string): boolean {
|
|
30
|
-
for (const pattern of TEST_PATH_PATTERNS) {
|
|
31
|
-
if (path.includes(pattern)) return true;
|
|
32
|
-
}
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function normalizeValue(value: number, max: number): number {
|
|
37
|
-
return max > 0 ? value / max : 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function computeHotspotScore(
|
|
41
|
-
weightedCommits: number,
|
|
42
|
-
maxWeighted: number,
|
|
43
|
-
density: number,
|
|
44
|
-
maxDensity: number,
|
|
45
|
-
): number {
|
|
46
|
-
return normalizeValue(weightedCommits, maxWeighted) * normalizeValue(density, maxDensity) * 100;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function computeHotspots(
|
|
50
|
-
churnResult: ChurnResult,
|
|
51
|
-
complexityMap: Map<string, number>,
|
|
52
|
-
minCommits = 3,
|
|
53
|
-
): { entries: HotspotEntry[]; summary: HotspotSummary } {
|
|
54
|
-
// Filter qualifying files
|
|
55
|
-
const qualifying = churnResult.files.filter(
|
|
56
|
-
(f) => !isTestPath(f.path) && f.totalCommits >= minCommits,
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
if (qualifying.length === 0) {
|
|
60
|
-
return {
|
|
61
|
-
entries: [],
|
|
62
|
-
summary: { count: 0, topScore: 0, meanScore: 0 },
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Compute normalization maxima from qualifying files only
|
|
67
|
-
let maxWeighted = 0;
|
|
68
|
-
let maxDensity = 0;
|
|
69
|
-
|
|
70
|
-
for (const f of qualifying) {
|
|
71
|
-
if (f.weightedCommits > maxWeighted) maxWeighted = f.weightedCommits;
|
|
72
|
-
const density = complexityMap.get(f.path) ?? 0;
|
|
73
|
-
if (density > maxDensity) maxDensity = density;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Score each qualifying file
|
|
77
|
-
const scored = qualifying.map((f) => {
|
|
78
|
-
const density = complexityMap.get(f.path) ?? 0;
|
|
79
|
-
const score = computeHotspotScore(f.weightedCommits, maxWeighted, density, maxDensity);
|
|
80
|
-
return { f, score, density };
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// Sort descending by score
|
|
84
|
-
scored.sort((a, b) => b.score - a.score);
|
|
85
|
-
|
|
86
|
-
// Build entries with 1-based rank
|
|
87
|
-
const entries: HotspotEntry[] = scored.map((item, idx) => ({
|
|
88
|
-
path: item.f.path,
|
|
89
|
-
score: item.score,
|
|
90
|
-
weightedCommits: item.f.weightedCommits,
|
|
91
|
-
complexityDensity: item.density,
|
|
92
|
-
rank: idx + 1,
|
|
93
|
-
}));
|
|
94
|
-
|
|
95
|
-
// Compute summary
|
|
96
|
-
const count = entries.length;
|
|
97
|
-
const topScore = entries[0]?.score ?? 0;
|
|
98
|
-
const meanScore = count > 0 ? entries.reduce((s, e) => s + e.score, 0) / count : 0;
|
|
99
|
-
|
|
100
|
-
return {
|
|
101
|
-
entries,
|
|
102
|
-
summary: { count, topScore, meanScore },
|
|
103
|
-
};
|
|
104
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export const LARGE_FUNCTION_LOC_THRESHOLD = 60;
|
|
2
|
-
export const LARGE_FUNCTION_REPORT_THRESHOLD_PCT = 0.03;
|
|
3
|
-
|
|
4
|
-
export interface LargeFunctionEntry {
|
|
5
|
-
path: string;
|
|
6
|
-
functionName: string;
|
|
7
|
-
lineCount: number;
|
|
8
|
-
startLine: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function shouldReportLargeFunctions(
|
|
12
|
-
veryHighCount: number,
|
|
13
|
-
totalFunctions: number
|
|
14
|
-
): boolean {
|
|
15
|
-
if (totalFunctions <= 0) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
return veryHighCount / totalFunctions >= LARGE_FUNCTION_REPORT_THRESHOLD_PCT;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function detectLargeFunctions(
|
|
22
|
-
functions: Array<{ path: string; name: string; loc: number; startLine: number }>,
|
|
23
|
-
threshold = LARGE_FUNCTION_LOC_THRESHOLD
|
|
24
|
-
): LargeFunctionEntry[] {
|
|
25
|
-
return functions
|
|
26
|
-
.filter((f) => f.loc >= threshold)
|
|
27
|
-
.sort((a, b) => b.loc - a.loc)
|
|
28
|
-
.map((f) => ({
|
|
29
|
-
path: f.path,
|
|
30
|
-
functionName: f.name,
|
|
31
|
-
lineCount: f.loc,
|
|
32
|
-
startLine: f.startLine,
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export type ContributorIdentifierFormat = 'raw' | 'handle' | 'hash';
|
|
2
|
-
|
|
3
|
-
export interface ContributorEntry {
|
|
4
|
-
identifier: string;
|
|
5
|
-
format: ContributorIdentifierFormat;
|
|
6
|
-
share: number;
|
|
7
|
-
staleDays: number;
|
|
8
|
-
commits: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface OwnershipMetrics {
|
|
12
|
-
busFactor: number;
|
|
13
|
-
contributorCount: number;
|
|
14
|
-
topContributor: ContributorEntry;
|
|
15
|
-
recentContributors: ContributorEntry[];
|
|
16
|
-
suggestedReviewers: ContributorEntry[];
|
|
17
|
-
declaredOwner?: string;
|
|
18
|
-
unowned?: boolean;
|
|
19
|
-
drift: boolean;
|
|
20
|
-
driftReason?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface HotspotSummary {
|
|
24
|
-
since: string;
|
|
25
|
-
minCommits: number;
|
|
26
|
-
filesAnalyzed: number;
|
|
27
|
-
filesExcluded: number;
|
|
28
|
-
shallowClone: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function computeBusFactor(contributors: ContributorEntry[]): number {
|
|
32
|
-
if (contributors.length === 0) return 0;
|
|
33
|
-
const sorted = [...contributors].sort((a, b) => b.share - a.share);
|
|
34
|
-
let cumulative = 0;
|
|
35
|
-
for (let i = 0; i < sorted.length; i++) {
|
|
36
|
-
cumulative += sorted[i].share;
|
|
37
|
-
if (cumulative >= 0.5) return i + 1;
|
|
38
|
-
}
|
|
39
|
-
return sorted.length;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function filterSuggestedReviewers(
|
|
43
|
-
contributors: ContributorEntry[],
|
|
44
|
-
topContributor: ContributorEntry,
|
|
45
|
-
maxStaleDays = 90,
|
|
46
|
-
): ContributorEntry[] {
|
|
47
|
-
return contributors
|
|
48
|
-
.filter(c => c.identifier !== topContributor.identifier && c.staleDays <= maxStaleDays)
|
|
49
|
-
.slice(0, 3);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function formatOwnershipMetrics(m: OwnershipMetrics): string {
|
|
53
|
-
const lines: string[] = [
|
|
54
|
-
`Bus factor: ${m.busFactor} (${m.contributorCount} contributor${m.contributorCount !== 1 ? 's' : ''})`,
|
|
55
|
-
`Top: ${m.topContributor.identifier} (${(m.topContributor.share * 100).toFixed(1)}%)`,
|
|
56
|
-
];
|
|
57
|
-
if (m.declaredOwner) lines.push(`Owner: ${m.declaredOwner}`);
|
|
58
|
-
if (m.unowned) lines.push('(unowned — no CODEOWNERS rule matched)');
|
|
59
|
-
if (m.drift) lines.push(`Drift: ${m.driftReason ?? 'unknown reason'}`);
|
|
60
|
-
return lines.join('\n');
|
|
61
|
-
}
|