scip-query 0.10.0 → 0.10.2
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 +115 -58
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-3KLLFNT4.js +2 -0
- package/dist/{chunk-UIWAZ2NT.js → chunk-3UVJJ6Z7.js} +1 -1
- package/dist/chunk-3UW7VM4H.js +62 -0
- package/dist/chunk-3ZYF3ELZ.js +2 -0
- package/dist/{chunk-MN75T4UB.js → chunk-47UA45TU.js} +2 -2
- package/dist/{chunk-NC4IUW25.js → chunk-4ZUJJRWT.js} +2 -2
- package/dist/chunk-5B53WB6E.js +4 -0
- package/dist/{chunk-2WEH5QHC.js → chunk-5FOPAXWY.js} +2 -2
- package/dist/{chunk-VZRILF2Z.js → chunk-5M4TYWVI.js} +2 -2
- package/dist/{chunk-QJWN6LA5.js → chunk-5QJXH6ZL.js} +5 -5
- package/dist/{chunk-NN3O7TPH.js → chunk-64MNV6AB.js} +1 -1
- package/dist/chunk-77YBOOYT.js +2 -0
- package/dist/chunk-7KCSELEV.js +2 -0
- package/dist/{chunk-ZZ2W5P3D.js → chunk-7OHWPJ5N.js} +2 -2
- package/dist/chunk-7S5E7KWT.js +2 -0
- package/dist/chunk-A3VNUGKJ.js +2 -0
- package/dist/{chunk-ISCKLDSS.js → chunk-A4L36SZS.js} +3 -3
- package/dist/{chunk-IVAIPXNO.js → chunk-AUVBR62P.js} +2 -2
- package/dist/chunk-AW4N6MGC.js +18 -0
- package/dist/{chunk-PG3ZI5IH.js → chunk-B6MJ5VQV.js} +2 -2
- package/dist/chunk-B75HZHUP.js +2 -0
- package/dist/chunk-BGBBVSH4.js +2 -0
- package/dist/chunk-BKDXBJDQ.js +2 -0
- package/dist/{chunk-AQYBOORI.js → chunk-C2QSK7E7.js} +1 -1
- package/dist/chunk-C3MZZ2ZN.js +2 -0
- package/dist/{chunk-AP5GTKSG.js → chunk-CAWSSEVM.js} +2 -2
- package/dist/chunk-CFL2CNIF.js +10 -0
- package/dist/{chunk-4HTJZC6G.js → chunk-CJJP64OC.js} +2 -2
- package/dist/chunk-CNTEQMHA.js +2 -0
- package/dist/{chunk-WEJYUS5O.js → chunk-CRU42NJU.js} +2 -2
- package/dist/chunk-CSWZFD46.js +2 -0
- package/dist/{chunk-ZOT3WUZW.js → chunk-CTCAF3YA.js} +2 -2
- package/dist/chunk-D322LMSA.js +5 -0
- package/dist/{chunk-772YYL6I.js → chunk-DAI74TJU.js} +2 -2
- package/dist/chunk-DE7MA6OD.js +3 -0
- package/dist/chunk-DJMK4DBL.js +2 -0
- package/dist/chunk-DRAZH77R.js +7 -0
- package/dist/{chunk-L2KFPRMA.js → chunk-E44ZMVNA.js} +2 -2
- package/dist/{chunk-BNW3Q24R.js → chunk-E7KERP7E.js} +2 -2
- package/dist/{chunk-QKO474FG.js → chunk-EOZIZWW4.js} +2 -2
- package/dist/chunk-ERHOS6AW.js +2 -0
- package/dist/{chunk-ADRYSISR.js → chunk-ESG4HBEF.js} +2 -2
- package/dist/chunk-EWC3UK4V.js +3 -0
- package/dist/chunk-FGCL6NDB.js +8 -0
- package/dist/chunk-FIB4JPEX.js +2 -0
- package/dist/chunk-FNRPGGVI.js +2 -0
- package/dist/chunk-FOQHUKNZ.js +4 -0
- package/dist/chunk-FPMVCDIJ.js +2 -0
- package/dist/chunk-FUPDW5AC.js +3 -0
- package/dist/chunk-G3WGZU5Q.js +2 -0
- package/dist/chunk-GS33KGAY.js +2 -0
- package/dist/chunk-GZCQTZLK.js +2 -0
- package/dist/{chunk-VGBSY6N7.js → chunk-HVTYSC26.js} +2 -2
- package/dist/{chunk-2BMFRBV6.js → chunk-ICXVNWMI.js} +2 -2
- package/dist/chunk-JM72FNGA.js +2 -0
- package/dist/chunk-KPHKX4LP.js +71 -0
- package/dist/{chunk-6DEX3XP6.js → chunk-LPLGJ4HO.js} +2 -2
- package/dist/chunk-MHK7Z53U.js +2 -0
- package/dist/chunk-MHTDOFV7.js +5 -0
- package/dist/chunk-MUULWXSJ.js +2 -0
- package/dist/chunk-MZ7APUFN.js +3 -0
- package/dist/chunk-NNDYO2DX.js +2 -0
- package/dist/chunk-NP5HYVLX.js +20 -0
- package/dist/{chunk-Y5H7TBVE.js → chunk-NVFERV4U.js} +2 -2
- package/dist/{chunk-LWYIGRHR.js → chunk-NXIAHE7F.js} +1 -1
- package/dist/chunk-O3OKSF6O.js +2 -0
- package/dist/chunk-O4L4AB3T.js +2 -0
- package/dist/chunk-OBBDKQAG.js +3 -0
- package/dist/chunk-OLD6PBU6.js +7 -0
- package/dist/{chunk-V76FCF5F.js → chunk-PFOCOG57.js} +2 -2
- package/dist/chunk-PVZMPG5I.js +2 -0
- package/dist/chunk-QLNGUWR7.js +2 -0
- package/dist/chunk-QSXQT3NE.js +2 -0
- package/dist/{chunk-OLCKSG3Y.js → chunk-QVCCLDZI.js} +2 -2
- package/dist/chunk-RHTJBYZ5.js +2 -0
- package/dist/chunk-SPE4YCOT.js +7 -0
- package/dist/{chunk-FVIKFWUL.js → chunk-TM6GVHA6.js} +2 -2
- package/dist/chunk-TO54DY4O.js +2 -0
- package/dist/chunk-UMNENNTX.js +2 -0
- package/dist/chunk-UNJG7P2I.js +2 -0
- package/dist/{chunk-TKDJQ2WD.js → chunk-UUBMFL3F.js} +1 -1
- package/dist/chunk-VAA5FFIW.js +2 -0
- package/dist/chunk-WDUTG2ZR.js +4 -0
- package/dist/chunk-X7ZY6FFF.js +4 -0
- package/dist/{chunk-BGRPMGTD.js → chunk-YQH353VA.js} +2 -2
- package/dist/chunk-YTR4CO5S.js +38 -0
- package/dist/chunk-YUOAAR24.js +2 -0
- package/dist/{chunk-YWZBKYLS.js → chunk-YYD245WG.js} +2 -2
- package/dist/{chunk-SCEMECW7.js → chunk-Z4VHYJ5U.js} +2 -2
- package/dist/chunk-ZFMPHDAT.js +4 -0
- package/dist/chunk-ZQLO2SCU.js +6 -0
- package/dist/chunk-ZSLT7NWQ.js +61 -0
- package/dist/cli.js +276 -271
- package/dist/{config-types-CGIeLEpY.d.ts → config-types-Bj4sh28g.d.ts} +37 -1
- package/dist/{db-DdTPetj5.d.ts → db-CTarohbZ.d.ts} +1 -1
- package/dist/git-history-Dao3_Pu9.d.ts +12 -0
- package/dist/{health-C6r2VgpA.d.ts → health-Bx0x1HAG.d.ts} +64 -4
- package/dist/index.d.ts +7 -6
- package/dist/index.js +1 -1
- package/dist/postinstall.js +2 -2
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +6 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +40 -5
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +6 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +10 -3
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +6 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +66 -3
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +20 -4
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +20 -3
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +10 -3
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +11 -3
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +16 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +20 -12
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +51 -0
- package/dist/queries/locality-candidates.js +2 -0
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +8 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +4 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +31 -0
- package/dist/queries/react-component-duplicates.js +2 -0
- package/dist/queries/react-hook-candidates.d.ts +40 -0
- package/dist/queries/react-hook-candidates.js +2 -0
- package/dist/queries/react-large-component-pressure.d.ts +34 -0
- package/dist/queries/react-large-component-pressure.js +2 -0
- package/dist/queries/recent-duplicates.d.ts +32 -3
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +7 -3
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +21 -3
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +10 -3
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/unused-imports.d.ts +4 -0
- package/dist/queries/unused-imports.js +2 -0
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +35 -0
- package/dist/queries/vue-component-duplicates.js +2 -0
- package/dist/queries/vue-composable-candidates.d.ts +40 -0
- package/dist/queries/vue-composable-candidates.js +2 -0
- package/dist/queries/vue-large-view-pressure.d.ts +37 -0
- package/dist/queries/vue-large-view-pressure.js +2 -0
- package/dist/queries/wrapper-candidates.d.ts +6 -3
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +10 -10
- package/dist/reindex.d.ts +1 -1
- package/dist/reindex.js +22 -22
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +2 -2
- package/docs/AGENT_GUIDE.md +353 -0
- package/docs/AI_FAILURE_MODES.md +278 -0
- package/docs/API.md +40 -0
- package/docs/COMMAND_REFERENCE.md +131 -0
- package/docs/DETECTOR_GUIDE.md +119 -0
- package/docs/accuracy-hardening-goal.md +54 -0
- package/docs/analyzer-inventory.md +162 -0
- package/docs/analyzer-validation-ledger.md +262 -0
- package/docs/analyzer-validation-protocol.md +192 -0
- package/docs/assets/scip-query-logo-dark.svg +21 -0
- package/docs/assets/scip-query-logo.svg +24 -0
- package/docs/locality-analyzer-design.md +193 -0
- package/package.json +44 -5
- package/skills/scip-directory-architecture/SKILL.md +178 -0
- package/skills/scip-maintainability/SKILL.md +24 -3
- package/skills/scip-query/SKILL.md +4 -2
- package/skills/scip-query-setup/SKILL.md +118 -0
- package/skills/scip-react-maintainability/SKILL.md +114 -0
- package/skills/scip-vue-maintainability/SKILL.md +130 -0
- package/dist/chunk-4DAPXOWD.js +0 -2
- package/dist/chunk-4JQFTUKD.js +0 -2
- package/dist/chunk-4MHT7LKP.js +0 -3
- package/dist/chunk-5OHZEO3U.js +0 -3
- package/dist/chunk-5QJIEYFB.js +0 -34
- package/dist/chunk-6IGXZZQ4.js +0 -4
- package/dist/chunk-6K2JQ2VI.js +0 -61
- package/dist/chunk-6QVCPUK6.js +0 -2
- package/dist/chunk-6VL4AIEO.js +0 -8
- package/dist/chunk-A2VTV2QB.js +0 -7
- package/dist/chunk-AI2ECT7L.js +0 -2
- package/dist/chunk-BUAC4Q4G.js +0 -2
- package/dist/chunk-BZ6LCGE6.js +0 -2
- package/dist/chunk-CMXFASVD.js +0 -2
- package/dist/chunk-CO3AL7NZ.js +0 -2
- package/dist/chunk-FVVT7GV6.js +0 -4
- package/dist/chunk-HXXRN77A.js +0 -2
- package/dist/chunk-IC3RC3KJ.js +0 -4
- package/dist/chunk-ITHQJZTG.js +0 -2
- package/dist/chunk-IW7ASGVF.js +0 -2
- package/dist/chunk-JODYQDE4.js +0 -2
- package/dist/chunk-MCW36F2D.js +0 -2
- package/dist/chunk-MX6F756F.js +0 -2
- package/dist/chunk-NGI4V4AB.js +0 -18
- package/dist/chunk-O6KCZPJQ.js +0 -62
- package/dist/chunk-OAI5GEIN.js +0 -6
- package/dist/chunk-OH5HIAID.js +0 -4
- package/dist/chunk-OXKEUWMJ.js +0 -2
- package/dist/chunk-PBGTMPJ7.js +0 -2
- package/dist/chunk-PRVDXGSK.js +0 -2
- package/dist/chunk-QYKKTYBN.js +0 -6
- package/dist/chunk-R3G6ERW7.js +0 -7
- package/dist/chunk-R6XDPWJA.js +0 -10
- package/dist/chunk-SJR4SB7B.js +0 -2
- package/dist/chunk-SYKCO25G.js +0 -16
- package/dist/chunk-T22X7WT6.js +0 -2
- package/dist/chunk-TH4JVC34.js +0 -71
- package/dist/chunk-VDY4HYNK.js +0 -2
- package/dist/chunk-VDZIEDJB.js +0 -2
- package/dist/chunk-VDZL45XI.js +0 -2
- package/dist/chunk-WJIS6BNI.js +0 -3
- package/dist/chunk-WN5Z3UVT.js +0 -7
- package/dist/chunk-XCW7DYHM.js +0 -2
- package/dist/chunk-ZF6P2NAT.js +0 -63
- package/dist/chunk-ZGIK464P.js +0 -2
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Command Reference
|
|
2
|
+
|
|
3
|
+
<!-- BEGIN GENERATED COMMAND REFERENCE -->
|
|
4
|
+
|
|
5
|
+
This syntax summary is generated from the CLI command descriptors. Keep workflow guidance hand-authored, but keep command syntax, descriptions, and option flags descriptor-owned.
|
|
6
|
+
|
|
7
|
+
### Indexing
|
|
8
|
+
|
|
9
|
+
| Command | Description | Options |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `reindex` | Index the codebase and convert to SQLite | `-l, --language <lang>`<br>`--pnpm-workspaces`<br>`--force`<br>`--allow-partial`<br>`--indexer-concurrency <n>` |
|
|
12
|
+
| `augment-sources` | Add source files skipped by upstream SCIP indexers to the SQLite documents table | - |
|
|
13
|
+
| `augment-vue` | Add compiler-resolved Vue SFC references to the SQLite index using Volar | `--project <tsconfig>` |
|
|
14
|
+
|
|
15
|
+
### Core
|
|
16
|
+
|
|
17
|
+
| Command | Description | Options |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `stats` | Show index statistics | `--json` |
|
|
20
|
+
|
|
21
|
+
### Navigation
|
|
22
|
+
|
|
23
|
+
| Command | Description | Options |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| `files <pattern>` | Find files matching a pattern | `--json` |
|
|
26
|
+
| `methods <className>` | List methods of a class (with line ranges) | `--json` |
|
|
27
|
+
| `refs <symbol>` | Find all files referencing a symbol | `--full`<br>`--json` |
|
|
28
|
+
| `trace <symbol>` | Trace a symbol: definition + all references | `--full`<br>`--json` |
|
|
29
|
+
| `deps <file>` | Files this file depends on (internal) | `--json` |
|
|
30
|
+
| `rdeps <file>` | Files that depend on this file/module | `--json` |
|
|
31
|
+
| `system <module>` | Full module map: files, symbols, deps in/out | `--json` |
|
|
32
|
+
| `surface <module>` | What symbols consumers actually use from this module | `--json` |
|
|
33
|
+
| `imports <file>` | What symbols does this file import? | `--full`<br>`--json` |
|
|
34
|
+
| `imported-by <symbol>` | Which files import this symbol? | `--json` |
|
|
35
|
+
| `outline <file>` | Tree view of symbols in a file, with line ranges | `--signatures`<br>`--json` |
|
|
36
|
+
| `members <symbol>` | All children of a symbol (methods, fields, nested types) | `--json` |
|
|
37
|
+
| `by-kind <kind>` | Find symbols by SCIP kind (class, interface, enum, function, etc.) | `-s, --scope <path>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
38
|
+
| `kind-counts` | Histogram of symbol kinds in the codebase | `-s, --scope <path>`<br>`--json` |
|
|
39
|
+
| `hierarchy <symbol>` | Show a symbol's ancestry chain (method → class → module) | `--json` |
|
|
40
|
+
| `code <symbol>` | Read the source code for a symbol (bounded to its definition range) | `-C, --context <n>`<br>`--json` |
|
|
41
|
+
| `dataflow <symbol>` | Reference-level dataflow: definition sites, usage sites, producers, consumers | `--full`<br>`--json` |
|
|
42
|
+
| `slice <symbol>` | Reference-level program slice: what affects this (backward) or what this affects (forward) | `--forward`<br>`--depth <n>`<br>`--full`<br>`--json` |
|
|
43
|
+
|
|
44
|
+
### Cleanup
|
|
45
|
+
|
|
46
|
+
| Command | Description | Options |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| `dead [scope]` | Find dead code and file-internal symbols (no cross-file consumers) | `--min-loc <n>`<br>`--include-tests`<br>`--skip-barrels`<br>`--include-members`<br>`--only-dead`<br>`--only-internal`<br>`--full`<br>`--json` |
|
|
49
|
+
| `unused-imports <file>` | Find imports not referenced in the same file | `--full`<br>`--json` |
|
|
50
|
+
| `isolated` | Find completely orphaned symbols (no references at all) | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--full`<br>`--json` |
|
|
51
|
+
| `similar [symbol]` | Find heuristic function similarity candidates from callee fingerprints | `--min-similarity <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--min-callees <n>`<br>`--cross-file-only`<br>`--full`<br>`--json` |
|
|
52
|
+
| `similar-files [file]` | Find heuristic similar-file candidates from dependency profiles | `--min-similarity <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--min-deps <n>`<br>`--full`<br>`--json` |
|
|
53
|
+
| `react-component-duplicates [file]` | Find heuristic duplicated React component structure candidates from JSX tags, props, events, and bindings | `--min-similarity <n>`<br>`--min-tokens <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
54
|
+
| `react-hook-candidates [file]` | Find heuristic React hook extraction candidates from shared state, effects, requests, and handlers | `--min-similarity <n>`<br>`--min-shared-behaviors <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
55
|
+
| `react-large-component-pressure [file]` | Find heuristic large React component pressure candidates from component lines, JSX structure, and hook behavior | `--min-component-lines <n>`<br>`--min-file-lines <n>`<br>`--min-jsx-tokens <n>`<br>`--min-behavior-tokens <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
56
|
+
| `vue-component-duplicates [file]` | Find heuristic duplicated Vue component structure candidates from template tags, bindings, slots, and directives | `--min-similarity <n>`<br>`--min-tokens <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
57
|
+
| `vue-composable-candidates [file]` | Find heuristic Vue composable extraction candidates from shared state, effects, requests, and template bindings | `--min-similarity <n>`<br>`--min-shared-behaviors <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
58
|
+
| `vue-large-view-pressure [file]` | Find heuristic large Vue view pressure candidates from template, script, style, and external script line counts | `--min-total-lines <n>`<br>`--min-template-lines <n>`<br>`--min-script-lines <n>`<br>`--min-style-lines <n>`<br>`--review-thresholds`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
59
|
+
| `similar-chains` | Find heuristic similar-chain candidates from dependency flows | `--min-similarity <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--min-length <n>`<br>`--max-length <n>`<br>`--full`<br>`--json` |
|
|
60
|
+
| `extract-candidates` | Find heuristic extraction candidates from isolated callee clusters | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--min-callees <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
61
|
+
| `locality-candidates [symbol-or-file]` | Find directory-locality and ancestry candidates from consumer ownership | `-s, --scope <path>`<br>`--min-consumers <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
62
|
+
| `cleanup-plan` | Ordered, batched deletion plan: graph-fact dead code plus the cascade candidates it unlocks | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--max-depth <n>`<br>`--verify`<br>`--patch`<br>`--json`<br>`--full` |
|
|
63
|
+
| `cleanup-apply` | Apply a compiler-verified cleanup-plan batch to the working tree | `-s, --scope <path>`<br>`--min-loc <n>`<br>`--max-depth <n>`<br>`--verified`<br>`--batch <n>`<br>`--all`<br>`--force-dirty`<br>`--full` |
|
|
64
|
+
| `recent-duplicates` | Directional duplicate candidates: recent code that re-implements established callable, React, or Vue code | `--window <n>`<br>`--min-similarity <n>`<br>`-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
65
|
+
| `doc-drift [doc]` | Stale-doc candidates: code the doc references or co-changed with kept changing after the doc stopped | `-n, --limit <n>`<br>`--min-coupling <n>`<br>`--full`<br>`--json` |
|
|
66
|
+
| `unused-params` | Speculative-generality candidates: trailing parameters no body ever uses (TS/JS) | `-s, --scope <path>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
67
|
+
| `drift [module]` | Detect heuristic drift candidates: unused imports, layer violations, and pattern deviations | `--min-deviation <n>`<br>`--full`<br>`--json` |
|
|
68
|
+
| `wrapper-candidates` | Find heuristic wrapper candidates only called by one consumer | `-s, --scope <path>`<br>`--max-loc <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
69
|
+
| `passthrough-candidates` | Find heuristic passthrough candidates that forward to one callee | `-s, --scope <path>`<br>`--max-loc <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
70
|
+
| `stale-abstractions` | Find heuristic stale abstraction candidates with 0-1 consumers | `-s, --scope <path>`<br>`--min-loc <n>`<br>`-n, --limit <n>`<br>`--include-low-confidence`<br>`--full`<br>`--json` |
|
|
71
|
+
| `complexity-hotspots` | Find heuristic complexity hotspot candidates from LOC x fan-in x fan-out | `-s, --scope <path>`<br>`--min-loc <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
72
|
+
| `convergence <symbol1> <symbol2>` | Show what a consolidated version of two similar functions would look like | `--full`<br>`--json` |
|
|
73
|
+
| `redundant-reexports` | Find barrel re-exports that nobody imports through | `-s, --scope <path>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
74
|
+
| `similar-signatures` | Find functions with near-identical type signatures (same shape) | `-s, --scope <path>`<br>`--min-loc <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
75
|
+
|
|
76
|
+
### Graph
|
|
77
|
+
|
|
78
|
+
| Command | Description | Options |
|
|
79
|
+
|---|---|---|
|
|
80
|
+
| `hotspots` | Most-referenced symbols in the codebase (choke points) | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
81
|
+
| `fan-in [symbol]` | How many files reference a symbol (or top fan-in across codebase) | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
82
|
+
| `fan-out [file]` | How many external symbols a file uses (or top fan-out across codebase) | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
83
|
+
| `coupling [file1] [file2]` | Coupling between two files, or top coupled pairs in codebase | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--full`<br>`--json` |
|
|
84
|
+
| `cycles` | Detect circular dependency chains between files | `-s, --scope <path>`<br>`--max-depth <n>`<br>`--json` |
|
|
85
|
+
| `bottlenecks` | Find coupling hubs: high fan-in AND high fan-out | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--min-fan-in <n>`<br>`--min-fan-out <n>`<br>`--full`<br>`--json` |
|
|
86
|
+
| `deep-chains` | Find the longest transitive dependency chains | `-n, --limit <n>`<br>`-s, --scope <path>`<br>`--min-depth <n>`<br>`--full`<br>`--json` |
|
|
87
|
+
| `call-graph <symbol>` | Show incoming callers and outgoing callees for a symbol | `--full`<br>`--json` |
|
|
88
|
+
|
|
89
|
+
### Impact
|
|
90
|
+
|
|
91
|
+
| Command | Description | Options |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| `affected <symbol>` | Transitive closure of symbols that could break if this symbol changes | `--max-depth <n>`<br>`-s, --scope <path>`<br>`--json` |
|
|
94
|
+
| `change-surface <file>` | Pre-change briefing: exports, consumers, and blast-radius risk | `--full`<br>`--json` |
|
|
95
|
+
| `co-change [file]` | Files that change together in git history without a dependency edge — hidden coupling candidates | `--min-together <n>`<br>`-n, --limit <n>`<br>`--all`<br>`--full`<br>`--json` |
|
|
96
|
+
| `diff-gate` | Gate the current diff: echo candidates, incomplete migrations, missing co-change partners, uncited doc updates, unused params, new dead symbols; exit 1 on findings | `--base <ref>`<br>`--min-together <n>`<br>`--max-echo-checks <n>`<br>`--max-helpers <n>`<br>`--skip <check>`<br>`--hook`<br>`--json` |
|
|
97
|
+
| `incomplete-migration` | Partially-completed extraction candidates: new helpers in the diff wired into some sites while similar un-migrated sites remain | `--base <ref>`<br>`--min-containment <n>`<br>`--max-helpers <n>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
98
|
+
| `diff-impact` | Compute changed symbols and downstream consumers from current git diff | `--base <ref>` |
|
|
99
|
+
|
|
100
|
+
### Planning
|
|
101
|
+
|
|
102
|
+
| Command | Description | Options |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| `plan-context <target>` | Pre-edit planning context for a symbol, file, or module | `--impact-depth <n>`<br>`--slice-depth <n>`<br>`-s, --scope <path>`<br>`-n, --limit <n>`<br>`--full`<br>`--json` |
|
|
105
|
+
|
|
106
|
+
### Health
|
|
107
|
+
|
|
108
|
+
| Command | Description | Options |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| `self-audit` | Score the cheap evidence paths against the TypeScript compiler oracle on sampled symbols | `--samples <n>`<br>`-s, --scope <path>`<br>`--json` |
|
|
111
|
+
| `health` | Composite codebase health report with prioritized action list | `-s, --scope <path>`<br>`--full`<br>`--json`<br>`--baseline`<br>`--write-baseline` |
|
|
112
|
+
| `complexity <symbol>` | Per-symbol complexity: branches, cyclomatic estimate, fan-in/out, callees | `--full`<br>`--json` |
|
|
113
|
+
|
|
114
|
+
### Maintenance
|
|
115
|
+
|
|
116
|
+
| Command | Description | Options |
|
|
117
|
+
|---|---|---|
|
|
118
|
+
| `install-skills` | Install skills (scip-query, scip-query-setup, concrete-plan, scip-ai-cleanup, scip-explore, scip-debloat, scip-doc-reconcile, scip-directory-architecture, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook) into Claude Code, Codex, and shared agent roots | - |
|
|
119
|
+
| `check-deps` | Check whether scip-query and the detected language indexers are actually runnable | - |
|
|
120
|
+
| `capabilities` | Report which evidence and verification capabilities are available in this project | `--json` |
|
|
121
|
+
| `capability-matrix` | Report the evidence and verification capability matrix by language | `--json` |
|
|
122
|
+
| `init` | Create a .scipquery.json config file for this project | - |
|
|
123
|
+
| `config-validate` | Validate .scipquery.json, including structured suppressions and declared coupling groups | `--json` |
|
|
124
|
+
| `suppress <id>` | Record an accepted finding in .scipquery.json with a required reason | `--reason <text>`<br>`--check <check>`<br>`--file <path>`<br>`--expires-at <iso>`<br>`--json` |
|
|
125
|
+
| `doctor` | Diagnose config, index freshness, dependency readiness, and project capabilities | `--json` |
|
|
126
|
+
| `setup-agent` | Seed agent guidance for this project: AGENTS.md/CLAUDE.md block pointing agents at the scip-query skills and diff gate, plus an optional git pre-commit backstop | `--git-hook` |
|
|
127
|
+
| `setup-ci` | Write a GitHub Actions workflow that runs scip-query reindex and diff-gate on pull requests | `--force`<br>`--dry-run` |
|
|
128
|
+
| `watch` | Watch for file changes and reindex automatically | `--debounce <ms>`<br>`--cooldown <ms>` |
|
|
129
|
+
| `status` | Show index status for this project | `--json`<br>`--capabilities` |
|
|
130
|
+
|
|
131
|
+
<!-- END GENERATED COMMAND REFERENCE -->
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Which Detector Do I Want?
|
|
2
|
+
|
|
3
|
+
scip-query has several detectors that sound alike but answer different
|
|
4
|
+
questions. This guide explains what each one actually measures, the
|
|
5
|
+
differences inside each confusable cluster, and which check to run after which
|
|
6
|
+
kind of change. (The companion doc [AI_FAILURE_MODES.md](AI_FAILURE_MODES.md)
|
|
7
|
+
maps these to the agent behaviors that create the problems.)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Cluster 1 — "This structure shouldn't exist" (the speculation family)
|
|
12
|
+
|
|
13
|
+
Same disease — structure built for a future that never came — detected at
|
|
14
|
+
four different altitudes:
|
|
15
|
+
|
|
16
|
+
| Command | Altitude | What it measures | The fix |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| `unused-params` | **parameter** | Trailing parameters no body ever uses. TS/JS only, trailing-run only — removals that are type-safe by construction. `_`-prefixed and externally-published signatures are exempt. | Delete the parameters and their call-site arguments. |
|
|
19
|
+
| `passthrough-candidates` | **function (fan-out view)** | Functions with exactly **one callee** and a small body — they just forward arguments to the real implementation. | Inline it: call the target directly. |
|
|
20
|
+
| `wrapper-candidates` | **function (fan-in view)** | Symbols with exactly **one caller** — indirection that provides no reuse. Strongest when the sole caller is itself widely used. | Fold the body into the caller. |
|
|
21
|
+
| `stale-abstractions` | **type** | Classes, interfaces, and type aliases with 0–1 *real* cross-file consumers (barrel re-exports don't count as consumers). Single-implementation interfaces, misplaced types. | De-abstract: replace the interface with the concrete thing, or move the type to its one consumer. |
|
|
22
|
+
|
|
23
|
+
How to keep them straight:
|
|
24
|
+
|
|
25
|
+
- `passthrough` looks **down** (what does this function call? one thing) —
|
|
26
|
+
`wrapper` looks **up** (who calls this function? one caller). A function can
|
|
27
|
+
be both: a one-line forwarder with a single caller is the purest bloat.
|
|
28
|
+
- `unused-params` is *inside* a signature; the other three are *about whole
|
|
29
|
+
symbols*.
|
|
30
|
+
- `stale-abstractions` is the only one about **types**, not behavior. Note its
|
|
31
|
+
confidence ranking: a single-consumer `class` is usually deliberate
|
|
32
|
+
encapsulation (low), a single-consumer `interface` is worth questioning
|
|
33
|
+
(medium), a zero-consumer type is just dead (high).
|
|
34
|
+
|
|
35
|
+
## Cluster 2 — "This already exists" (the similarity family)
|
|
36
|
+
|
|
37
|
+
All of these find duplication, but at different granularities and with
|
|
38
|
+
different evidence — and two of them add *direction*:
|
|
39
|
+
|
|
40
|
+
| Command | Granularity | Evidence | Question it answers |
|
|
41
|
+
|---|---|---|---|
|
|
42
|
+
| `similar <symbol>` | function | callee-fingerprint cosine (TF-IDF), source-token fallback | "What else does roughly what this function does?" |
|
|
43
|
+
| `similar-signatures` | function | normalized parameter + return types | "What has the same *shape*, regardless of body?" |
|
|
44
|
+
| `similar-files` | file | Jaccard on import/dependency profiles | "Which files are copy-paste variants of each other?" |
|
|
45
|
+
| `similar-chains` | pipeline | edit distance on infrastructure-filtered dependency chains | "Which end-to-end flows are parallel re-implementations?" |
|
|
46
|
+
| `recent-duplicates` | callable/frontend unit + **git age** | callable, React, and Vue similarity + file-add history | "Which side is the established original, which is the fresh echo?" (ECHO = new copies old; TWIN = both new) |
|
|
47
|
+
| `incomplete-migration` | function + **git diff** | callee *containment* vs new-in-diff helpers | "I just extracted a helper — which call sites still have the logic inline and were never migrated?" |
|
|
48
|
+
| `convergence <a> <b>` | a known pair | shared/unique callees | "I already know these two overlap — give me the merge prescription." |
|
|
49
|
+
|
|
50
|
+
How to keep them straight:
|
|
51
|
+
|
|
52
|
+
- Use `similar` when you have **one symbol** in hand; `similar-files` /
|
|
53
|
+
`similar-chains` for repo-wide sweeps at coarser grain;
|
|
54
|
+
`similar-signatures` when implementations differ but the shape repeats.
|
|
55
|
+
- `recent-duplicates` is duplicate evidence **plus direction in time** - it tells you
|
|
56
|
+
which copy to delete. Run it after agent sessions. It covers generic callables,
|
|
57
|
+
React component structure, React hook behavior, Vue template structure, and
|
|
58
|
+
Vue composable-like behavior.
|
|
59
|
+
- `incomplete-migration` is the **inverse of an echo**: the *new* code is the
|
|
60
|
+
canonical one (the helper you just extracted), and the *established* code is
|
|
61
|
+
what should disappear. It also scores by containment, not symmetric
|
|
62
|
+
similarity, because an un-migrated site holds the helper's logic *plus* its
|
|
63
|
+
own — cosine under-scores exactly those.
|
|
64
|
+
- `extract-candidates` is the **before** picture: seams inside one big
|
|
65
|
+
function that *should* become a helper. `incomplete-migration` is the
|
|
66
|
+
**after** picture: you made the helper but didn't finish moving everyone
|
|
67
|
+
onto it.
|
|
68
|
+
|
|
69
|
+
## Cluster 3 — "Things drifting apart" (the drift family)
|
|
70
|
+
|
|
71
|
+
Three detectors share the word "drift" or the concept; they watch different
|
|
72
|
+
gaps:
|
|
73
|
+
|
|
74
|
+
| Command | Watches the gap between | Evidence |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `drift` | a file and its **siblings/architecture** | reference graph: unused imports, layer violations, "no sibling imports this" deviations |
|
|
77
|
+
| `doc-drift` | **docs** and the code they describe | doc file-citations + doc↔code co-change history; flags broken references and staleness scores |
|
|
78
|
+
| `co-change` | two **files** with an invisible contract | git history: pairs that change together with no dependency edge |
|
|
79
|
+
|
|
80
|
+
How to keep them straight: `drift` is structural and intra-code, `doc-drift`
|
|
81
|
+
is prose-vs-code, `co-change` is code-vs-code where the connection exists only
|
|
82
|
+
in commit history. The diff-gate runs all three angles scoped to your change
|
|
83
|
+
(`doc-reference` and `co-change-partner` checks).
|
|
84
|
+
|
|
85
|
+
## Cluster 4 — "Nothing uses this" (the deadness family)
|
|
86
|
+
|
|
87
|
+
| Command | Scope | Question |
|
|
88
|
+
|---|---|---|
|
|
89
|
+
| `dead` | symbols | "What has zero consumers?" (evidence-ranked, entrypoint-aware) |
|
|
90
|
+
| `isolated` | callables | "What is fully disconnected — no callers *and* no callees?" |
|
|
91
|
+
| `cleanup-plan` | the cascade | "If I delete the dead stuff, what *becomes* dead next — and will my compiler vouch for the whole batch?" (`--verify`) |
|
|
92
|
+
|
|
93
|
+
`dead` finds candidates; `isolated` finds the most extreme subset;
|
|
94
|
+
`cleanup-plan --verify` turns candidates into a compiler-proven deletion plan.
|
|
95
|
+
Don't hand-delete from `dead` output when `cleanup-plan` can prove it.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## After-the-change check matrix
|
|
100
|
+
|
|
101
|
+
The reflex to build (and the one the `scip-query` router skill teaches
|
|
102
|
+
agents): match the check to what the change *did*. `diff-gate` runs the
|
|
103
|
+
broad sweep on every diff; these are the targeted follow-ups.
|
|
104
|
+
|
|
105
|
+
| You just... | Run |
|
|
106
|
+
|---|---|
|
|
107
|
+
| Extracted a helper / created an abstraction | `scip-query incomplete-migration` — did every site migrate? |
|
|
108
|
+
| Wrote a brand-new helper or module | `scip-query similar <it>` and `scip-query recent-duplicates` — did it already exist? |
|
|
109
|
+
| Added parameters, options, or config flags | `scip-query unused-params` — does anything use them yet? |
|
|
110
|
+
| Added a forwarding/wrapper layer | `scip-query wrapper-candidates` and `scip-query passthrough-candidates` — does it earn its indirection? |
|
|
111
|
+
| Added an interface, base class, or type alias | `scip-query stale-abstractions` — does it have more than one real consumer? |
|
|
112
|
+
| Changed a schema, contract, config, or generated file | `scip-query co-change <file>` — who historically moves with it? |
|
|
113
|
+
| Changed code that docs describe | `scip-query doc-drift` — which docs now lie? |
|
|
114
|
+
| Deleted code | `scip-query cleanup-plan --verify` — what else just became dead, and does the compiler agree? |
|
|
115
|
+
| Anything at all, before saying "done" | `scip-query reindex && scip-query diff-gate` |
|
|
116
|
+
|
|
117
|
+
And before any non-trivial change: plan with `scip-query plan-context
|
|
118
|
+
<target>` (or the `concrete-plan` skill, which requires a scip-query citation
|
|
119
|
+
for every claim in the plan).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Accuracy Hardening Goal
|
|
2
|
+
|
|
3
|
+
Make scip-query's command answers reliable across languages and repositories by separating smoke tests from source-backed accuracy checks, fixing lookup/call-graph gaps found by real repos, and labeling heuristic results as candidates rather than exact facts.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
- Keep CI changes out of scope for now.
|
|
8
|
+
- Add committed test coverage that runs locally with `npm test`.
|
|
9
|
+
- Keep real-repo calibration optional because those repositories exist only on some machines.
|
|
10
|
+
- Prefer fixes that improve the shared indexing/query machinery over tuning output for one repository.
|
|
11
|
+
|
|
12
|
+
## Deliverables
|
|
13
|
+
|
|
14
|
+
1. Source-backed command accuracy coverage:
|
|
15
|
+
- Add fixture/oracle tests for exact commands such as `symbols`, `code`, `refs`, `trace`, `call-graph`, `complexity`, `dataflow`, and `slice`.
|
|
16
|
+
- Cover TypeScript, Python, Rust, and mixed-index behavior where practical.
|
|
17
|
+
- Assert against source facts: definition text, expected files, expected callees/callers, and line-bounded code snippets.
|
|
18
|
+
|
|
19
|
+
2. Optional real-repo calibration harness:
|
|
20
|
+
- Add a script that can run against local repositories when they exist.
|
|
21
|
+
- Reindex each repo into a temporary cache.
|
|
22
|
+
- Run source-backed checks for selected known symbols.
|
|
23
|
+
- Print clear PASS/FAIL output with the command and evidence.
|
|
24
|
+
- Never require these private/local repositories in normal test runs.
|
|
25
|
+
|
|
26
|
+
3. Indexer reliability taxonomy:
|
|
27
|
+
- Preserve the existing fail-closed behavior for failed languages.
|
|
28
|
+
- Keep `--allow-partial` as the explicit opt-in for incomplete mixed-language indexes.
|
|
29
|
+
- Repair malformed SCIP definition occurrences before SQLite conversion when that can be done without inventing symbol metadata.
|
|
30
|
+
- Keep conversion failures actionable and specific.
|
|
31
|
+
|
|
32
|
+
4. Lookup and call-graph accuracy:
|
|
33
|
+
- Fix path-qualified lookup ranking such as `src/app.rs/run` so it prefers symbols defined in that file.
|
|
34
|
+
- Keep exact call graph facts precise while still recovering real callable edges from SCIP mentions when AST extraction misses them.
|
|
35
|
+
- Add regression tests for Rust qualified path calls.
|
|
36
|
+
|
|
37
|
+
5. Heuristic output labeling:
|
|
38
|
+
- Label heuristic commands as candidates in CLI output.
|
|
39
|
+
- Make the distinction visible for `similar`, `similar-files`, `similar-chains`, `extract-candidates`, `wrapper-candidates`, `passthrough-candidates`, `stale-abstractions`, `complexity-hotspots`, and `drift`.
|
|
40
|
+
- Avoid implying those commands are exact compiler facts.
|
|
41
|
+
|
|
42
|
+
6. Performance guardrails:
|
|
43
|
+
- Add an optional local performance/calibration path that records durations and index sizes.
|
|
44
|
+
- Do not fail normal tests on private-repo timing.
|
|
45
|
+
|
|
46
|
+
## Acceptance Criteria
|
|
47
|
+
|
|
48
|
+
- `npm test` passes.
|
|
49
|
+
- `npm run typecheck` passes.
|
|
50
|
+
- `npm run build` passes.
|
|
51
|
+
- The optional calibration script passes on at least one TypeScript repo, one Python repo, and one Rust repo when those repos exist locally.
|
|
52
|
+
- Path-qualified Rust lookup resolves `src/app.rs/run` to `app:run()`, not an unrelated `run`-named test.
|
|
53
|
+
- `call-graph main` in the Rust fixture reports the qualified `app:run()` callee.
|
|
54
|
+
- Heuristic command output includes explicit candidate/disclaimer language.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Analyzer Inventory and Action-Tier Review
|
|
2
|
+
|
|
3
|
+
An analyzer in this project is a query or command-backed program that examines repository evidence such as the SCIP graph, source text, AST profiles, git history, docs, or a diff, and returns a structured answer about code health, change risk, reuse, or navigation.
|
|
4
|
+
|
|
5
|
+
A finding is an analyzer result that names a concrete codebase location, relationship, or diff condition as worth attention. Its defining role is to turn raw evidence into a maintainer-facing claim.
|
|
6
|
+
|
|
7
|
+
The useful product split is not the same as evidence quality. Evidence quality says how the claim was obtained: graph fact, semantic provider, source heuristic, change graph, or baseline. Action tier says how strongly the claim justifies a repair without broader product or architecture judgment.
|
|
8
|
+
|
|
9
|
+
Companion docs:
|
|
10
|
+
|
|
11
|
+
- `docs/analyzer-validation-protocol.md` defines how to validate true positives, false positives, and false negatives across real repositories.
|
|
12
|
+
- `docs/analyzer-validation-ledger.md` tracks the remaining validation work, run batches, and completion state.
|
|
13
|
+
- `docs/locality-analyzer-design.md` designs the missing code-organization analyzer for extraction placement and shared-folder locality.
|
|
14
|
+
|
|
15
|
+
The action tiers are:
|
|
16
|
+
|
|
17
|
+
- Direct repair evidence identifies code or docs that usually need a local action: delete, wire up, finish migration, remove unused surface, break a cycle, or split excessive complexity. Review is still required, but the default next step is action.
|
|
18
|
+
- Contextual signal evidence identifies a pattern that may hide a better design, but the right action depends on ownership, product semantics, locality, naming, or architecture. The default next step is investigation.
|
|
19
|
+
- Support analysis provides facts used by people, agents, or other analyzers, but does not itself assert a smell.
|
|
20
|
+
|
|
21
|
+
## Current Surfaces
|
|
22
|
+
|
|
23
|
+
The published query surface lives in `src/queries/public-query-entries.ts`. The CLI command order and families live in `src/runtime/commands/query-command-specs.ts`. The composite health score runs the phases listed in `HEALTH_PHASES` in `src/queries/health/health.ts`. The diff gate runs the checks listed in `DIFF_GATE_CHECKS` in `src/queries/impact/diff-gate.ts`.
|
|
24
|
+
|
|
25
|
+
`health --json` on this repository currently reports:
|
|
26
|
+
|
|
27
|
+
- score 100, riskScore 100, hygieneScore 100
|
|
28
|
+
- zero active findings across all health phases
|
|
29
|
+
- 174 suppression comments: 72 extract, 62 wrapper, 17 stale, 15 similar, 8 passthrough
|
|
30
|
+
|
|
31
|
+
That suppression shape is evidence that broad candidate analyzers have historically produced enough accepted or false-positive results to need explicit maintainer judgment. The suppression lifecycle review confirmed the current source comments are recent and reasoned, while structured file-scoped suppressions now warn when their file path goes stale.
|
|
32
|
+
|
|
33
|
+
The declared-coupling config has been refreshed after the inventory surfaced old pre-folder-move paths. `config-validate` now warns when a declared-coupling entry names a file that no longer exists, so known maintenance units stay connected to the current file graph instead of silently becoming stale metadata.
|
|
34
|
+
|
|
35
|
+
## Health-Scored Analyzers
|
|
36
|
+
|
|
37
|
+
| Analyzer | Evidence examined | Current health role | Recommended action tier | Evaluation |
|
|
38
|
+
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------: | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
39
|
+
| `dead` | Production definitions, SCIP/source/caller references, package roots, framework-discovered route/page roots, and entry exclusions | Risk, graph findings | Direct repair for `dead-code`; contextual for `file-internal` | Strong when `kind === dead-code`: zero references and excluded external-live surfaces make deletion likely. `file-internal` is not direct deletion evidence; it may be private helper ownership. |
|
|
40
|
+
| `cleanup-plan` | `dead --only-dead` seed plus conservative cascade references | Standalone, not direct health phase | Direct repair | Strongest deletion analyzer. It computes ordered batches and can be compiler-verified from the command layer. |
|
|
41
|
+
| `isolated` | Production callables with no callers and no non-self callees | Risk, graph findings | Direct repair | Strong dead-leaf signal. It is stricter than `dead` and usually means remove or wire up. |
|
|
42
|
+
| `cycles` | File dependency graph, with module-hierarchy/test/barrel/entry cycle classification | Risk | Direct repair for `real`; support/noise for `module-hierarchy` | Good split already exists. Real cycles normally need architectural repair. Module-hierarchy cycles should not score. |
|
|
43
|
+
| `similar` / `similarAll` | Callable callee fingerprints, IDF weighting, source-token fallback | Hygiene | Contextual signal | Similarity is a reuse lead, not proof of duplicate semantics. Needs naming, behavior, signatures, and product intent before action. Shared evidence is now labeled as domain, access/query, framework/generic, mixed, or neutral structural overlap. |
|
|
44
|
+
| `recent-duplicates` | `similarAll`, React/Vue duplicate analyzers, git file-age orientation | Standalone cleanup | Direct repair for `echo`; contextual for `twin` | Directionality makes this much stronger than plain similarity. A recent echo usually should reuse/delete. Twins still need choice of owner. |
|
|
45
|
+
| `react-component-duplicates` | JSX structure tokens from React profiles | Hygiene | Contextual signal | Good UI reuse lead. Needs product semantics and design-system judgment before extracting. |
|
|
46
|
+
| `react-hook-candidates` | Shared React hook/state/effect/request/handler tokens, evidence class, action tier, and recommendation | Hygiene, with `scoreCount` discount | Contextual signal for domain or mixed behavior; support for generic workflow/shared abstraction rows | Better than raw similarity because behavior tokens are named. The output now separates generic UI workflow and existing shared abstractions from domain behavior, but extraction still needs product judgment. |
|
|
47
|
+
| `react-large-component-pressure` | Component LOC, file LOC, JSX token count, behavior token count, pressure kind, context, recommendation kind | Hygiene | Direct repair pressure with review direction | Large component pressure usually implies splitting. It now distinguishes JSX, behavior, file, and route/page pressure, but still does not choose the destination directory for extracted code. |
|
|
48
|
+
| `vue-component-duplicates` | Vue template structure tokens | Hygiene | Contextual signal | Same reuse caveat as React component duplicates. |
|
|
49
|
+
| `vue-composable-candidates` | Vue composable/store/reactivity/lifecycle/request/function/template tokens, evidence class, action tier, and recommendation | Hygiene, with `scoreCount` discount | Contextual signal for domain or mixed behavior; support for generic workflow/shared abstraction rows | Good extraction lead when domain behavior is present. Generic workflow scaffolding remains visible as support, and extraction still needs domain and locality judgment. |
|
|
50
|
+
| `vue-large-view-pressure` | SFC total/template/script/style/external-script line counts, pressure kind, context, recommendation kind | Hygiene | Direct repair pressure with review direction | Usually implies splitting a large view. It now distinguishes template, script, style, external-script, and route/page pressure, but still needs companion directory-locality guidance. |
|
|
51
|
+
| `extract-candidates` | Large callable callee clusters, co-occurrence isolation, extraction kind, action tier, and recommendation | Hygiene | Contextual signal | It finds possible extraction seams, not proof of a new abstraction. The output now distinguishes workflow orchestration from broad/cohesive helper clusters and keeps every row as signal. |
|
|
52
|
+
| `wrapper-candidates` | Small production callables with one real external caller, caller fan-in, and boundary-token evidence | Hygiene | Contextual signal, sometimes direct | Single-caller wrappers can be needless indirection, but may also be names, domain/lifecycle boundaries, test seams, or API shaping. Boundary evidence discounts those without hiding them. |
|
|
53
|
+
| `passthrough-candidates` | Small production callables with exactly one callee, literal pass-through body, runtime-boundary evidence, public-facade evidence, action tier, recommendation, and score count | Hygiene, with `scoreCount` discount | Direct when no boundary or public-facade evidence is present; contextual signal when either exists | Body-shape gate is real. Boundary evidence distinguishes adapter, provider, public, capability, transport, lifecycle, access-policy, and facade-shaped forwarders; public-facade evidence separately identifies package-public or rooted exported passthroughs. |
|
|
54
|
+
| `stale-abstractions` | Type-like definitions, real consumers, barrel consumers, transitive reachability, definer usage, confidence, staleness kind, action tier, and recommendation | Hygiene | Direct for unused abstractions; contextual signal for one-consumer ownership rows | `0 consumers` is direct repair. `1 consumer` is contextual, including high-confidence misplaced types, because the repair may be move, inline, keep, or document as public contract. |
|
|
55
|
+
| `drift` | File dep graph, symbol ref graph, semantic/source import usage, explicit or inferred layer policy, sibling patterns, action tier, policy basis, recommendation | Hygiene | Split by kind | `unused-import` is direct repair. Explicit `layer-violation` is direct; inferred layer policy and `pattern-deviation` rows are contextual signal. Pattern deviations remain excluded from health scoring. |
|
|
56
|
+
| `complexity-hotspots` | Production callable LOC, fan-in, fan-out, callee count | Risk | Direct repair pressure | Complexity pressure usually means refactor, but the current score is structural, not cyclomatic. It should be separate from branch-count complexity. |
|
|
57
|
+
| `co-change` / hidden coupling | Git co-change pairs, dependency edges, declared couplings, file noise filters, partner-class labels, declared-coupling suggestions, commit scope, recency context, commit-subject context, and score-weighted count | Risk, weighted by history strength | Contextual signal | Strong evidence that coordination may be missing, but not proof that extraction or unification is correct. Partner classes, history context, subject context, and score weighting now separate contract-like focused current pairs from broad, stale, or unlabeled history before suggesting declared coupling. |
|
|
58
|
+
| Suppression inventory | `scip-query: ignore-*` comments in source, plus structured `.scipquery.json` suppressions | Evidence quality axis | Meta signal | Useful precision feedback. High suppressions should reduce trust or weight for that detector family. Structured file-scoped suppressions now validate path freshness. |
|
|
59
|
+
|
|
60
|
+
## Diff-Gate Checks
|
|
61
|
+
|
|
62
|
+
| Check | Evidence examined | Recommended action tier | Evaluation |
|
|
63
|
+
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| `echo` | Changed symbols compared to established `similar` matches outside the diff | Direct repair leaning | More actionable than repo-wide `similar` because it is scoped to new or changed code. Still verify semantics before reuse. |
|
|
65
|
+
| `incomplete-migration` | New helpers in the diff, existing references, leftover established sites with helper-callee containment, site coverage, helper-shape evidence, and migration-scope hints | Direct repair | Strong. It models the exact failure mode of half-finished extraction and gives concrete leftover sites, while rejecting broad old sites where the helper pattern is only a small fragment and labeling possible subtype/variant leftovers for review. |
|
|
66
|
+
| `co-change-partner` | Historical partner changed without the other side in current diff, with co-change partner class, commit scope, recency, commit-subject context, and optional declared-coupling suggestion | Contextual signal | Good sync warning, but sometimes the coupling no longer holds or should be intentionally broken. Partner classes, history context, and subject context make doc/code, config/code, schema/script, model/view, test/code, broad-sweep, stale, docs-labeled, fix-labeled, and issue-ref cases easier to review. |
|
|
67
|
+
| `doc-reference` | Living docs citing changed files, excluding import-only source changes, with citation kind and Markdown-local cited-claim context | Split by citation evidence | Behavioral/current doc claims are direct doc-review evidence. Configuration examples and intentional records are support-tier checks unless the cited target changed meaning. |
|
|
68
|
+
| `unused-params` | Trailing unused params in changed files | Direct repair | Conservative enough to be a high-confidence local fix. |
|
|
69
|
+
| `new-dead` | Changed production symbols with zero consumers, excluding entry/root/test/framework-discovered cases | Direct repair | Either wire it up, remove it, or mark it as an externally live root before it lands. |
|
|
70
|
+
| `baseline` | New health finding identity versus committed baseline | Direct gate | It does not explain the smell itself, but correctly blocks regression until fixed or accepted. |
|
|
71
|
+
|
|
72
|
+
## Standalone Cleanup and Similarity Analyzers
|
|
73
|
+
|
|
74
|
+
| Analyzer | Evidence examined | Recommended action tier | Evaluation |
|
|
75
|
+
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
76
|
+
| `unused-params` | TS/JS AST facts plus identifier usage lines | Direct repair | Intentionally conservative: trailing only, simple params only, underscore-intent skipped, external roots skipped. Should be in the direct tier despite heuristic metadata. |
|
|
77
|
+
| `unused-imports` | Source/AST import facts plus local binding usage | Direct repair | A narrower direct cleanup analyzer. It should stay direct when the imported binding is unused in executable and type surfaces, with framework/compiler caveats handled in `drift` validation. |
|
|
78
|
+
| `redundant-reexports` | Barrel exports, JS/TS re-export statements, SCIP/source fallback consumers, direct importers, package-surface evidence | Direct for private barrels; signal for package-public barrels | Strong when the candidate barrel is private and both barrel and direct consumers are zero. Package-public barrels stay visible as signal because external consumers may import through them. |
|
|
79
|
+
| `similar-files` | File dependency-profile Jaccard with infrastructure and distinctive-dep gates | Contextual signal | Good for copy-paste family discovery, not direct extraction proof. |
|
|
80
|
+
| `similar-chains` | Dependency chain generation, infrastructure filtering, edit distance | Contextual signal | Finds duplicated pipelines, but pipeline ownership and abstraction shape require design judgment. |
|
|
81
|
+
| `similar-signatures` | Semantic/documented/source normalized function signatures | Contextual signal | Same type shape is only a weak lead. Useful for search, not scoring unless combined with behavior evidence. |
|
|
82
|
+
| `convergence` | Two symbols' shared and unique callees | Support/contextual signal | It explains a possible consolidation strategy; it should not score by itself. |
|
|
83
|
+
| `locality-candidates` | Candidate symbol/file path, directory ancestry, consumer files, consumer coverage, nearest common owner, boundary markers, and counterevidence | Contextual signal | Guides placement and ownership review for extracted or shared code. It is deliberately report-only and should not force moves or affect health score without repair-outcome evidence. |
|
|
84
|
+
| `doc-drift` | Living docs, path citations, cited-claim contexts, doc-code co-change, doc intent, action tier, code churn after doc update, broken references | Split by evidence | Broken references are direct repair. Path-cited stale subjects now expose citation context. Co-change-only staleness is signal for current guidance and support for historical notes. |
|
|
85
|
+
|
|
86
|
+
## Graph, Risk, and Planning Analyzers
|
|
87
|
+
|
|
88
|
+
| Analyzer | Evidence examined | Recommended role | Evaluation |
|
|
89
|
+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
90
|
+
| `affected` | Transitive symbol impact from a changed symbol | Support analysis | Blast-radius map, not smell. |
|
|
91
|
+
| `change-surface` | Definitions in a file plus external consumer counts | Support/risk analysis | Pre-change risk briefing. Useful for planning and score context, not a repair. |
|
|
92
|
+
| `plan-context` | Trace, references, call graph, dataflow, deps/rdeps, surface, affected, change-surface, complexity, history | Support analysis | Composite planning bundle. It should not contribute smell score directly. |
|
|
93
|
+
| `bottlenecks` | Callable fan-in times fan-out, risk kind, action tier, evidence reasons, recommendation | Contextual signal | Good risk hotspot, not automatic refactor. Output now states `signal` and frames central code as coordination risk rather than repair proof. |
|
|
94
|
+
| `hotspots` | Most referenced symbols | Support/contextual signal | Identifies choke points. Not a smell alone. |
|
|
95
|
+
| `fan-in` / `fan-out` | Reference counts into symbols or out of files | Support analysis | Raw graph metrics. |
|
|
96
|
+
| `coupling` | Shared symbols between two files or top coupled pairs, coupling kind, action tier, evidence reasons, recommendation | Contextual signal | May reveal boundary problems, but shared symbols can be intended. Output now makes the coordination-pressure interpretation explicit. |
|
|
97
|
+
| `deep-chains` | Longest dependency chains after SCC condensation, suffix de-duplication, chain kind, action tier, evidence reasons, recommendation | Contextual signal | Long chains imply propagation risk, but action depends on layers and ownership. Strict suffix duplicates are now removed from top results. |
|
|
98
|
+
| `complexity` | Branch count, cyclomatic estimate, callee count, fan-in, fan-out for one symbol | Direct repair pressure | This is closer to the user-specified "cyclomatic complexity" analyzer than `complexity-hotspots`. Should score strongly when branches/cyclomatic exceed thresholds. |
|
|
99
|
+
| `self-audit` | Cheap evidence paths checked against TypeScript compiler oracle | Meta analysis | Measures analyzer accuracy. Should guide trust/weight, not code health directly. |
|
|
100
|
+
|
|
101
|
+
## Navigation and Evidence Providers
|
|
102
|
+
|
|
103
|
+
These commands analyze the index, but they are not finding detectors and should not affect health score directly: `stats`, `files`, `methods`, `refs`, `trace`, `deps`, `rdeps`, `system`, `surface`, `imports`, `imported-by`, `outline`, `members`, `by-kind`, `kind-counts`, `hierarchy`, `call-graph`, `code`, `dataflow`, and `slice`.
|
|
104
|
+
|
|
105
|
+
They are essential because other analyzers and agents use them to ground claims. Their defining characteristic is retrieval or explanation, not smell detection.
|
|
106
|
+
|
|
107
|
+
The support-analysis accuracy review confirmed that `refs`, `affected`, `change-surface`, `plan-context`, `imports`, `deps`, `rdeps`, `fan-in`, `fan-out`, `hotspots`, `status`, and `self-audit` return useful source-grounded evidence for a TypeScript target. It also fixed diagnostic parity so `status` and `doctor` use the same root-aware config validation as `config-validate`.
|
|
108
|
+
|
|
109
|
+
The cross-language boundary review confirmed that Rust projects have graph-backed indexing, source fallback, cleanup detector output, git/diff support, and compiler cleanup verification when `rust-analyzer` and `cargo check` are available. It also confirmed that TypeScript semantic self-audit is explicitly unavailable on Rust and that React/Vue analyzers return stack-specific empty results rather than Rust findings.
|
|
110
|
+
|
|
111
|
+
`cleanup-apply` is not an analyzer. It is an action command that applies a `cleanup-plan` batch, so it should be validated through the `cleanup-plan --verify` path and normal project checks.
|
|
112
|
+
|
|
113
|
+
## Overlap and Duplication Review
|
|
114
|
+
|
|
115
|
+
The codebase already avoids some duplicate analysis by sharing kernels:
|
|
116
|
+
|
|
117
|
+
- `runCandidateAnalysis` gives candidate-style analyzers one lifecycle for scan limits, preparation, evaluation, ordering, and result caps.
|
|
118
|
+
- `rankedPairwiseProfileResults` gives React, Vue, file-profile, and pairwise similarity analyzers a shared pair-ranking shape.
|
|
119
|
+
- `HEALTH_DETECTOR_PROFILES` keeps health and baseline detector options aligned.
|
|
120
|
+
|
|
121
|
+
The remaining conceptual overlap is mostly healthy, but needs product labels:
|
|
122
|
+
|
|
123
|
+
| Overlap family | Members | Same analysis or distinct? | Recommendation |
|
|
124
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
125
|
+
| Deletability | `dead`, `isolated`, `cleanup-plan`, `redundant-reexports`, `new-dead` | Distinct evidence scopes over the same core question: can this be removed or must it be wired? | Model as one "deletability" action family with subtypes and confidence. |
|
|
126
|
+
| Similarity and reuse | `similar`, `similar-files`, `similar-chains`, `similar-signatures`, `convergence`, React/Vue duplicates, `recent-duplicates`, `echo` | Distinct evidence bases. The risk is UX confusion, not implementation duplication. | Keep separate, but expose basis, action tier, and root-cause groups where pairwise rows repeat. |
|
|
127
|
+
| Extraction pressure | `extract-candidates`, React/Vue behavior candidates, large component/view pressure, `incomplete-migration` | Different stages: discover seam, detect duplicated behavior, detect excessive size, catch unfinished migration. | Score unfinished migrations higher than discovery leads. |
|
|
128
|
+
| Indirection | `wrapper-candidates`, `passthrough-candidates`, `stale-abstractions` | Related but not the same: single caller, literal forwarding, low-consumer types. | Passthrough and wrapper rows now split by boundary evidence; stale should split by confidence. |
|
|
129
|
+
| Architecture/history drift | `drift`, `doc-drift`, `co-change`, `co-change-partner`, `doc-reference` | Same broad problem of things moving out of sync, but sources differ. | Co-change should remain signal; doc-reference is direct only for behavioral cited claims and support for configuration examples or intentional records. |
|
|
130
|
+
| Graph risk | `fan-in`, `fan-out`, `hotspots`, `bottlenecks`, `coupling`, `deep-chains`, `change-surface`, `affected` | Mostly layered views of graph pressure. | Treat as support/context, except `cycles` and high cyclomatic complexity. |
|
|
131
|
+
|
|
132
|
+
## Score Model Implications
|
|
133
|
+
|
|
134
|
+
The current report has `riskScore`, `hygieneScore`, evidence labels, `scoreCount`, pressure penalties, validation lift, and suppression inventory. That is close, but it does not encode action implication directly.
|
|
135
|
+
|
|
136
|
+
Recommended model:
|
|
137
|
+
|
|
138
|
+
1. Add an action tier to each finding category: `direct`, `signal`, or `support`.
|
|
139
|
+
2. Keep evidence quality separate: `graph-fact`, `semantic`, `heuristic`, `change-graph`, `baseline`.
|
|
140
|
+
3. Score direct findings with heavier base penalties because they usually imply a local repair.
|
|
141
|
+
4. Score signal findings with lighter base penalties and stronger pressure penalties when signals accumulate.
|
|
142
|
+
5. Add a "signal backlog pressure" multiplier when direct findings are near zero but contextual signals remain high. This captures the user's point: a repo with no obvious smells but many unresolved architectural signals is not actually clean.
|
|
143
|
+
6. Let suppression history and `self-audit` validation adjust detector trust. A detector with many suppressions or low validation lift should score less until recalibrated.
|
|
144
|
+
|
|
145
|
+
Suggested initial tier map:
|
|
146
|
+
|
|
147
|
+
- Direct: `cleanup-plan`, `dead-code`, `isolated`, `real cycles`, `unused-params`, `new-dead`, `incomplete-migration`, behavioral/current `doc-reference` claims, broken `doc-drift` references, `redundant-reexports` with zero consumers, direct passthrough rows with no boundary or public-facade role, `unused-import` drift, high branch/cyclomatic `complexity`, large React/Vue pressure.
|
|
148
|
+
- Signal: `co-change`, `co-change-partner`, ordinary `similar`, `similar-files`, `similar-chains`, `similar-signatures`, `convergence`, `extract-candidates`, `locality-candidates`, `wrapper-candidates`, `passthrough-candidates` with boundary or public-facade roles, single-consumer `stale-abstractions`, React/Vue duplicate or behavior candidates, bottlenecks, hotspots, coupling, deep chains, inferred layer or pattern drift, doc staleness from churn.
|
|
149
|
+
- Support: navigation commands, `affected`, `change-surface`, `plan-context`, `stats`, `self-audit`, suppression inventory, baseline comparison mechanics, configuration-example and intentional-record `doc-reference` rows.
|
|
150
|
+
|
|
151
|
+
## Directory Locality Analyzer
|
|
152
|
+
|
|
153
|
+
`locality-candidates` now evaluates extraction locality after a large component/view or helper extraction. The referents are directories, feature folders, local shared folders, global shared folders, import distances, consumer sets, and abstraction ownership. The analyzer classifies where an extracted unit may belong by comparing actual consumers and directory boundaries.
|
|
154
|
+
|
|
155
|
+
Command shape:
|
|
156
|
+
|
|
157
|
+
- `scip-query locality-candidates [symbol-or-file]`
|
|
158
|
+
- Inputs: extracted or candidate symbol/file, consumer files, nearest common ancestor, feature/domain folders, existing shared folders, import path depth, package/workspace boundaries, and whether consumers cross feature boundaries.
|
|
159
|
+
- Outputs: recommended locality level such as same file, sibling folder, feature-local shared folder, app-level shared folder, package-level shared module, or no extraction.
|
|
160
|
+
- Action tier: contextual signal. It guides placement; it should not force moves without architecture judgment.
|
|
161
|
+
|
|
162
|
+
This should pair with `react-large-component-pressure`, `vue-large-view-pressure`, `extract-candidates`, and `incomplete-migration` so agents do not reduce size scores by dumping extracted pieces into flat local directories.
|