scip-query 0.17.2 → 0.19.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.
Files changed (300) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +3 -1
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/{chunk-ATC4MEVA.js → chunk-2FAJTZSX.js} +2 -2
  5. package/dist/{chunk-W7FNZKX5.js → chunk-2ZNZSNVW.js} +2 -2
  6. package/dist/chunk-35NLDRZC.js +2 -0
  7. package/dist/{chunk-PQD7P6WB.js → chunk-3KQOIXLO.js} +2 -2
  8. package/dist/{chunk-VCRMI56V.js → chunk-3OSRXJKK.js} +2 -2
  9. package/dist/chunk-42QYU6FD.js +3 -0
  10. package/dist/{chunk-BEGHYHOQ.js → chunk-4ZCNFENR.js} +2 -2
  11. package/dist/{chunk-O7NA5FCA.js → chunk-4ZHJAHLE.js} +2 -2
  12. package/dist/chunk-547VY366.js +18 -0
  13. package/dist/{chunk-NX2YAXVQ.js → chunk-54UYBTZW.js} +2 -2
  14. package/dist/{chunk-7ROLM67J.js → chunk-6DHPQS72.js} +2 -2
  15. package/dist/chunk-6SHX42QQ.js +6 -0
  16. package/dist/{chunk-FVLZB54V.js → chunk-7EI4MU5A.js} +2 -2
  17. package/dist/{chunk-J7IMQRCU.js → chunk-7FG5M53V.js} +2 -2
  18. package/dist/chunk-A45K6VUK.js +2 -0
  19. package/dist/{chunk-SXDXR5FH.js → chunk-AEDB4WXE.js} +2 -2
  20. package/dist/{chunk-O5A7BTMA.js → chunk-AERYQJ52.js} +2 -2
  21. package/dist/chunk-AM2LGOEX.js +3 -0
  22. package/dist/{chunk-P6FOIU7O.js → chunk-AWSRND4W.js} +2 -2
  23. package/dist/{chunk-5GAUXLOE.js → chunk-BOXAKNN6.js} +2 -2
  24. package/dist/{chunk-IKMOYFUM.js → chunk-BYPVNKJT.js} +2 -2
  25. package/dist/chunk-DQIJMKNE.js +3 -0
  26. package/dist/{chunk-K65T4TJS.js → chunk-DV6B262O.js} +2 -2
  27. package/dist/chunk-DWN7QDTV.js +26 -0
  28. package/dist/{chunk-G6DDSHMD.js → chunk-EZGT3NJX.js} +2 -2
  29. package/dist/{chunk-MFIA6EIT.js → chunk-EZHARAL4.js} +2 -2
  30. package/dist/chunk-F334Z5UA.js +38 -0
  31. package/dist/{chunk-2A7LUMZP.js → chunk-F5L7WEZF.js} +2 -2
  32. package/dist/{chunk-5CJ6AQN7.js → chunk-FLIF3JWA.js} +2 -2
  33. package/dist/chunk-FMC3BI4I.js +2 -0
  34. package/dist/{chunk-YMFHC5J2.js → chunk-G6QQCX45.js} +2 -2
  35. package/dist/{chunk-Q4GKL4CC.js → chunk-G6RQVDTI.js} +2 -2
  36. package/dist/chunk-GBB2RUDN.js +927 -0
  37. package/dist/{chunk-LL5NQB5V.js → chunk-GJ3FR5WG.js} +2 -2
  38. package/dist/chunk-GMZYT44R.js +5 -0
  39. package/dist/{chunk-OQFPCIXO.js → chunk-GNJHHPZE.js} +2 -2
  40. package/dist/chunk-HOXI4F5I.js +4 -0
  41. package/dist/{chunk-4QBRVI7D.js → chunk-IWK562KR.js} +2 -2
  42. package/dist/chunk-IXORBCMR.js +120 -0
  43. package/dist/chunk-J3U47L4Q.js +2 -0
  44. package/dist/{chunk-K4XL4HOK.js → chunk-J65FQLDL.js} +2 -2
  45. package/dist/{chunk-45QWQSWS.js → chunk-J6BR4MD6.js} +2 -2
  46. package/dist/{chunk-J7WYG63U.js → chunk-JFGUBZWE.js} +2 -2
  47. package/dist/{chunk-BPMBOZAN.js → chunk-KD6TPIXM.js} +2 -2
  48. package/dist/{chunk-3M2UCPFS.js → chunk-KHE7J5ZN.js} +1 -1
  49. package/dist/{chunk-IG6X65MG.js → chunk-KWBA6FDD.js} +2 -2
  50. package/dist/{chunk-KA7RMBVU.js → chunk-LJD7V7UO.js} +2 -2
  51. package/dist/{chunk-ROMKXEUM.js → chunk-MDDF67O2.js} +2 -2
  52. package/dist/{chunk-S22ICAWV.js → chunk-MFBXBLHA.js} +2 -2
  53. package/dist/{chunk-A2GX3PYV.js → chunk-MTFHE7ZO.js} +2 -2
  54. package/dist/chunk-NEG77KKH.js +4 -0
  55. package/dist/{chunk-WA64GKWB.js → chunk-NH7WNNQC.js} +3 -3
  56. package/dist/{chunk-K3UVTL3J.js → chunk-OGHGTD6Z.js} +2 -2
  57. package/dist/chunk-OYYZLJVT.js +2 -0
  58. package/dist/{chunk-DJI446FQ.js → chunk-PAZFJMXB.js} +2 -2
  59. package/dist/{chunk-U244OVE6.js → chunk-PBADFBRR.js} +2 -2
  60. package/dist/{chunk-UWR52GNZ.js → chunk-PKAPOFF5.js} +2 -2
  61. package/dist/{chunk-APCXCRED.js → chunk-PXJIEMND.js} +2 -2
  62. package/dist/{chunk-NJD4C5G5.js → chunk-QB5WSOTY.js} +2 -2
  63. package/dist/{chunk-AY44MGWS.js → chunk-QHOUNTDZ.js} +2 -2
  64. package/dist/chunk-QN67MWDU.js +2 -0
  65. package/dist/{chunk-JLZUM476.js → chunk-QNMOZ3CJ.js} +2 -2
  66. package/dist/{chunk-AWYKDRYV.js → chunk-RIGY5DDE.js} +2 -2
  67. package/dist/chunk-RJLU7IMR.js +10 -0
  68. package/dist/{chunk-N3JH45WR.js → chunk-S65OEY2G.js} +2 -2
  69. package/dist/chunk-SATRCB5O.js +20 -0
  70. package/dist/chunk-T5CSWYAZ.js +2 -0
  71. package/dist/{chunk-H4T2AST4.js → chunk-TC3X33N6.js} +2 -2
  72. package/dist/{chunk-3CJXFMR5.js → chunk-TCVRJ56J.js} +2 -2
  73. package/dist/{chunk-7XP7ZRSI.js → chunk-TDGCALH6.js} +2 -2
  74. package/dist/chunk-TDZXQAH7.js +2 -0
  75. package/dist/{chunk-SUYCF4SX.js → chunk-TOYQTO44.js} +2 -2
  76. package/dist/chunk-UJL3N6TC.js +5 -0
  77. package/dist/chunk-UVMME4FI.js +16 -0
  78. package/dist/{chunk-6JSTKSZH.js → chunk-UXOVHGT6.js} +2 -2
  79. package/dist/chunk-VV5WJLRO.js +67 -0
  80. package/dist/{chunk-4H7T7FIM.js → chunk-WT7TOU2C.js} +2 -2
  81. package/dist/{chunk-4FLF7BHJ.js → chunk-X36LKKVG.js} +2 -2
  82. package/dist/{chunk-C7MBQSIC.js → chunk-X3OOU7CF.js} +2 -2
  83. package/dist/chunk-X65VYV2S.js +2 -0
  84. package/dist/chunk-XBN5VO53.js +2 -0
  85. package/dist/{chunk-TLTLJ4SW.js → chunk-XDSB47KO.js} +2 -2
  86. package/dist/{chunk-4L4X66GE.js → chunk-XDVT7QPG.js} +2 -2
  87. package/dist/chunk-XESK6725.js +2 -0
  88. package/dist/{chunk-OQFA2SUQ.js → chunk-XPYXEEDO.js} +2 -2
  89. package/dist/{chunk-T4P27T6S.js → chunk-XTSVYYAL.js} +2 -2
  90. package/dist/{chunk-27YDE22N.js → chunk-YBAC3RON.js} +2 -2
  91. package/dist/{chunk-2DBY4MO7.js → chunk-YHYTDWFT.js} +2 -2
  92. package/dist/chunk-YYR7ADNB.js +2 -0
  93. package/dist/chunk-ZL5Y23AJ.js +3 -0
  94. package/dist/{chunk-CMLHZWRS.js → chunk-ZNSLF5AC.js} +2 -2
  95. package/dist/chunk-ZXWFN7CK.js +2 -0
  96. package/dist/cli.js +2 -2
  97. package/dist/{command-descriptors-7UUURHWT.js → command-descriptors-SWFWGIFK.js} +173 -167
  98. package/dist/{config-types-70s7NxKB.d.ts → config-types-BA3xLCfG.d.ts} +28 -1
  99. package/dist/{db-BBmJ0v3b.d.ts → db-CzA-9_rL.d.ts} +6 -18
  100. package/dist/direct-navigation-RKMPBXMI.js +3 -0
  101. package/dist/{health-CWpFL_6z.d.ts → health-DYy13GAe.d.ts} +3 -1
  102. package/dist/index.d.ts +23 -41
  103. package/dist/index.js +1 -1
  104. package/dist/postinstall.js +1 -1
  105. package/dist/queries/affected.d.ts +2 -2
  106. package/dist/queries/affected.js +1 -1
  107. package/dist/queries/architecture.d.ts +83 -0
  108. package/dist/queries/architecture.js +2 -0
  109. package/dist/queries/bottlenecks.d.ts +2 -2
  110. package/dist/queries/bottlenecks.js +1 -1
  111. package/dist/queries/by-kind.d.ts +2 -2
  112. package/dist/queries/by-kind.js +1 -1
  113. package/dist/queries/call-graph.d.ts +2 -2
  114. package/dist/queries/call-graph.js +1 -1
  115. package/dist/queries/change-surface.d.ts +2 -2
  116. package/dist/queries/change-surface.js +1 -1
  117. package/dist/queries/cleanup-plan.d.ts +2 -2
  118. package/dist/queries/cleanup-plan.js +1 -1
  119. package/dist/queries/co-change.d.ts +2 -2
  120. package/dist/queries/co-change.js +1 -1
  121. package/dist/queries/code.d.ts +2 -2
  122. package/dist/queries/code.js +1 -1
  123. package/dist/queries/complexity-hotspots.d.ts +2 -2
  124. package/dist/queries/complexity-hotspots.js +1 -1
  125. package/dist/queries/complexity.d.ts +2 -2
  126. package/dist/queries/complexity.js +1 -1
  127. package/dist/queries/convergence.d.ts +2 -2
  128. package/dist/queries/convergence.js +1 -1
  129. package/dist/queries/coupling.d.ts +2 -2
  130. package/dist/queries/coupling.js +1 -1
  131. package/dist/queries/cycles.d.ts +2 -2
  132. package/dist/queries/cycles.js +1 -1
  133. package/dist/queries/dataflow.d.ts +2 -2
  134. package/dist/queries/dataflow.js +1 -1
  135. package/dist/queries/dead.d.ts +2 -2
  136. package/dist/queries/dead.js +1 -1
  137. package/dist/queries/decorative-checkers.d.ts +2 -2
  138. package/dist/queries/decorative-checkers.js +1 -1
  139. package/dist/queries/deep-chains.d.ts +2 -2
  140. package/dist/queries/deep-chains.js +1 -1
  141. package/dist/queries/deps.d.ts +2 -2
  142. package/dist/queries/deps.js +1 -1
  143. package/dist/queries/diff-gate.d.ts +5 -3
  144. package/dist/queries/diff-gate.js +1 -1
  145. package/dist/queries/diff-impact.d.ts +2 -2
  146. package/dist/queries/diff-impact.js +1 -1
  147. package/dist/queries/doc-drift.d.ts +2 -2
  148. package/dist/queries/doc-drift.js +1 -1
  149. package/dist/queries/drift.d.ts +27 -10
  150. package/dist/queries/drift.js +1 -1
  151. package/dist/queries/duplicate-bodies.d.ts +2 -2
  152. package/dist/queries/duplicate-bodies.js +1 -1
  153. package/dist/queries/extract-candidates.d.ts +2 -2
  154. package/dist/queries/extract-candidates.js +1 -1
  155. package/dist/queries/fan.d.ts +2 -2
  156. package/dist/queries/fan.js +1 -1
  157. package/dist/queries/files.d.ts +2 -2
  158. package/dist/queries/health.d.ts +3 -3
  159. package/dist/queries/health.js +1 -1
  160. package/dist/queries/hierarchy.d.ts +2 -2
  161. package/dist/queries/hierarchy.js +1 -1
  162. package/dist/queries/hotspots.d.ts +2 -2
  163. package/dist/queries/hotspots.js +1 -1
  164. package/dist/queries/imports.d.ts +2 -2
  165. package/dist/queries/imports.js +1 -1
  166. package/dist/queries/incomplete-migration.d.ts +2 -2
  167. package/dist/queries/incomplete-migration.js +1 -1
  168. package/dist/queries/index.d.ts +5 -4
  169. package/dist/queries/index.js +1 -1
  170. package/dist/queries/isolated.d.ts +2 -2
  171. package/dist/queries/isolated.js +1 -1
  172. package/dist/queries/locality-candidates.d.ts +2 -2
  173. package/dist/queries/locality-candidates.js +1 -1
  174. package/dist/queries/members.d.ts +2 -2
  175. package/dist/queries/members.js +1 -1
  176. package/dist/queries/methods.d.ts +2 -2
  177. package/dist/queries/methods.js +1 -1
  178. package/dist/queries/not-implemented.d.ts +2 -2
  179. package/dist/queries/not-implemented.js +1 -1
  180. package/dist/queries/outline.d.ts +2 -2
  181. package/dist/queries/outline.js +1 -1
  182. package/dist/queries/passthrough-candidates.d.ts +2 -2
  183. package/dist/queries/passthrough-candidates.js +1 -1
  184. package/dist/queries/plan-context.d.ts +2 -2
  185. package/dist/queries/plan-context.js +1 -1
  186. package/dist/queries/react-component-duplicates.d.ts +2 -2
  187. package/dist/queries/react-component-duplicates.js +1 -1
  188. package/dist/queries/react-hook-candidates.d.ts +2 -2
  189. package/dist/queries/react-hook-candidates.js +1 -1
  190. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  191. package/dist/queries/react-large-component-pressure.js +1 -1
  192. package/dist/queries/recent-duplicates.d.ts +2 -2
  193. package/dist/queries/recent-duplicates.js +1 -1
  194. package/dist/queries/redundant-reexports.d.ts +2 -2
  195. package/dist/queries/redundant-reexports.js +1 -1
  196. package/dist/queries/refs.d.ts +2 -2
  197. package/dist/queries/refs.js +1 -1
  198. package/dist/queries/self-audit.d.ts +2 -2
  199. package/dist/queries/self-audit.js +1 -1
  200. package/dist/queries/similar-chains.d.ts +2 -2
  201. package/dist/queries/similar-chains.js +1 -1
  202. package/dist/queries/similar-files.d.ts +2 -2
  203. package/dist/queries/similar-files.js +1 -1
  204. package/dist/queries/similar-signatures.d.ts +2 -2
  205. package/dist/queries/similar-signatures.js +1 -1
  206. package/dist/queries/similar.d.ts +2 -2
  207. package/dist/queries/similar.js +1 -1
  208. package/dist/queries/slice.d.ts +2 -2
  209. package/dist/queries/slice.js +1 -1
  210. package/dist/queries/stale-abstractions.d.ts +2 -2
  211. package/dist/queries/stale-abstractions.js +1 -1
  212. package/dist/queries/stats.d.ts +2 -2
  213. package/dist/queries/surface.d.ts +2 -2
  214. package/dist/queries/surface.js +1 -1
  215. package/dist/queries/symbols.d.ts +2 -2
  216. package/dist/queries/symbols.js +1 -1
  217. package/dist/queries/system.d.ts +2 -2
  218. package/dist/queries/system.js +1 -1
  219. package/dist/queries/test-quality.d.ts +2 -2
  220. package/dist/queries/test-quality.js +1 -1
  221. package/dist/queries/trace.d.ts +2 -2
  222. package/dist/queries/trace.js +1 -1
  223. package/dist/queries/twin-ab.d.ts +2 -2
  224. package/dist/queries/twin-ab.js +1 -1
  225. package/dist/queries/twin-drift.d.ts +2 -2
  226. package/dist/queries/twin-drift.js +1 -1
  227. package/dist/queries/unused-imports.d.ts +2 -2
  228. package/dist/queries/unused-imports.js +1 -1
  229. package/dist/queries/unused-params.d.ts +2 -2
  230. package/dist/queries/unused-params.js +1 -1
  231. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  232. package/dist/queries/vue-component-duplicates.js +1 -1
  233. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  234. package/dist/queries/vue-composable-candidates.js +1 -1
  235. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  236. package/dist/queries/vue-large-view-pressure.js +1 -1
  237. package/dist/queries/wrapper-candidates.d.ts +2 -2
  238. package/dist/queries/wrapper-candidates.js +1 -1
  239. package/dist/reindex-worker.js +24 -24
  240. package/dist/reindex.d.ts +12 -10
  241. package/dist/reindex.js +38 -38
  242. package/dist/runtime.d.ts +10 -9
  243. package/dist/runtime.js +2 -1
  244. package/dist/rust-semantic-session-server.js +1 -1
  245. package/dist/{scip-cli-CoMzb7Zu.d.ts → scip-cli-1bVKJgXi.d.ts} +1 -1
  246. package/dist/watch-server.js +7 -6
  247. package/docs/AI_FAILURE_MODES.md +1 -0
  248. package/docs/COMMAND_REFERENCE.md +4 -3
  249. package/docs/DETECTOR_GUIDE.md +5 -3
  250. package/docs/analyzer-inventory.md +16 -6
  251. package/docs/analyzer-validation-ledger.md +12 -1
  252. package/docs/architecture-coherence-vision.md +219 -0
  253. package/package.json +5 -1
  254. package/skills/_shared/SKILL.md +5 -4
  255. package/skills/scip-api-impact/SKILL.md +5 -1
  256. package/skills/scip-claim-audit/SKILL.md +1 -0
  257. package/skills/scip-cleanup-audit/SKILL.md +4 -0
  258. package/skills/scip-concrete-plan/SKILL.md +129 -48
  259. package/skills/scip-conductor/SKILL.md +1 -1
  260. package/skills/scip-debug/SKILL.md +6 -1
  261. package/skills/scip-directory-architecture/SKILL.md +116 -2
  262. package/skills/scip-explore/SKILL.md +2 -1
  263. package/skills/scip-integrity-audit/SKILL.md +17 -0
  264. package/skills/scip-maintainability/SKILL.md +9 -4
  265. package/skills/scip-query/SKILL.md +4 -1
  266. package/skills/scip-root-cause/SKILL.md +150 -0
  267. package/skills/scip-root-cause/agents/openai.yaml +4 -0
  268. package/skills/scip-tla-model-system/SKILL.md +7 -9
  269. package/skills/scip-twin-drift/SKILL.md +1 -1
  270. package/skills/scip-verify/SKILL.md +20 -3
  271. package/dist/chunk-6AITNECC.js +0 -928
  272. package/dist/chunk-7LERNHDG.js +0 -5
  273. package/dist/chunk-7VR5TNOI.js +0 -2
  274. package/dist/chunk-CHJ3QROR.js +0 -2
  275. package/dist/chunk-CVWX24IY.js +0 -2
  276. package/dist/chunk-ELLPMCWA.js +0 -3
  277. package/dist/chunk-IS7DZ7TB.js +0 -2
  278. package/dist/chunk-K53GNKY3.js +0 -2
  279. package/dist/chunk-KJOKTZUE.js +0 -2
  280. package/dist/chunk-KSD6IWF4.js +0 -38
  281. package/dist/chunk-LEKXKHIQ.js +0 -5
  282. package/dist/chunk-LFPQFRCX.js +0 -26
  283. package/dist/chunk-MBVHEPHQ.js +0 -16
  284. package/dist/chunk-NJTIAQY7.js +0 -3
  285. package/dist/chunk-OINSINYW.js +0 -2
  286. package/dist/chunk-QEIGJJBC.js +0 -20
  287. package/dist/chunk-RUQE7DZT.js +0 -2
  288. package/dist/chunk-RUV4KHWA.js +0 -2
  289. package/dist/chunk-SALRDXWM.js +0 -121
  290. package/dist/chunk-SMBIGBGN.js +0 -67
  291. package/dist/chunk-SON6DQNK.js +0 -7
  292. package/dist/chunk-SSGACGAD.js +0 -3
  293. package/dist/chunk-TFWDJDGO.js +0 -2
  294. package/dist/chunk-U4G4UYLB.js +0 -2
  295. package/dist/chunk-WD3PAQJT.js +0 -10
  296. package/dist/chunk-XLJORP6N.js +0 -4
  297. package/dist/chunk-XTF6ELXT.js +0 -3
  298. package/dist/chunk-YYYERNQL.js +0 -18
  299. package/dist/chunk-Z4MCFCGX.js +0 -3
  300. package/dist/direct-navigation-CVCFER5G.js +0 -3
