scip-query 0.19.4 → 0.19.6
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 +75 -1
- package/README.md +242 -49
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-2YU7I3QO.js → chunk-24QNP7MN.js} +2 -2
- package/dist/{chunk-CNKAGUPL.js → chunk-26X7KCJR.js} +2 -2
- package/dist/{chunk-GPBBJ5Y4.js → chunk-273W2U4Y.js} +3 -3
- package/dist/{chunk-7GXM52MI.js → chunk-2CVXCGL4.js} +2 -2
- package/dist/{chunk-ABMYA4TN.js → chunk-2EZSOTSY.js} +2 -2
- package/dist/{chunk-HKEHS2AS.js → chunk-2GSQR6YA.js} +2 -2
- package/dist/{chunk-FECYOO5O.js → chunk-2OXVAGGT.js} +2 -2
- package/dist/chunk-2ZOCHAL2.js +8 -0
- package/dist/{chunk-QGXBRIM5.js → chunk-336DC5NJ.js} +2 -2
- package/dist/chunk-35SQLYCQ.js +2 -0
- package/dist/{chunk-VXQNNXJE.js → chunk-3OIKRYU5.js} +2 -2
- package/dist/{chunk-52ZYCAEO.js → chunk-47X75ZKH.js} +2 -2
- package/dist/{chunk-NPKYOIFM.js → chunk-4CGVLUDP.js} +2 -2
- package/dist/chunk-4RI4BJGT.js +8 -0
- package/dist/{chunk-P2PC2WGR.js → chunk-52HQTTPB.js} +2 -2
- package/dist/{chunk-YNRNA5LK.js → chunk-5OC3HWP5.js} +2 -2
- package/dist/{chunk-STOL2BTL.js → chunk-6XFC7PQ5.js} +2 -2
- package/dist/{chunk-J77UIT3I.js → chunk-6XHTISLI.js} +2 -2
- package/dist/chunk-6YTSKJJ3.js +2 -0
- package/dist/{chunk-BTEE5NZQ.js → chunk-7E3TH5ZN.js} +2 -2
- package/dist/{chunk-X6D5IC6I.js → chunk-7LABSJSR.js} +2 -2
- package/dist/chunk-7Q6VYYCH.js +2 -0
- package/dist/{chunk-FWUUZTIO.js → chunk-A43URCQ3.js} +2 -2
- package/dist/chunk-A63U2W3P.js +3 -0
- package/dist/{chunk-3MJ5YA4Y.js → chunk-ADFSIJP2.js} +2 -2
- package/dist/chunk-AOLE4DYM.js +6 -0
- package/dist/chunk-APMMR5Y2.js +2 -0
- package/dist/chunk-B5MHCHP3.js +107 -0
- package/dist/{chunk-4RSI5EMG.js → chunk-CSTYYXKC.js} +2 -2
- package/dist/{chunk-25LPM4DG.js → chunk-CYJM7CYF.js} +2 -2
- package/dist/{chunk-S44IULR6.js → chunk-DD5BOU5I.js} +2 -2
- package/dist/{chunk-YGAGTIDK.js → chunk-DGMCFMPG.js} +7 -7
- package/dist/{chunk-UOAV44HR.js → chunk-E2ZXPB7J.js} +2 -2
- package/dist/{chunk-IZKFSVBV.js → chunk-EVOC5I5I.js} +2 -2
- package/dist/{chunk-XTX6QHOF.js → chunk-F42A3AKG.js} +2 -2
- package/dist/{chunk-Q4IIEGXJ.js → chunk-FHCTEANE.js} +2 -2
- package/dist/{chunk-3SVWW4PN.js → chunk-FKGN4A4E.js} +2 -2
- package/dist/{chunk-IG7N5ZIK.js → chunk-FQTPPXNA.js} +2 -2
- package/dist/{chunk-F6O7AAC3.js → chunk-G4UQL4CP.js} +2 -2
- package/dist/chunk-GA64UPMI.js +6 -0
- package/dist/{chunk-ZXJYMGD3.js → chunk-GK3GRUJX.js} +2 -2
- package/dist/chunk-HEBAY673.js +2 -0
- package/dist/chunk-HELS7KFF.js +2 -0
- package/dist/{chunk-B5NLK2B3.js → chunk-IPDCSB6N.js} +2 -2
- package/dist/{chunk-M7MTH5NR.js → chunk-IYAOX36F.js} +2 -2
- package/dist/{chunk-YVVCVR2L.js → chunk-J7VT2CRB.js} +2 -2
- package/dist/{chunk-4333ETTV.js → chunk-JELJLXEE.js} +2 -2
- package/dist/{chunk-LBMJEAEW.js → chunk-JERWGHQT.js} +2 -2
- package/dist/chunk-JJJCO4QC.js +945 -0
- package/dist/{chunk-6E7UTQY7.js → chunk-JZNLMHWY.js} +2 -2
- package/dist/{chunk-R4FQGQ4X.js → chunk-K42M2KWT.js} +2 -2
- package/dist/{chunk-H7UKLTWJ.js → chunk-KLVJABXA.js} +2 -2
- package/dist/chunk-KP4KBDVF.js +3 -0
- package/dist/{chunk-RV2FQIX3.js → chunk-LMFVTUW2.js} +2 -2
- package/dist/chunk-LRTP3DKL.js +3 -0
- package/dist/{chunk-U6WNH5GC.js → chunk-MGBJHRFB.js} +2 -2
- package/dist/{chunk-QDV6RDCP.js → chunk-MLGTCX56.js} +2 -2
- package/dist/{chunk-54HA4ZXH.js → chunk-N3SE646F.js} +2 -2
- package/dist/{chunk-KP6XRY5Z.js → chunk-NBRUH7OE.js} +2 -2
- package/dist/{chunk-M7AIS73L.js → chunk-NN4ZIRPK.js} +2 -2
- package/dist/{chunk-I5RJM53C.js → chunk-NQLSSVOB.js} +2 -2
- package/dist/{chunk-4SALD7RU.js → chunk-OBKDTVZ3.js} +2 -2
- package/dist/{chunk-GBQ5NYPR.js → chunk-OHWZKLVA.js} +6 -6
- package/dist/{chunk-6NSFJYRC.js → chunk-OP3MTFJR.js} +2 -2
- package/dist/{chunk-EOOJGLDU.js → chunk-OQ2A4G2G.js} +2 -2
- package/dist/{chunk-DLWR3NUU.js → chunk-P6HBYNBE.js} +2 -2
- package/dist/{chunk-QVWS2VWZ.js → chunk-PC44K7RF.js} +2 -2
- package/dist/{chunk-A2EZV2UM.js → chunk-QBYYWGAT.js} +2 -2
- package/dist/{chunk-QRGV2F7L.js → chunk-QHKUY4FW.js} +2 -2
- package/dist/chunk-QHRL4LKM.js +2 -0
- package/dist/{chunk-I5AWSI2G.js → chunk-QQWOFXNW.js} +2 -2
- package/dist/{chunk-WQTAC523.js → chunk-RBFFD4V2.js} +2 -2
- package/dist/{chunk-SOAT6NLA.js → chunk-RJHCPSZ7.js} +2 -2
- package/dist/{chunk-VGRICIQI.js → chunk-RWRLUZ6U.js} +2 -2
- package/dist/{chunk-4T3LTWUS.js → chunk-S2GP3CU3.js} +2 -2
- package/dist/{chunk-HEXVUYFQ.js → chunk-SHKZ7OVJ.js} +2 -2
- package/dist/{chunk-NSS46APD.js → chunk-TFUU5MQQ.js} +2 -2
- package/dist/{chunk-IUFDSKGG.js → chunk-TYQ76QHQ.js} +2 -2
- package/dist/{chunk-NRCXJDHL.js → chunk-U5CNPPTZ.js} +2 -2
- package/dist/{chunk-MITTUCEH.js → chunk-UQK5CRUK.js} +2 -2
- package/dist/{chunk-XLTP42QA.js → chunk-UUJBLG6J.js} +2 -2
- package/dist/chunk-UXP636P5.js +144 -0
- package/dist/{chunk-64RFXJT5.js → chunk-VEVBIAOJ.js} +6 -6
- package/dist/chunk-VKRQDBW5.js +9 -0
- package/dist/{chunk-C7NIYIQ4.js → chunk-VOQFGC2W.js} +4 -4
- package/dist/{chunk-DZ74OMG6.js → chunk-VP542C25.js} +2 -2
- package/dist/{chunk-Q3AFUTGB.js → chunk-WMXRRBII.js} +2 -2
- package/dist/{chunk-ZGZUZ7XE.js → chunk-WXAAURU7.js} +2 -2
- package/dist/chunk-X3NLZHPA.js +20 -0
- package/dist/{chunk-WER3B7MI.js → chunk-XF3KLXN3.js} +2 -2
- package/dist/{chunk-NH5ALKPW.js → chunk-XVJ3V7LM.js} +2 -2
- package/dist/{chunk-4XTA5OMB.js → chunk-YGQN3XGZ.js} +2 -2
- package/dist/{chunk-CFMXJPHH.js → chunk-YHXBD52M.js} +2 -2
- package/dist/{chunk-7B3UPBVA.js → chunk-YLVE3SXZ.js} +2 -2
- package/dist/{chunk-YIJ7ZAA4.js → chunk-YTUD45PU.js} +2 -2
- package/dist/{chunk-VTKGCT3V.js → chunk-YWB2EBNB.js} +2 -2
- package/dist/{chunk-UKZBVX4U.js → chunk-Z2LHPIOM.js} +2 -2
- package/dist/chunk-Z5QQPJ3U.js +30 -0
- package/dist/{chunk-NZL2DBT7.js → chunk-ZLJLE6LK.js} +2 -2
- package/dist/{chunk-XYADIZHU.js → chunk-ZTTISZ7J.js} +2 -2
- package/dist/cli.js +3 -3
- package/dist/command-descriptors-SJDZ7QGR.js +617 -0
- package/dist/{config-types-D20KuvvZ.d.ts → config-types-BWQ5xPGI.d.ts} +4 -0
- package/dist/{db-G_II8yXU.d.ts → db-B0r1o7Vt.d.ts} +18 -1
- package/dist/direct-navigation-HTKOZEOM.js +3 -0
- package/dist/{health-oblXYgkF.d.ts → health-CFnlCiTz.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +2 -2
- package/dist/queries/architecture.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 +2 -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 +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 +2 -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 +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +3 -3
- package/dist/queries/decorative-checkers.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 +30 -2
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +2 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +2 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +2 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- 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 +2 -2
- 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 +2 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +17 -3
- 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/not-implemented.d.ts +3 -3
- package/dist/queries/not-implemented.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 +2 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -2
- 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 +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 +2 -2
- 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/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/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.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 +3 -3
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +2 -2
- package/dist/queries/twin-drift.js +1 -1
- 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 +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -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 +23 -24
- package/dist/reindex.d.ts +10 -4
- package/dist/reindex.js +33 -38
- package/dist/runtime.d.ts +167 -11
- package/dist/runtime.js +3 -2
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{scip-cli-kRpaexVJ.d.ts → scip-cli-DCvnlZCu.d.ts} +5 -1
- package/dist/watch-server.js +5 -5
- package/docs/AGENT_GUIDE.md +1 -1
- package/docs/AI_FAILURE_MODES.md +18 -18
- package/docs/API_EVOLUTION.md +71 -0
- package/docs/CLI_JSON_OUTPUT.md +83 -0
- package/docs/COMMAND_REFERENCE.md +10 -8
- package/docs/COMMITTED_RECORD_COMPATIBILITY.md +117 -0
- package/docs/CONFIGURATION_WRITE_SAFETY.md +130 -0
- package/docs/DETECTOR_GUIDE.md +47 -47
- package/docs/DURABILITY.md +103 -0
- package/docs/INDEX_GENERATIONS.md +121 -0
- package/docs/LOCK_PROTOCOL.md +133 -0
- package/docs/MAILBOX_LIFECYCLE.md +197 -0
- package/docs/REINDEX_METADATA_COMPATIBILITY.md +84 -0
- package/docs/RUST_DURABLE_SESSION_PROTOCOL.md +126 -0
- package/docs/TELEMETRY_RETENTION.md +72 -0
- package/docs/TIME_SEMANTICS.md +77 -0
- package/docs/WATCH_REFRESH_REQUESTS.md +110 -0
- package/docs/WINDOWS_SIDECAR_RELEASE.md +298 -0
- package/docs/analyzer-validation-ledger.md +24 -23
- package/docs/schemas/cli-json-envelope.schema.json +53 -0
- package/docs/schemas/npm-release-state.schema.json +146 -0
- package/docs/schemas/outcome-event-record.schema.json +39 -0
- package/docs/schemas/project-config.schema.json +247 -0
- package/docs/schemas/suppression-record.schema.json +31 -0
- package/docs/schemas/windows-sidecar-provenance.schema.json +137 -0
- package/package.json +15 -5
- package/scripts/build-scip-windows.mjs +180 -61
- package/scripts/scip-windows-provenance.mjs +364 -0
- package/scripts/verify-scip-windows.mjs +29 -0
- package/skills/_shared/SKILL.md +91 -242
- package/skills/_shared/agents/openai.yaml +1 -1
- package/skills/_shared/references/agent-contract-catalog.md +105 -0
- package/skills/_shared/references/command-catalog.md +118 -0
- package/skills/_shared/references/detector-precision-and-diffgate.md +59 -0
- package/skills/_shared/references/evidence-and-dead-code.md +25 -0
- package/skills/scip-audit/SKILL.md +76 -0
- package/skills/scip-audit/agents/openai.yaml +4 -0
- package/skills/scip-audit/references/claims.md +98 -0
- package/skills/scip-audit/references/cleanup.md +101 -0
- package/skills/scip-audit/references/directory.md +222 -0
- package/skills/scip-audit/references/frontend.md +130 -0
- package/skills/scip-audit/references/integrity.md +154 -0
- package/skills/scip-audit/references/maintainability.md +162 -0
- package/skills/scip-audit/references/twin-drift.md +104 -0
- package/skills/scip-diagnose/SKILL.md +52 -0
- package/skills/scip-diagnose/agents/openai.yaml +4 -0
- package/skills/scip-diagnose/references/debug.md +117 -0
- package/skills/{scip-probe-reachability/SKILL.md → scip-diagnose/references/probe-reachability.md} +12 -27
- package/skills/scip-diagnose/references/root-cause.md +145 -0
- package/skills/scip-diagnose/references/triage.md +119 -0
- package/skills/scip-explore/SKILL.md +53 -84
- package/skills/scip-explore/agents/openai.yaml +2 -2
- package/skills/scip-explore/references/diagrams.md +40 -0
- package/skills/scip-explore/references/language-playbook.md +49 -0
- package/skills/scip-improve/SKILL.md +56 -0
- package/skills/scip-improve/agents/openai.yaml +4 -0
- package/skills/scip-improve/references/cleanup-batches.md +53 -0
- package/skills/scip-improve/references/directory-moves.md +53 -0
- package/skills/scip-improve/references/doc-reconcile.md +30 -0
- package/skills/scip-improve/references/frontend-extraction.md +39 -0
- package/skills/scip-improve/references/maintainability-mechanism.md +43 -0
- package/skills/scip-improve/references/twin-drift.md +35 -0
- package/skills/scip-plan/SKILL.md +68 -0
- package/skills/scip-plan/agents/openai.yaml +4 -0
- package/skills/scip-plan/references/api-impact.md +19 -0
- package/skills/scip-plan/references/conductor.md +41 -0
- package/skills/scip-plan/references/high-assurance.md +43 -0
- package/skills/scip-plan/references/hyper-optimization.md +50 -0
- package/skills/scip-plan/references/tla-model.md +88 -0
- package/skills/scip-query/SKILL.md +52 -97
- package/skills/scip-query/agents/openai.yaml +2 -2
- package/skills/scip-setup/SKILL.md +65 -176
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/skills/scip-setup/references/bootstrap-workflow.md +120 -0
- package/skills/scip-setup/references/language-verification.md +61 -0
- package/skills/scip-setup/references/lifecycle-commands.md +119 -0
- package/skills/scip-setup/references/per-repo-triage.md +24 -0
- package/skills/scip-verify/SKILL.md +123 -70
- package/skills/scip-verify/agents/openai.yaml +2 -2
- package/skills/scip-verify/references/calibrate-detectors.md +170 -0
- package/dist/chunk-2CTX5CMX.js +0 -4
- package/dist/chunk-2Y373BDD.js +0 -2
- package/dist/chunk-C2QSK7E7.js +0 -2
- package/dist/chunk-D4U5Q3FT.js +0 -7
- package/dist/chunk-K2ERX4UT.js +0 -3
- package/dist/chunk-KHE7J5ZN.js +0 -3
- package/dist/chunk-L7SPDE73.js +0 -84
- package/dist/chunk-LHMNRHGV.js +0 -3
- package/dist/chunk-LM72NQ7T.js +0 -3
- package/dist/chunk-MSWVMDAH.js +0 -122
- package/dist/chunk-NH7WNNQC.js +0 -20
- package/dist/chunk-OMPZHGHO.js +0 -2
- package/dist/chunk-SVLTAG5O.js +0 -927
- package/dist/chunk-U7DSEKOM.js +0 -30
- package/dist/chunk-V27BEQJN.js +0 -7
- package/dist/chunk-VMNZB6WI.js +0 -4
- package/dist/chunk-XBN5VO53.js +0 -2
- package/dist/chunk-ZAIILQNP.js +0 -5
- package/dist/command-descriptors-MFU4BCJ7.js +0 -612
- package/dist/direct-navigation-MRMQFIRB.js +0 -3
- package/skills/scip-api-impact/SKILL.md +0 -139
- package/skills/scip-api-impact/agents/openai.yaml +0 -4
- package/skills/scip-calibrate/SKILL.md +0 -131
- package/skills/scip-calibrate/agents/openai.yaml +0 -4
- package/skills/scip-claim-audit/SKILL.md +0 -106
- package/skills/scip-claim-audit/agents/openai.yaml +0 -4
- package/skills/scip-cleanup-audit/SKILL.md +0 -126
- package/skills/scip-cleanup-audit/agents/openai.yaml +0 -4
- package/skills/scip-cleanup-improve/SKILL.md +0 -84
- package/skills/scip-cleanup-improve/agents/openai.yaml +0 -4
- package/skills/scip-concrete-plan/SKILL.md +0 -262
- package/skills/scip-concrete-plan/agents/openai.yaml +0 -4
- package/skills/scip-conductor/SKILL.md +0 -133
- package/skills/scip-conductor/agents/openai.yaml +0 -4
- package/skills/scip-debug/SKILL.md +0 -130
- package/skills/scip-debug/agents/openai.yaml +0 -4
- package/skills/scip-diagram/SKILL.md +0 -110
- package/skills/scip-diagram/agents/openai.yaml +0 -4
- package/skills/scip-directory-architecture/SKILL.md +0 -254
- package/skills/scip-directory-architecture/agents/openai.yaml +0 -4
- package/skills/scip-doc-reconcile/SKILL.md +0 -89
- package/skills/scip-doc-reconcile/agents/openai.yaml +0 -4
- package/skills/scip-hyper-optimization/SKILL.md +0 -156
- package/skills/scip-hyper-optimization/agents/openai.yaml +0 -4
- package/skills/scip-integrity-audit/SKILL.md +0 -152
- package/skills/scip-integrity-audit/agents/openai.yaml +0 -4
- package/skills/scip-language-playbook/SKILL.md +0 -106
- package/skills/scip-language-playbook/agents/openai.yaml +0 -4
- package/skills/scip-maintainability/SKILL.md +0 -158
- package/skills/scip-maintainability/agents/openai.yaml +0 -4
- package/skills/scip-probe-reachability/agents/openai.yaml +0 -4
- package/skills/scip-react-maintainability/SKILL.md +0 -101
- package/skills/scip-react-maintainability/agents/openai.yaml +0 -4
- package/skills/scip-root-cause/SKILL.md +0 -150
- package/skills/scip-root-cause/agents/openai.yaml +0 -4
- package/skills/scip-tla-model-system/SKILL.md +0 -148
- package/skills/scip-tla-model-system/agents/openai.yaml +0 -4
- package/skills/scip-triage-issue/SKILL.md +0 -126
- package/skills/scip-triage-issue/agents/openai.yaml +0 -4
- package/skills/scip-twin-drift/SKILL.md +0 -107
- package/skills/scip-twin-drift/agents/openai.yaml +0 -4
- package/skills/scip-vue-maintainability/SKILL.md +0 -107
- package/skills/scip-vue-maintainability/agents/openai.yaml +0 -4
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: scip-root-cause
|
|
3
|
-
description: Diagnose the design flaw behind a family of related bugs with scip-query evidence. Use when similar bugs keep recurring, the same subsystem keeps needing patches, or the user lists fixed/observed bugs and asks what is really wrong; produces a falsifiable flaw diagnosis, a latent-instance hunt, and the least invasive remedy that kills the class.
|
|
4
|
-
commands:
|
|
5
|
-
- template: "scip-query trace <mechanism-symbol>"
|
|
6
|
-
when: "Assemble the family: mechanism and violated invariant for each bug."
|
|
7
|
-
- template: "scip-query co-change <fix-site-file>"
|
|
8
|
-
when: "Assemble the family: files that historically changed with each fix site."
|
|
9
|
-
- template: "scip-query system <system-scope>"
|
|
10
|
-
when: "Define the system: real responsibilities, files, dependencies in and out."
|
|
11
|
-
- template: "scip-query similar <fixed-symbol> --json --full"
|
|
12
|
-
when: "Predict: hunt latent instances among sibling implementations of the fixed code."
|
|
13
|
-
- template: "scip-query refs <invariant-carrier>"
|
|
14
|
-
when: "Predict: every site that touches the violated invariant's state."
|
|
15
|
-
- template: "scip-query affected <remedy-symbol> --json"
|
|
16
|
-
when: "Choose the rung: blast radius of the candidate remedy."
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# scip-root-cause
|
|
20
|
-
|
|
21
|
-
Use this skill to move from a family of related bugs to the design flaw that produces them, and to the least invasive remedy that eliminates the class. `scip-debug` takes one failure to one minimal fix; `scip-maintainability` finds structural smells without bug evidence; this skill starts from the evidence that patching has not worked — the same kind of bug keeps coming back — and asks what the system's design gets wrong.
|
|
22
|
-
|
|
23
|
-
Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
|
|
24
|
-
|
|
25
|
-
<!-- BEGIN GENERATED SKILL COMMANDS -->
|
|
26
|
-
## Commands for this skill
|
|
27
|
-
|
|
28
|
-
| Command | Purpose | When |
|
|
29
|
-
| --- | --- | --- |
|
|
30
|
-
| `scip-query trace <mechanism-symbol>` | Trace a symbol: definition + all references | Assemble the family: mechanism and violated invariant for each bug. |
|
|
31
|
-
| `scip-query co-change <fix-site-file>` | Files that change together in git history without a dependency edge — hidden coupling candidates | Assemble the family: files that historically changed with each fix site. |
|
|
32
|
-
| `scip-query system <system-scope>` | Full module map: files, symbols, deps in/out | Define the system: real responsibilities, files, dependencies in and out. |
|
|
33
|
-
| `scip-query similar <fixed-symbol> --json --full` | Find heuristic function similarity candidates from callee fingerprints | Predict: hunt latent instances among sibling implementations of the fixed code. |
|
|
34
|
-
| `scip-query refs <invariant-carrier>` | Find all files referencing a symbol | Predict: every site that touches the violated invariant's state. |
|
|
35
|
-
| `scip-query affected <remedy-symbol> --json` | Transitive closure of symbols that could break if this symbol changes | Choose the rung: blast radius of the candidate remedy. |
|
|
36
|
-
|
|
37
|
-
Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
|
|
38
|
-
<!-- END GENERATED SKILL COMMANDS -->
|
|
39
|
-
|
|
40
|
-
## Terms
|
|
41
|
-
|
|
42
|
-
A bug family is a set of failures whose mechanisms violate the same invariant; what makes it a family rather than a coincidence is that one stated flaw derives every member, so fixing members one at a time treats symptoms of a shared cause.
|
|
43
|
-
|
|
44
|
-
A design flaw is a mismatch between what a system's design assumes and what its real responsibilities require; what makes it the root cause is that it is the earliest fact from which every family member's mechanism follows, so removing it removes the class.
|
|
45
|
-
|
|
46
|
-
Retrodiction is deriving each already-known bug from the hypothesized flaw; what makes it a test is that a family member the flaw cannot derive either shrinks the family or kills the hypothesis.
|
|
47
|
-
|
|
48
|
-
A latent instance is a not-yet-reported bug the flaw predicts must exist in unfixed code; what makes it decisive is that it is checkable now — finding one confirms the diagnosis and becomes a fix target, while an honest hunt that finds none weakens the diagnosis and must be reported as weakening it.
|
|
49
|
-
|
|
50
|
-
The remedy ladder is the ordered set of interventions from least to most invasive; what makes the order binding is that each rung is only justified when a constructed family member survives the rung below it.
|
|
51
|
-
|
|
52
|
-
## Rules
|
|
53
|
-
|
|
54
|
-
1. Every bug in the family gets a mechanism traced to source, not a symptom description: which invariant broke, where, and what the fix did. Sources: fix commits (`git log`, `git show`) plus `trace`/`code`/`dataflow`.
|
|
55
|
-
2. The flaw hypothesis must be falsifiable and stated as a design claim — "the design assumes X, but the system's responsibilities include Y" — never as a narrative about unlucky bugs.
|
|
56
|
-
3. State at least two rivals and kill them with evidence: unrelated coincidences, caller misuse rather than design, one missed edge case rather than a structural flaw.
|
|
57
|
-
4. The hypothesis must retrodict every family member and predict at least one latent instance, and the latent-instance hunt must be executed (`similar`, `refs` over the invariant's carriers, or a constructed probe), not argued.
|
|
58
|
-
5. Choose the lowest remedy rung that kills the whole class — retrodicted and latent members both. Climb a rung only when a constructed family member survives the rung below, and keep that counterexample in the record.
|
|
59
|
-
6. Root-cause stories are the most rationalization-prone artifact in software: prefer delegating the attack on the diagnosis and the remedy to a fresh subagent given only the family table, system definition, and hypothesis — briefed to win by refuting. Solo fallback: write the rival hypotheses and the latent-instance predictions before reading any more code.
|
|
60
|
-
7. The verdict is derived with counts, and the diagnosis hands off to `scip-concrete-plan` for implementation — this skill does not edit application code.
|
|
61
|
-
|
|
62
|
-
## Workflow
|
|
63
|
-
|
|
64
|
-
### 1. Assemble the bug family
|
|
65
|
-
|
|
66
|
-
For each reported or fixed bug, fill one row:
|
|
67
|
-
|
|
68
|
-
```markdown
|
|
69
|
-
| Bug | Symptom | Mechanism (file:symbol) | Invariant violated | Fix applied | Source |
|
|
70
|
-
| --- | --- | --- | --- | --- | --- |
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Evidence: the user's description, fix commits (`git log --follow`, `git show`), `scip-query trace`/`code` on the mechanism symbols, `scip-query co-change` on fix sites to find members the user forgot.
|
|
74
|
-
|
|
75
|
-
This step is complete only when every row has a source-traced mechanism and a named invariant — a bug whose mechanism cannot be traced is listed as `unconfirmed member`, not silently included.
|
|
76
|
-
|
|
77
|
-
### 2. Define the system
|
|
78
|
-
|
|
79
|
-
Define the system that owns the family, contextually: its wider class, then the essential responsibility that explains its other traits in this codebase — with referents from `scip-query system <scope>` and `surface <scope>`. Then list the design's load-bearing assumptions as the code actually embodies them (not as the README states them), each with a `Source:` citation.
|
|
80
|
-
|
|
81
|
-
This step is complete only when the system's real responsibilities and embodied assumptions are stated with citations.
|
|
82
|
-
|
|
83
|
-
### 3. Hypothesize the flaw — and its rivals
|
|
84
|
-
|
|
85
|
-
State the flaw as a falsifiable design claim:
|
|
86
|
-
|
|
87
|
-
```markdown
|
|
88
|
-
Flaw hypothesis: the design assumes <X> (Source: <citation>), but the system's
|
|
89
|
-
responsibilities include <Y> (Source: <citation>); every family member is an
|
|
90
|
-
instance of the X∧Y collision.
|
|
91
|
-
|
|
92
|
-
Rivals:
|
|
93
|
-
- R1. Coincidence — the members have unrelated causes. Killed by: <evidence> | ALIVE
|
|
94
|
-
- R2. Misuse — callers hold the bug, the design is sound. Killed by: <evidence> | ALIVE
|
|
95
|
-
- R3. <next-most-plausible> — Killed by: <evidence> | ALIVE
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
A rival still marked `ALIVE` at the end of the workflow caps the diagnosis at `CANDIDATE`, not `CONFIRMED`.
|
|
99
|
-
|
|
100
|
-
### 4. Retrodict and predict
|
|
101
|
-
|
|
102
|
-
Retrodiction: derive each family-table row from the flaw in one sentence each. A member that cannot be derived is removed from the family (say so) or refutes the hypothesis (start over).
|
|
103
|
-
|
|
104
|
-
Prediction: the flaw implies unfixed instances exist. Name where they must be, then hunt:
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
scip-query similar <fixed-symbol> --json --full
|
|
108
|
-
scip-query refs <invariant-carrier>
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
plus a constructed probe when the claim is cheaply executable. Record each prediction with an executed result:
|
|
112
|
-
|
|
113
|
-
```markdown
|
|
114
|
-
- L1. <predicted latent instance> → FOUND at <file:line> (new fix target) | NOT FOUND after <hunt executed>
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
This step is complete only when every family member is retrodicted and every prediction has an executed hunt result. Zero latent instances found is a reportable weakness of the diagnosis, not a detail to omit.
|
|
118
|
-
|
|
119
|
-
### 5. Choose the lowest rung
|
|
120
|
-
|
|
121
|
-
The remedy ladder, in order:
|
|
122
|
-
|
|
123
|
-
1. **Enforce the invariant at a boundary** — type, guard, constraint, lint, trigger — without moving code.
|
|
124
|
-
2. **Consolidate the responsibility into one owner** — the scattered decision gets one named mechanism.
|
|
125
|
-
3. **Redesign the core behind its existing interface** — consumers untouched.
|
|
126
|
-
4. **Redesign the interfaces** — last resort; consumers migrate.
|
|
127
|
-
|
|
128
|
-
For the chosen rung, run the attack: construct a family member — retrodicted or latent — that survives the rung. If one survives, keep the counterexample in the record and climb one rung. Check blast radius with `scip-query affected` before proposing any rung above 1. For protocol- or lifecycle-shaped flaws whose remedy must hold across interleavings, note the escalation path to `scip-tla-model-system`.
|
|
129
|
-
|
|
130
|
-
This step is complete only when the chosen rung has an attack record showing no family member survives it, and every rejected lower rung keeps its surviving counterexample.
|
|
131
|
-
|
|
132
|
-
### 6. Report and hand off
|
|
133
|
-
|
|
134
|
-
```markdown
|
|
135
|
-
## Root-cause diagnosis
|
|
136
|
-
|
|
137
|
-
System: <definition with referents>
|
|
138
|
-
Bug family: <n> members traced, <u> unconfirmed
|
|
139
|
-
Flaw: <the design claim> — CONFIRMED | CANDIDATE (rival <id> alive)
|
|
140
|
-
Rivals: <r> stated, <k> killed with evidence
|
|
141
|
-
Retrodiction: <n>/<n> members derived
|
|
142
|
-
Latent instances: <p> predicted, <f> found (each a fix target), hunts executed
|
|
143
|
-
Remedy: rung <1-4> — <the intervention>; lower rungs rejected by <counterexamples>
|
|
144
|
-
Blast radius: <affected summary>
|
|
145
|
-
Escalation: <none | scip-tla-model-system for <property>>
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Hand the diagnosis to `scip-concrete-plan`: the flaw and invariants become its Definitions & Invariants, the family table and hunt results become premises, and the surviving-counterexample record seeds its attack pass.
|
|
149
|
-
|
|
150
|
-
The diagnosis is complete only when the verdict line carries the counts and every count is backed by an entry in the record above it.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "SCIP Root Cause"
|
|
3
|
-
short_description: "Diagnose the design flaw behind a family of recurring bugs"
|
|
4
|
-
default_prompt: "Use scip-query to trace a family of related bugs to the design flaw that produces them: retrodict every member, hunt the latent instances the flaw predicts, and propose the least invasive remedy that eliminates the class."
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: scip-tla-model-system
|
|
3
|
-
description: Model TypeScript systems with TLA+ and scip-query evidence. Use to scaffold, verify, instrument, or trace-check TLA+ specs, mapping files, configs, regression models, counterexample loops, or code/model conformance for an existing system.
|
|
4
|
-
commands:
|
|
5
|
-
- template: 'scip-query tla scaffold <file>'
|
|
6
|
-
when: 'Start here for a new model: derive a draft spec, config, and mapping from indexed code.'
|
|
7
|
-
- template: 'scip-query tla verify <spec>'
|
|
8
|
-
when: 'Mechanical conformance: referents, reads/writes, calls, and the model checker.'
|
|
9
|
-
- template: 'scip-query tla instrument <spec>'
|
|
10
|
-
when: 'Generate a trace recorder plus wiring sites for each mapped action.'
|
|
11
|
-
- template: 'scip-query tla trace-check <spec> --trace <file>'
|
|
12
|
-
when: "Semantic conformance: check a recorded execution against the model's Next relation."
|
|
13
|
-
- template: 'scip-query tla fetch-tools'
|
|
14
|
-
when: 'Download the pinned tla2tools.jar into the cache when the checker is unavailable.'
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
# scip-tla-model-system
|
|
18
|
-
|
|
19
|
-
Use this skill when a TypeScript system needs a TLA+ model tied to code evidence. A modeled slice is the bounded part of the real system represented by the model: state, transitions, inputs, outputs, and failure modes.
|
|
20
|
-
|
|
21
|
-
Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
|
|
22
|
-
|
|
23
|
-
<!-- BEGIN GENERATED SKILL COMMANDS -->
|
|
24
|
-
## Commands for this skill
|
|
25
|
-
|
|
26
|
-
| Command | Purpose | When |
|
|
27
|
-
| --- | --- | --- |
|
|
28
|
-
| `scip-query tla scaffold <file>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Start here for a new model: derive a draft spec, config, and mapping from indexed code. |
|
|
29
|
-
| `scip-query tla verify <spec>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Mechanical conformance: referents, reads/writes, calls, and the model checker. |
|
|
30
|
-
| `scip-query tla instrument <spec>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Generate a trace recorder plus wiring sites for each mapped action. |
|
|
31
|
-
| `scip-query tla trace-check <spec> --trace <file>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Semantic conformance: check a recorded execution against the model's Next relation. |
|
|
32
|
-
| `scip-query tla fetch-tools` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Download the pinned tla2tools.jar into the cache when the checker is unavailable. |
|
|
33
|
-
|
|
34
|
-
Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
|
|
35
|
-
<!-- END GENERATED SKILL COMMANDS -->
|
|
36
|
-
|
|
37
|
-
## Choose the Slice
|
|
38
|
-
|
|
39
|
-
Model the part with the most dangerous interleavings — retries, concurrency, partial failure, money, state machines with guards. Never model a linear happy path: a model that cannot meaningfully fail verifies nothing. If the state space would exceed roughly a million states, the model is too concrete; collapse data you never branch on and replace unbounded values with small symbolic sets. `scaffold` requires the target file to own mutable module-level state (a `let`/const plus a writer function) or, failing that, a class whose instance fields a method of that same class writes; a file of pure functions or constants is rejected — pick the file that holds the state, not the file that only computes over it.
|
|
40
|
-
|
|
41
|
-
**Known boundary: files where the indexer emitted no member rows at all are invisible to `scaffold`.** `scaffold` calls `getDefinitionsForFile(db, file, { includeClassMemberFallbacks: true })`, which surfaces class-member fallback rows (`ClassName#field.` symbols with a real definition mention) alongside primary rows even when the file has other primary-indexed definitions — a concurrency class like a lock, connection pool, or watcher (verified live: `Watcher` in `src/runtime/watch.ts` — 26 instance fields and 12 state-writing actions discovered, previously 0) now scaffolds correctly. What remains genuinely invisible is narrower: a file where the indexer emitted **no** member row for a class at all — neither a primary `defn_enclosing_ranges` row nor a role=1 definition mention — has nothing for either query to return, and `scaffold` reports "no mutable state discovered" because there is nothing in the index to find. When you hit that: model by hand from `plan-context`/`trace` evidence instead of via `scaffold`. See `docs/plans/2026-07-02-catalog-class-members.md` for the K3 survey of whether other commands (`members`, `refs`, `trace`, `health`, `dead`) should opt in too — no decision has been made there yet, so this remains scaffold-only.
|
|
42
|
-
|
|
43
|
-
## Loop
|
|
44
|
-
|
|
45
|
-
1. Explore the target with `scip-query plan-context <target>`, `system`, `trace`, `call-graph`, and `dataflow` until state and transitions are concrete.
|
|
46
|
-
2. Run `scip-query tla scaffold <file>` to generate the draft spec, config, and mapping (`--out` must stay inside the project root). Resolve every `TODO` it emits: guards, domains, initial values. The scaffold derives _what_ changes; you supply _when_ it may. TRIAGE the output first: if the discovered variables are mostly constants and the system's real state lives in files or a database (locks, caches, published artifacts), keep the mapping referents but discard the scaffolded variable set — hand-model the protocol's conceptual state and bind it with `resource` aliases instead. `tla verify` does not detect unfilled `TODO`s and will report PASS on a placeholder model — grep the spec for `TODO` before trusting a green run.
|
|
47
|
-
3. Strengthen the model per the quality rules below.
|
|
48
|
-
4. Run `scip-query tla verify <spec> --map <map> --config <cfg>`. Read the Proof line: every waiver must carry a reason you would defend in review. `--map` is usually unnecessary: if no `Spec.scip-tla.json` sits next to `Spec.tla`, `tla verify` scans sibling `*.scip-tla.json` files for one whose `module` field names this spec (the project-relative `.tla` path, bare filename, or the TLA `MODULE` identifier are all accepted) and uses it automatically, printing `(matched by module field)` — this is what makes bare `tla verify Foo.tla` work even when the only mapping on disk is named `FooHardened.scip-tla.json`. Two or more mappings naming the same module is a hard error listing every candidate; pass `--map` explicitly to disambiguate.
|
|
49
|
-
5. Wire the recorder from `scip-query tla instrument`, run the existing tests with `SCIP_TLA_TRACE=<path>`, then run `scip-query tla trace-check <spec> --trace <path>`. Acceptance means the code's observed behavior is a behavior of the model; divergence names the step to investigate. Modeling a fix-vs-regression pair as two named `Next` relations in one spec (e.g. `NextCurrent`/`NextVulnerable`)? Pass `--next <operator>` to pick which one the trace must satisfy — the harness defaults to a bare `Next`, which such specs deliberately don't define.
|
|
50
|
-
6. Classify every finding as code bug, model bug, mapping bug, insufficient trace/alias evidence, or accepted non-modeled behavior.
|
|
51
|
-
7. Patch code, model, or mapping and rerun until only explicitly waived uncertainty remains.
|
|
52
|
-
|
|
53
|
-
The loop is complete only when `tla verify` passes with reasoned waivers, at least one recorded trace passes `tla trace-check`, and unexercised actions are listed as accepted gaps.
|
|
54
|
-
|
|
55
|
-
## Model Quality Rules
|
|
56
|
-
|
|
57
|
-
- **TypeOK first.** Write the type invariant before any property; it catches most modeling mistakes at the lowest checking cost.
|
|
58
|
-
- **Every invariant needs a failure story.** Before running TLC, write down the concrete scenario that would violate it. If no scenario exists, the invariant is decorative — delete or replace it.
|
|
59
|
-
- **Falsify every invariant individually.** One break-test is not enough: for EACH invariant there must be a documented variant or mutation under which TLC refutes it (the CurrentSpec/VulnerableSpec pattern makes this permanent instead of a throwaway edit). An invariant no variant can violate is decorative — delete or redesign it.
|
|
60
|
-
- **Break the model on purpose.** After the first green run, remove one guard or widen one domain and confirm TLC catches it. A spec that cannot fail proves nothing. Restore it afterward.
|
|
61
|
-
- **Safety before liveness.** Add fairness only when a liveness property demands it; check deadlock unless termination is intended.
|
|
62
|
-
- **Bound the space deliberately.** Small symbolic constant sets, symmetry where sound, sequences kept short. Nondeterministic `\in` transitions from the scaffold are permissive placeholders — tighten them to concrete transitions as you learn the code.
|
|
63
|
-
- **Trace divergence taxonomy.** When `trace-check` diverges: a missing model transition means the model is too strict; an impossible recorded state means instrumentation projects the wrong slice; a genuinely illegal code transition is a bug — write the regression model before fixing it.
|
|
64
|
-
|
|
65
|
-
## Fast Regression Models
|
|
66
|
-
|
|
67
|
-
A regression model is a small TLA+ module or checker config derived from a counterexample, production bug, or suspected transition.
|
|
68
|
-
|
|
69
|
-
1. Preserve the full model as source of truth.
|
|
70
|
-
2. Create a companion regression spec/config named for the failure, seeded from the exact counterexample trace (a diverging `trace-check` output is already that trace).
|
|
71
|
-
3. Prefer bounded constants and narrowed action sets over weakening the main model.
|
|
72
|
-
4. Run the regression first after each patch; run the full model after it passes.
|
|
73
|
-
5. Keep the regression if it protects future behavior.
|
|
74
|
-
|
|
75
|
-
## Mapping Contract
|
|
76
|
-
|
|
77
|
-
```json
|
|
78
|
-
{
|
|
79
|
-
"module": "specs/Queue.tla",
|
|
80
|
-
"config": "specs/Queue.cfg",
|
|
81
|
-
"scope": ["src/queue"],
|
|
82
|
-
"variables": {
|
|
83
|
-
"queue": { "code": ["src/queue/store.ts/queue"], "aliases": ["queue"] },
|
|
84
|
-
"lockOwner": {
|
|
85
|
-
"code": ["src/queue/lock.ts/LockMetadata#pid"],
|
|
86
|
-
"aliases": ["pid"],
|
|
87
|
-
"resource": { "path": "lockPath" }
|
|
88
|
-
},
|
|
89
|
-
"status": {
|
|
90
|
-
"code": ["src/queue/lock.ts/LockMetadata#lifecycleStage"],
|
|
91
|
-
"aliases": ["lifecycleStage"],
|
|
92
|
-
"selfAlias": false
|
|
93
|
-
},
|
|
94
|
-
"phase": {
|
|
95
|
-
"code": ["src/queue/lock.ts/__phase_no_stored_field__"],
|
|
96
|
-
"aliases": ["__phase_unmatchable__"],
|
|
97
|
-
"waive": { "reason": "phase is a pure control-flow position; no code field stores it" }
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"actions": {
|
|
101
|
-
"Enqueue": {
|
|
102
|
-
"code": ["src/queue/commands.ts/enqueue"],
|
|
103
|
-
"reads": ["queue"],
|
|
104
|
-
"writes": ["queue"],
|
|
105
|
-
"waive": { "reason": "required only when a declared fact cannot be statically proven" }
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
"invariants": ["TypeOK"],
|
|
109
|
-
"traces": ["specs/queue-run.trace.json"]
|
|
110
|
-
}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
`code` entries must resolve through `scip-query trace`; variables must map to value-like symbols (a const, let, field, or property holding runtime state — never a type). Waivers are per-fact and require a reason; blanket `allowUnknown` is legacy. Waivers cover write facts symmetrically with reads: `actions.<name>.waive.writes` exempts `model-code-write`, `undeclared-write`, and `missing-write-evidence` findings the same way `waive.reads` exempts the read-side equivalents, and a variable-level `waive` on `actions.<name>.writes` also exempts the corresponding `model-mapping-write` mismatch against the SANY-derived model text. A waived write still shows up in the Proof line's waiver ledger with its reason — it never silently vanishes.
|
|
114
|
-
|
|
115
|
-
An action `code` entry can narrow itself to a line window, `"file#function@L<start>-L<end>"` (C3) — when several guard/branch actions share one function, whole-function `code` forces every sibling to claim every write in it; a window scopes fact collection to that sub-range instead, so each branch action attributes only its own write. The window must fall entirely inside the referent's actual resolved span or `tla verify` reports a hard `invalid-line-window` error naming the file, function, and actual span — never a silent clamp back to the whole function. Windows are line-number-brittle by design: a later refactor that shifts lines is caught loudly (the containment check plus `tla verify`'s referent resolution), not silently mis-scanned.
|
|
116
|
-
|
|
117
|
-
`resource` binds a variable to filesystem state — a lock file, a published artifact — anything the model treats as owned state but that code only touches through path-taking calls, never a plain assignment. The conformance scanner classifies `writeFileSync`/`rmSync`/`renameSync`/`mkdirSync`/`unlinkSync` calls whose first argument's text contains the declared `path` as writes of the variable, and `readFileSync`/`existsSync`/`statSync` calls the same way as reads. The match is textual containment, not a resolved value — evidence tier stays `static-action`, and a resource-bound variable still needs a value-like `code` referent for the kind check.
|
|
118
|
-
|
|
119
|
-
`statements` (Q2) binds a variable to SQL-backed state — prepared statements, table rows behind `db.prepare(...)`/`.exec(...)`/tagged templates. Each entry is `{ "pattern": "<substring or regex>" }`, compiled as a RegExp. Any call expression argument whose static string text (a string literal, or the static fragments of a template literal — `${...}` interpolations excluded) matches `pattern` is classified by its leading SQL verb: `INSERT`/`UPDATE`/`DELETE`/`REPLACE` is a write, `SELECT` is a read. Matching is not restricted to a callee allowlist (SQL APIs vary too much) — classification comes entirely from the matched text's leading verb. Two variables sharing a `statements` pattern is a mapping-load error, same as a shared `resource` path. Evidence tier stays `static-action`. Dynamic SQL built by string concatenation has no static text to match and still falls through to a waiver.
|
|
120
|
-
|
|
121
|
-
`ormCalls` (C1) binds a variable to ORM-backed state when there is no literal SQL text to match at all — Drizzle-style query builders (`db.update(t).set(...)`, `db.insert(t).values(...)`, `db.select().from(t)`, `db.delete(t)`). Each entry is `{ "table": "<identifier>", "methods"?: [...] }`. A call chain whose own method name is in the write set (`update`/`insert`/`delete` by default) or read set (`select`/`query`/`findFirst`/`findMany` by default) AND whose own table argument (or, for `select`, the `.from(t)` chain segment) names `table` attributes to the variable — matching never looks at the receiver (`db`, `tx`, ...), only the method + table-arg shape. `methods` narrows the effective set to a subset of that seven-name vocabulary; an unrecognized name fails to load. Two variables binding the same `(table, method)` pair is a mapping-load error, same category as a shared `statements` pattern — but a write-only binding and a read-only binding on the same table do not collide. Evidence tier stays `static-action`.
|
|
122
|
-
|
|
123
|
-
`variables.<v>.selfAlias: false` opts out of the automatic self-name alias (default `true`, fully backward compatible): normally a variable's own TLA+ name is always added to its alias list, which means an object-literal key or identifier that merely echoes the variable's name — but means something unrelated elsewhere in scope — becomes an unavoidable false write/read attribution. Set it `false` and give a precise, unambiguous alias instead (as `status` does above, aliased only to `lifecycleStage`); a `selfAlias: false` variable with no other alias, no `resource`, no `statements`, and no `waive` is a load error, since it would otherwise be silently unattributable.
|
|
124
|
-
|
|
125
|
-
`variables.<v>.waive: {reason}` exempts that one variable's `missing-referent`/`invalid-referent-kind` findings — for state that genuinely has no code twin (a pure control-flow position, a derived decision, a value observable only through `process.exitCode`). It does not exempt read/write facts; those stay on the action's own `waive`. Prefer this over the old workaround of citing an unrelated real symbol just to satisfy the value-like-kind check — name a referent that plainly does not resolve (or does resolve but to the wrong kind) and waive it honestly; a reader should never have to guess that a `code[]` entry is a decoy.
|
|
126
|
-
|
|
127
|
-
Top-level `"unmappedWriteScope": "actions" | "scope-files"` (default `"scope-files"`) controls how strictly `scope` is enforced: the default requires every function anywhere in `scope` that touches a modeled variable to be mapped as an action, or its write is a hard `unmapped-write` error. Set `"actions"` to opt out of that whole-file sweep when `scope` legitimately contains code the mapping was never meant to cover in full — only the per-action write/read checks still run.
|
|
128
|
-
|
|
129
|
-
Top-level `"init": { "codeRefs": ["file#function", ...], "waive"?: {"reason": ...} }` (Q3) binds the model's `Init` to the code referent(s) that materialize initial state — most often a lazy-init factory. `codeRefs` resolves and kind-checks like an action's `code` (function-like, `missing-referent`/`invalid-referent-kind` findings apply, `waive` exempts both). Writes statically found inside an Init referent's own range are Init-attributed: they are excluded from `unmapped-write` findings without needing `unmappedWriteScope: "actions"`. `init.codeRefs` must not overlap any action's `code` referents — that is a mapping-load error, same category as a variable-alias collision.
|
|
130
|
-
|
|
131
|
-
## Mapping Discipline
|
|
132
|
-
|
|
133
|
-
- **Alias selection is the sharpest knife.** Never alias a variable to a ubiquitous local identifier (`connection`, `result`, `data`) — every function touching that local gets misattributed across actions. For state with no code twin, use a deliberately unmatchable alias (e.g. `evidenceRowsModelOnly`) so the static layer neither proves nor pollutes, and let the reasoned waiver carry the fact.
|
|
134
|
-
- **Turn off the forced self-alias when the variable's own name is a common word.** A TLA+ variable named `status`, `phase`, or `state` gets its own name auto-included as an alias by default — and object literals elsewhere in scope (`{ status: 'ok' }` in an unrelated response shape) will match it. If the variable's own name is common enough to collide, set `selfAlias: false` and give a precise alias that names the actual stored field instead.
|
|
135
|
-
- **Know the four state backings.** Program variables: normal aliases. Filesystem-backed state (locks, published artifacts): `resource: { "path": ... }` bindings make fs calls provable. SQL-backed state (prepared statements, table rows behind literal SQL text): `statements: [{ "pattern": ... }]` bindings make it provable too (Q2) — a call argument's static SQL text matching `pattern` is classified as a write or read by its leading verb. ORM-backed state with no literal SQL to match (Drizzle-style query builders): `ormCalls: [{ "table": ... }]` bindings (C1) classify by the call chain's own method + table-arg shape instead. Only genuinely dynamic SQL (built by string concatenation, no static text to match) or an ORM shape the method/table matcher cannot see still needs a waiver naming the residual class; never fake attribution.
|
|
136
|
-
- **Lazy initialization is Init, not an action.** A factory that lazily builds state corresponds to the model's `Init`. Top-level `"init": { "codeRefs": ["file#function", ...] }` (Q3) binds it: writes statically found inside an Init referent are Init-attributed and excluded from `unmapped-write` findings without needing `unmappedWriteScope: "actions"` as a whole-file workaround. `init.codeRefs` must not overlap any action's `code` referents — map the factory to `init`, never to an action.
|
|
137
|
-
- **Design for traces early.** The trace encoder pins scalar (and scalar-array) variables only; a model whose state is all functions and tuple-sets cannot be trace-validated. If trace-check matters for the slice, add scalar projection variables (counts, last outcomes, a phase) alongside the structured state.
|
|
138
|
-
- **Trace until covered.** One accepted trace proves one path, not the mapping. Record traces until every Current action with a code twin is exercised by at least one accepted trace, or is explicitly classified with why it cannot be (unreachable without fault injection, environment-gated, model-only). An action no trace ever exercises is a conformance claim resting on static mapping alone. `tla trace-check ... --coverage` (C2) mechanizes the check: it reports steps-exercised-per-action, counted from accepted steps only (a step that never proved a legal transition — checker unavailable, or past the divergence point of a rejected trace — does not count), and names every action still unexercised. `--trace` is repeatable (merged and deduped with the mapping's own `traces` list) so recording another trace to cover a gap is additive, not a rewrite. Coverage is informational — it does not change `trace-check`'s exit code — so it never substitutes for actually closing the gap.
|
|
139
|
-
|
|
140
|
-
## Accuracy Rules
|
|
141
|
-
|
|
142
|
-
- `tla verify` is the mechanical checker; `tla trace-check` is the semantic one. Only the pair justifies the word "conforms".
|
|
143
|
-
- A PASS with waivers is a conditional claim — the Proof line says exactly what was and was not proven. Never summarize it as unconditional.
|
|
144
|
-
- A PASS on a scaffold with unresolved `TODO`s is meaningless, not conditional: the checker has no TODO detector and will pass a placeholder model. Never report a PASS without confirming step 2 of the Loop is actually done.
|
|
145
|
-
- If code changed but the model did not, inspect whether the mapped transition changed meaning; `diff-gate` flags the changed referents.
|
|
146
|
-
- If the model checker fails, fix the TLA+ model before relying on conformance output.
|
|
147
|
-
- Use `--checker none` only when intentionally checking the mapping without SANY, TLC, or Apalache.
|
|
148
|
-
- The write/read scanner follows one call hop from a mapped action's referent (no recursion) — a callee's effect on a _declared_ fact counts as evidence, marked `(via <callee>, one call hop...)` in findings. It never asserts a new, undeclared fact: a callee shared by several actions cannot make one action silently inherit another's write. If a variable's waiver becomes provable this way, update the waiver reason to name the real call chain instead of deleting the explanation — the evidence is still approximate (which specific runtime call path executes is not proven, only that the code family does).
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: scip-triage-issue
|
|
3
|
-
description: Triage issues with scip-query evidence. Use for bug reports, GitHub issues, failing tests, support reports, TODOs, vague defects, root-cause packets, issue bodies, or test-first fix plans.
|
|
4
|
-
commands:
|
|
5
|
-
- template: "scip-query files <issue-term>"
|
|
6
|
-
when: "Map ownership: locate files for the reported term."
|
|
7
|
-
- template: "scip-query trace <entry-or-error-symbol>"
|
|
8
|
-
when: "Trace the failing path: definition plus every reference."
|
|
9
|
-
- template: "scip-query code <entry-or-error-symbol>"
|
|
10
|
-
when: "Trace the failing path: read the exact source."
|
|
11
|
-
- template: "scip-query call-graph <entry-symbol>"
|
|
12
|
-
when: "Trace the failing path: callers and callees."
|
|
13
|
-
- template: "scip-query similar <suspect-symbol> --json --full"
|
|
14
|
-
when: "Compare and bound: nearby implementations for missing handling."
|
|
15
|
-
- template: "scip-query affected <symbol> --json"
|
|
16
|
-
when: "Compare and bound: transitive impact bound for the fix plan."
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# scip-triage-issue
|
|
20
|
-
|
|
21
|
-
Use this skill to turn a report into a grounded fix packet. Triage is the evidence pass that determines whether the issue is reproducible, where it enters the codebase, what root cause is likely, and what test should fail before the fix.
|
|
22
|
-
|
|
23
|
-
Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
|
|
24
|
-
|
|
25
|
-
<!-- BEGIN GENERATED SKILL COMMANDS -->
|
|
26
|
-
## Commands for this skill
|
|
27
|
-
|
|
28
|
-
| Command | Purpose | When |
|
|
29
|
-
| --- | --- | --- |
|
|
30
|
-
| `scip-query files <issue-term>` | Find files matching a pattern | Map ownership: locate files for the reported term. |
|
|
31
|
-
| `scip-query trace <entry-or-error-symbol>` | Trace a symbol: definition + all references | Trace the failing path: definition plus every reference. |
|
|
32
|
-
| `scip-query code <entry-or-error-symbol>` | Read the source code for a symbol (bounded to its definition range) | Trace the failing path: read the exact source. |
|
|
33
|
-
| `scip-query call-graph <entry-symbol>` | Show incoming callers and outgoing callees for a symbol | Trace the failing path: callers and callees. |
|
|
34
|
-
| `scip-query similar <suspect-symbol> --json --full` | Find heuristic function similarity candidates from callee fingerprints | Compare and bound: nearby implementations for missing handling. |
|
|
35
|
-
| `scip-query affected <symbol> --json` | Transitive closure of symbols that could break if this symbol changes | Compare and bound: transitive impact bound for the fix plan. |
|
|
36
|
-
|
|
37
|
-
Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
|
|
38
|
-
<!-- END GENERATED SKILL COMMANDS -->
|
|
39
|
-
|
|
40
|
-
## Rules
|
|
41
|
-
|
|
42
|
-
1. Do not file or implement from the title alone.
|
|
43
|
-
2. Use scip-query for code evidence: entry points, references, call flow, data flow, blast radius, and similar implementations.
|
|
44
|
-
3. Prefer a failing test plan before a code plan.
|
|
45
|
-
4. If the user asks only for triage, stop at the packet. If they asked to fix it too, implement after the packet is clear.
|
|
46
|
-
|
|
47
|
-
## Workflow
|
|
48
|
-
|
|
49
|
-
### 1. Normalize the report
|
|
50
|
-
|
|
51
|
-
Record summary, observed behavior, expected behavior, reproduction, affected surface, severity, user impact, and logs/screenshots/tests/links.
|
|
52
|
-
|
|
53
|
-
Ask the user only for product intent, credentials, private data, or external system state the repo cannot answer.
|
|
54
|
-
|
|
55
|
-
This step is complete only when missing facts are either recovered or named.
|
|
56
|
-
|
|
57
|
-
### 2. Map ownership
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
scip-query files <issue-term>
|
|
61
|
-
scip-query outline <candidate-file>
|
|
62
|
-
scip-query system <module-or-scope>
|
|
63
|
-
scip-query surface <module-or-scope>
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Use `kind-counts` and `by-kind` for broad subsystems.
|
|
67
|
-
|
|
68
|
-
This step is complete only when likely owner files and surfaces are named.
|
|
69
|
-
|
|
70
|
-
### 3. Trace the failing path
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
scip-query trace <entry-or-error-symbol>
|
|
74
|
-
scip-query code <entry-or-error-symbol>
|
|
75
|
-
scip-query call-graph <entry-symbol>
|
|
76
|
-
scip-query dataflow <state-or-input-symbol>
|
|
77
|
-
scip-query slice <state-or-input-symbol>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
For stack traces, read the exact range with `scip-query code 'file:start-end'`.
|
|
81
|
-
|
|
82
|
-
This step is complete only when a suspected root cause is tied to source evidence or labeled unproven.
|
|
83
|
-
|
|
84
|
-
### 4. Compare and bound
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
scip-query similar <suspect-symbol> --json --full
|
|
88
|
-
scip-query similar <suspect-symbol> <comparison-symbol> --plan
|
|
89
|
-
scip-query similar-files <suspect-file> --json --full
|
|
90
|
-
scip-query co-change <suspect-file> --json --full
|
|
91
|
-
scip-query change-surface <suspect-file> --json --full
|
|
92
|
-
scip-query affected <suspect-symbol> --json
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
This step is complete only when the packet has a narrow test shape and impact bound.
|
|
96
|
-
|
|
97
|
-
## Packet
|
|
98
|
-
|
|
99
|
-
```markdown
|
|
100
|
-
## Issue
|
|
101
|
-
<one-sentence mismatch>
|
|
102
|
-
|
|
103
|
-
## Reproduction
|
|
104
|
-
<steps, command, failing test, or missing data>
|
|
105
|
-
|
|
106
|
-
## Evidence
|
|
107
|
-
- <scip-query command>: <fact>
|
|
108
|
-
|
|
109
|
-
## Suspected Root Cause
|
|
110
|
-
<earliest code fact that explains the symptom>
|
|
111
|
-
|
|
112
|
-
## Impact
|
|
113
|
-
- users/surfaces affected
|
|
114
|
-
- blast radius
|
|
115
|
-
|
|
116
|
-
## Fix Plan
|
|
117
|
-
1. Add or update failing test/smoke check.
|
|
118
|
-
2. Make the smallest code change.
|
|
119
|
-
3. Run targeted test.
|
|
120
|
-
4. Invoke `scip-verify`.
|
|
121
|
-
|
|
122
|
-
## Open Questions
|
|
123
|
-
- <product intent or external state only>
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
If no root cause is proven, label the issue `needs reproduction` or `needs product decision`.
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: scip-twin-drift
|
|
3
|
-
description: Find and resolve twin drift with scip-query. Use for same-name or near-name functions across files with diverged bodies, drifted policy thresholds, one-sided fixes, or consolidating a duplicated concept into one canonical helper.
|
|
4
|
-
commands:
|
|
5
|
-
- template: "scip-query twin-drift --json --full"
|
|
6
|
-
when: "Run the detector: every DIVERGENT and near-name group in scope."
|
|
7
|
-
- template: "scip-query duplicate-bodies --json --full"
|
|
8
|
-
when: "Cross-check: IDENTICAL groups are duplicate-bodies' job, not this skill's."
|
|
9
|
-
- template: "scip-query code <symbol>"
|
|
10
|
-
when: "Classify a divergent group: read every member's body."
|
|
11
|
-
- template: "scip-query refs <symbol>"
|
|
12
|
-
when: "Pick the canonical twin: consumer count per member."
|
|
13
|
-
- template: "scip-query diff-gate --json"
|
|
14
|
-
when: "Verify: the twin-partner check must not flag a one-sided fix."
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
# scip-twin-drift
|
|
18
|
-
|
|
19
|
-
Use this skill when the same concept exists in more than one place under the same or a near-name (case-insensitive, or edit-distance ≤ 2 for names ≥ 8 characters) and the bodies have silently diverged. A twin drift group is a same-leaf-name family of callables spanning at least two files whose normalized-token bodies are neither identical (that is `duplicate-bodies`' job) nor unrelated (a homonym like `render` or `parse`) but partially overlapping — the signature of a concept that was copied once and then edited independently in only some of its copies.
|
|
20
|
-
|
|
21
|
-
Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
|
|
22
|
-
|
|
23
|
-
<!-- BEGIN GENERATED SKILL COMMANDS -->
|
|
24
|
-
## Commands for this skill
|
|
25
|
-
|
|
26
|
-
| Command | Purpose | When |
|
|
27
|
-
| --- | --- | --- |
|
|
28
|
-
| `scip-query twin-drift --json --full` | Twin drift candidates: same-name (or near-name) functions across files with diverged bodies | Run the detector: every DIVERGENT and near-name group in scope. |
|
|
29
|
-
| `scip-query duplicate-bodies --json --full` | Find exact duplicate small-body candidates across files | Cross-check: IDENTICAL groups are duplicate-bodies' job, not this skill's. |
|
|
30
|
-
| `scip-query code <symbol>` | Read the source code for a symbol (bounded to its definition range) | Classify a divergent group: read every member's body. |
|
|
31
|
-
| `scip-query refs <symbol>` | Find all files referencing a symbol | Pick the canonical twin: consumer count per member. |
|
|
32
|
-
| `scip-query diff-gate --json` | Gate the current diff: architecture regressions plus echo, migration, coordination, doc-drift, unused-param, and new-dead candidates; exit 1 on blocking findings | Verify: the twin-partner check must not flag a one-sided fix. |
|
|
33
|
-
|
|
34
|
-
Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
|
|
35
|
-
<!-- END GENERATED SKILL COMMANDS -->
|
|
36
|
-
|
|
37
|
-
## Rules
|
|
38
|
-
|
|
39
|
-
1. `IDENTICAL` groups defer to `duplicate-bodies`; do not re-report them here.
|
|
40
|
-
2. Homonyms (similarity below `--min-similarity`, default 0.3) are noise unless `--include-homonyms` was requested; do not chase them.
|
|
41
|
-
3. Every `DIVERGENT` group in scope gets a classification before this skill reports done.
|
|
42
|
-
4. Prefer consolidation to one exported helper over leaving parallel copies; when consolidation is unsafe or premature, record the intent gap explicitly (comment or waiver) rather than silently accepting drift.
|
|
43
|
-
5. A twin-partner `diff-gate` finding on a change you are making is the live version of this same defect class — treat it as a signal to run this skill, not just to suppress.
|
|
44
|
-
|
|
45
|
-
## Workflow
|
|
46
|
-
|
|
47
|
-
### 1. Run the detector
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
scip-query twin-drift --json --full
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Scope with `-s/--scope <path>` when the review is bounded to a module. Record group count, member count, and `maxDivergence` per group.
|
|
54
|
-
|
|
55
|
-
This step is complete only when every group in scope is enumerated with its relationship (`divergent` vs suppressed homonym).
|
|
56
|
-
|
|
57
|
-
### 2. Classify each DIVERGENT group
|
|
58
|
-
|
|
59
|
-
For each group, read every member with `scip-query code <symbol-or-file:range>` and use the group's `firstDivergentTokens` as a starting point for where the bodies diverge. Classify the group as one of:
|
|
60
|
-
|
|
61
|
-
- **Intentional variation**: the copies differ because the domains genuinely differ (for example a React-specific vs Vue-specific structural comparator that must branch on framework-specific overlap checks). Essential variation stays; record why.
|
|
62
|
-
- **Drifted policy**: the copies encode what should be one policy (a threshold, a normalization rule, an edge-case guard) that only some copies received when it last changed. This is a bug: pick the correct value and propagate it, or extract the policy into one named function/constant.
|
|
63
|
-
- **One-sided fix**: one copy was bugfixed or hardened and its twin(s) were not. This is also a bug: apply the same fix to every member, or consolidate.
|
|
64
|
-
|
|
65
|
-
This step is complete only when every DIVERGENT group in scope has one of these three labels with a one-line reason.
|
|
66
|
-
|
|
67
|
-
### 3. Pick the canonical twin and act
|
|
68
|
-
|
|
69
|
-
For groups getting consolidated, pick the canonical member by consumer count:
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
scip-query refs <symbol-in-file-A>
|
|
73
|
-
scip-query refs <symbol-in-file-B>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Prefer the member with the most consumers, or the one in the more general/shared location when counts tie. Extract or move the canonical body to one exported helper; update the other member(s) to call it, or delete them if they were pure duplication with different names for the caller's convenience. Preserve any classified-essential variation as a parameter or a thin caller-side branch, not as a second copy of the whole body.
|
|
77
|
-
|
|
78
|
-
For groups marked intentional variation, do not force consolidation; record the reason in a comment near one of the members so the next `twin-drift` run and the next reader both see it was considered.
|
|
79
|
-
|
|
80
|
-
This step is complete only when every DIVERGENT group is either consolidated (with the old copies gone or forwarding) or has a recorded reason it stays separate.
|
|
81
|
-
|
|
82
|
-
### 4. Verify
|
|
83
|
-
|
|
84
|
-
Rerun the detector to confirm consolidated groups no longer appear as DIVERGENT, then run the routed postchecks from the shared reference and:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
scip-query diff-gate --json
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
The `twin-partner` check is advisory (it never blocks the gate by itself) but a finding here on your own diff means you just reproduced the exact defect class this skill exists to catch — fix or explicitly accept it before finishing.
|
|
91
|
-
|
|
92
|
-
This step is complete only when `twin-drift` shows no unclassified `DIVERGENT` groups in scope and `diff-gate` findings are resolved or explained.
|
|
93
|
-
|
|
94
|
-
## Report
|
|
95
|
-
|
|
96
|
-
```markdown
|
|
97
|
-
Scope:
|
|
98
|
-
Groups found: N (M divergent, K suppressed homonyms)
|
|
99
|
-
|
|
100
|
-
Divergent groups:
|
|
101
|
-
- <leaf name> (<files>) — classification: intentional variation / drifted policy / one-sided fix
|
|
102
|
-
- action: consolidated into <canonical file:symbol> / reason kept separate
|
|
103
|
-
|
|
104
|
-
Verification:
|
|
105
|
-
- `scip-query twin-drift --json --full`: <result>
|
|
106
|
-
- `scip-query diff-gate --json`: <result>
|
|
107
|
-
```
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "SCIP Twin Drift"
|
|
3
|
-
short_description: "Find and resolve same-name twins that have silently diverged"
|
|
4
|
-
default_prompt: "Use scip-query twin-drift to find same-name or near-name functions that have diverged across files, classify each divergence, and consolidate or record the intent gap."
|