@shrkcrft/cli 0.1.0-alpha.29 → 0.1.0-alpha.31

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 (510) hide show
  1. package/dist/asset-preview/apply-asset-preview.js +1 -1
  2. package/dist/authoring/authoring-kit.d.ts +9 -1
  3. package/dist/authoring/authoring-kit.d.ts.map +1 -1
  4. package/dist/authoring/authoring-kit.js +26 -13
  5. package/dist/bootstrap/unlinked-workspace-dependency.d.ts +11 -0
  6. package/dist/bootstrap/unlinked-workspace-dependency.d.ts.map +1 -0
  7. package/dist/bootstrap/unlinked-workspace-dependency.js +99 -0
  8. package/dist/command-registry.d.ts +100 -1
  9. package/dist/command-registry.d.ts.map +1 -1
  10. package/dist/command-registry.js +130 -3
  11. package/dist/commands/api-diff.command.d.ts.map +1 -1
  12. package/dist/commands/api-diff.command.js +12 -0
  13. package/dist/commands/apply.command.d.ts.map +1 -1
  14. package/dist/commands/apply.command.js +3 -0
  15. package/dist/commands/arch.command.d.ts.map +1 -1
  16. package/dist/commands/arch.command.js +26 -7
  17. package/dist/commands/architecture.command.d.ts.map +1 -1
  18. package/dist/commands/architecture.command.js +8 -2
  19. package/dist/commands/baseline.command.d.ts +76 -0
  20. package/dist/commands/baseline.command.d.ts.map +1 -1
  21. package/dist/commands/baseline.command.js +599 -75
  22. package/dist/commands/biome.command.d.ts.map +1 -1
  23. package/dist/commands/biome.command.js +20 -0
  24. package/dist/commands/boundaries.command.d.ts +9 -1
  25. package/dist/commands/boundaries.command.d.ts.map +1 -1
  26. package/dist/commands/boundaries.command.js +88 -20
  27. package/dist/commands/bundle.command.d.ts.map +1 -1
  28. package/dist/commands/bundle.command.js +57 -11
  29. package/dist/commands/cache-align.command.d.ts.map +1 -1
  30. package/dist/commands/cache-align.command.js +3 -1
  31. package/dist/commands/changelog-data.d.ts.map +1 -1
  32. package/dist/commands/changelog-data.js +164 -0
  33. package/dist/commands/changes.command.d.ts.map +1 -1
  34. package/dist/commands/changes.command.js +15 -0
  35. package/dist/commands/check.command.d.ts.map +1 -1
  36. package/dist/commands/check.command.js +1260 -324
  37. package/dist/commands/checks.command.d.ts.map +1 -1
  38. package/dist/commands/checks.command.js +188 -40
  39. package/dist/commands/ci.command.d.ts.map +1 -1
  40. package/dist/commands/ci.command.js +35 -2
  41. package/dist/commands/code-intel.command.d.ts.map +1 -1
  42. package/dist/commands/code-intel.command.js +8 -1
  43. package/dist/commands/command-catalog.d.ts +23 -1
  44. package/dist/commands/command-catalog.d.ts.map +1 -1
  45. package/dist/commands/command-catalog.js +152 -35
  46. package/dist/commands/commands.command.d.ts +21 -3
  47. package/dist/commands/commands.command.d.ts.map +1 -1
  48. package/dist/commands/commands.command.js +172 -27
  49. package/dist/commands/compress.command.d.ts.map +1 -1
  50. package/dist/commands/compress.command.js +4 -0
  51. package/dist/commands/constructs.command.d.ts.map +1 -1
  52. package/dist/commands/constructs.command.js +50 -12
  53. package/dist/commands/context.command.d.ts.map +1 -1
  54. package/dist/commands/context.command.js +40 -5
  55. package/dist/commands/contract-templates.command.d.ts.map +1 -1
  56. package/dist/commands/contract-templates.command.js +9 -1
  57. package/dist/commands/contract.command.d.ts.map +1 -1
  58. package/dist/commands/contract.command.js +35 -0
  59. package/dist/commands/conventions.command.d.ts.map +1 -1
  60. package/dist/commands/conventions.command.js +189 -29
  61. package/dist/commands/coverage.command.d.ts.map +1 -1
  62. package/dist/commands/coverage.command.js +9 -0
  63. package/dist/commands/daily.commands.d.ts +0 -1
  64. package/dist/commands/daily.commands.d.ts.map +1 -1
  65. package/dist/commands/daily.commands.js +12 -76
  66. package/dist/commands/dashboard.command.d.ts.map +1 -1
  67. package/dist/commands/dashboard.command.js +10 -0
  68. package/dist/commands/dev.command.d.ts.map +1 -1
  69. package/dist/commands/dev.command.js +45 -2
  70. package/dist/commands/diagnostics.command.d.ts +0 -2
  71. package/dist/commands/diagnostics.command.d.ts.map +1 -1
  72. package/dist/commands/diagnostics.command.js +5 -78
  73. package/dist/commands/diff-check.command.d.ts +6 -4
  74. package/dist/commands/diff-check.command.d.ts.map +1 -1
  75. package/dist/commands/diff-check.command.js +190 -103
  76. package/dist/commands/docs-references.command.d.ts +20 -0
  77. package/dist/commands/docs-references.command.d.ts.map +1 -0
  78. package/dist/commands/docs-references.command.js +520 -0
  79. package/dist/commands/doctor.command.d.ts.map +1 -1
  80. package/dist/commands/doctor.command.js +60 -5
  81. package/dist/commands/drift.command.d.ts.map +1 -1
  82. package/dist/commands/drift.command.js +17 -4
  83. package/dist/commands/eslint.command.d.ts.map +1 -1
  84. package/dist/commands/eslint.command.js +20 -0
  85. package/dist/commands/export.command.d.ts.map +1 -1
  86. package/dist/commands/export.command.js +23 -1
  87. package/dist/commands/feedback-dispatch.command.d.ts.map +1 -1
  88. package/dist/commands/feedback-dispatch.command.js +29 -0
  89. package/dist/commands/feedback.command.d.ts.map +1 -1
  90. package/dist/commands/feedback.command.js +6 -1
  91. package/dist/commands/finish.command.d.ts.map +1 -1
  92. package/dist/commands/finish.command.js +32 -8
  93. package/dist/commands/fix.command.d.ts.map +1 -1
  94. package/dist/commands/fix.command.js +19 -0
  95. package/dist/commands/gate.command.d.ts +6 -1
  96. package/dist/commands/gate.command.d.ts.map +1 -1
  97. package/dist/commands/gate.command.js +50 -124
  98. package/dist/commands/gates.command.d.ts +54 -0
  99. package/dist/commands/gates.command.d.ts.map +1 -1
  100. package/dist/commands/gates.command.js +1314 -64
  101. package/dist/commands/gen.command.d.ts.map +1 -1
  102. package/dist/commands/gen.command.js +4 -0
  103. package/dist/commands/generated.command.d.ts +62 -0
  104. package/dist/commands/generated.command.d.ts.map +1 -1
  105. package/dist/commands/generated.command.js +639 -156
  106. package/dist/commands/graph-code-subverbs.d.ts +15 -0
  107. package/dist/commands/graph-code-subverbs.d.ts.map +1 -1
  108. package/dist/commands/graph-code-subverbs.js +203 -25
  109. package/dist/commands/graph.command.d.ts.map +1 -1
  110. package/dist/commands/graph.command.js +79 -37
  111. package/dist/commands/help.command.d.ts +30 -6
  112. package/dist/commands/help.command.d.ts.map +1 -1
  113. package/dist/commands/help.command.js +323 -199
  114. package/dist/commands/helper.command.d.ts +1 -0
  115. package/dist/commands/helper.command.d.ts.map +1 -1
  116. package/dist/commands/helper.command.js +195 -56
  117. package/dist/commands/impact.command.d.ts.map +1 -1
  118. package/dist/commands/impact.command.js +115 -12
  119. package/dist/commands/infer.command.d.ts.map +1 -1
  120. package/dist/commands/infer.command.js +20 -45
  121. package/dist/commands/ingest.command.d.ts +0 -1
  122. package/dist/commands/ingest.command.d.ts.map +1 -1
  123. package/dist/commands/ingest.command.js +25 -41
  124. package/dist/commands/knowledge-author.command.d.ts +0 -3
  125. package/dist/commands/knowledge-author.command.d.ts.map +1 -1
  126. package/dist/commands/knowledge-author.command.js +10 -23
  127. package/dist/commands/knowledge.command.d.ts.map +1 -1
  128. package/dist/commands/knowledge.command.js +469 -129
  129. package/dist/commands/languages.command.d.ts.map +1 -1
  130. package/dist/commands/languages.command.js +27 -0
  131. package/dist/commands/lint.command.d.ts.map +1 -1
  132. package/dist/commands/lint.command.js +3 -0
  133. package/dist/commands/mcp.command.d.ts +18 -0
  134. package/dist/commands/mcp.command.d.ts.map +1 -1
  135. package/dist/commands/mcp.command.js +33 -8
  136. package/dist/commands/onboard.command.d.ts.map +1 -1
  137. package/dist/commands/onboard.command.js +20 -0
  138. package/dist/commands/owners.command.d.ts.map +1 -1
  139. package/dist/commands/owners.command.js +14 -2
  140. package/dist/commands/packs-new.d.ts +13 -1
  141. package/dist/commands/packs-new.d.ts.map +1 -1
  142. package/dist/commands/packs-new.js +500 -335
  143. package/dist/commands/packs.command.d.ts.map +1 -1
  144. package/dist/commands/packs.command.js +378 -36
  145. package/dist/commands/paths.command.d.ts.map +1 -1
  146. package/dist/commands/paths.command.js +9 -1
  147. package/dist/commands/pipelines.command.d.ts.map +1 -1
  148. package/dist/commands/pipelines.command.js +7 -1
  149. package/dist/commands/plan-check.command.d.ts.map +1 -1
  150. package/dist/commands/plan-check.command.js +3 -0
  151. package/dist/commands/plan.command.d.ts.map +1 -1
  152. package/dist/commands/plan.command.js +3 -0
  153. package/dist/commands/playbooks.command.d.ts.map +1 -1
  154. package/dist/commands/playbooks.command.js +7 -2
  155. package/dist/commands/policy-lint.command.d.ts +19 -2
  156. package/dist/commands/policy-lint.command.d.ts.map +1 -1
  157. package/dist/commands/policy-lint.command.js +224 -65
  158. package/dist/commands/policy.command.d.ts.map +1 -1
  159. package/dist/commands/policy.command.js +6 -1
  160. package/dist/commands/pr.command.d.ts.map +1 -1
  161. package/dist/commands/pr.command.js +14 -0
  162. package/dist/commands/presets.command.d.ts.map +1 -1
  163. package/dist/commands/presets.command.js +12 -27
  164. package/dist/commands/profiles.command.d.ts.map +1 -1
  165. package/dist/commands/profiles.command.js +94 -26
  166. package/dist/commands/provenance.command.js +1 -1
  167. package/dist/commands/quality.command.d.ts.map +1 -1
  168. package/dist/commands/quality.command.js +129 -33
  169. package/dist/commands/recommend.command.d.ts +20 -4
  170. package/dist/commands/recommend.command.d.ts.map +1 -1
  171. package/dist/commands/recommend.command.js +172 -278
  172. package/dist/commands/registrations.command.d.ts.map +1 -1
  173. package/dist/commands/registrations.command.js +138 -13
  174. package/dist/commands/registry-lifecycle-run.d.ts +14 -0
  175. package/dist/commands/registry-lifecycle-run.d.ts.map +1 -0
  176. package/dist/commands/registry-lifecycle-run.js +336 -0
  177. package/dist/commands/registry.command.d.ts.map +1 -1
  178. package/dist/commands/registry.command.js +235 -62
  179. package/dist/commands/release.command.d.ts.map +1 -1
  180. package/dist/commands/release.command.js +99 -20
  181. package/dist/commands/report.command.d.ts.map +1 -1
  182. package/dist/commands/report.command.js +38 -2
  183. package/dist/commands/reuse-coverage.command.d.ts +23 -0
  184. package/dist/commands/reuse-coverage.command.d.ts.map +1 -0
  185. package/dist/commands/reuse-coverage.command.js +536 -0
  186. package/dist/commands/reuse.command.d.ts +3 -18
  187. package/dist/commands/reuse.command.d.ts.map +1 -1
  188. package/dist/commands/reuse.command.js +395 -244
  189. package/dist/commands/review.command.d.ts.map +1 -1
  190. package/dist/commands/review.command.js +33 -1
  191. package/dist/commands/rounds.command.d.ts.map +1 -1
  192. package/dist/commands/rounds.command.js +5 -0
  193. package/dist/commands/safety.command.d.ts.map +1 -1
  194. package/dist/commands/safety.command.js +9 -0
  195. package/dist/commands/scaffolds.command.d.ts.map +1 -1
  196. package/dist/commands/scaffolds.command.js +97 -25
  197. package/dist/commands/search.command.d.ts +0 -8
  198. package/dist/commands/search.command.d.ts.map +1 -1
  199. package/dist/commands/search.command.js +136 -28
  200. package/dist/commands/self-config-xrefs.command.d.ts +24 -0
  201. package/dist/commands/self-config-xrefs.command.d.ts.map +1 -0
  202. package/dist/commands/self-config-xrefs.command.js +170 -0
  203. package/dist/commands/self-config.command.d.ts.map +1 -1
  204. package/dist/commands/self-config.command.js +261 -65
  205. package/dist/commands/smart-context.command.d.ts.map +1 -1
  206. package/dist/commands/smart-context.command.js +39 -3
  207. package/dist/commands/spec.command.d.ts.map +1 -1
  208. package/dist/commands/spec.command.js +3 -0
  209. package/dist/commands/stats.command.d.ts.map +1 -1
  210. package/dist/commands/stats.command.js +3 -0
  211. package/dist/commands/surface.command.d.ts +6 -1
  212. package/dist/commands/surface.command.d.ts.map +1 -1
  213. package/dist/commands/surface.command.js +256 -54
  214. package/dist/commands/task-context.command.js +1 -1
  215. package/dist/commands/task.command.d.ts.map +1 -1
  216. package/dist/commands/task.command.js +22 -1
  217. package/dist/commands/templates.command.d.ts +4 -0
  218. package/dist/commands/templates.command.d.ts.map +1 -1
  219. package/dist/commands/templates.command.js +109 -22
  220. package/dist/commands/test.command.d.ts.map +1 -1
  221. package/dist/commands/test.command.js +161 -33
  222. package/dist/commands/tests.command.d.ts.map +1 -1
  223. package/dist/commands/tests.command.js +29 -3
  224. package/dist/commands/trace.command.d.ts.map +1 -1
  225. package/dist/commands/trace.command.js +29 -4
  226. package/dist/commands/watch.command.d.ts.map +1 -1
  227. package/dist/commands/watch.command.js +3 -0
  228. package/dist/commands/why.command.d.ts.map +1 -1
  229. package/dist/commands/why.command.js +3 -0
  230. package/dist/commands/wiring.command.d.ts +18 -4
  231. package/dist/commands/wiring.command.d.ts.map +1 -1
  232. package/dist/commands/wiring.command.js +362 -74
  233. package/dist/dashboard/code-intelligence-data.js +4 -4
  234. package/dist/diff/deleted-orphan-coverage.d.ts +32 -0
  235. package/dist/diff/deleted-orphan-coverage.d.ts.map +1 -0
  236. package/dist/diff/deleted-orphan-coverage.js +107 -0
  237. package/dist/diff/deleted-orphan-scope-notes.d.ts +23 -0
  238. package/dist/diff/deleted-orphan-scope-notes.d.ts.map +1 -0
  239. package/dist/diff/deleted-orphan-scope-notes.js +49 -0
  240. package/dist/diff/deleted-orphans.d.ts +32 -0
  241. package/dist/diff/deleted-orphans.d.ts.map +1 -1
  242. package/dist/diff/deleted-orphans.js +42 -2
  243. package/dist/dispatch/closest-match.d.ts +15 -0
  244. package/dist/dispatch/closest-match.d.ts.map +1 -0
  245. package/dist/dispatch/closest-match.js +47 -0
  246. package/dist/dispatch/global-flags.d.ts +94 -0
  247. package/dist/dispatch/global-flags.d.ts.map +1 -0
  248. package/dist/dispatch/global-flags.js +123 -0
  249. package/dist/dispatch/guard-invocation-input.d.ts +24 -0
  250. package/dist/dispatch/guard-invocation-input.d.ts.map +1 -0
  251. package/dist/dispatch/guard-invocation-input.js +1 -0
  252. package/dist/dispatch/guard-invocation.d.ts +33 -0
  253. package/dist/dispatch/guard-invocation.d.ts.map +1 -0
  254. package/dist/dispatch/guard-invocation.js +183 -0
  255. package/dist/dispatch/help-intercept.d.ts +22 -0
  256. package/dist/dispatch/help-intercept.d.ts.map +1 -0
  257. package/dist/dispatch/help-intercept.js +42 -0
  258. package/dist/dispatch/i-declared-invocation.d.ts +17 -0
  259. package/dist/dispatch/i-declared-invocation.d.ts.map +1 -0
  260. package/dist/dispatch/i-declared-invocation.js +1 -0
  261. package/dist/dispatch/i-unknown-flag-refusal-input.d.ts +28 -0
  262. package/dist/dispatch/i-unknown-flag-refusal-input.d.ts.map +1 -0
  263. package/dist/dispatch/i-unknown-flag-refusal-input.js +1 -0
  264. package/dist/dispatch/invocation-rejection-kind.d.ts +15 -0
  265. package/dist/dispatch/invocation-rejection-kind.d.ts.map +1 -0
  266. package/dist/dispatch/invocation-rejection-kind.js +15 -0
  267. package/dist/dispatch/invocation-rejection.d.ts +18 -0
  268. package/dist/dispatch/invocation-rejection.d.ts.map +1 -0
  269. package/dist/dispatch/invocation-rejection.js +1 -0
  270. package/dist/dispatch/judge-invocation.d.ts +24 -0
  271. package/dist/dispatch/judge-invocation.d.ts.map +1 -0
  272. package/dist/dispatch/judge-invocation.js +50 -0
  273. package/dist/dispatch/positional-mode.d.ts +18 -0
  274. package/dist/dispatch/positional-mode.d.ts.map +1 -0
  275. package/dist/dispatch/positional-mode.js +18 -0
  276. package/dist/dispatch/read-tracking-map.d.ts +28 -0
  277. package/dist/dispatch/read-tracking-map.d.ts.map +1 -0
  278. package/dist/dispatch/read-tracking-map.js +58 -0
  279. package/dist/dispatch/refuse-sibling-valve-flags.d.ts +30 -0
  280. package/dist/dispatch/refuse-sibling-valve-flags.d.ts.map +1 -0
  281. package/dist/dispatch/refuse-sibling-valve-flags.js +65 -0
  282. package/dist/dispatch/subverb-spec.d.ts +26 -0
  283. package/dist/dispatch/subverb-spec.d.ts.map +1 -0
  284. package/dist/dispatch/subverb-spec.js +1 -0
  285. package/dist/dispatch/undocumented-flag-reads.d.ts +22 -0
  286. package/dist/dispatch/undocumented-flag-reads.d.ts.map +1 -0
  287. package/dist/dispatch/undocumented-flag-reads.js +283 -0
  288. package/dist/dispatch/unknown-flag-refusal-mode.d.ts +13 -0
  289. package/dist/dispatch/unknown-flag-refusal-mode.d.ts.map +1 -0
  290. package/dist/dispatch/unknown-flag-refusal-mode.js +13 -0
  291. package/dist/dispatch/unknown-flag-refusal.d.ts +22 -0
  292. package/dist/dispatch/unknown-flag-refusal.d.ts.map +1 -0
  293. package/dist/dispatch/unknown-flag-refusal.js +57 -0
  294. package/dist/dispatch/unread-flags.d.ts +152 -0
  295. package/dist/dispatch/unread-flags.d.ts.map +1 -0
  296. package/dist/dispatch/unread-flags.js +295 -0
  297. package/dist/dispatch/verdict-valve-flag.d.ts +21 -0
  298. package/dist/dispatch/verdict-valve-flag.d.ts.map +1 -0
  299. package/dist/dispatch/verdict-valve-flag.js +21 -0
  300. package/dist/dispatch/walk-declared-subverbs.d.ts +14 -0
  301. package/dist/dispatch/walk-declared-subverbs.d.ts.map +1 -0
  302. package/dist/dispatch/walk-declared-subverbs.js +28 -0
  303. package/dist/exit-codes.d.ts +41 -3
  304. package/dist/exit-codes.d.ts.map +1 -1
  305. package/dist/exit-codes.js +153 -14
  306. package/dist/finish/run-finish.d.ts +72 -5
  307. package/dist/finish/run-finish.d.ts.map +1 -1
  308. package/dist/finish/run-finish.js +453 -104
  309. package/dist/gates/accepted-empty-note.d.ts +10 -0
  310. package/dist/gates/accepted-empty-note.d.ts.map +1 -0
  311. package/dist/gates/accepted-empty-note.js +11 -0
  312. package/dist/gates/allow-empty.d.ts +25 -0
  313. package/dist/gates/allow-empty.d.ts.map +1 -0
  314. package/dist/gates/allow-empty.js +27 -0
  315. package/dist/gates/asset-doctor-failing-units.d.ts +16 -0
  316. package/dist/gates/asset-doctor-failing-units.d.ts.map +1 -0
  317. package/dist/gates/asset-doctor-failing-units.js +14 -0
  318. package/dist/gates/asset-doctor-failure-line.d.ts +16 -0
  319. package/dist/gates/asset-doctor-failure-line.d.ts.map +1 -0
  320. package/dist/gates/asset-doctor-failure-line.js +28 -0
  321. package/dist/gates/empty-rule-advice-lines.d.ts +15 -0
  322. package/dist/gates/empty-rule-advice-lines.d.ts.map +1 -0
  323. package/dist/gates/empty-rule-advice-lines.js +20 -0
  324. package/dist/gates/gate-envelope.d.ts +85 -8
  325. package/dist/gates/gate-envelope.d.ts.map +1 -1
  326. package/dist/gates/gate-envelope.js +56 -7
  327. package/dist/gates/gate-rule-globs.d.ts +67 -0
  328. package/dist/gates/gate-rule-globs.d.ts.map +1 -0
  329. package/dist/gates/gate-rule-globs.js +139 -0
  330. package/dist/gates/gate-rule-view.d.ts +25 -6
  331. package/dist/gates/gate-rule-view.d.ts.map +1 -1
  332. package/dist/gates/gate-rule-view.js +105 -77
  333. package/dist/gates/i-coverage-dead-glob.d.ts +19 -0
  334. package/dist/gates/i-coverage-dead-glob.d.ts.map +1 -0
  335. package/dist/gates/i-coverage-dead-glob.js +1 -0
  336. package/dist/gates/i-coverage-negation.d.ts +13 -0
  337. package/dist/gates/i-coverage-negation.d.ts.map +1 -0
  338. package/dist/gates/i-coverage-negation.js +1 -0
  339. package/dist/gates/i-registration-query-settle-input.d.ts +18 -0
  340. package/dist/gates/i-registration-query-settle-input.d.ts.map +1 -0
  341. package/dist/gates/i-registration-query-settle-input.js +1 -0
  342. package/dist/gates/i-unit-state-note-row.d.ts +16 -0
  343. package/dist/gates/i-unit-state-note-row.d.ts.map +1 -0
  344. package/dist/gates/i-unit-state-note-row.js +1 -0
  345. package/dist/gates/i-unit-state-notes.d.ts +32 -0
  346. package/dist/gates/i-unit-state-notes.d.ts.map +1 -0
  347. package/dist/gates/i-unit-state-notes.js +1 -0
  348. package/dist/gates/incomplete-registry-inventory.d.ts +19 -0
  349. package/dist/gates/incomplete-registry-inventory.d.ts.map +1 -0
  350. package/dist/gates/incomplete-registry-inventory.js +63 -0
  351. package/dist/gates/measure-registration-roles.d.ts +10 -0
  352. package/dist/gates/measure-registration-roles.d.ts.map +1 -0
  353. package/dist/gates/measure-registration-roles.js +9 -0
  354. package/dist/gates/plane-verdict.d.ts +14 -0
  355. package/dist/gates/plane-verdict.d.ts.map +1 -0
  356. package/dist/gates/plane-verdict.js +22 -0
  357. package/dist/gates/qualify-clean-for-units.d.ts +12 -0
  358. package/dist/gates/qualify-clean-for-units.d.ts.map +1 -0
  359. package/dist/gates/qualify-clean-for-units.js +18 -0
  360. package/dist/gates/registration-graph-verdict.d.ts +34 -0
  361. package/dist/gates/registration-graph-verdict.d.ts.map +1 -0
  362. package/dist/gates/registration-graph-verdict.js +70 -0
  363. package/dist/gates/registration-roles.d.ts +9 -0
  364. package/dist/gates/registration-roles.d.ts.map +1 -0
  365. package/dist/gates/registration-roles.js +1 -0
  366. package/dist/gates/registry-liveness.d.ts +11 -0
  367. package/dist/gates/registry-liveness.d.ts.map +1 -0
  368. package/dist/gates/registry-liveness.js +13 -0
  369. package/dist/gates/rule-coverage.d.ts +225 -4
  370. package/dist/gates/rule-coverage.d.ts.map +1 -1
  371. package/dist/gates/rule-coverage.js +610 -43
  372. package/dist/gates/run-gate-planes.d.ts +58 -0
  373. package/dist/gates/run-gate-planes.d.ts.map +1 -0
  374. package/dist/gates/run-gate-planes.js +403 -0
  375. package/dist/gates/scaffold-selftest.d.ts +56 -0
  376. package/dist/gates/scaffold-selftest.d.ts.map +1 -0
  377. package/dist/gates/scaffold-selftest.js +119 -0
  378. package/dist/gates/seam-rejected-rules.d.ts +28 -0
  379. package/dist/gates/seam-rejected-rules.d.ts.map +1 -0
  380. package/dist/gates/seam-rejected-rules.js +95 -0
  381. package/dist/gates/self-test-check.d.ts +29 -0
  382. package/dist/gates/self-test-check.d.ts.map +1 -0
  383. package/dist/gates/self-test-check.js +1 -0
  384. package/dist/gates/self-test-subject.d.ts +28 -0
  385. package/dist/gates/self-test-subject.d.ts.map +1 -0
  386. package/dist/gates/self-test-subject.js +1 -0
  387. package/dist/gates/self-test.d.ts +20 -0
  388. package/dist/gates/self-test.d.ts.map +1 -0
  389. package/dist/gates/self-test.js +82 -0
  390. package/dist/gates/settle-verdict.d.ts +14 -0
  391. package/dist/gates/settle-verdict.d.ts.map +1 -0
  392. package/dist/gates/settle-verdict.js +13 -0
  393. package/dist/gates/settled-verdict.d.ts +8 -0
  394. package/dist/gates/settled-verdict.d.ts.map +1 -0
  395. package/dist/gates/settled-verdict.js +1 -0
  396. package/dist/gates/template-registry-coverage.d.ts +18 -0
  397. package/dist/gates/template-registry-coverage.d.ts.map +1 -0
  398. package/dist/gates/template-registry-coverage.js +24 -0
  399. package/dist/gates/unit-state-notes.d.ts +40 -0
  400. package/dist/gates/unit-state-notes.d.ts.map +1 -0
  401. package/dist/gates/unit-state-notes.js +71 -0
  402. package/dist/gates/verdict-line.d.ts +18 -0
  403. package/dist/gates/verdict-line.d.ts.map +1 -0
  404. package/dist/gates/verdict-line.js +40 -0
  405. package/dist/graph/graph-reuse-lookup.d.ts +10 -0
  406. package/dist/graph/graph-reuse-lookup.d.ts.map +1 -0
  407. package/dist/graph/graph-reuse-lookup.js +41 -0
  408. package/dist/graph/index-behind-hint.d.ts +11 -0
  409. package/dist/graph/index-behind-hint.d.ts.map +1 -0
  410. package/dist/graph/index-behind-hint.js +27 -0
  411. package/dist/knowledge/knowledge-stale-gate-flags.d.ts +3 -0
  412. package/dist/knowledge/knowledge-stale-gate-flags.d.ts.map +1 -0
  413. package/dist/knowledge/knowledge-stale-gate-flags.js +1 -0
  414. package/dist/knowledge/knowledge-stale-gate-input.d.ts +3 -0
  415. package/dist/knowledge/knowledge-stale-gate-input.d.ts.map +1 -0
  416. package/dist/knowledge/knowledge-stale-gate-input.js +1 -0
  417. package/dist/knowledge/knowledge-stale-gate-result.d.ts +3 -0
  418. package/dist/knowledge/knowledge-stale-gate-result.d.ts.map +1 -0
  419. package/dist/knowledge/knowledge-stale-gate-result.js +1 -0
  420. package/dist/knowledge/knowledge-stale-gate.d.ts +10 -0
  421. package/dist/knowledge/knowledge-stale-gate.d.ts.map +1 -0
  422. package/dist/knowledge/knowledge-stale-gate.js +9 -0
  423. package/dist/main.d.ts.map +1 -1
  424. package/dist/main.js +204 -83
  425. package/dist/output/failure-hints.d.ts.map +1 -1
  426. package/dist/output/failure-hints.js +11 -9
  427. package/dist/output/rejected-entries-note.d.ts +57 -0
  428. package/dist/output/rejected-entries-note.d.ts.map +1 -0
  429. package/dist/output/rejected-entries-note.js +103 -0
  430. package/dist/output/stdout-is-pipe.d.ts +13 -0
  431. package/dist/output/stdout-is-pipe.d.ts.map +1 -0
  432. package/dist/output/stdout-is-pipe.js +21 -0
  433. package/dist/packs/stale-build-warning.d.ts +11 -0
  434. package/dist/packs/stale-build-warning.d.ts.map +1 -0
  435. package/dist/packs/stale-build-warning.js +23 -0
  436. package/dist/quality/run-quality.d.ts +123 -0
  437. package/dist/quality/run-quality.d.ts.map +1 -0
  438. package/dist/quality/run-quality.js +442 -0
  439. package/dist/schemas/json-schemas.d.ts +184 -3
  440. package/dist/schemas/json-schemas.d.ts.map +1 -1
  441. package/dist/schemas/json-schemas.js +113 -2
  442. package/dist/shrk.d.ts +3 -0
  443. package/dist/shrk.d.ts.map +1 -0
  444. package/dist/shrk.js +30 -0
  445. package/dist/surface/audience-applicability.d.ts +26 -0
  446. package/dist/surface/audience-applicability.d.ts.map +1 -0
  447. package/dist/surface/audience-applicability.js +60 -0
  448. package/dist/surface/catalog-command-safety.d.ts +18 -0
  449. package/dist/surface/catalog-command-safety.d.ts.map +1 -0
  450. package/dist/surface/catalog-command-safety.js +62 -0
  451. package/dist/surface/cli-command-resolver.d.ts +21 -0
  452. package/dist/surface/cli-command-resolver.d.ts.map +1 -0
  453. package/dist/surface/cli-command-resolver.js +87 -0
  454. package/dist/surface/command-dispatch-kind.d.ts +20 -0
  455. package/dist/surface/command-dispatch-kind.d.ts.map +1 -0
  456. package/dist/surface/command-dispatch-kind.js +20 -0
  457. package/dist/surface/command-index-entry.d.ts +40 -0
  458. package/dist/surface/command-index-entry.d.ts.map +1 -0
  459. package/dist/surface/command-index-entry.js +1 -0
  460. package/dist/surface/command-index.d.ts +77 -0
  461. package/dist/surface/command-index.d.ts.map +1 -0
  462. package/dist/surface/command-index.js +323 -0
  463. package/dist/surface/i-command-index.d.ts +22 -0
  464. package/dist/surface/i-command-index.d.ts.map +1 -0
  465. package/dist/surface/i-command-index.js +1 -0
  466. package/dist/surface/i-command-string-context.d.ts +20 -0
  467. package/dist/surface/i-command-string-context.d.ts.map +1 -0
  468. package/dist/surface/i-command-string-context.js +1 -0
  469. package/dist/surface/i-surface-denial.d.ts +13 -0
  470. package/dist/surface/i-surface-denial.d.ts.map +1 -0
  471. package/dist/surface/i-surface-denial.js +1 -0
  472. package/dist/surface/load-surface-context.d.ts +17 -1
  473. package/dist/surface/load-surface-context.d.ts.map +1 -1
  474. package/dist/surface/load-surface-context.js +48 -10
  475. package/dist/surface/not-enabled-error.d.ts +38 -4
  476. package/dist/surface/not-enabled-error.d.ts.map +1 -1
  477. package/dist/surface/not-enabled-error.js +96 -6
  478. package/dist/surface/profiles.d.ts +7 -0
  479. package/dist/surface/profiles.d.ts.map +1 -1
  480. package/dist/surface/resolve-command-string.d.ts +10 -0
  481. package/dist/surface/resolve-command-string.d.ts.map +1 -0
  482. package/dist/surface/resolve-command-string.js +572 -0
  483. package/dist/surface/surface-config-writer.d.ts +7 -2
  484. package/dist/surface/surface-config-writer.d.ts.map +1 -1
  485. package/dist/surface/surface-config-writer.js +25 -6
  486. package/dist/surface/surface-layer.d.ts +11 -0
  487. package/dist/surface/surface-layer.d.ts.map +1 -0
  488. package/dist/surface/surface-layer.js +11 -0
  489. package/dist/surface/surface-refusal-reason.d.ts +16 -0
  490. package/dist/surface/surface-refusal-reason.d.ts.map +1 -0
  491. package/dist/surface/surface-refusal-reason.js +16 -0
  492. package/dist/surface/surface-selector.d.ts +26 -0
  493. package/dist/surface/surface-selector.d.ts.map +1 -0
  494. package/dist/surface/surface-selector.js +42 -0
  495. package/dist/surface/surface-summary.d.ts +61 -18
  496. package/dist/surface/surface-summary.d.ts.map +1 -1
  497. package/dist/surface/surface-summary.js +147 -60
  498. package/dist/surface/tier.d.ts +85 -22
  499. package/dist/surface/tier.d.ts.map +1 -1
  500. package/dist/surface/tier.js +132 -30
  501. package/dist/usage/usage-log.d.ts +6 -1
  502. package/dist/usage/usage-log.d.ts.map +1 -1
  503. package/dist/usage/usage-log.js +7 -2
  504. package/dist/validation/run-validation-loop.d.ts +9 -0
  505. package/dist/validation/run-validation-loop.d.ts.map +1 -1
  506. package/dist/validation/run-validation-loop.js +14 -11
  507. package/dist/validation/typecheck-emitted.d.ts +8 -9
  508. package/dist/validation/typecheck-emitted.d.ts.map +1 -1
  509. package/dist/validation/typecheck-emitted.js +17 -97
  510. package/package.json +34 -34