@@ -1,22 +1,24 @@
1
1
  ---
2
2
  name: scip-concrete-plan
3
- description: Plan code changes with scip-query evidence and testable design. Use for non-trivial implementation, refactor, migration, API, or bug-fix plans before editing code; require source citations, reuse audit, test seams, side-effect boundaries, contracts, and verification.
3
+ description: Plan code changes with scip-query evidence and testable design. Use for non-trivial implementation, refactor, migration, API, or bug-fix plans before editing code; require contextual definitions, cited premises, reuse audit, test seams, counterexample attacks, and a derived verdict.
4
4
  commands:
5
5
  - template: "scip-query status --capabilities"
6
6
  when: "Discover: confirm the index is fresh before citing graph facts."
7
7
  - template: "scip-query plan-context <target>"
8
8
  when: "Discover: anchor the plan with pre-edit context for the target."
9
9
  - template: "scip-query refs <symbol>"
10
- when: "Reuse audit: find existing consumers before proposing a new unit."
10
+ when: "Premises: enumerate every writer and reader of a touched state surface; reuse audit: find existing consumers."
11
+ - template: "scip-query dataflow <symbol-or-variable>"
12
+ when: "Premises: producers and consumers backing a state-authority premise."
11
13
  - template: "scip-query code <symbol>"
