scip-query 0.10.12 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/{vendor/scip/LICENSE.scip → LICENSE} +1 -0
- package/README.md +141 -49
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-2VSDXOG5.js +2 -0
- package/dist/chunk-343O6EVV.js +2 -0
- package/dist/{chunk-RUV5IY25.js → chunk-3KDUITBE.js} +2 -2
- package/dist/chunk-3T2FNHIU.js +2 -0
- package/dist/{chunk-EOLGSSDR.js → chunk-3V6JQQM5.js} +2 -2
- package/dist/chunk-5AAAEZ2Z.js +2 -0
- package/dist/chunk-6Q6OFLFQ.js +8 -0
- package/dist/chunk-6XA4LDHY.js +2 -0
- package/dist/chunk-75X52JTA.js +2 -0
- package/dist/{chunk-LEHVP4DY.js → chunk-7HB3CZFD.js} +2 -2
- package/dist/chunk-7JZRFDCU.js +2 -0
- package/dist/{chunk-SQNHOOJ5.js → chunk-7XL7J7PT.js} +2 -2
- package/dist/{chunk-GKB4JJDU.js → chunk-ALHNAPS2.js} +2 -2
- package/dist/{chunk-TBCHRDAC.js → chunk-BDRBPG7Y.js} +2 -2
- package/dist/chunk-BN5SXXQS.js +40 -0
- package/dist/chunk-C4ICAIJ4.js +3 -0
- package/dist/{chunk-2GLNBCHB.js → chunk-CMHYBXJB.js} +2 -2
- package/dist/{chunk-S2MRVIJ5.js → chunk-DRPAQAFM.js} +6 -6
- package/dist/chunk-FERAXG6Y.js +72 -0
- package/dist/chunk-FLJJLSGB.js +2 -0
- package/dist/chunk-FXG3PHVW.js +9 -0
- package/dist/{chunk-JS6B76AQ.js → chunk-GCN2P4EJ.js} +2 -2
- package/dist/chunk-GHXRVCIY.js +21 -0
- package/dist/chunk-GNG622H3.js +3 -0
- package/dist/chunk-H4LUPLEJ.js +2 -0
- package/dist/{chunk-XUCZ3RQ5.js → chunk-H56MGERE.js} +4 -4
- package/dist/chunk-H7NSJ7L2.js +5 -0
- package/dist/chunk-HINMXZ6J.js +2 -0
- package/dist/chunk-HXXMPYEF.js +2 -0
- package/dist/{chunk-A4UTLKHU.js → chunk-HZKMEXA3.js} +2 -2
- package/dist/{chunk-T3AEVJBG.js → chunk-IFSX6YVU.js} +2 -2
- package/dist/chunk-ISLWJ4PY.js +10 -0
- package/dist/chunk-J5WVNZ6O.js +2 -0
- package/dist/chunk-K2HYR5A7.js +3 -0
- package/dist/{chunk-UVPY3RUZ.js → chunk-K6UI6EBZ.js} +2 -2
- package/dist/{chunk-MNCQPMCH.js → chunk-KJCDEDQW.js} +2 -2
- package/dist/{chunk-KZ4MG5NY.js → chunk-KKMOB3OJ.js} +2 -2
- package/dist/{chunk-ELC77ZDE.js → chunk-KMVGRIO2.js} +2 -2
- package/dist/chunk-LWOOTRHC.js +2 -0
- package/dist/{chunk-DQ6433ZG.js → chunk-LZNLRE4X.js} +17 -8
- package/dist/{chunk-7C6JBBE4.js → chunk-M2YXL62V.js} +2 -2
- package/dist/chunk-MNEJYEHW.js +3 -0
- package/dist/chunk-MTDBHTSF.js +2 -0
- package/dist/{chunk-VB2EZZPA.js → chunk-N2Z3CU7X.js} +2 -2
- package/dist/{chunk-2UVCH7CQ.js → chunk-N7PNFLGY.js} +2 -2
- package/dist/chunk-NAH5EAZS.js +6 -0
- package/dist/{chunk-XHMVZFA6.js → chunk-NBXK32I6.js} +2 -2
- package/dist/chunk-NJJ7AS4F.js +2 -0
- package/dist/{chunk-ANUEY5WV.js → chunk-NLMRJ7SI.js} +2 -2
- package/dist/chunk-ODVITBYU.js +26 -0
- package/dist/chunk-ORBRX2QJ.js +2 -0
- package/dist/{chunk-NTSR6SRP.js → chunk-P36UR5II.js} +2 -2
- package/dist/chunk-PYZZBIEU.js +3 -0
- package/dist/chunk-PZS6J5YG.js +16 -0
- package/dist/{chunk-3XSNW5XB.js → chunk-QARYU7R3.js} +2 -2
- package/dist/chunk-QJ3FK4TB.js +38 -0
- package/dist/{chunk-4ISHQ7UW.js → chunk-QXGTGE2C.js} +4 -4
- package/dist/chunk-QZ4JVECJ.js +2 -0
- package/dist/{chunk-63CI3IXR.js → chunk-R3JY4EZ4.js} +10 -10
- package/dist/{chunk-FX6ULETZ.js → chunk-R5336VHZ.js} +2 -2
- package/dist/chunk-RJMXSHKM.js +2 -0
- package/dist/chunk-STBXCPKY.js +5 -0
- package/dist/chunk-T2FQ4GHD.js +9 -0
- package/dist/chunk-TFWDJDGO.js +2 -0
- package/dist/chunk-TG7QSYCJ.js +2 -0
- package/dist/{chunk-ZUUNREKS.js → chunk-TTS75UF2.js} +5 -5
- package/dist/{chunk-DDQONX6B.js → chunk-U7I373V4.js} +2 -2
- package/dist/chunk-UIKLA3F5.js +2 -0
- package/dist/{chunk-6BN3EHQE.js → chunk-UMPNL7T6.js} +2 -2
- package/dist/chunk-URSSPS5H.js +2 -0
- package/dist/chunk-VGMUFW3J.js +2 -0
- package/dist/chunk-VXTNADIW.js +18 -0
- package/dist/{chunk-PWAK75BU.js → chunk-VYF5HA76.js} +2 -2
- package/dist/chunk-WFGOH2UI.js +43 -0
- package/dist/chunk-WGA5BBTA.js +4 -0
- package/dist/chunk-WIBFXSYB.js +6 -0
- package/dist/chunk-WPSS37EW.js +2 -0
- package/dist/chunk-WQHWIVA7.js +3 -0
- package/dist/chunk-WS3Z6W3M.js +65 -0
- package/dist/chunk-WXVGNFAO.js +2 -0
- package/dist/{chunk-RXINFVBN.js → chunk-WZLPXFZU.js} +2 -2
- package/dist/chunk-X4O6K47U.js +2 -0
- package/dist/chunk-X6OGDTQH.js +2 -0
- package/dist/chunk-XEMQUN3Z.js +20 -0
- package/dist/{chunk-OFXN2BCT.js → chunk-XHWLNQVZ.js} +2 -2
- package/dist/chunk-XMR747CP.js +2 -0
- package/dist/{chunk-JJ5SAWBT.js → chunk-Y6L4LXPG.js} +2 -2
- package/dist/chunk-YCPASUCX.js +2 -0
- package/dist/chunk-YZXV3CU3.js +60 -0
- package/dist/{chunk-XRUGSM76.js → chunk-ZEKBR4OK.js} +2 -2
- package/dist/chunk-ZMGBWSFZ.js +2 -0
- package/dist/cli.js +446 -280
- package/dist/{config-types-dvHOz0zU.d.ts → config-types-BrHl3Bge.d.ts} +57 -0
- package/dist/{db-rMZO5JFK.d.ts → db-_Bdx0E1W.d.ts} +1 -1
- package/dist/diff-gate-types-CG2YQ_ei.d.ts +4 -0
- package/dist/{frontend-behavior-evidence-BxKpKWUu.d.ts → frontend-behavior-evidence-EfM4_9bc.d.ts} +1 -1
- package/dist/{health-CtTIGh6H.d.ts → health-BEZ1Rt0S.d.ts} +54 -2
- package/dist/index.d.ts +4 -68
- package/dist/index.js +1 -1
- package/dist/postinstall.js +1 -4
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -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 +12 -2
- 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 +7 -3
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +42 -4
- 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 +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +12 -3
- 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 +3 -3
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -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 +65 -8
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +21 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +29 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +15 -3
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +55 -0
- package/dist/queries/duplicate-bodies.js +2 -0
- package/dist/queries/extract-candidates.d.ts +2 -2
- 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 +4 -3
- 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 +3 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +12 -7
- 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 +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- 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 +11 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +3 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +7 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +3 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +2 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- 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 +4 -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 +17 -10
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +42 -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 +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- 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/twin-ab.d.ts +55 -0
- package/dist/queries/twin-ab.js +2 -0
- package/dist/queries/twin-drift.d.ts +97 -0
- package/dist/queries/twin-drift.js +2 -0
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- 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 +7 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +3 -3
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +6 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +9 -9
- package/dist/reindex.d.ts +3 -3
- package/dist/reindex.js +19 -19
- package/dist/runtime.d.ts +11 -6
- package/dist/runtime.js +2 -2
- package/dist/{scip-cli-trnNvymv.d.ts → scip-cli-C7cg4ZHR.d.ts} +1 -1
- package/dist/symbol-types-DaoeXKUt.d.ts +66 -0
- package/docs/AGENT_GUIDE.md +20 -18
- package/docs/AI_FAILURE_MODES.md +36 -13
- package/docs/API.md +1 -1
- package/docs/COMMAND_REFERENCE.md +56 -13
- package/docs/DETECTOR_GUIDE.md +20 -3
- package/docs/REGEX_POLICY.md +34 -0
- package/docs/analyzer-inventory.md +40 -3
- package/docs/analyzer-validation-ledger.md +34 -6
- package/package.json +21 -7
- package/scripts/build-scip-windows.mjs +10 -7
- package/skills/_shared/SKILL.md +243 -0
- package/skills/_shared/agents/openai.yaml +4 -0
- package/skills/scip-api-impact/SKILL.md +55 -71
- package/skills/scip-claim-audit/SKILL.md +105 -0
- package/skills/scip-claim-audit/agents/openai.yaml +4 -0
- package/skills/scip-cleanup-audit/SKILL.md +122 -0
- package/skills/scip-cleanup-audit/agents/openai.yaml +4 -0
- package/skills/scip-cleanup-improve/SKILL.md +84 -0
- package/skills/scip-cleanup-improve/agents/openai.yaml +4 -0
- package/skills/scip-concrete-plan/SKILL.md +181 -0
- package/skills/scip-concrete-plan/agents/openai.yaml +4 -0
- package/skills/scip-conductor/SKILL.md +133 -0
- package/skills/scip-conductor/agents/openai.yaml +4 -0
- package/skills/scip-debug/SKILL.md +60 -58
- package/skills/scip-diagram/SKILL.md +64 -94
- package/skills/scip-directory-architecture/SKILL.md +65 -107
- package/skills/scip-doc-reconcile/SKILL.md +56 -67
- package/skills/scip-explore/SKILL.md +78 -210
- package/skills/scip-hyper-optimization/SKILL.md +124 -198
- package/skills/scip-integrity-audit/SKILL.md +103 -0
- package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
- package/skills/scip-language-playbook/SKILL.md +56 -326
- package/skills/scip-maintainability/SKILL.md +80 -219
- package/skills/scip-probe-reachability/SKILL.md +92 -0
- package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
- package/skills/scip-query/SKILL.md +108 -124
- package/skills/scip-react-maintainability/SKILL.md +64 -82
- package/skills/scip-setup/SKILL.md +121 -0
- package/skills/scip-setup/agents/openai.yaml +4 -0
- package/skills/scip-tla-model-system/SKILL.md +138 -0
- package/skills/scip-tla-model-system/agents/openai.yaml +4 -0
- package/skills/scip-triage-issue/SKILL.md +53 -41
- package/skills/scip-twin-drift/SKILL.md +107 -0
- package/skills/scip-twin-drift/agents/openai.yaml +4 -0
- package/skills/scip-verify/SKILL.md +70 -88
- package/skills/scip-vue-maintainability/SKILL.md +67 -94
- package/dist/chunk-2DOW7QCA.js +0 -71
- package/dist/chunk-2FMFF4RI.js +0 -2
- package/dist/chunk-5GXTUANY.js +0 -2
- package/dist/chunk-5JHEN5VN.js +0 -25
- package/dist/chunk-62ULXMQ7.js +0 -18
- package/dist/chunk-7EK7OSWS.js +0 -2
- package/dist/chunk-7IWIMNHI.js +0 -2
- package/dist/chunk-7XTO4YXB.js +0 -8
- package/dist/chunk-AOWFUGDL.js +0 -2
- package/dist/chunk-AREANYIA.js +0 -3
- package/dist/chunk-AZBELWZQ.js +0 -7
- package/dist/chunk-B32FX5KB.js +0 -2
- package/dist/chunk-B6MJ5VQV.js +0 -2
- package/dist/chunk-CXWCLVYL.js +0 -2
- package/dist/chunk-CYHIKTJN.js +0 -3
- package/dist/chunk-DFSEARAU.js +0 -2
- package/dist/chunk-DVFP6PZI.js +0 -2
- package/dist/chunk-E3ADDB43.js +0 -2
- package/dist/chunk-F6IXELII.js +0 -20
- package/dist/chunk-FMGVZBS2.js +0 -2
- package/dist/chunk-GG5LHT27.js +0 -2
- package/dist/chunk-H7JF2CKK.js +0 -2
- package/dist/chunk-HHOMJCP5.js +0 -4
- package/dist/chunk-HRDSU5FN.js +0 -9
- package/dist/chunk-HWVYTJOV.js +0 -2
- package/dist/chunk-JNMLBL36.js +0 -2
- package/dist/chunk-L446VQYQ.js +0 -2
- package/dist/chunk-LDJUB7XW.js +0 -2
- package/dist/chunk-MYTUWXHK.js +0 -4
- package/dist/chunk-N25HPUOK.js +0 -2
- package/dist/chunk-NABVR6B7.js +0 -2
- package/dist/chunk-NBNEVLRC.js +0 -3
- package/dist/chunk-ONPCQ2PM.js +0 -6
- package/dist/chunk-Q5P7NOVM.js +0 -2
- package/dist/chunk-RGKRYO22.js +0 -4
- package/dist/chunk-RM2WQ75T.js +0 -2
- package/dist/chunk-ROGZXWN2.js +0 -2
- package/dist/chunk-RSSXKJ6J.js +0 -38
- package/dist/chunk-RVGEZYMQ.js +0 -2
- package/dist/chunk-SA3DPTHT.js +0 -7
- package/dist/chunk-SGTKURU6.js +0 -52
- package/dist/chunk-T4N2ZRVY.js +0 -21
- package/dist/chunk-THB6AM3V.js +0 -11
- package/dist/chunk-ULHLDOD6.js +0 -4
- package/dist/chunk-UQ73QF5D.js +0 -43
- package/dist/chunk-UUBMFL3F.js +0 -59
- package/dist/chunk-V5FGK3DZ.js +0 -2
- package/dist/chunk-WTY5FERW.js +0 -2
- package/dist/chunk-WUOB4DHH.js +0 -6
- package/dist/chunk-YFQIKYOP.js +0 -2
- package/dist/chunk-Z2LDWIJV.js +0 -5
- package/dist/chunk-ZNWWVYQL.js +0 -3
- package/skills/concrete-plan/SKILL.md +0 -372
- package/skills/concrete-plan/agents/openai.yaml +0 -4
- package/skills/scip-adoption/SKILL.md +0 -122
- package/skills/scip-adoption/agents/openai.yaml +0 -4
- package/skills/scip-ai-cleanup/SKILL.md +0 -153
- package/skills/scip-ai-cleanup/agents/openai.yaml +0 -4
- package/skills/scip-debloat/SKILL.md +0 -439
- package/skills/scip-debloat/agents/openai.yaml +0 -4
- package/skills/scip-health-audit/SKILL.md +0 -162
- package/skills/scip-health-audit/agents/openai.yaml +0 -4
- package/skills/scip-health-improve/SKILL.md +0 -155
- package/skills/scip-health-improve/agents/openai.yaml +0 -4
- package/skills/scip-query-setup/SKILL.md +0 -170
- package/skills/scip-query-setup/agents/openai.yaml +0 -3
- package/vendor/scip/README.md +0 -6
- package/vendor/scip/win32-arm64/scip.exe +0 -0
- package/vendor/scip/win32-x64/scip.exe +0 -0
|
@@ -1,100 +1,89 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: scip-maintainability
|
|
3
|
-
description:
|
|
3
|
+
description: Review maintainability with scip-query evidence. Use for hidden policies, scattered concepts, accidental variation, weak boundaries, system compression, architecture smells, structural refactors, or maintainability improvements beyond health scores.
|
|
4
|
+
commands:
|
|
5
|
+
- template: "scip-query stats"
|
|
6
|
+
when: "Map evidence: repo-wide size before bounding the review."
|
|
7
|
+
- template: "scip-query system <scope>"
|
|
8
|
+
when: "Map evidence: files, symbols, deps in/out for the scope."
|
|
9
|
+
- template: "scip-query surface <scope>"
|
|
10
|
+
when: "Map evidence: what consumers actually use from the scope."
|
|
11
|
+
- template: "scip-query change-surface <file>"
|
|
12
|
+
when: "Map evidence: exports, consumers, and blast-radius risk."
|
|
13
|
+
- template: "scip-query affected <symbol>"
|
|
14
|
+
when: "Map evidence: transitive consumers of a candidate symbol."
|
|
15
|
+
- template: "scip-query drift --patterns"
|
|
16
|
+
when: "Map evidence: layer violations and pattern deviations as probes (--patterns is off by default and near-zero precision; treat hits as leads, not findings)."
|
|
4
17
|
---
|
|
5
18
|
|
|
6
|
-
#
|
|
19
|
+
# scip-maintainability
|
|
7
20
|
|
|
8
|
-
|
|
21
|
+
Use this skill to review a codebase as a maintainer who must make future changes safely. Maintainability is the degree to which real code units let a maintainer understand, verify, and change behavior without rediscovering hidden knowledge.
|
|
9
22
|
|
|
10
|
-
|
|
23
|
+
Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
|
|
11
24
|
|
|
12
|
-
|
|
25
|
+
<!-- BEGIN GENERATED SKILL COMMANDS -->
|
|
26
|
+
## Commands for this skill
|
|
13
27
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- "Find deeper maintainability problems"
|
|
23
|
-
- "What hidden policies or concepts are scattered?"
|
|
24
|
-
- "Compress this system"
|
|
25
|
-
- "Find the refactor that actually makes this easier to maintain"
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Hard Rules
|
|
30
|
-
|
|
31
|
-
1. **Evidence first.** Use `scip-query` to ground claims in files, symbols, references, call graphs, dependencies, surfaces, and blast radius. Check `scip-query status --capabilities`; if freshness is `stale`, `missing`, or `unknown`, run `scip-query reindex` before trusting graph facts.
|
|
28
|
+
| Command | Purpose | When |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| `scip-query stats` | Show index statistics | Map evidence: repo-wide size before bounding the review. |
|
|
31
|
+
| `scip-query system <scope>` | Full module map: files, symbols, deps in/out | Map evidence: files, symbols, deps in/out for the scope. |
|
|
32
|
+
| `scip-query surface <scope>` | What symbols consumers actually use from this module | Map evidence: what consumers actually use from the scope. |
|
|
33
|
+
| `scip-query change-surface <file>` | Pre-change briefing: exports, consumers, and blast-radius risk | Map evidence: exports, consumers, and blast-radius risk. |
|
|
34
|
+
| `scip-query affected <symbol>` | Transitive closure of symbols that could break if this symbol changes | Map evidence: transitive consumers of a candidate symbol. |
|
|
35
|
+
| `scip-query drift --patterns` | Detect heuristic drift candidates: unused imports and layer violations by default; pass --patterns for pattern deviations too | Map evidence: layer violations and pattern deviations as probes (--patterns is off by default and near-zero precision; treat hits as leads, not findings). |
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
3. **Name the referents before naming the smell.** A smell is not real until you can point to the concrete files, symbols, tests, or public surfaces that make the future-maintenance risk real.
|
|
36
|
-
|
|
37
|
-
4. **Preserve essential variation.** Do not compress code merely because it looks similar. Different language grammars, runtime contracts, compatibility boundaries, public APIs, or domain rules may justify different code.
|
|
38
|
-
|
|
39
|
-
5. **Reject false abstractions.** A new abstraction is justified only when it removes a hidden policy, names a lifecycle, enforces a rule callers were hand-maintaining, or reduces the concept count required for safe change.
|
|
40
|
-
|
|
41
|
-
6. **Prefer small named mechanisms.** Delete, inline, merge, generate, or enforce before adding broad frameworks.
|
|
42
|
-
|
|
43
|
-
7. **Treat suppressions as accepted design records.** Prefer fixing findings.
|
|
44
|
-
Use `scip-query suppress <id> --reason "<specific reason>"` only for
|
|
45
|
-
intentional design, compatibility shims, framework entry points, or accepted
|
|
46
|
-
false positives. Run `scip-query config-validate` afterward.
|
|
47
|
-
|
|
48
|
-
---
|
|
37
|
+
Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
|
|
38
|
+
<!-- END GENERATED SKILL COMMANDS -->
|
|
49
39
|
|
|
50
|
-
##
|
|
40
|
+
## Terms
|
|
51
41
|
|
|
52
42
|
A code smell is an observable codebase fact that predicts avoidable future mistakes because the same knowledge must be rediscovered, synchronized, or defended in more than one place.
|
|
53
43
|
|
|
54
|
-
A concept boundary is the line around code units that exist for one reason to change.
|
|
44
|
+
A concept boundary is the line around code units that exist for one reason to change.
|
|
55
45
|
|
|
56
|
-
A hidden policy is a rule for choosing behavior when several plausible behaviors exist, but the rule
|
|
46
|
+
A hidden policy is a rule for choosing behavior when several plausible behaviors exist, but the rule lives in local branches, comments, conventions, or caller folklore instead of a named mechanism.
|
|
57
47
|
|
|
58
|
-
A lifecycle is a repeatable sequence of states or steps that makes a result valid
|
|
48
|
+
A lifecycle is a repeatable sequence of states or steps that makes a result valid.
|
|
59
49
|
|
|
60
|
-
Accidental variation is difference in code shape that does not correspond to
|
|
50
|
+
Accidental variation is difference in code shape that does not correspond to behavior, domain facts, runtime constraints, or external contracts.
|
|
61
51
|
|
|
62
|
-
Essential variation is difference that must remain because the real
|
|
52
|
+
Essential variation is difference that must remain because the real units differ: language grammars, user-visible APIs, runtime environments, or compatibility boundaries.
|
|
63
53
|
|
|
64
|
-
|
|
54
|
+
System compression is replacing several mechanisms that perform the same role, policy, lifecycle, or surface job with fewer named mechanisms that preserve behavior.
|
|
65
55
|
|
|
66
|
-
|
|
56
|
+
## Rules
|
|
57
|
+
|
|
58
|
+
1. Ground claims in files, symbols, references, call graphs, dependencies, surfaces, and blast radius.
|
|
59
|
+
2. Do not chase health scores; detector counts are clues, not objectives.
|
|
60
|
+
3. Name concrete referents before naming the smell.
|
|
61
|
+
4. Preserve essential variation.
|
|
62
|
+
5. Add an abstraction only when it removes hidden policy, names a lifecycle, enforces a rule, or reduces concept count.
|
|
63
|
+
6. Prefer deletion, inlining, merging, generation, or enforcement before broad frameworks.
|
|
67
64
|
|
|
68
65
|
## Workflow
|
|
69
66
|
|
|
70
|
-
### 1. Bound the
|
|
67
|
+
### 1. Bound the review
|
|
71
68
|
|
|
72
|
-
Restate the question
|
|
69
|
+
Restate the question:
|
|
73
70
|
|
|
74
71
|
```text
|
|
75
72
|
What future-maintenance mistakes does this structure invite, and what smaller named mechanisms would prevent them without hiding real variation?
|
|
76
73
|
```
|
|
77
74
|
|
|
78
|
-
|
|
75
|
+
Name the scope: repo, module, command family, query family, runtime surface, fixture set, or feature path.
|
|
79
76
|
|
|
80
|
-
|
|
77
|
+
This step is complete only when the review question and scope are concrete.
|
|
81
78
|
|
|
82
|
-
|
|
79
|
+
### 2. Map evidence
|
|
83
80
|
|
|
84
81
|
```bash
|
|
85
|
-
scip-query status
|
|
86
|
-
scip-query status --capabilities # Reindex only when freshness is stale, missing, or unknown
|
|
87
82
|
scip-query stats
|
|
88
83
|
scip-query system <scope>
|
|
89
84
|
scip-query surface <scope>
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Then map the concrete units:
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
85
|
scip-query files <pattern>
|
|
96
86
|
scip-query outline <file>
|
|
97
|
-
scip-query outline <file>
|
|
98
87
|
scip-query deps <file>
|
|
99
88
|
scip-query rdeps <file>
|
|
100
89
|
scip-query trace <symbol>
|
|
@@ -103,190 +92,62 @@ scip-query affected <symbol>
|
|
|
103
92
|
scip-query change-surface <file>
|
|
104
93
|
```
|
|
105
94
|
|
|
106
|
-
Use cleanup commands as probes
|
|
95
|
+
Use cleanup commands as probes: `health`, `similar`, `similar-files`, `similar-chains`, `extract-candidates`, `wrapper-candidates`, `passthrough-candidates`, `stale-abstractions`, `drift`, and `cycles`.
|
|
107
96
|
|
|
108
|
-
|
|
109
|
-
scip-query health --json
|
|
110
|
-
scip-query similar
|
|
111
|
-
scip-query similar-files
|
|
112
|
-
scip-query similar-chains
|
|
113
|
-
scip-query extract-candidates
|
|
114
|
-
scip-query wrapper-candidates
|
|
115
|
-
scip-query passthrough-candidates
|
|
116
|
-
scip-query stale-abstractions --include-low-confidence
|
|
117
|
-
scip-query drift
|
|
118
|
-
scip-query cycles
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### 3. Build a Role Inventory
|
|
97
|
+
This step is complete only when concrete units, consumers, tests, fallbacks, adapters, generated artifacts, and compatibility constraints are visible.
|
|
122
98
|
|
|
123
|
-
|
|
99
|
+
### 3. Build the role inventory
|
|
124
100
|
|
|
125
|
-
|
|
126
|
-
- callers and downstream public surfaces
|
|
127
|
-
- tests and fixtures that define behavior
|
|
128
|
-
- fallback paths, caches, registries, adapters, and command handlers
|
|
129
|
-
- generated artifacts or compatibility constraints
|
|
130
|
-
- the role each unit plays in the workflow
|
|
101
|
+
For each cluster, ask:
|
|
131
102
|
|
|
132
|
-
|
|
103
|
+
- What one concept appears in several places?
|
|
104
|
+
- What policy is hidden?
|
|
105
|
+
- What lifecycle is unnamed?
|
|
106
|
+
- Which differences are essential?
|
|
107
|
+
- What must a maintainer know that the local interface does not admit?
|
|
108
|
+
- Would a smaller mechanism remove a reason to change, or only move code?
|
|
133
109
|
|
|
134
|
-
|
|
135
|
-
- What policy is hidden in branches, comments, argument conventions, or test fixtures?
|
|
136
|
-
- What lifecycle is present but unnamed?
|
|
137
|
-
- Which differences are essential, and which are accidental?
|
|
138
|
-
- What must a new maintainer know that the local interface does not admit?
|
|
139
|
-
- Would a smaller named mechanism remove a reason to change, or only move code around?
|
|
110
|
+
This step is complete only when every candidate smell names its referents and its future-maintenance failure mode.
|
|
140
111
|
|
|
141
|
-
### 4. Rank
|
|
112
|
+
### 4. Rank pressure
|
|
142
113
|
|
|
143
114
|
Prefer severe smells in this order:
|
|
144
115
|
|
|
145
116
|
1. Hidden correctness or evidence policy spread across modules.
|
|
146
|
-
2. Repeated lifecycle or pipeline with no
|
|
147
|
-
3. Public surface
|
|
148
|
-
4. Large module with
|
|
117
|
+
2. Repeated lifecycle or pipeline with no owner.
|
|
118
|
+
3. Public surface exposing accidental internals.
|
|
119
|
+
4. Large module with unrelated reasons to change.
|
|
149
120
|
5. Tests that encode incident history without contract vocabulary.
|
|
150
121
|
6. Adapter families with repeated capability or fallback shapes.
|
|
151
122
|
7. Suppression comments that document architecture decisions instead of exceptions.
|
|
152
|
-
8. Thin wrappers
|
|
123
|
+
8. Thin wrappers and passthroughs that do not buy clarity.
|
|
153
124
|
|
|
154
|
-
Reject
|
|
125
|
+
Reject smells that are aesthetic, unverifiable, or false compression.
|
|
155
126
|
|
|
156
|
-
|
|
157
|
-
- the new abstraction needs more concepts than it removes
|
|
158
|
-
- a compatibility boundary must stay explicit
|
|
159
|
-
- the smell is only aesthetic
|
|
160
|
-
- the behavior cannot be verified
|
|
127
|
+
This step is complete only when each target is ranked, skipped, or deferred with evidence.
|
|
161
128
|
|
|
162
|
-
### 5. Choose a
|
|
129
|
+
### 5. Choose a model
|
|
163
130
|
|
|
164
131
|
For substantial changes, compare at least two models:
|
|
165
132
|
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
|
|
170
|
-
Evaluate each model by:
|
|
171
|
-
|
|
172
|
-
- behavior preserved
|
|
173
|
-
- concept count removed
|
|
174
|
-
- blast radius from `affected`, `change-surface`, `deps`, and `rdeps`
|
|
175
|
-
- deletion potential
|
|
176
|
-
- failure mode if the abstraction is false
|
|
177
|
-
- migration path and verification cost
|
|
178
|
-
|
|
179
|
-
Choose the model that removes a concept or policy duplication, not the model that merely extracts a helper.
|
|
133
|
+
- Conservative: delete or inline local bloat.
|
|
134
|
+
- Shape-level: introduce one small mechanism for a repeated role or lifecycle.
|
|
135
|
+
- Radical: replace a scattered surface with metadata, generation, or enforced policy.
|
|
180
136
|
|
|
181
|
-
|
|
137
|
+
Evaluate behavior preserved, concept count removed, blast radius, deletion potential, false-abstraction failure mode, migration path, and verification cost.
|
|
182
138
|
|
|
183
|
-
|
|
139
|
+
This step is complete only when the chosen model removes a concept or policy duplication rather than merely extracting a helper.
|
|
184
140
|
|
|
185
|
-
|
|
186
|
-
# SCIP Maintainability Register
|
|
141
|
+
### 6. Produce a register or atlas
|
|
187
142
|
|
|
188
|
-
|
|
189
|
-
## Scope Map
|
|
190
|
-
## Smell Ledger
|
|
143
|
+
For broad review, write a register under `docs/plans/` unless the user asks not to edit files. For implementation, write an atlas before editing.
|
|
191
144
|
|
|
192
|
-
|
|
193
|
-
| --- | --- | --- | --- | --- | --- |
|
|
145
|
+
Use dispositions: `merge`, `delete`, `inline`, `extract`, `generate`, `enforce`, `supersede`, `defer`, `skip`.
|
|
194
146
|
|
|
195
|
-
|
|
196
|
-
## Deferred Boundaries
|
|
197
|
-
## Verification Plan
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
For implementation work, create an atlas before editing:
|
|
201
|
-
|
|
202
|
-
```markdown
|
|
203
|
-
# <Scope> Maintainability Atlas
|
|
204
|
-
|
|
205
|
-
## Scope Map
|
|
206
|
-
## Role Inventory
|
|
207
|
-
## Hidden Policies
|
|
208
|
-
## Essential vs Accidental Variation
|
|
209
|
-
## Opportunity Ledger
|
|
210
|
-
## Dependency Order
|
|
211
|
-
## Touch Map
|
|
212
|
-
## Validation Plan
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
Use dispositions:
|
|
216
|
-
|
|
217
|
-
- `merge`: combine mechanisms with the same role
|
|
218
|
-
- `delete`: remove proven unused or replaced code
|
|
219
|
-
- `inline`: remove a wrapper, adapter, or single-use abstraction
|
|
220
|
-
- `extract`: isolate a real shared role that multiple consumers need
|
|
221
|
-
- `generate`: derive a surface from metadata instead of maintaining it by hand
|
|
222
|
-
- `enforce`: centralize a policy or invariant so callers cannot drift
|
|
223
|
-
- `supersede`: absorb a local issue into a larger cluster
|
|
224
|
-
- `defer`: keep visible but out of scope because of a verified blocker
|
|
225
|
-
- `skip`: reject because the compression is false or net-negative
|
|
226
|
-
|
|
227
|
-
### 7. Implement Conservatively
|
|
228
|
-
|
|
229
|
-
When asked to fix the smells:
|
|
230
|
-
|
|
231
|
-
- introduce the smallest named mechanism that matches the real concept
|
|
232
|
-
- keep essential variation close to the adapter or domain code that knows it
|
|
233
|
-
- move hidden policies behind interfaces that make the choice visible
|
|
234
|
-
- preserve behavior before broadening scope
|
|
235
|
-
- update registers or docs to record deferred boundaries and why
|
|
236
|
-
|
|
237
|
-
### 8. Verify the Work
|
|
238
|
-
|
|
239
|
-
Run focused tests for touched code and repeat the structural probes that motivated the change:
|
|
240
|
-
|
|
241
|
-
```bash
|
|
242
|
-
scip-query health --json
|
|
243
|
-
scip-query drift
|
|
244
|
-
scip-query stale-abstractions --include-low-confidence
|
|
245
|
-
scip-query wrapper-candidates
|
|
246
|
-
scip-query passthrough-candidates
|
|
247
|
-
scip-query similar-files
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
Then run the post-change checks that match what the fix actually did:
|
|
251
|
-
|
|
252
|
-
| Change made | Required post-check |
|
|
253
|
-
| --- | --- |
|
|
254
|
-
| Extracted a helper, hook, composable, component logic, or named abstraction | `scip-query incomplete-migration`; migrate every unchanged site that still contains the extracted logic or document essential variation |
|
|
255
|
-
| Added a new helper, module, component, hook, or composable | `scip-query similar <new-symbol>` when symbol-like, plus `scip-query recent-duplicates --full`; delete echoes of established code |
|
|
256
|
-
| Consolidated duplicated files, command handlers, adapters, or workflows | rerun the detector that motivated the change: `similar-files`, `similar-chains`, `wrapper-candidates`, `passthrough-candidates`, frontend duplicate commands, or `health` |
|
|
257
|
-
| Added parameters, options, config flags, props, or broad option objects | `scip-query unused-params`; remove speculative inputs that no body uses |
|
|
258
|
-
| Added a wrapper, adapter, facade, re-export, or forwarding layer | `scip-query wrapper-candidates`, `scip-query passthrough-candidates`, and `scip-query redundant-reexports` when exports changed |
|
|
259
|
-
| Added an interface, base class, type alias, or abstraction boundary | `scip-query stale-abstractions --include-low-confidence`; prove the abstraction has real consumers and policy |
|
|
260
|
-
| Changed schema, config, generated files, command descriptors, package surface, or docs-backed behavior | `scip-query co-change <file>` and `scip-query doc-drift`; update historical partners and stale docs |
|
|
261
|
-
| Deleted code | `scip-query cleanup-plan --verify`; take the compiler-proven cascade or explain why not |
|
|
262
|
-
|
|
263
|
-
Always finish implemented maintainability work with:
|
|
264
|
-
|
|
265
|
-
```bash
|
|
266
|
-
scip-query diff-impact --json
|
|
267
|
-
scip-query status --capabilities
|
|
268
|
-
# If freshness is stale, missing, or unknown:
|
|
269
|
-
# scip-query reindex
|
|
270
|
-
scip-query diff-gate --json
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
Treat `diff-gate` findings as unfinished work. Fix them or state a concrete acceptance reason; do not silently report success.
|
|
274
|
-
|
|
275
|
-
Report:
|
|
276
|
-
|
|
277
|
-
- the named smell addressed
|
|
278
|
-
- the mechanism introduced, deleted, or simplified
|
|
279
|
-
- what was deliberately not compressed
|
|
280
|
-
- verification results, including the post-change checks that matched the edit
|
|
281
|
-
- commit hash, when committed
|
|
282
|
-
|
|
283
|
-
---
|
|
147
|
+
This step is complete only when each opportunity has evidence, disposition, dependency order, touch map, and validation plan.
|
|
284
148
|
|
|
285
|
-
|
|
149
|
+
### 7. Implement and verify when asked
|
|
286
150
|
|
|
287
|
-
|
|
151
|
+
Implement the smallest named mechanism that matches the real concept. Keep essential variation near the adapter or domain code that knows it. After changes, run focused tests and routed postchecks from the shared reference, then invoke `scip-verify`.
|
|
288
152
|
|
|
289
|
-
|
|
290
|
-
- "This helper names a policy that was previously caller folklore."
|
|
291
|
-
- "This is false compression because the two adapters differ by runtime contract."
|
|
292
|
-
- "The health score changed, but that is a side effect, not the reason this was worth doing."
|
|
153
|
+
Report the smell addressed, mechanism introduced or removed, what was deliberately not compressed, and verification results.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scip-probe-reachability
|
|
3
|
+
description: Prove whether a parser/AST branch is actually reachable by running the real parser on minimal inputs. Use for unreachable or dead node-type/shape branches, wrong node-type strings, tree-sitter grammar mismatches, or any conditional written for an AST or parser output that has never been checked against the real parser.
|
|
4
|
+
commands:
|
|
5
|
+
- template: "scip-query outline <file> --signatures"
|
|
6
|
+
when: "Enumerate branches: symbol tree with signatures for the target file."
|
|
7
|
+
- template: "scip-query code <symbol>"
|
|
8
|
+
when: "Enumerate branches: read each branch condition's exact node-type check."
|
|
9
|
+
- template: "scip-query trace <symbol>"
|
|
10
|
+
when: "Enumerate branches: confirm the function's only caller/entry point."
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# scip-probe-reachability
|
|
14
|
+
|
|
15
|
+
Use this skill for code that branches on a parser or AST node's type or shape (`node.type === '...'`, a grammar-specific tag, a regex over token shape) where nobody has verified the real parser ever produces that type or shape. A branch written from documentation, memory, or a similar grammar in another language can be permanently dead: it looks correct, compiles, and is never exercised by a single test, because the input that should reach it never reaches it under the actual parser.
|
|
16
|
+
|
|
17
|
+
Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
|
|
18
|
+
|
|
19
|
+
<!-- BEGIN GENERATED SKILL COMMANDS -->
|
|
20
|
+
## Commands for this skill
|
|
21
|
+
|
|
22
|
+
| Command | Purpose | When |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `scip-query outline <file> --signatures` | Tree view of symbols in a file, with line ranges | Enumerate branches: symbol tree with signatures for the target file. |
|
|
25
|
+
| `scip-query code <symbol>` | Read the source code for a symbol (bounded to its definition range) | Enumerate branches: read each branch condition's exact node-type check. |
|
|
26
|
+
| `scip-query trace <symbol>` | Trace a symbol: definition + all references | Enumerate branches: confirm the function's only caller/entry point. |
|
|
27
|
+
|
|
28
|
+
Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
|
|
29
|
+
<!-- END GENERATED SKILL COMMANDS -->
|
|
30
|
+
|
|
31
|
+
## Rules
|
|
32
|
+
|
|
33
|
+
1. Never trust a branch condition by reading it; run the real parser on an input constructed to hit it.
|
|
34
|
+
2. Write scratch probe scripts only under the session scratchpad, never inside the repository — they are throwaway evidence, not product code.
|
|
35
|
+
3. Never create a git worktree and never symlink `node_modules` for this skill's probes; import the parser module directly (from `src/` via a TypeScript runner, or from the built package) in a standalone script that needs no repo-root install step.
|
|
36
|
+
4. A branch is a finding whether it is truly unreachable (dead code) or reachable but under a different node-type string than the code checks (a silent misclassification, which is worse than dead code because it fails without raising anything).
|
|
37
|
+
5. Completion requires every node-type/shape branch in the target function to have either a reached probe or a filed finding — partial coverage is not done.
|
|
38
|
+
|
|
39
|
+
## Workflow
|
|
40
|
+
|
|
41
|
+
### 1. Enumerate branch conditions
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
scip-query outline <target-file> --signatures
|
|
45
|
+
scip-query code <target-function>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
List every conditional that tests a node's `type`, tag name, or shape (an `if`/`else if` chain over `node.type === '...'`, a `switch` on a grammar tag, or a regex matched against node text standing in for a type check). Record the exact string or pattern each branch expects.
|
|
49
|
+
|
|
50
|
+
This step is complete only when every node-type/shape branch in the target function is listed with its file:line and the exact condition text.
|
|
51
|
+
|
|
52
|
+
### 2. Construct a minimal input per branch
|
|
53
|
+
|
|
54
|
+
For each branch, write the smallest source snippet in the target language that should, by the language's grammar, produce a node of that type or shape at that point in the tree. Prefer one snippet per branch; note when a single snippet is expected to exercise more than one branch (siblings in a walk).
|
|
55
|
+
|
|
56
|
+
This step is complete only when every branch has a candidate input snippet.
|
|
57
|
+
|
|
58
|
+
### 3. Run the real parser
|
|
59
|
+
|
|
60
|
+
Write one scratch script under the session scratchpad (never in the repo) that imports the actual parser module used by the target code — not a reimplementation, not a mental model of the grammar — and, for each candidate snippet:
|
|
61
|
+
|
|
62
|
+
1. Parses it.
|
|
63
|
+
2. Walks the resulting tree and collects every node type actually produced.
|
|
64
|
+
3. Reports whether the branch's expected type/shape appears anywhere in that set.
|
|
65
|
+
|
|
66
|
+
Run the script (for example `npx vite-node <scratch-script>` from the repo root, or a plain `node` script importing the built package) and record reached/unreached per branch.
|
|
67
|
+
|
|
68
|
+
This step is complete only when every branch from step 1 has a recorded reached/unreached result from an actual parser run, not an inference.
|
|
69
|
+
|
|
70
|
+
### 4. File findings for unreached branches
|
|
71
|
+
|
|
72
|
+
For each unreached branch, determine and record which of these it is:
|
|
73
|
+
|
|
74
|
+
- **Dead branch**: the grammar never produces this node type/shape anywhere reachable from valid source in this language; the branch is unreachable code. Fix: delete it, or replace it with the branch that actually covers the intended case (found by inspecting the node types the parser did produce for the candidate input).
|
|
75
|
+
- **Wrong node-type string**: the intended case is real and common, but the branch checks the wrong string (a rename in the grammar, a typo, or a mismatch borrowed from a different language/version). Fix: correct the string to what step 3 actually observed.
|
|
76
|
+
|
|
77
|
+
This step is complete only when every unreached branch has one of these two labels and a fix direction.
|
|
78
|
+
|
|
79
|
+
### 5. Report
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
Target: <file:function>
|
|
83
|
+
|
|
84
|
+
Branches:
|
|
85
|
+
| Branch condition | Candidate input | Reached? | Finding |
|
|
86
|
+
| --- | --- | --- | --- |
|
|
87
|
+
|
|
88
|
+
Findings:
|
|
89
|
+
- <branch> — dead branch / wrong node-type string — fix: <direction>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Completion requires every branch from step 1 to appear in the table with a reached/unreached result.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "SCIP Probe Reachability"
|
|
3
|
+
short_description: "Prove parser/AST branches are reachable by running the real parser"
|
|
4
|
+
default_prompt: "Enumerate the node-type/shape branches in the target parser or AST-consuming function, construct a minimal input per branch, run the real parser on each in a scratch script, and file findings for every unreached branch."
|