@@ -0,0 +1,442 @@
1
+ import { withFileReadCache, withLexCache } from '@shrkcrft/boundaries';
2
+ import { DEAD_SELECTOR_CAUSES, formatUnitLiveness } from '@shrkcrft/core';
3
+ import { buildQualityReport, examineQualityGate, KNOWLEDGE_STALE_GATE_ID, QualityGateExamination, } from '@shrkcrft/inspector';
4
+ import { warmCliReferenceRegistries } from "../surface/cli-command-resolver.js";
5
+ import { ExitCode } from "../exit-codes.js";
6
+ import { GATE_PLANES } from "../gates/gate-rule-view.js";
7
+ import { runGatePlanes } from "../gates/run-gate-planes.js";
8
+ import { buildGateEnvelope } from "../gates/gate-envelope.js";
9
+ import { settleVerdict } from "../gates/settle-verdict.js";
10
+ import { buildGateCoverage, coverageDeadUnits, coverageWentLiveUnits, formatDeadUnits, reportsDeadGlobs, settleGateCoverage, withRejectedRules, } from "../gates/rule-coverage.js";
11
+ export const QUALITY_RUN_SCHEMA = 'sharkcraft.quality-run/v1';
12
+ /** The isolated repro command for each inspector-bundle gate. */
13
+ const INSPECTOR_REPRO = Object.freeze({
14
+ doctor: 'shrk doctor',
15
+ readiness: 'shrk doctor',
16
+ boundaries: 'shrk check boundaries',
17
+ coverage: 'shrk coverage',
18
+ drift: 'shrk drift',
19
+ 'context-tests': 'shrk test context',
20
+ 'agent-tests': 'shrk test agent',
21
+ packs: 'shrk packs doctor',
22
+ // Round 13: the item is `buildDeclaredXrefReport` — exactly what `self-config
23
+ // xrefs` prints. `self-config doctor` computes a different report (dead
24
+ // units, probes, rejections), so on a tree with no declared id the item
25
+ // said "skipped — none declared" while its repro exited 2 over dead units.
26
+ 'cross-references': 'shrk self-config xrefs',
27
+ });
28
+ /** At most this many unexamined gate ids ride on the run's coverage record. */
29
+ const COVERAGE_LABEL_CAP = 20;
30
+ /**
31
+ * Run EVERY configured gate to completion and report every failure.
32
+ *
33
+ * A CI job that chains gates as separate steps stops at the first failing step,
34
+ * so N independent failures cost N round-trips to discover — the classic case
35
+ * being a first-ever run on a long-lived branch, where fixing gate A only
36
+ * reveals gate B. The default here is therefore exhaustive: the point is to
37
+ * surface the whole backlog in one local pass. `failFast` is available for the
38
+ * opposite, CI-like behaviour, and says so in the report rather than making the
39
+ * remaining gates look clean.
40
+ */
41
+ export async function runQuality(input) {
42
+ const items = [];
43
+ const diagnostics = [...(input.planeDiagnostics ?? [])];
44
+ // Warm the shared reference registry WITH the command resolver BEFORE any
45
+ // bundle gate reads it. The agent-test gate resolves `expectedCommands`
46
+ // through it: warmed bare (the inspector cannot build the command index), a
47
+ // correct `shrk doctor` read as NOT VERIFIED here while `shrk test agent`
48
+ // passed it — the aggregate and the verb disagreeing about one test.
49
+ try {
50
+ await warmCliReferenceRegistries(input.inspection);
51
+ }
52
+ catch (e) {
53
+ diagnostics.push(`could not warm the reference registries: ${e.message}`);
54
+ }
55
+ const report = await buildQualityReport({
56
+ inspection: input.inspection,
57
+ config: input.config,
58
+ strict: input.strict,
59
+ ...(input.changedFiles ? { changedFiles: input.changedFiles } : {}),
60
+ // This bundle runs the seven planes below, so the report must not add its
61
+ // not-run `gate-planes` row.
62
+ callerRunsGatePlanes: true,
63
+ });
64
+ // The knowledge stale-check row is THE gate MCP / the dashboard read too; it
65
+ // becomes this bundle's item after the fail-fast check below, as before.
66
+ let knowledgeGate;
67
+ for (const g of report.gates) {
68
+ if (g.id === KNOWLEDGE_STALE_GATE_ID) {
69
+ knowledgeGate = g;
70
+ continue;
71
+ }
72
+ // A gate that ran over NOTHING (zero context tests, zero boundary rules)
73
+ // reports `passed` from a zero failure count, which is not a pass. It is a
74
+ // skip: DELIBERATE when the gate is optional (so a repo without context
75
+ // tests still goes green), accidental — NOT verified — when it is required.
76
+ // THE classification of a gate's run (`examineQualityGate`), the same one
77
+ // the inspector derives `IQualityReport.overall` from, so MCP / the
78
+ // dashboard and this bundle cannot disagree about a gate. A gate that ran
79
+ // over NOTHING (zero context tests, zero boundary rules) is a skip:
80
+ // deliberate when optional, NOT verified when required. A gate that found
81
+ // nothing wrong over PART of its scope is an accidental skip too.
82
+ const exam = examineQualityGate(g);
83
+ const examinedNothing = g.executed && g.data?.['examinedNothing'] === true;
84
+ const partial = g.executed && !examinedNothing && exam === QualityGateExamination.Unexamined;
85
+ const status = !g.executed
86
+ ? 'error'
87
+ : exam !== QualityGateExamination.Examined
88
+ ? 'skipped'
89
+ : g.passed
90
+ ? 'passed'
91
+ : 'failed';
92
+ items.push({
93
+ id: g.id,
94
+ label: g.label,
95
+ status,
96
+ severity: g.blocking ? 'error' : 'warning',
97
+ notes: examinedNothing
98
+ ? [
99
+ ...g.notes,
100
+ g.blocking
101
+ ? 'examined nothing — this gate is required, so it is NOT verified'
102
+ : 'examined nothing — optional, so skipped (never counted as a pass)',
103
+ ]
104
+ : g.notes,
105
+ repro: INSPECTOR_REPRO[g.id] ?? 'shrk quality',
106
+ ...(examinedNothing ? { skippedDeliberately: !g.blocking } : {}),
107
+ ...(partial && !examinedNothing ? { partial: true } : {}),
108
+ ...(g.data ? { data: g.data } : {}),
109
+ });
110
+ }
111
+ const stopNow = () => input.failFast && items.some((i) => i.status === 'failed' && i.severity === 'error');
112
+ // The knowledge corpus verdict, through the SAME gate `shrk knowledge
113
+ // stale-check` settles — so the pre-push bundle and the verb cannot disagree
114
+ // (an unverifiable entry keeps both off `pass`) — read from the report's own
115
+ // row, the one MCP `get_quality_report` and the dashboard read.
116
+ if (!stopNow() && knowledgeGate)
117
+ items.push(knowledgeStaleItem(knowledgeGate));
118
+ // The seven data-defined planes. Without them the "before you push" command
119
+ // does not run the rules the repo actually declared, which is the gap that
120
+ // makes `gates check` a separate step people forget.
121
+ // A pack rule the merge seam rejected is a configured rule that did NOT run:
122
+ // a FAILED item (a config failure blocks, as in `gates check`), and an
123
+ // errored row of the coverage item (round 12 review, R12-X1).
124
+ const rejectedRules = input.rejectedRules ?? [];
125
+ const rejectedKeys = new Set(rejectedRules.map((r) => `${r.type}:${r.id}`));
126
+ const hasPlaneRules = input.gateRules.length > 0 || rejectedRules.length > 0;
127
+ if (hasPlaneRules && !stopNow()) {
128
+ // ONE lex window and ONE read window around the plane check AND the
129
+ // coverage pass (round 11 review: the coverage item re-walked, re-read and
130
+ // re-lexed every file the plane run had just read — ~0.4s on this repo).
131
+ // The lex memo is keyed by CONTENT, so it can never be stale; the read memo
132
+ // is exact because every spawn site (`compute.run`, `regen`) clears it
133
+ // right after the child exits.
134
+ withLexCache(() => withFileReadCache(() => {
135
+ const planeRun = input.gateRules.length > 0
136
+ ? runGatePlanes(input.gateRules, {
137
+ cwd: input.cwd,
138
+ excludeDirs: input.excludeDirs,
139
+ ...(input.changedFiles ? { changedFiles: input.changedFiles } : {}),
140
+ inspection: input.inspection,
141
+ })
142
+ : { results: [], diagnostics: [] };
143
+ diagnostics.push(...planeRun.diagnostics);
144
+ const results = [...planeRun.results, ...rejectedRules];
145
+ // `partial` is derived in ONE place — the envelope builder — so quality
146
+ // marks a rule partial exactly when `gates check` does.
147
+ const settledRules = buildGateEnvelope('quality', ExitCode.VerifiedPass, results, {
148
+ unit: 'rules',
149
+ expected: results.length,
150
+ examined: results.length,
151
+ }).rules;
152
+ for (const plane of GATE_PLANES) {
153
+ for (const r of settledRules.filter((x) => x.type === plane)) {
154
+ const item = planeItem(plane, r, input.strict);
155
+ items.push(rejectedKeys.has(`${plane}:${r.id}`)
156
+ ? { ...item, status: 'failed', severity: 'error', repro: 'shrk packs contributions' }
157
+ : item);
158
+ }
159
+ }
160
+ // The stale-selector detector and every rule's selfTest — what `gates
161
+ // coverage` concludes. Without it "the before-you-push gate" passed a
162
+ // rule whose selfTest was broken, because only `gates coverage`
163
+ // evaluates one.
164
+ items.push(stopNow() ? coverageNotRun() : gatesCoverageItem(input, results));
165
+ }));
166
+ }
167
+ else if (hasPlaneRules) {
168
+ for (const r of rejectedRules) {
169
+ items.push({
170
+ id: `${r.type}:${r.id}`,
171
+ label: `[${r.type}] ${r.id}`,
172
+ status: 'failed',
173
+ severity: 'error',
174
+ notes: [r.error ?? 'failed validation at the pack-plane merge seam — NOT evaluated'],
175
+ repro: 'shrk packs contributions',
176
+ });
177
+ }
178
+ for (const r of input.gateRules) {
179
+ items.push({
180
+ id: `${r.plane}:${r.id}`,
181
+ label: `[${r.plane}] ${r.id}`,
182
+ status: 'skipped',
183
+ severity: 'warning',
184
+ notes: ['not run — an earlier gate failed under --fail-fast'],
185
+ repro: `shrk gates check --only ${r.id}`,
186
+ skippedDeliberately: true,
187
+ });
188
+ }
189
+ items.push(coverageNotRun());
190
+ }
191
+ for (const r of input.skippedByScope ?? []) {
192
+ items.push({
193
+ id: `${r.plane}:${r.id}`,
194
+ label: `[${r.plane}] ${r.id}`,
195
+ status: 'skipped',
196
+ severity: 'warning',
197
+ notes: ['outside the changeset'],
198
+ repro: `shrk gates check --only ${r.id}`,
199
+ skippedDeliberately: true,
200
+ });
201
+ }
202
+ const failed = items.filter((i) => i.status === 'failed' && i.severity === 'error').length;
203
+ const failedWarnings = items.filter((i) => i.status === 'failed' && i.severity !== 'error').length;
204
+ const errored = items.filter((i) => i.status === 'error').length;
205
+ const evaluated = items.filter((i) => i.status === 'passed' || i.status === 'failed').length;
206
+ const deliberate = items.filter((i) => i.status === 'skipped' && i.skippedDeliberately === true).length;
207
+ const unexamined = items.filter((i) => i.status === 'error' || (i.status === 'skipped' && i.skippedDeliberately !== true));
208
+ // The verdict goes through the one guard every verdict verb uses: a blocking
209
+ // failure is `fail`; otherwise any gate that errored, skipped by accident or
210
+ // passed over part of its scope — or a run that examined nothing at all — is
211
+ // a coverage shortfall, which can never settle to `pass`.
212
+ const coverage = {
213
+ unit: 'gates',
214
+ expected: items.length - deliberate,
215
+ examined: evaluated,
216
+ ...(unexamined.length > 0
217
+ ? {
218
+ unexamined: unexamined.slice(0, COVERAGE_LABEL_CAP).map((i) => i.id),
219
+ unexaminedTotal: unexamined.length,
220
+ reason: unexamined.some((i) => i.partial === true)
221
+ ? 'could not run, examined nothing, or examined only part of their scope'
222
+ : 'could not run, or examined nothing',
223
+ }
224
+ : {}),
225
+ };
226
+ const settled = settleVerdict(failed > 0 ? ExitCode.Failure : ExitCode.VerifiedPass, [coverage]);
227
+ const verdict = settled.verdict === 'pass' ? 'pass' : settled.verdict === 'not-verified' ? 'not-verified' : 'fail';
228
+ return {
229
+ schema: QUALITY_RUN_SCHEMA,
230
+ items,
231
+ passed: items.filter((i) => i.status === 'passed').length,
232
+ failed,
233
+ failedWarnings,
234
+ skipped: items.filter((i) => i.status === 'skipped').length,
235
+ errored,
236
+ evaluated,
237
+ verdict,
238
+ exit: settled.exit,
239
+ coverage,
240
+ shortfalls: settled.shortfalls,
241
+ accepted: settled.accepted,
242
+ ...(input.changedFiles ? { scopedFiles: input.changedFiles.length } : {}),
243
+ failFast: input.failFast,
244
+ diagnostics,
245
+ };
246
+ }
247
+ const COVERAGE_ITEM_ID = 'gates-coverage';
248
+ const COVERAGE_ITEM_LABEL = 'Gate-rule coverage — stale selectors + selfTest';
249
+ /**
250
+ * `gates coverage` as one bundle item: stale selectors, every rule's selfTest,
251
+ * partial rules. Settled by `settleGateCoverage` — the derivation the verb
252
+ * itself uses — so this item and `shrk gates coverage` cannot disagree. Dead
253
+ * globs inside connected rules ride along as advisory notes, exactly as they
254
+ * are advisory in the verb without `--fail-on-dead-units`.
255
+ *
256
+ * A rule coverage cannot inspect without a side effect (`inspectable: false`,
257
+ * e.g. a `command` baseline with no `watchFiles`) is settled on the coverage
258
+ * its plane CHECK reported in this same run. That check spawned the command and
259
+ * examined it. Reading coverage's "could not inspect" as "unverified" would
260
+ * leave a healthy rule a permanent `2`, with this item and the rule's own plane
261
+ * item contradicting each other about one rule. A selfTest such a rule can
262
+ * never evaluate stays a misconfiguration (`1`): its status is untouched.
263
+ */
264
+ function gatesCoverageItem(input, planeResults) {
265
+ // Rules arrive with `$use` already resolved; the shared-extractor section of
266
+ // the report is not read here, so no extractor map is needed.
267
+ const built = withRejectedRules(buildGateCoverage(input.cwd, input.gateRules, input.excludeDirs, {}, false, input.inspection), input.rejectedRules ?? []);
268
+ const checked = new Map(planeResults.map((r) => [`${r.type}:${r.id}`, r.coverage]));
269
+ const settledOnCheck = [];
270
+ const report = {
271
+ ...built,
272
+ rules: built.rules.map((r) => {
273
+ const fromCheck = r.inspectable === false ? checked.get(`${r.plane}:${r.id}`) : undefined;
274
+ if (!fromCheck)
275
+ return r;
276
+ settledOnCheck.push(`[${r.plane}] ${r.id}`);
277
+ return { ...r, coverage: fromCheck };
278
+ }),
279
+ };
280
+ const env = settleGateCoverage(report);
281
+ const notes = [];
282
+ const noticed = new Set();
283
+ // A rule its own negations emptied is not stale — its skipReason says why.
284
+ const emptiedByNegations = new Set(report.rules.filter((r) => r.excludedByNegations !== undefined).map((r) => `${r.plane}:${r.id}`));
285
+ for (const r of env.rules) {
286
+ if (r.status === 'passed')
287
+ continue;
288
+ noticed.add(r.id);
289
+ const lead = `[${r.type}] ${r.id}`;
290
+ if (r.status === 'partial') {
291
+ notes.push(`${lead} — PARTIAL: ${r.shortfall ?? 'examined less than its scope'}`);
292
+ }
293
+ else if (r.status === 'skipped') {
294
+ notes.push(`${lead} — ${r.skipReason ?? 'matched nothing'}` +
295
+ (emptiedByNegations.has(`${r.type}:${r.id}`) ? '' : '; the selector is probably stale'));
296
+ }
297
+ else if (r.status === 'error') {
298
+ notes.push(`${lead} — ${r.error ?? 'could not run'}`);
299
+ }
300
+ else if (r.violations.length > 0) {
301
+ for (const v of r.violations)
302
+ notes.push(`${lead} — selfTest: ${v.message ?? v.id}`);
303
+ }
304
+ else {
305
+ notes.push(`${lead} — ${r.skipReason ?? 'failed'}`);
306
+ }
307
+ }
308
+ for (const r of report.rules) {
309
+ // The same predicate `gates coverage` counts and draws with: a rule already
310
+ // reported as matching nothing gets no second, advisory note.
311
+ if (!reportsDeadGlobs(r))
312
+ continue;
313
+ // Worded by the one formatter `gates coverage` prints with, so a dead
314
+ // negation reads "excludes nothing", never "matched 0 files".
315
+ const dead = coverageDeadUnits(r);
316
+ // …with the one causes sentence (round 13 review): a note has no footer,
317
+ // so it carries `DEAD_SELECTOR_CAUSES` itself, as `check boundaries` does.
318
+ notes.push(`[${r.plane}] ${r.id} — advisory: ${dead.length} dead glob(s): ${formatDeadUnits(dead)} — ${DEAD_SELECTOR_CAUSES}`);
319
+ }
320
+ // Round 13 (lane G): a glob marked `expectEmpty` whose target now exists —
321
+ // the fence went live — is an ADVISORY note here, worded by the one
322
+ // per-unit formatter; quality never fails on a selector unit (`gates
323
+ // coverage --fail-on-dead-units` does, for a local marker). A PACK marker is
324
+ // INFO (round 13 review), as `check boundaries` prints it.
325
+ for (const r of report.rules) {
326
+ for (const u of coverageWentLiveUnits(r)) {
327
+ const tag = u.mark?.packageName !== undefined ? 'info' : 'advisory';
328
+ notes.push(`[${r.plane}] ${r.id} — ${tag}: ${formatUnitLiveness(u, { causes: false })}`);
329
+ }
330
+ }
331
+ // …and every intended-empty unit it ACCEPTED is printed, never silent — the
332
+ // settled acceptance lines (non-empty only when the item passed).
333
+ for (const a of env.accepted)
334
+ notes.push(`accepted: ${a}`);
335
+ for (const label of settledOnCheck) {
336
+ notes.push(`${label} — coverage cannot inspect it without running it; settled on its plane check in this run`);
337
+ }
338
+ return {
339
+ id: COVERAGE_ITEM_ID,
340
+ label: COVERAGE_ITEM_LABEL,
341
+ status: env.exit === ExitCode.Failure ? 'failed' : env.exit === ExitCode.VerifiedPass ? 'passed' : 'skipped',
342
+ // A broken selfTest blocks whatever --strict says, as it does in the verb.
343
+ severity: 'error',
344
+ notes,
345
+ repro: noticed.size > 0 ? `shrk gates coverage --only ${[...noticed].join(',')}` : 'shrk gates coverage',
346
+ data: {
347
+ rules: report.total,
348
+ empty: report.empty,
349
+ errored: report.errored,
350
+ expectationFailures: report.expectationFailures,
351
+ deadGlobs: report.deadGlobCount,
352
+ },
353
+ };
354
+ }
355
+ /** The coverage item when `--fail-fast` stopped the run before it. */
356
+ function coverageNotRun() {
357
+ return {
358
+ id: COVERAGE_ITEM_ID,
359
+ label: COVERAGE_ITEM_LABEL,
360
+ status: 'skipped',
361
+ severity: 'warning',
362
+ notes: ['not run — an earlier gate failed under --fail-fast'],
363
+ repro: 'shrk gates coverage',
364
+ skippedDeliberately: true,
365
+ };
366
+ }
367
+ /** Map one plane rule result onto a bundle item, with its isolated repro verb. */
368
+ function planeItem(plane, r, strict) {
369
+ const notes = [];
370
+ if (r.status === 'skipped' && r.skipReason)
371
+ notes.push(`SKIPPED — ${r.skipReason}`);
372
+ // A rule that passed over PART of its scope proved nothing about the rest, so
373
+ // here it is an accidental skip: the verdict cannot be `pass` over it.
374
+ if (r.status === 'partial' && r.shortfall)
375
+ notes.push(`PARTIAL — ${r.shortfall}`);
376
+ if (r.error)
377
+ notes.push(r.error);
378
+ for (const v of r.violations.slice(0, 5)) {
379
+ const at = v.file ? ` (${v.file}${v.line !== undefined ? `:${v.line}` : ''})` : '';
380
+ notes.push(`${v.id}${at}${v.message ? ` — ${v.message}` : ''}`);
381
+ }
382
+ if (r.violations.length > 5)
383
+ notes.push(`… ${r.violations.length - 5} more`);
384
+ return {
385
+ id: `${plane}:${r.id}`,
386
+ label: `[${plane}] ${r.id}`,
387
+ status: r.status === 'partial' ? 'skipped' : r.status,
388
+ ...(r.status === 'partial' ? { partial: true } : {}),
389
+ severity: strict || r.severity === 'error' ? 'error' : 'warning',
390
+ notes,
391
+ // `gates explain` resolves a rule id across EVERY plane, so one form works
392
+ // for all seven and the developer never has to know which verb owns it.
393
+ repro: `shrk gates explain ${r.id}`,
394
+ ...(Object.keys(r.counts).length > 0 ? { data: { ...r.counts } } : {}),
395
+ };
396
+ }
397
+ /**
398
+ * The knowledge stale-check as one bundle item — the report's own
399
+ * `knowledge-stale` row (`knowledgeStaleQualityGate`, decided by the SAME gate
400
+ * the verb settles), mapped onto the item shape. Nothing is re-derived here, so
401
+ * this item, MCP `get_quality_report` and the dashboard read one answer.
402
+ *
403
+ * An empty corpus (or a changeset no entry references) is a DELIBERATE skip —
404
+ * a missing `sharkcraft/` folder or a broken config is the doctor gate's
405
+ * finding. Any unverifiable entry that no `knowledgeCheck.minReferenced` floor
406
+ * accepts is an ACCIDENTAL skip: the run cannot settle to `pass` over it.
407
+ */
408
+ function knowledgeStaleItem(g) {
409
+ const base = {
410
+ id: g.id,
411
+ label: g.label,
412
+ severity: 'error',
413
+ repro: 'shrk knowledge stale-check',
414
+ };
415
+ const skip = g.data?.['skip'];
416
+ if (skip === 'empty-corpus') {
417
+ return { ...base, status: 'skipped', notes: g.notes, skippedDeliberately: true, data: { examinedNothing: true } };
418
+ }
419
+ if (skip === 'out-of-changeset') {
420
+ return {
421
+ ...base,
422
+ status: 'skipped',
423
+ notes: g.notes,
424
+ repro: 'shrk knowledge stale-check --changed-only',
425
+ skippedDeliberately: true,
426
+ };
427
+ }
428
+ if (!g.executed)
429
+ return { ...base, status: 'error', notes: g.notes };
430
+ const exit = g.data?.['settledExit'];
431
+ return {
432
+ ...base,
433
+ status: exit === ExitCode.VerifiedPass ? 'passed' : exit === ExitCode.Failure ? 'failed' : 'skipped',
434
+ notes: g.notes,
435
+ ...(exit === ExitCode.NotVerified ? { skippedDeliberately: false } : {}),
436
+ data: {
437
+ coverage: g.data?.['coverage'],
438
+ unverifiableIds: g.data?.['unverifiableIds'],
439
+ failureCounts: g.data?.['failureCounts'],
440
+ },
441
+ };
442
+ }
@@ -420,9 +420,115 @@ export declare const KnowledgeEntrySchema: {
420
420
  readonly summary: {
421
421
  readonly type: "string";
422
422
  };
423
+ readonly related: {
424
+ readonly type: "array";
425
+ readonly items: {
426
+ readonly type: "string";
427
+ };
428
+ };
429
+ readonly seeAlso: {
430
+ readonly type: "array";
431
+ readonly items: {
432
+ readonly type: "string";
433
+ };
434
+ };
435
+ readonly supersededBy: {
436
+ readonly type: "array";
437
+ readonly items: {
438
+ readonly type: "string";
439
+ };
440
+ };
423
441
  readonly actionHints: {
424
442
  readonly $ref: "action-hints.json";
425
443
  };
444
+ readonly references: {
445
+ readonly type: "array";
446
+ readonly items: {
447
+ readonly type: "object";
448
+ readonly required: readonly ["kind"];
449
+ readonly properties: {
450
+ readonly kind: {
451
+ readonly enum: readonly ["file", "directory", "symbol", "command", "template", "playbook", "construct", "helper", "policy", "boundary-rule", "path-convention", "package", "url"];
452
+ };
453
+ readonly path: {
454
+ readonly type: "string";
455
+ };
456
+ readonly symbol: {
457
+ readonly type: "string";
458
+ };
459
+ readonly id: {
460
+ readonly type: "string";
461
+ };
462
+ readonly command: {
463
+ readonly type: "string";
464
+ };
465
+ readonly required: {
466
+ readonly type: "boolean";
467
+ };
468
+ readonly note: {
469
+ readonly type: "string";
470
+ };
471
+ readonly contains: {
472
+ readonly type: "string";
473
+ readonly minLength: 1;
474
+ };
475
+ readonly matches: {
476
+ readonly type: "string";
477
+ readonly minLength: 1;
478
+ };
479
+ readonly scan: {
480
+ readonly enum: readonly ["all", "code", "strings", "comments", "code-and-templates"];
481
+ };
482
+ readonly count: {
483
+ readonly type: "object";
484
+ readonly required: readonly ["source", "expected"];
485
+ readonly properties: {
486
+ readonly source: {
487
+ readonly type: "object";
488
+ };
489
+ readonly expected: {
490
+ readonly type: "integer";
491
+ readonly minimum: 0;
492
+ };
493
+ readonly measure: {
494
+ readonly enum: readonly ["ids", "sites"];
495
+ };
496
+ };
497
+ };
498
+ };
499
+ };
500
+ };
501
+ readonly anchors: {
502
+ readonly type: "array";
503
+ readonly items: {
504
+ readonly type: "object";
505
+ readonly required: readonly ["id", "kind"];
506
+ readonly properties: {
507
+ readonly id: {
508
+ readonly type: "string";
509
+ };
510
+ readonly kind: {
511
+ readonly enum: readonly ["file", "symbol", "command", "construct", "template", "helper", "playbook", "policy"];
512
+ };
513
+ readonly path: {
514
+ readonly type: "string";
515
+ };
516
+ readonly symbol: {
517
+ readonly type: "string";
518
+ };
519
+ readonly targetId: {
520
+ readonly type: "string";
521
+ };
522
+ readonly description: {
523
+ readonly type: "string";
524
+ };
525
+ };
526
+ };
527
+ };
528
+ readonly verifiedOn: {
529
+ readonly type: "string";
530
+ readonly pattern: "^\\d{4}-\\d{2}-\\d{2}$";
531
+ };
426
532
  };