12
- when: "Reuse audit: read source before citing a behavior claim."
14
+ when: "Premises: read source before citing a behavior claim."
13
15
  - template: "scip-query trace <symbol>"
14
16
  when: "Verify the plan: rerun source-producing context for cited targets."
15
17
  ---
16
18
 
17
19
  # Concrete Plan
18
20
 
19
- Use this skill to write an implementation plan that another agent can execute without guessing. A concrete plan is a dated Markdown checklist whose code claims come from scip-query evidence and whose design makes the intended behavior easy to test before it is easy to ship.
21
+ Use this skill to write an implementation plan that another agent can execute without guessing and a reviewer can check without re-deriving. A concrete plan is a certificate: a dated Markdown document whose conclusion ready to implement — is derived from numbered, source-cited premises, defended against constructed counterexamples, and shaped so the intended behavior is easy to test before it is easy to ship.
20
22
 
21
23
  Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md) when you need lookup tips, command families, postchecks, or subagent rules.
22
24
 
@@ -27,8 +29,9 @@ Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md) when you
27
29
  | --- | --- | --- |
28
30
  | `scip-query status --capabilities` | Show index status for this project | Discover: confirm the index is fresh before citing graph facts. |
29
31
  | `scip-query plan-context <target>` | Pre-edit planning context for a symbol, file, or module | Discover: anchor the plan with pre-edit context for the target. |
30
- | `scip-query refs <symbol>` | Find all files referencing a symbol | Reuse audit: find existing consumers before proposing a new unit. |
31
- | `scip-query code <symbol>` | Read the source code for a symbol (bounded to its definition range) | Reuse audit: read source before citing a behavior claim. |
32
+ | `scip-query refs <symbol>` | Find all files referencing a symbol | Premises: enumerate every writer and reader of a touched state surface; reuse audit: find existing consumers. |
33
+ | `scip-query dataflow <symbol-or-variable>` | Reference-level dataflow: definition sites, usage sites, producers, consumers | Premises: producers and consumers backing a state-authority premise. |
34
+ | `scip-query code <symbol>` | Read the source code for a symbol (bounded to its definition range) | Premises: read source before citing a behavior claim. |
32
35
  | `scip-query trace <symbol>` | Trace a symbol: definition + all references | Verify the plan: rerun source-producing context for cited targets. |
33
36
 
34
37
  Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
@@ -39,9 +42,14 @@ Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only
39
42
  1. Start with `scip-query status --capabilities`; reindex only when freshness is `stale`, `missing`, or `unknown`.
40
43
  2. Anchor the plan with `scip-query plan-context <target>`. If the target is not indexed, record that fact and use scip-query for every code-adjacent claim it can answer.
41
44
  3. Put the plan in `docs/plans/YYYY-MM-DD-<short-name>.md`.
42
- 4. Every code step includes a `Source` field naming the scip-query command that produced the path, line range, and behavior claim.
43
- 5. Every behavior-changing step includes a testability design: test seam, injected dependencies, pure core, side-effect boundary, and validation.
44
- 6. Do not propose a new helper, wrapper, type, parameter, config flag, component, hook, or module until the reuse audit proves reuse or extension is not the better move.
45
+ 4. Define every load-bearing concept contextually and state every invariant in `iff` or `must always` form. A definition without referents (a `Source:` line) is a guess.
46
+ 5. Evidence lives in numbered premises (`P1`, `P2`, ...), each with a `Source` naming the scip-query command that produced it. Every shared-state surface the plan touches gets a state-authority premise enumerating its complete writer and reader sets.
47
+ 6. Steps and defenses cite the premises they depend on. A claim no premise supports is either new evidence to gather or an explicit `ASSUMPTION` never silent.
48
+ 7. Do not propose a new helper, wrapper, type, parameter, config flag, component, hook, or module until the reuse audit proves reuse or extension is not the better move.
49
+ 8. Every behavior-changing step includes a testability design: test seam, injected dependencies, pure core, side-effect boundary, and validation.
50
+ 9. Attack entries must be constructed scenarios — actor, starting state, sequence — and each ends in a recorded outcome: `HELD` citing the defending step and premises, or `HOLE` with its repair step or accepted reason. An assertion of absence ("no new shared mutable state") is not a defense; it cannot fail, so it cannot catch anything.
51
+ 10. Installing an enforcer — trigger, constraint, guard, gate — opens an enforcement window: every existing writer in the relevant state-authority premise must be brought into compliance in the same or an earlier step, or the window recorded as an accepted hole. Every step declares `Deployable`.
52
+ 11. The verdict is derived, not asserted: `PLANNED-COMPLETE` only when the coverage matrix has no blank rows and every attack ends in `HELD` with citations or an accepted hole. An attack record where nothing ever broke is a red flag — attacks run against a draft should find holes; if none did, rerun the pass as falsification, preferably in a fresh subagent context.
45
53
 
46
54
  ## Planning Terms
47
55
 
@@ -53,6 +61,16 @@ A side-effect boundary is the edge where deterministic program decisions meet fi
53
61
 
54
62
  A contract is the stable promise one code unit exposes to another, including accepted inputs, returned outputs, errors, timing expectations, and side effects that callers may rely on.
55
63
 
64
+ An invariant is a property of the changed system that must hold at every observable moment; what makes it load-bearing is that attacks are judged against it and the final verdict is derived from whether it survives them all.
65
+
66
+ A premise is a numbered, source-cited statement of fact about the current code; what makes it a premise rather than a note is that steps and defenses cite it by ID, so a false premise is traceable to everything built on it.
67
+
68
+ A state-authority premise is a premise that enumerates the complete writer and reader sets of one shared state surface; what makes it powerful is that "complete" is falsifiable with `refs` and `dataflow`, turning a forgotten write path from an unknowable into a checkable omission.
69
+
70
+ A counterexample attack is a concrete actor, starting state, and action sequence constructed to violate an invariant; what makes it evidence is that its defense cites premises and steps, so "we considered failure" becomes "this specific failure is blocked here."
71
+
72
+ An enforcement window is the interval between the step that installs an invariant enforcer and the step that brings the last existing writer into compliance; what makes it dangerous is that during it, every unupdated writer fails the new check in production, so the plan that adds safety is itself the outage.
73
+
56
74
  ## Workflow
57
75
 
58
76
  ### 1. Discover
@@ -64,22 +82,50 @@ scip-query status --capabilities
64
82
  scip-query plan-context <target>
65
83
  ```
66
84
 
67
- Use the shared reference for follow-up commands. Fill three gates before designing:
85
+ Use the shared reference for follow-up commands. Fill four gates before designing:
68
86
 
69
87
  ```markdown
70
88
  ## Goal
71
89
  What the user is trying to accomplish and what done looks like for them.
72
90
 
91
+ ## Definitions & Invariants
92
+ For each load-bearing concept: its wider class, then the one trait that causally
93
+ explains its other traits in this codebase — with the referents. Then the
94
+ invariants the change must preserve, in iff / must-always form.
95
+
73
96
  ## Current State
74
- The affected end-to-end flow, with scip-query citations for entry points, callers, data flow, dependencies, downstream impact, and non-obvious invariants.
97
+ A short narrative of the affected end-to-end flow. Every factual sentence
98
+ cites a premise by ID.
75
99
 
76
100
  ## Reuse Audit