427
533
  };
428
534
  export declare const AdoptionStateSchema: {
@@ -943,10 +1049,29 @@ export declare const ScaffoldPatternSchema: {
943
1049
  };
944
1050
  readonly matchPaths: {
945
1051
  readonly type: "array";
1052
+ readonly minItems: 1;
946
1053
  readonly items: {
947
- readonly type: "string";
1054
+ readonly oneOf: readonly [{
1055
+ readonly type: "string";
1056
+ }, {
1057
+ readonly type: "object";
1058
+ readonly required: readonly ["pattern", "expectEmpty"];
1059
+ readonly additionalProperties: false;
1060
+ readonly properties: {
1061
+ readonly pattern: {
1062
+ readonly type: "string";
1063
+ readonly minLength: 1;
1064
+ };
1065
+ readonly expectEmpty: {
1066
+ readonly const: true;
1067
+ };
1068
+ readonly reason: {
1069
+ readonly type: "string";
1070
+ readonly minLength: 1;
1071
+ };
1072
+ };
1073
+ }];
948
1074
  };
949
- readonly minItems: 1;
950
1075
  };
951
1076
  readonly excludePaths: {
952
1077
  readonly type: "array";
@@ -1063,7 +1188,7 @@ export declare const QualityReportSchema: {
1063
1188
  readonly required: readonly ["overall", "gates", "score"];
1064
1189
  readonly properties: {
1065
1190
  readonly overall: {
1066
- readonly enum: readonly ["pass", "warn", "fail"];
1191
+ readonly enum: readonly ["pass", "warn", "fail", "not-verified"];
1067
1192
  };
1068
1193
  readonly blockers: {
1069
1194
  readonly type: "integer";
@@ -1092,6 +1217,15 @@ export declare const QualityReportSchema: {
1092
1217
  readonly type: "string";
1093
1218
  };
1094
1219
  };
1220
+ readonly coverage: {
1221
+ readonly type: "object";
1222
+ };
1223
+ readonly shortfalls: {
1224
+ readonly type: "array";
1225
+ readonly items: {
1226
+ readonly type: "string";
1227
+ };
1228
+ };
1095
1229
  };
1096
1230
  };
1097
1231
  export declare const SafetyAuditSchema: {
@@ -1540,6 +1674,34 @@ export declare const AreaMapSchema: {
1540
1674
  readonly unclassifiedFiles: {
1541
1675
  readonly type: "integer";
1542
1676
  };
1677
+ readonly totalFiles: {
1678
+ readonly type: "integer";
1679
+ };
1680
+ readonly classifiedFiles: {
1681
+ readonly type: "integer";
1682
+ };
1683
+ readonly classificationRate: {
1684
+ readonly type: "number";
1685
+ readonly minimum: 0;
1686
+ readonly maximum: 1;
1687
+ };
1688
+ readonly minClassificationRate: {
1689
+ readonly type: "number";
1690
+ readonly minimum: 0;
1691
+ readonly maximum: 1;
1692
+ };
1693
+ readonly degraded: {
1694
+ readonly type: "boolean";
1695
+ };
1696
+ readonly unclassifiedSample: {
1697
+ readonly type: "array";
1698
+ readonly items: {
1699
+ readonly type: "string";
1700
+ };
1701
+ };
1702
+ readonly patternSource: {
1703
+ readonly enum: readonly ["built-in", "config", "config+built-in"];
1704
+ };
1543
1705
  };
1544
1706
  };
1545
1707
  export declare const ImpactAnalysisSchema: {
@@ -1564,6 +1726,25 @@ export declare const ImpactAnalysisSchema: {
1564
1726
  readonly affectedAreas: {
1565
1727
  readonly type: "array";
1566
1728
  };
1729
+ readonly areaCoverage: {
1730
+ readonly type: "object";
1731
+ readonly properties: {
1732
+ readonly classificationRate: {
1733
+ readonly type: "number";
1734
+ readonly minimum: 0;
1735
+ readonly maximum: 1;
1736
+ };
1737
+ readonly degraded: {
1738
+ readonly type: "boolean";
1739
+ };
1740
+ readonly unclassifiedTargets: {
1741
+ readonly type: "array";
1742
+ readonly items: {
1743
+ readonly type: "string";
1744
+ };
1745
+ };
1746
+ };
1747
+ };
1567
1748
  };
1568
1749
  };
1569
1750
  export declare const TestImpactSchema: {