77
- For every new symbol or file being considered: reuse target, extension target, or evidence-backed reason new code is justified.
101
+ For every new symbol or file being considered: reuse target, extension target,
102
+ or evidence-backed reason new code is justified.
78
103
  ```
79
104
 
80
- This step is complete only when the plan can explain the current flow, its consumers, and every proposed new unit's reuse decision with citations.
105
+ Definition discipline: place the concept in its wider class, then name the essential trait the one that makes the concept's other traits in this codebase possible and explains them. Do not label genus or differentia; write it as prose. Ban circular and synonym definitions ("the refresh coordinator coordinates refreshes" defines nothing). Any new term the plan introduces gets defined the same way. Good definitions condense: they imply the concept's other traits instead of listing them, and derived requirements fall out of them — if restore is defined as the inverse of cancel, then the privilege to restore must not be weaker than the privilege to cancel, and a plan that gates them asymmetrically must defend that asymmetry.
106
+
107
+ This step is complete only when the concepts are defined with referents, the invariants are stated formally, and every proposed new unit has a reuse decision with citations.
108
+
109
+ ### 2. Establish Premises
81
110
 
82
- ### 2. Shape for Tests
111
+ Number every fact the plan depends on:
112
+
113
+ ```markdown
114
+ ## Premises
115
+
116
+ - P1. <current behavior fact> — Source: `scip-query code <symbol>`
117
+ - P2. Writers of `<state surface>`: <complete list>. Readers: <complete list>.
118
+ — Source: `scip-query refs <symbol>` + `scip-query dataflow <symbol>`
119
+ - P3. ASSUMPTION: <belief the evidence cannot yet confirm, and what would confirm it>
120
+ ```
121
+
122
+ State-authority rule: for every state surface the plan touches — database column, store field, event topic, endpoint, cache entry — write one premise enumerating its complete writer and reader sets. Completeness comes from `refs` and `dataflow`, not memory.
123
+
124
+ Why this premise class exists: a sprint-restore plan hardened `restore()` and the cancellation path but never enumerated the writers of sprint status. Review found `PATCH /sprints/:id` could set `status: 'active'` around every restore invariant, and transition automations wrote `sprintId` straight past the new membership guard — two of that review's five ship-blockers, both sitting in the writer list one `refs` call would have produced. With a state-authority premise, each writer in the list must be visited by an attack; without it, the side doors are invisible until review.
125
+
126
+ This step is complete only when every state surface named in any phase has a state-authority premise and every remaining unknown is an explicit `ASSUMPTION`.
127
+
128
+ ### 3. Shape for Tests
83
129
 
84
130
  Before writing implementation phases, add:
85
131
 
@@ -101,7 +147,7 @@ Plan the code so tests can call the pure core directly and exercise the side-eff
101
147
 
102
148
  This step is complete only when every changed behavior has a named test seam and the plan makes clear which logic can be tested without real external services.
103
149
 
104
- ### 3. Design the Checklist
150
+ ### 4. Design the Checklist
105
151
 
106
152
  Write phases in execution order. Keep each phase deployable or explicitly mark why it is not. Use this step format:
107
153
 
@@ -109,7 +155,8 @@ Write phases in execution order. Keep each phase deployable or explicitly mark w
109
155
  ### N.M - Imperative title
110
156
 
111
157
  - [ ] **File**: `path/to/file.ts:LINE-LINE`
112
- - **Source**: `scip-query <command>`
158
+ - **Premises**: P<n>, P<m>
159
+ - **Deployable**: yes | no — <reason> | part of single-deploy group <name>
113
160
  - **What**: Current behavior verified from source.
114
161
  - **Change**: Exact edit to make.
115
162
  - **Testability**:
@@ -119,41 +166,59 @@ Write phases in execution order. Keep each phase deployable or explicitly mark w
119
166
  - Side-effect shell:
120
167
  - Contract:
121
168
  - **Validation**: Targeted test, smoke command, or manual check that proves the behavior.
122
- - **Why**: Why this step is needed and why this order is safe.
169
+ - **Why**: Why this step is needed and why this order is safe, citing the premises it rests on.
123
170
  ```
124
171
 
125
- This step is complete only when no checklist item says "update this file" without exact current behavior, target behavior, and validation.
172
+ If a step installs an enforcer trigger, constraint, guard, gate check its enforcement window here: every existing writer in the relevant state-authority premise is brought into compliance in the same or an earlier step, or the window is carried into the attack record as a hole to accept or repair.
173
+
174
+ This step is complete only when no checklist item says "update this file" without exact current behavior, target behavior, cited premises, a deployability declaration, and validation.
126
175
 
127
- ### 4. Stress-Test
176
+ ### 5. Attack the Plan
128
177
 
129
- Apply these lenses to every phase. Add or change steps until each answer is concrete:
178
+ Construct counterexamples against every invariant. This pass is falsification, not defense: it succeeds by finding holes, and against a draft it should find some. Prefer delegating it to a fresh subagent when the environment can spawn one — give the adversary only the Definitions & Invariants, Premises, state-authority maps, and the checklist, not your design rationale, and brief it that it wins by producing holes; fold its findings back as HOLE entries and repair steps. Solo fallback: enumerate the full attack list from the coverage-matrix rows below before writing any Outcome line, so attacks cannot be shaped around defenses you already have.
130
179
 
131
- | Lens | Plan must answer |
180
+ Use the lenses as attack prompts — purpose, blast radius, valid intermediate state, reversibility, failure, concurrency, boundaries, data integrity, observability, human experience, efficiency, reuse, testability — and record each attack in this form:
181
+
182
+ ```markdown
183
+ ### A<n>. <invariant> via <lens>
184
+ - Attack: <actor> + <starting state> + <action sequence>
185
+ - Outcome: HELD — defended by step <N.M> (P<i>, P<j>)
186
+ | HOLE — repaired by new step <N.M>
187
+ | HOLE — accepted: <reason>
188
+ ```
189
+
190
+ A `HELD` that cannot name its defending step and premises is not `HELD`; it is a hole wearing confidence. A repaired hole keeps its `HOLE — repaired by step N.M` label permanently — do not rewrite it to `HELD` after the repair, because the repair history is the evidence that the pass falsified. The verdict's repaired count must equal the number of `HOLE — repaired` entries in the record. Close the record with a coverage matrix — one row per writer in every state-authority premise and per applicable lens (valid intermediate state is always applicable when any step installs an enforcer or migration):
191
+
192
+ ```markdown
193
+ | Surface or lens | Attacks |
132
194
  | --- | --- |
133
- | Purpose | Why does the current code exist, and what invariant must survive? |
134
- | Blast radius | Which direct and transitive consumers move with this change? |
135
- | Valid intermediate state | Would the project still work after only this phase? |
136
- | Reversibility | Is this a one-way or two-way door, and what rollback exists? |
137
- | Failure | What happens when I/O, external APIs, malformed data, retries, or crashes occur? |
138
- | Concurrency | What shared state can be touched twice or out of order? |
139
- | Boundaries | Who can call this entry point, and where is input validated? |
140
- | Data integrity | What existing data, generated artifacts, or persisted contracts are affected? |
141
- | Observability | Can a maintainer diagnose failures from logs/errors without rereading the source? |
142
- | Human experience | What would surprise, confuse, or block a real user? |
143
- | Reuse | Does existing code already solve this problem or most of it? |
144
- | Testability | Are dependencies injectable, logic pure where practical, concerns separated, and contracts small? |
145
-
146
- This step is complete only when every discovered gap has either a new plan step or a written reason it is accepted.
147
-
148
- ### 5. Verify the Plan
195
+ | <writer, reader, or lens> | A2, A7 |
196
+ ```
197
+
198
+ A blank row is an unattacked writer. The record is incomplete until every row names an attack or carries an accepted reason. Spread attacks across rows before deepening one: depth on the axis you already anticipated does not protect the axes you did not — the leaks come from blank rows, not from the tenth variation of the race you already modeled.
199
+
200
+ Invalid entry this exact shape preceded three post-review remediation rounds on a real plan:
201
+
202
+ > **Concurrency**: Validation happens before database writes; no new shared mutable state or retry behavior is introduced.
203
+
204
+ It names no actor, no interleaving, and cites nothing. It is an assertion of absence: it cannot fail, so it caught nothing review later found exactly the race it waved away. A valid entry for the same phase:
205
+
206
+ > ### A3. "Every stored value is a member of its field's option set" via concurrency
207
+ > - Attack: admin removes option O in transaction A while a user writes value O in transaction B; interleaving B-validates → A-commits → B-commits persists an orphaned value.
208
+ > - Outcome: HOLE — repaired by new step 2.2: validation reads the option definition outside B's lock (P4), so serialize definition changes with every value writer via FOR UPDATE on the definition row; regression proves both interleavings against PostgreSQL.
209
+
210
+ This step is complete only when the coverage matrix has no blank rows and every attack entry ends in a cited `HELD` or a recorded `HOLE`.
211
+
212
+ ### 6. Verify the Plan and Derive the Verdict
149
213
 
150
214
  Run or delegate phase-by-phase reference checks. Each verifier confirms:
151
215
 
152
216
  - every path exists;
153
217
  - every line range is still within about five lines;
218
+ - every premise reproduces when its `Source` command is rerun — a premise that no longer reproduces is false, and everything citing it is suspect until fixed;
154
219
  - every behavior claim matches source;
155
220
  - every new unit has reuse evidence;
156
- - every behavior-changing step has a validation command and testability design.
221
+ - every behavior-changing step has cited premises, a validation command, and a testability design.
157
222
 
158
223
  Then rerun the source-producing context for the cited targets:
159
224
 
@@ -161,9 +226,22 @@ Then rerun the source-producing context for the cited targets:
161
226
  scip-query plan-context <target>
162
227
  ```
163
228
 
164
- Use the shared reference for subagent briefing text when delegating.
229
+ Use the shared reference for subagent briefing text when delegating. Close the plan by applying the definitions to the record — do not summarize feelings:
230
+
231
+ ```markdown
232
+ ## Verdict
233
+
234
+ A plan is PLANNED-COMPLETE iff the coverage matrix has no blank rows, every
235
+ attack ends in HELD with cited steps and premises or an accepted hole with a
236
+ written reason, and no premise failed reverification.
237
+
238
+ Result: PLANNED-COMPLETE | INCOMPLETE — <n> attacks, <x> holes repaired,
239
+ <y> holes accepted; <unresolved items>
240
+ ```
241
+
242
+ The counts are part of the verdict. "16 attacks, 0 holes repaired" against a fresh draft is not a strong plan; it is an attack pass that defended instead of falsified — rerun it before shipping the plan.
165
243
 
166
- This step is complete only when stale references are fixed and every phase has a validation path.
244
+ This step is complete only when stale references are fixed, every premise reverified, and the verdict line is derived from the attack record.
167
245
 
168
246
  ## Output Shape
169
247
 
@@ -171,11 +249,14 @@ The plan file contains:
171
249
 
172
250
  1. Title and date.
173
251
  2. Goal.
174
- 3. Current State.
175
- 4. Reuse Audit.
176
- 5. Testability Design.
177
- 6. Design Phases.
178
- 7. Stress-Test Findings.
179
- 8. Execution Order and deployable phase notes.
180
- 9. Ship Order with one-way doors flagged.
181
- 10. Summary of files to create, edit, delete, and verify.
252
+ 3. Definitions & Invariants.
253
+ 4. Premises (including state-authority premises and explicit assumptions).
254
+ 5. Current State (narrative citing premise IDs).
255
+ 6. Reuse Audit.
256
+ 7. Testability Design.
257
+ 8. Design Phases (steps citing premises, each with a deployability declaration).
258
+ 9. Attack Record (attacks with outcomes, holes repaired or accepted, coverage matrix).
259
+ 10. Execution Order and deployable phase notes.
260
+ 11. Ship Order with one-way doors flagged.
261
+ 12. Verdict with attack and hole counts.
262
+ 13. Summary of files to create, edit, delete, and verify.
@@ -24,7 +24,7 @@ Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
24
24
  | Command | Purpose | When |
25
25
  | --- | --- | --- |
26
26
  | `scip-query plan-context <target>` | Pre-edit planning context for a symbol, file, or module | Anchor each phase's step before delegating it. |
27
- | `scip-query diff-gate --json` | Gate the current diff: echo candidates, incomplete migrations, missing co-change partners, unedited twin partners (advisory), uncited doc updates, unused params, new dead symbols; exit 1 on blocking findings | Verify a handoff before accepting it and before closing the program. |
27
+ | `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 a handoff before accepting it and before closing the program. |
28
28
  | `scip-query health --json` | Composite codebase health report with prioritized action list | Pre-register or check a program-level health benchmark. |
29
29
 
30
30
  Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
@@ -43,6 +43,7 @@ Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only
43
43
  2. Use scip-query to find entry points, call paths, data flow, and blast radius.
44
44
  3. Prefer one narrow fix over broad cleanup.
45
45
  4. Verify with the narrowest repo test or smoke command, then invoke `scip-verify`.
46
+ 5. A root-cause claim whose fix crosses a file boundary requires a rival: state the next-most-plausible explanation for the same symptom and run the observation that separates them. A root cause with no rival considered is a guess with confidence.
46
47
 
47
48
  ## Workflow
48
49
 
@@ -82,6 +83,8 @@ scip-query slice <symbol-or-variable> --forward
82
83
 
83
84
  Stop expanding when the first code fact that can cause the symptom is found.
84
85
 
86
+ When a candidate cause emerges, state it as a hypothesis alongside one rival — the next-most-plausible explanation for the same symptom. Name the observation that distinguishes them (a log line, a probe, a narrower test) and execute it. Choose the discriminator that is cheapest to run, not the one most likely to confirm.
87
+
85
88
  This step is complete only when the path explains the symptom or the missing evidence is explicit.
86
89
 
87
90
  ### 4. Compare nearby implementations
@@ -117,9 +120,11 @@ Run the reproduction, narrow test or smoke command, and invoke `scip-verify`.
117
120
  Bug:
118
121
  Entry point:
119
122
  Root cause:
123
+ Rival considered:
124
+ Discriminator: <the executed observation that separated them>
120
125
  Fix:
121
126
  Verification:
122
127
  Remaining risk:
123
128
  ```
124
129
 
125
- Do not present a guess as a root cause. If no root cause is proven, report the missing evidence.
130
+ Do not present a guess as a root cause. A root cause with no rival considered and no executed discriminator is a guess. If no root cause is proven, report the missing evidence.
@@ -10,8 +10,16 @@ commands:
10
10
  when: "Inventory evidence: files with overlapping dependency profiles."
11
11
  - template: "scip-query cycles"
12
12
  when: "Inventory evidence: circular dependency chains between files."
13
+ - template: "scip-query architecture --json"
14
+ when: "Measure configured boundaries, actual dependency traffic, forbidden edges, reciprocal pairs, and boundary cycles."
15
+ - template: "scip-query drift --architecture"
16
+ when: "Review direct drift findings together with boundary coverage and architecture signals."
13
17
  - template: "scip-query co-change --json --full"
14
18
  when: "Inventory evidence: hidden file-level coupling from git history."
19
+ - template: "scip-query health --write-baseline"
20
+ when: "Record reviewed existing debt before enabling architecture regression enforcement."
21
+ - template: "scip-query diff-gate"
22
+ when: "Verify that the current diff introduces no new declared architecture violation."
15
23
  - template: "scip-query config-validate --json"
16
24
  when: "Implement a slice: validate locality config after a move."
17
25
  ---
@@ -31,7 +39,11 @@ Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
31
39
  | `scip-query locality-candidates --json --full` | Find directory-locality and ancestry candidates from consumer ownership | Inventory evidence: directory-locality candidates from consumer ownership. |
32
40
  | `scip-query similar-files --full --json` | Find heuristic similar-file candidates from dependency profiles | Inventory evidence: files with overlapping dependency profiles. |
33
41
  | `scip-query cycles` | Detect circular dependency chains between files | Inventory evidence: circular dependency chains between files. |
42
+ | `scip-query architecture --json` | Evaluate project-owned architectural boundaries and dependency rules | Measure configured boundaries, actual dependency traffic, forbidden edges, reciprocal pairs, and boundary cycles. |
43
+ | `scip-query drift --architecture` | Detect drift candidates: unused imports and declared architecture violations; pass --architecture for boundary context | Review direct drift findings together with boundary coverage and architecture signals. |
34
44
  | `scip-query co-change --json --full` | Files that change together in git history without a dependency edge — hidden coupling candidates | Inventory evidence: hidden file-level coupling from git history. |
45
+ | `scip-query health --write-baseline` | Composite codebase health report with prioritized action list | Record reviewed existing debt before enabling architecture regression enforcement. |
46
+ | `scip-query diff-gate` | Gate the current diff: architecture regressions plus echo, migration, coordination, doc-drift, unused-param, and new-dead candidates; exit 1 on blocking findings | Verify that the current diff introduces no new declared architecture violation. |
35
47
  | `scip-query config-validate --json` | Validate .scipquery.json, including structured suppressions and declared coupling groups | Implement a slice: validate locality config after a move. |
36
48
 
37
49
  Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
@@ -41,6 +53,16 @@ Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only
41
53
 
42
54
  An ownership boundary is a folder, package, module, or convention that groups code around one stable responsibility.
43
55
 
56
+ A dependency edge points from code that relies on something to the code it relies on. For imports, `A -> B` means A imports B.
57
+
58
+ A forbidden edge is an actual cross-boundary dependency rejected by an explicit project rule. Directory distance or an unusual import does not make an edge forbidden by itself.
59
+
60
+ A layer is a responsibility ordered by dependency direction, such as presentation depending on application. A subsystem is a responsibility that owns an end-to-end capability, such as authentication or rendering. A package is a publication or build unit. A service is an independently running unit. Do not force all four into one layer hierarchy.
61
+
62
+ A reciprocal dependency is dependency traffic in both directions between two boundaries. It is a review signal because the boundaries exert mutual change pressure, not proof that either import is wrong.
63
+
64
+ An architecture ratchet is an enforcement rule that records existing violations while preventing new ones, allowing a large codebase to improve without a speculative rewrite.
65
+
44
66
  A target structure is a proposed future layout that expresses an ownership model, not merely a prettier tree.
45
67
 
46
68
  A migration slice is the smallest set of file moves and import updates that can be verified independently.
@@ -55,6 +77,8 @@ A slop codebase is a codebase whose files are arranged by accident, convenience,
55
77
  4. Do not reward generic `shared` unless the shared concept has a name, owner, and cross-boundary consumers.
56
78
  5. For messy repos, produce a discovery map and decisions instead of pretending the target is obvious.
57
79
  6. Prefer small verified moves.
80
+ 7. Configure descriptive boundaries before closing dependency rules.
81
+ 8. Treat graph shape as evidence about responsibilities, never as a substitute for identifying them.
58
82
 
59
83
  ## Workflow
60
84
 
@@ -77,6 +101,8 @@ scip-query change-surface <file>
77
101
  scip-query plan-context <file-or-symbol>
78
102
  scip-query locality-candidates --json --full
79
103
  scip-query cycles
104
+ scip-query architecture --json
105
+ scip-query drift --architecture
80
106
  scip-query co-change
81
107
  scip-query similar-files --min-similarity 0.6 --min-deps 3
82
108
  scip-query similar-chains --min-similarity 0.5
@@ -98,7 +124,66 @@ Classify each candidate:
98
124
 
99
125
  This step is complete only when mature, emerging, and accidental boundaries are separated.
100
126
 
101
- ### 4. Propose structure or decisions
127
+ ### 4. Build a descriptive architecture model
128
+
129
+ For a large existing codebase, identify real system units before calling them layers. Inventory:
130
+
131
+ - workspace packages and public exports;
132
+ - applications, services, and deployable entry points;
133
+ - domain capabilities and end-to-end subsystems;
134
+ - persistence, network, rendering, compiler, and other technical responsibilities;
135
+ - tests, routes, contracts, and ownership or architecture documentation;
136
+ - dependency and co-change evidence that shows which files already move as a unit.
137
+
138
+ Add mature boundary path patterns to `.scipquery.json` without `allowedDependencies` rows first:
139
+
140
+ ```json
141
+ {
142
+ "architecture": {
143
+ "boundaries": [
144
+ { "name": "domain", "paths": ["src/domain/**"] },
145
+ { "name": "runtime", "paths": ["src/runtime/**"] }
146
+ ]
147
+ }
148
+ }
149
+ ```
150
+
151
+ Then run:
152
+
153
+ ```bash
154
+ scip-query config-validate --json
155
+ scip-query architecture --json
156
+ ```
157
+
158
+ Use unmapped and ambiguous files to repair boundary membership. Use actual boundary edges, reciprocal pairs, and strongly connected groups to test whether the names describe real separation.
159
+
160
+ This step is complete only when every configured boundary has a stated responsibility and the mapping gaps are understood.
161
+
162
+ ### 5. Declare only supported dependency rules
163
+
164
+ An `allowedDependencies` row is closed: an outgoing target omitted from a present row is forbidden. A missing row makes no dependency claim.
165
+
166
+ ```json
167
+ {
168
+ "architecture": {
169
+ "boundaries": [
170
+ { "name": "domain", "paths": ["src/domain/**"] },
171
+ { "name": "runtime", "paths": ["src/runtime/**"] }
172
+ ],
173
+ "allowedDependencies": {
174
+ "domain": [],
175
+ "runtime": ["domain"]
176
+ },
177
+ "requireAcyclic": true
178
+ }
179
+ }
180
+ ```
181
+
182
+ For each closed row, record the evidence for its intended direction. Do not copy the current dependency graph into the allow-list merely to obtain zero findings. Leave emerging or disputed rows undeclared.
183
+
184
+ This step is complete only when every forbidden edge is understood as either implementation debt, a false boundary, or a policy mistake.
185
+
186
+ ### 6. Propose structure or decisions
102
187
 
103
188
  Use this shape:
104
189
 
@@ -108,6 +193,10 @@ Use this shape:
108
193
  ## Scope
109
194
  ## Current Structure Map
110
195
  ## Boundary Maturity
196
+ ## Descriptive Architecture Model
197
+ ## Dependency Rules
198
+ ## Forbidden-Edge Ledger
199
+ ## Reciprocal and Cycle Review
111
200
  ## Target Structure
112
201
  ## Move Ledger
113
202
  ## Locality Config
@@ -120,7 +209,29 @@ List no-move decisions when broad consumers, route/package/contract surfaces, in
120
209
 
121
210
  This step is complete only when every proposed move has a reason and verification path.
122
211
 
123
- ### 5. Implement one slice when asked
212
+ ### 7. Ratchet, then implement one slice when asked
213
+
214
+ For a large repository with existing violations, review the direct findings and
215
+ write the shared health baseline:
216
+
217
+ ```bash
218
+ scip-query drift --architecture
219
+ scip-query health --write-baseline
220
+ ```
221
+
222
+ The baseline records stable architecture identities by boundary pair, not by
223
+ whichever example file happens to sort first. The default `scip-query
224
+ diff-gate` architecture check then compares only architecture identities; it
225
+ does not run every health detector. `diff-gate --baseline` remains the opt-in
226
+ full health ratchet and does not duplicate architecture findings.
227
+
228
+ Commit `.scipquery-baseline.json` with `.scipquery.json`. A missing baseline
229
+ causes the architecture gate to report that enforcement is not enabled; it
230
+ does not silently treat the current graph as accepted.
231
+
232
+ Prefer inspecting the least-broad edge inside a boundary cycle first, but
233
+ determine whether the repair is a move, dependency inversion, named shared
234
+ contract, boundary merge, or policy correction.
124
235
 
125
236
  Before editing, state files to move, imports/exports/tests/docs to update, expected verification, and rollback risk. Then move the smallest high-confidence slice and run:
126
237
 
@@ -135,6 +246,9 @@ Also run project tests or typecheck for the affected workspace. If `.scipquery.j
135
246
  ```bash
136
247
  scip-query config-validate
137
248
  scip-query locality-candidates --json --full
249
+ scip-query architecture --json
250
+ scip-query drift --architecture
251
+ scip-query diff-gate
138
252
  ```
139
253
 
140
254
  Then invoke `scip-verify`. The implementation is complete only when imports, tests, locality signals, and verification are checked.
@@ -44,6 +44,7 @@ Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only
44
44
  3. Read source with `scip-query code`; do not describe what a function probably does.
45
45
  4. Follow the graph before trusting folder structure.
46
46
  5. Start wide, then narrow.
47
+ 6. Descriptions need citations; conclusions need discriminators. A conclusion — why something happens, what a unit is for, which intent explains a shape — states one rival explanation and the trace evidence that rules it out.
47
48
 
48
49
  ## Workflow
49
50
 
@@ -117,4 +118,4 @@ This step is complete only when the explanation includes the risky symbols or st
117
118
 
118
119
  ## Report
119
120
 
120
- Report overview, entry points, call flow, data flow, dependencies, consumers, risk areas, and the command citations that prove each claim. Exploration is complete only when the user can see what was proven and what remains unverified.
121
+ Report overview, entry points, call flow, data flow, dependencies, consumers, risk areas, and the command citations that prove each claim. For each conclusion-bearing claim, name the rival explanation considered and the evidence that ruled it out. Exploration is complete only when the user can see what was proven, what remains unverified, and which conclusions rest on a discriminator rather than a single story.
@@ -43,6 +43,12 @@ validates (checkers, gates, verifiers, validators — find producers with
43
43
  an input that MUST fail — a wrong binding, a corrupt file, an impossible
44
44
  value — and run it. A checker that passes its should-fail input is
45
45
  decorative: file it as a defect, not a note.
46
+ Before filing, attempt the defense: an accusation triggers a rewrite, so
47
+ search for the failure exit the drill may have missed — a config-gated
48
+ branch, an async rejection, one-hop delegation (the calibration's known
49
+ noise archetypes). File the defect with the executed should-fail input
50
+ attached and the defense attempt noted; a defense that succeeds clears the
51
+ checker and stays in the record as its witness.
46
52
  Complete only when every checker in scope has been witnessed rejecting a
47
53
  constructed should-fail input, or is listed with a reason it cannot be.
48
54
 
@@ -121,6 +127,17 @@ the fix. The audit is complete only when every drill's exit criterion is
121
127
  met for the scope, and every defect found has a regression artifact — a
122
128
  test, fixture, or model that fails on the pre-fix behavior.
123
129
 
130
+ End with a derived verdict, not an impression:
131
+
132
+ ```markdown
133
+ Integrity: <scope> — <c> checkers witnessed failing, <a> adapters diffed
134
+ against reality, <f> fallback primaries witnessed live, <m> metrics
135
+ recomputed, <t> twins compared; <d> defects filed, <u> unverifiable (reasons)
136
+ ```
137
+
138
+ A suspect scope that produces zero defects is itself a claim: state what
139
+ made the suspicion wrong, or rerun the drill that should have caught it.
140
+
124
141
  A regression artifact that doesn't actually assert anything, or asserts the
125
142
  same literal it stubbed into its own mock, is a fake witness — the same
126
143
  "reports success without doing the work" failure mode this skill hunts in
@@ -12,8 +12,8 @@ commands:
12
12
  when: "Map evidence: exports, consumers, and blast-radius risk."
13
13
  - template: "scip-query affected <symbol>"
14
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)."
15
+ - template: "scip-query drift --patterns --architecture"
16
+ when: "Map evidence: declared architecture violations plus boundary and pattern signals; treat opt-in pattern hits as leads, not findings."
17
17
  ---
18
18
 
19
19
  # scip-maintainability
@@ -32,7 +32,7 @@ Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
32
32
  | `scip-query surface <scope>` | What symbols consumers actually use from this module | Map evidence: what consumers actually use from the scope. |
33
33
  | `scip-query change-surface <file>` | Pre-change briefing: exports, consumers, and blast-radius risk | Map evidence: exports, consumers, and blast-radius risk. |
34
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). |
35
+ | `scip-query drift --patterns --architecture` | Detect drift candidates: unused imports and declared architecture violations; pass --architecture for boundary context | Map evidence: declared architecture violations plus boundary and pattern signals; treat opt-in pattern hits as leads, not findings. |
36
36
 
37
37
  Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
38
38
  <!-- END GENERATED SKILL COMMANDS -->
@@ -53,6 +53,8 @@ Essential variation is difference that must remain because the real units differ
53
53
 
54
54
  System compression is replacing several mechanisms that perform the same role, policy, lifecycle, or surface job with fewer named mechanisms that preserve behavior.
55
55
 
56
+ A unifying definition is the single essential trait that makes several code sites one concept; what makes it a test is that failing to state it proves the sites are not one concept, and consolidating them anyway would package-deal essential variation into a false abstraction.
57
+
56
58
  ## Rules
57
59
 
58
60
  1. Ground claims in files, symbols, references, call graphs, dependencies, surfaces, and blast radius.
@@ -61,6 +63,7 @@ System compression is replacing several mechanisms that perform the same role, p
61
63
  4. Preserve essential variation.
62
64
  5. Add an abstraction only when it removes hidden policy, names a lifecycle, enforces a rule, or reduces concept count.
63
65
  6. Prefer deletion, inlining, merging, generation, or enforcement before broad frameworks.
66
+ 7. A scattered-concept or consolidation claim ships its unifying definition. If no single essential trait covers every cited site, the variation is essential: record it and do not consolidate.
64
67
 
65
68
  ## Workflow
66
69
 
@@ -100,7 +103,7 @@ This step is complete only when concrete units, consumers, tests, fallbacks, ada
100
103
 
101
104
  For each cluster, ask:
102
105
 
103
- - What one concept appears in several places?
106
+ - What one concept appears in several places — and what single essential trait makes them one concept? If the trait cannot be stated, they are not one concept.
104
107
  - What policy is hidden?
105
108
  - What lifecycle is unnamed?
106
109
  - Which differences are essential?
@@ -144,6 +147,8 @@ For broad review, write a register under `docs/plans/` unless the user asks not
144
147
 
145
148
  Use dispositions: `merge`, `delete`, `inline`, `extract`, `generate`, `enforce`, `supersede`, `defer`, `skip`.
146
149
 
150
+ Every `merge`, `extract`, or `generate` entry carries its unifying definition and its strongest dissenter — the cited site most likely to differ essentially — with the evidence that it does not. A dissenter that survives moves the entry to `skip` with reason `essential variation`; the dissenter stays in the register either way.
151
+
147
152
  This step is complete only when each opportunity has evidence, disposition, dependency order, touch map, and validation plan.
148
153
 
149
154
  ### 7. Implement and verify when asked