@shrkcrft/inspector 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 (694) hide show
  1. package/dist/acceptance-replay.js +1 -1
  2. package/dist/agent-contract-templates.js +6 -6
  3. package/dist/agent-contract.d.ts.map +1 -1
  4. package/dist/agent-contract.js +13 -8
  5. package/dist/agent-orchestration.js +2 -2
  6. package/dist/agent-task-prep.d.ts +16 -0
  7. package/dist/agent-task-prep.d.ts.map +1 -1
  8. package/dist/agent-task-prep.js +51 -4
  9. package/dist/ai-readiness.d.ts.map +1 -1
  10. package/dist/ai-readiness.js +21 -3
  11. package/dist/architecture-map.d.ts +16 -0
  12. package/dist/architecture-map.d.ts.map +1 -1
  13. package/dist/architecture-map.js +42 -26
  14. package/dist/area-explore.d.ts +2 -2
  15. package/dist/area-explore.d.ts.map +1 -1
  16. package/dist/area-explore.js +36 -16
  17. package/dist/area-map.d.ts +56 -11
  18. package/dist/area-map.d.ts.map +1 -1
  19. package/dist/area-map.js +106 -25
  20. package/dist/asset-doctor-proposed-exit.d.ts +21 -0
  21. package/dist/asset-doctor-proposed-exit.d.ts.map +1 -0
  22. package/dist/asset-doctor-proposed-exit.js +22 -0
  23. package/dist/asset-provenance.js +1 -1
  24. package/dist/boundaries-changed-only.d.ts +24 -1
  25. package/dist/boundaries-changed-only.d.ts.map +1 -1
  26. package/dist/boundaries-changed-only.js +12 -2
  27. package/dist/boundary-check-options.model.d.ts +40 -0
  28. package/dist/boundary-check-options.model.d.ts.map +1 -0
  29. package/dist/boundary-check-options.model.js +1 -0
  30. package/dist/boundary-check-result.model.d.ts +89 -0
  31. package/dist/boundary-check-result.model.d.ts.map +1 -0
  32. package/dist/boundary-check-result.model.js +1 -0
  33. package/dist/boundary-configuration-status.d.ts +38 -0
  34. package/dist/boundary-configuration-status.d.ts.map +1 -0
  35. package/dist/boundary-configuration-status.js +118 -0
  36. package/dist/boundary-configuration-status.model.d.ts +37 -0
  37. package/dist/boundary-configuration-status.model.d.ts.map +1 -0
  38. package/dist/boundary-configuration-status.model.js +1 -0
  39. package/dist/boundary-load-issue.model.d.ts +30 -0
  40. package/dist/boundary-load-issue.model.d.ts.map +1 -0
  41. package/dist/boundary-load-issue.model.js +1 -0
  42. package/dist/boundary-rule-check.model.d.ts +44 -0
  43. package/dist/boundary-rule-check.model.d.ts.map +1 -0
  44. package/dist/boundary-rule-check.model.js +1 -0
  45. package/dist/boundary-rule-invalidation.model.d.ts +31 -0
  46. package/dist/boundary-rule-invalidation.model.d.ts.map +1 -0
  47. package/dist/boundary-rule-invalidation.model.js +1 -0
  48. package/dist/boundary-rule-set-diff.model.d.ts +75 -0
  49. package/dist/boundary-rule-set-diff.model.d.ts.map +1 -0
  50. package/dist/boundary-rule-set-diff.model.js +1 -0
  51. package/dist/boundary-rule-sources.d.ts +28 -0
  52. package/dist/boundary-rule-sources.d.ts.map +1 -0
  53. package/dist/boundary-rule-sources.js +110 -0
  54. package/dist/boundary-stale-exception-finding.model.d.ts +12 -0
  55. package/dist/boundary-stale-exception-finding.model.d.ts.map +1 -0
  56. package/dist/boundary-stale-exception-finding.model.js +1 -0
  57. package/dist/boundary-unit-liveness.d.ts +35 -0
  58. package/dist/boundary-unit-liveness.d.ts.map +1 -0
  59. package/dist/boundary-unit-liveness.js +71 -0
  60. package/dist/change-intent.d.ts +3 -0
  61. package/dist/change-intent.d.ts.map +1 -1
  62. package/dist/change-intent.js +61 -27
  63. package/dist/changes-summary.d.ts.map +1 -1
  64. package/dist/changes-summary.js +19 -9
  65. package/dist/ci-integrity-report.js +1 -1
  66. package/dist/ci-predict.d.ts.map +1 -1
  67. package/dist/ci-predict.js +38 -5
  68. package/dist/code-intelligence-doctor.d.ts +40 -0
  69. package/dist/code-intelligence-doctor.d.ts.map +1 -1
  70. package/dist/code-intelligence-doctor.js +86 -12
  71. package/dist/command-recommender.d.ts +45 -2
  72. package/dist/command-recommender.d.ts.map +1 -1
  73. package/dist/command-recommender.js +41 -263
  74. package/dist/command-resolution-status.d.ts +44 -0
  75. package/dist/command-resolution-status.d.ts.map +1 -0
  76. package/dist/command-resolution-status.js +44 -0
  77. package/dist/command-safety-level.d.ts +15 -0
  78. package/dist/command-safety-level.d.ts.map +1 -0
  79. package/dist/command-safety-level.js +43 -0
  80. package/dist/command-taxonomy.js +1 -1
  81. package/dist/compliance-evidence.js +1 -1
  82. package/dist/compliance-profiles.js +1 -1
  83. package/dist/construct-registry.d.ts +40 -0
  84. package/dist/construct-registry.d.ts.map +1 -1
  85. package/dist/construct-registry.js +186 -82
  86. package/dist/context-tuning.d.ts +4 -0
  87. package/dist/context-tuning.d.ts.map +1 -1
  88. package/dist/context-tuning.js +10 -7
  89. package/dist/contract-template-registry.d.ts +10 -0
  90. package/dist/contract-template-registry.d.ts.map +1 -1
  91. package/dist/contract-template-registry.js +59 -33
  92. package/dist/contribution-kind.d.ts +52 -0
  93. package/dist/contribution-kind.d.ts.map +1 -0
  94. package/dist/contribution-kind.js +52 -0
  95. package/dist/contribution-load-failures.d.ts +106 -0
  96. package/dist/contribution-load-failures.d.ts.map +1 -0
  97. package/dist/contribution-load-failures.js +575 -0
  98. package/dist/contributions-report.d.ts +28 -0
  99. package/dist/contributions-report.d.ts.map +1 -0
  100. package/dist/contributions-report.js +242 -0
  101. package/dist/convention-registry.d.ts +22 -0
  102. package/dist/convention-registry.d.ts.map +1 -1
  103. package/dist/convention-registry.js +79 -39
  104. package/dist/coverage-report.d.ts.map +1 -1
  105. package/dist/coverage-report.js +6 -6
  106. package/dist/custom-checks.d.ts +60 -1
  107. package/dist/custom-checks.d.ts.map +1 -1
  108. package/dist/custom-checks.js +159 -6
  109. package/dist/dashboard/dashboard-data.d.ts +6 -0
  110. package/dist/dashboard/dashboard-data.d.ts.map +1 -1
  111. package/dist/dashboard/dashboard-data.js +99 -8
  112. package/dist/dashboard/dashboard-knowledge.d.ts.map +1 -1
  113. package/dist/dashboard/dashboard-knowledge.js +14 -2
  114. package/dist/decision-records.d.ts +20 -0
  115. package/dist/decision-records.d.ts.map +1 -1
  116. package/dist/decision-records.js +68 -20
  117. package/dist/declared-cross-references.d.ts +61 -0
  118. package/dist/declared-cross-references.d.ts.map +1 -0
  119. package/dist/declared-cross-references.js +550 -0
  120. package/dist/declared-gate-plane-rules.d.ts +24 -0
  121. package/dist/declared-gate-plane-rules.d.ts.map +1 -0
  122. package/dist/declared-gate-plane-rules.js +39 -0
  123. package/dist/declared-reference-coverage.d.ts +27 -0
  124. package/dist/declared-reference-coverage.d.ts.map +1 -0
  125. package/dist/declared-reference-coverage.js +50 -0
  126. package/dist/declared-xref-status.d.ts +19 -0
  127. package/dist/declared-xref-status.d.ts.map +1 -0
  128. package/dist/declared-xref-status.js +19 -0
  129. package/dist/delegate-pack-recipes.d.ts +13 -2
  130. package/dist/delegate-pack-recipes.d.ts.map +1 -1
  131. package/dist/delegate-pack-recipes.js +45 -14
  132. package/dist/demo-package.js +2 -2
  133. package/dist/demo-script.js +2 -2
  134. package/dist/demo-workflow.js +3 -3
  135. package/dist/dev-cycle.js +1 -1
  136. package/dist/dev-session.js +1 -1
  137. package/dist/doc-references.d.ts +80 -0
  138. package/dist/doc-references.d.ts.map +1 -0
  139. package/dist/doc-references.js +269 -0
  140. package/dist/doctor-result.d.ts +8 -0
  141. package/dist/doctor-result.d.ts.map +1 -1
  142. package/dist/doctor-verdict-kind.d.ts +19 -0
  143. package/dist/doctor-verdict-kind.d.ts.map +1 -0
  144. package/dist/doctor-verdict-kind.js +19 -0
  145. package/dist/doctor-verdict.d.ts +18 -0
  146. package/dist/doctor-verdict.d.ts.map +1 -0
  147. package/dist/doctor-verdict.js +28 -0
  148. package/dist/drift.d.ts +17 -0
  149. package/dist/drift.d.ts.map +1 -1
  150. package/dist/drift.js +40 -10
  151. package/dist/entrypoint-matrix.d.ts.map +1 -1
  152. package/dist/entrypoint-matrix.js +4 -1
  153. package/dist/feedback-ingestion.d.ts +28 -2
  154. package/dist/feedback-ingestion.d.ts.map +1 -1
  155. package/dist/feedback-ingestion.js +68 -19
  156. package/dist/fix-preview.d.ts.map +1 -1
  157. package/dist/fix-preview.js +9 -5
  158. package/dist/framework-extractor-outcomes.d.ts +27 -0
  159. package/dist/framework-extractor-outcomes.d.ts.map +1 -0
  160. package/dist/framework-extractor-outcomes.js +83 -0
  161. package/dist/fuzzy-impact.d.ts.map +1 -1
  162. package/dist/fuzzy-impact.js +12 -21
  163. package/dist/healing-plan.d.ts.map +1 -1
  164. package/dist/healing-plan.js +3 -4
  165. package/dist/helper-catalog.d.ts +25 -0
  166. package/dist/helper-catalog.d.ts.map +1 -0
  167. package/dist/helper-catalog.js +91 -0
  168. package/dist/helper-registry.d.ts.map +1 -1
  169. package/dist/helper-registry.js +17 -1
  170. package/dist/helper-view.d.ts +33 -0
  171. package/dist/helper-view.d.ts.map +1 -0
  172. package/dist/helper-view.js +1 -0
  173. package/dist/i-asset-doctor-flags.d.ts +16 -0
  174. package/dist/i-asset-doctor-flags.d.ts.map +1 -0
  175. package/dist/i-asset-doctor-flags.js +1 -0
  176. package/dist/i-command-resolution.d.ts +22 -0
  177. package/dist/i-command-resolution.d.ts.map +1 -0
  178. package/dist/i-command-resolution.js +1 -0
  179. package/dist/i-command-resolve-options.d.ts +24 -0
  180. package/dist/i-command-resolve-options.d.ts.map +1 -0
  181. package/dist/i-command-resolve-options.js +1 -0
  182. package/dist/i-command-safety.d.ts +13 -0
  183. package/dist/i-command-safety.d.ts.map +1 -0
  184. package/dist/i-command-safety.js +1 -0
  185. package/dist/i-contribution-accepted-entry.d.ts +18 -0
  186. package/dist/i-contribution-accepted-entry.d.ts.map +1 -0
  187. package/dist/i-contribution-accepted-entry.js +1 -0
  188. package/dist/i-contribution-entry-rejection.d.ts +21 -0
  189. package/dist/i-contribution-entry-rejection.d.ts.map +1 -0
  190. package/dist/i-contribution-entry-rejection.js +1 -0
  191. package/dist/i-contribution-file-issue.d.ts +18 -0
  192. package/dist/i-contribution-file-issue.d.ts.map +1 -0
  193. package/dist/i-contribution-file-issue.js +1 -0
  194. package/dist/i-contribution-file-report.d.ts +40 -0
  195. package/dist/i-contribution-file-report.d.ts.map +1 -0
  196. package/dist/i-contribution-file-report.js +1 -0
  197. package/dist/i-contribution-file-validation.d.ts +24 -0
  198. package/dist/i-contribution-file-validation.d.ts.map +1 -0
  199. package/dist/i-contribution-file-validation.js +1 -0
  200. package/dist/i-contributions-report.d.ts +31 -0
  201. package/dist/i-contributions-report.d.ts.map +1 -0
  202. package/dist/i-contributions-report.js +1 -0
  203. package/dist/i-declared-xref-field.d.ts +25 -0
  204. package/dist/i-declared-xref-field.d.ts.map +1 -0
  205. package/dist/i-declared-xref-field.js +1 -0
  206. package/dist/i-declared-xref-issue.d.ts +25 -0
  207. package/dist/i-declared-xref-issue.d.ts.map +1 -0
  208. package/dist/i-declared-xref-issue.js +1 -0
  209. package/dist/i-declared-xref-report.d.ts +48 -0
  210. package/dist/i-declared-xref-report.d.ts.map +1 -0
  211. package/dist/i-declared-xref-report.js +1 -0
  212. package/dist/i-declared-xref-row.d.ts +29 -0
  213. package/dist/i-declared-xref-row.d.ts.map +1 -0
  214. package/dist/i-declared-xref-row.js +1 -0
  215. package/dist/i-doctor-verdict.d.ts +10 -0
  216. package/dist/i-doctor-verdict.d.ts.map +1 -0
  217. package/dist/i-doctor-verdict.js +1 -0
  218. package/dist/i-kind-outcomes.d.ts +13 -0
  219. package/dist/i-kind-outcomes.d.ts.map +1 -0
  220. package/dist/i-kind-outcomes.js +1 -0
  221. package/dist/i-pack-doctor-verdict.d.ts +15 -0
  222. package/dist/i-pack-doctor-verdict.d.ts.map +1 -0
  223. package/dist/i-pack-doctor-verdict.js +1 -0
  224. package/dist/i-probed-id-field.d.ts +17 -0
  225. package/dist/i-probed-id-field.d.ts.map +1 -0
  226. package/dist/i-probed-id-field.js +1 -0
  227. package/dist/i-reference-kind-declaration.d.ts +38 -0
  228. package/dist/i-reference-kind-declaration.d.ts.map +1 -0
  229. package/dist/i-reference-kind-declaration.js +1 -0
  230. package/dist/i-reference-warm-options.d.ts +21 -0
  231. package/dist/i-reference-warm-options.d.ts.map +1 -0
  232. package/dist/i-reference-warm-options.js +1 -0
  233. package/dist/i-registry-outcomes.d.ts +16 -0
  234. package/dist/i-registry-outcomes.d.ts.map +1 -0
  235. package/dist/i-registry-outcomes.js +1 -0
  236. package/dist/i-scaffold-pattern-doctor-report.d.ts +35 -0
  237. package/dist/i-scaffold-pattern-doctor-report.d.ts.map +1 -0
  238. package/dist/i-scaffold-pattern-doctor-report.js +1 -0
  239. package/dist/i-search-tuning-key-probe.d.ts +30 -0
  240. package/dist/i-search-tuning-key-probe.d.ts.map +1 -0
  241. package/dist/i-search-tuning-key-probe.js +1 -0
  242. package/dist/i-search-tuning-lint-issue.d.ts +61 -0
  243. package/dist/i-search-tuning-lint-issue.d.ts.map +1 -0
  244. package/dist/i-search-tuning-lint-issue.js +1 -0
  245. package/dist/i-search-tuning-lint-report.d.ts +38 -0
  246. package/dist/i-search-tuning-lint-report.d.ts.map +1 -0
  247. package/dist/i-search-tuning-lint-report.js +1 -0
  248. package/dist/i-unresolvable-reference-scan.d.ts +14 -0
  249. package/dist/i-unresolvable-reference-scan.d.ts.map +1 -0
  250. package/dist/i-unresolvable-reference-scan.js +1 -0
  251. package/dist/i-unresolvable-reference.d.ts +29 -0
  252. package/dist/i-unresolvable-reference.d.ts.map +1 -0
  253. package/dist/i-unresolvable-reference.js +1 -0
  254. package/dist/i-workspace-profile-payload.d.ts +12 -0
  255. package/dist/i-workspace-profile-payload.d.ts.map +1 -0
  256. package/dist/i-workspace-profile-payload.js +1 -0
  257. package/dist/impact-analysis.d.ts +15 -0
  258. package/dist/impact-analysis.d.ts.map +1 -1
  259. package/dist/impact-analysis.js +58 -13
  260. package/dist/impact-render.d.ts.map +1 -1
  261. package/dist/impact-render.js +22 -0
  262. package/dist/import-hygiene.d.ts +35 -1
  263. package/dist/import-hygiene.d.ts.map +1 -1
  264. package/dist/import-hygiene.js +107 -13
  265. package/dist/index.d.ts +145 -0
  266. package/dist/index.d.ts.map +1 -1
  267. package/dist/index.js +176 -0
  268. package/dist/inspection-discovery.d.ts +45 -0
  269. package/dist/inspection-discovery.d.ts.map +1 -0
  270. package/dist/inspection-discovery.js +70 -0
  271. package/dist/knowledge-advisory-code.d.ts +17 -0
  272. package/dist/knowledge-advisory-code.d.ts.map +1 -0
  273. package/dist/knowledge-advisory-code.js +17 -0
  274. package/dist/knowledge-aged-entry.d.ts +10 -0
  275. package/dist/knowledge-aged-entry.d.ts.map +1 -0
  276. package/dist/knowledge-aged-entry.js +1 -0
  277. package/dist/knowledge-authoring.d.ts +24 -1
  278. package/dist/knowledge-authoring.d.ts.map +1 -1
  279. package/dist/knowledge-authoring.js +46 -7
  280. package/dist/knowledge-entry-verdict-record.d.ts +22 -0
  281. package/dist/knowledge-entry-verdict-record.d.ts.map +1 -0
  282. package/dist/knowledge-entry-verdict-record.js +1 -0
  283. package/dist/knowledge-entry-verdict.d.ts +17 -0
  284. package/dist/knowledge-entry-verdict.d.ts.map +1 -0
  285. package/dist/knowledge-entry-verdict.js +17 -0
  286. package/dist/knowledge-graph.d.ts +6 -0
  287. package/dist/knowledge-graph.d.ts.map +1 -1
  288. package/dist/knowledge-graph.js +18 -7
  289. package/dist/knowledge-kind-bucket.d.ts +19 -0
  290. package/dist/knowledge-kind-bucket.d.ts.map +1 -0
  291. package/dist/knowledge-kind-bucket.js +1 -0
  292. package/dist/knowledge-load-failure.d.ts +23 -0
  293. package/dist/knowledge-load-failure.d.ts.map +1 -0
  294. package/dist/knowledge-load-failure.js +1 -0
  295. package/dist/knowledge-reference-kind-bucket.d.ts +11 -0
  296. package/dist/knowledge-reference-kind-bucket.d.ts.map +1 -0
  297. package/dist/knowledge-reference-kind-bucket.js +1 -0
  298. package/dist/knowledge-stale-advisory.d.ts +14 -0
  299. package/dist/knowledge-stale-advisory.d.ts.map +1 -0
  300. package/dist/knowledge-stale-advisory.js +1 -0
  301. package/dist/knowledge-stale-coverage.d.ts +19 -0
  302. package/dist/knowledge-stale-coverage.d.ts.map +1 -0
  303. package/dist/knowledge-stale-coverage.js +1 -0
  304. package/dist/knowledge-stale-gate-flags.d.ts +33 -0
  305. package/dist/knowledge-stale-gate-flags.d.ts.map +1 -0
  306. package/dist/knowledge-stale-gate-flags.js +1 -0
  307. package/dist/knowledge-stale-gate-input.d.ts +46 -0
  308. package/dist/knowledge-stale-gate-input.d.ts.map +1 -0
  309. package/dist/knowledge-stale-gate-input.js +1 -0
  310. package/dist/knowledge-stale-gate-result.d.ts +33 -0
  311. package/dist/knowledge-stale-gate-result.d.ts.map +1 -0
  312. package/dist/knowledge-stale-gate-result.js +1 -0
  313. package/dist/knowledge-stale-gate-rule.d.ts +33 -0
  314. package/dist/knowledge-stale-gate-rule.d.ts.map +1 -0
  315. package/dist/knowledge-stale-gate-rule.js +1 -0
  316. package/dist/knowledge-stale-gate-violation.d.ts +13 -0
  317. package/dist/knowledge-stale-gate-violation.d.ts.map +1 -0
  318. package/dist/knowledge-stale-gate-violation.js +1 -0
  319. package/dist/knowledge-stale-gate.d.ts +83 -0
  320. package/dist/knowledge-stale-gate.d.ts.map +1 -0
  321. package/dist/knowledge-stale-gate.js +429 -0
  322. package/dist/knowledge-stale-quality-gate.d.ts +26 -0
  323. package/dist/knowledge-stale-quality-gate.d.ts.map +1 -0
  324. package/dist/knowledge-stale-quality-gate.js +110 -0
  325. package/dist/knowledge-stale.d.ts +122 -9
  326. package/dist/knowledge-stale.d.ts.map +1 -1
  327. package/dist/knowledge-stale.js +1002 -316
  328. package/dist/knowledge-unverifiable-reason.d.ts +12 -0
  329. package/dist/knowledge-unverifiable-reason.d.ts.map +1 -0
  330. package/dist/knowledge-unverifiable-reason.js +12 -0
  331. package/dist/loader-diagnostics.d.ts +14 -2
  332. package/dist/loader-diagnostics.d.ts.map +1 -1
  333. package/dist/match-terms.d.ts +48 -0
  334. package/dist/match-terms.d.ts.map +1 -0
  335. package/dist/match-terms.js +155 -0
  336. package/dist/migration-profile-registry.d.ts +10 -0
  337. package/dist/migration-profile-registry.d.ts.map +1 -1
  338. package/dist/migration-profile-registry.js +57 -34
  339. package/dist/migration-readiness.d.ts.map +1 -1
  340. package/dist/migration-readiness.js +1 -3
  341. package/dist/nearest-id.d.ts +14 -0
  342. package/dist/nearest-id.d.ts.map +1 -0
  343. package/dist/nearest-id.js +12 -0
  344. package/dist/pack-asset-freshness.d.ts +65 -0
  345. package/dist/pack-asset-freshness.d.ts.map +1 -0
  346. package/dist/pack-asset-freshness.js +340 -0
  347. package/dist/pack-author-ux.d.ts +24 -3
  348. package/dist/pack-author-ux.d.ts.map +1 -1
  349. package/dist/pack-author-ux.js +87 -93
  350. package/dist/pack-contributions-inventory.d.ts +79 -39
  351. package/dist/pack-contributions-inventory.d.ts.map +1 -1
  352. package/dist/pack-contributions-inventory.js +443 -286
  353. package/dist/pack-doctor-verdict.d.ts +29 -0
  354. package/dist/pack-doctor-verdict.d.ts.map +1 -0
  355. package/dist/pack-doctor-verdict.js +45 -0
  356. package/dist/pack-doctor.d.ts +74 -1
  357. package/dist/pack-doctor.d.ts.map +1 -1
  358. package/dist/pack-doctor.js +281 -1
  359. package/dist/pack-helper-plan.d.ts +24 -0
  360. package/dist/pack-helper-plan.d.ts.map +1 -0
  361. package/dist/pack-helper-plan.js +77 -0
  362. package/dist/pack-helper-registry.d.ts +14 -0
  363. package/dist/pack-helper-registry.d.ts.map +1 -1
  364. package/dist/pack-helper-registry.js +76 -37
  365. package/dist/pack-manifest-reader.d.ts +8 -0
  366. package/dist/pack-manifest-reader.d.ts.map +1 -0
  367. package/dist/pack-manifest-reader.js +79 -0
  368. package/dist/pack-release-check.d.ts +14 -1
  369. package/dist/pack-release-check.d.ts.map +1 -1
  370. package/dist/pack-release-check.js +23 -1
  371. package/dist/pack-signature-status.d.ts +18 -6
  372. package/dist/pack-signature-status.d.ts.map +1 -1
  373. package/dist/pack-signature-status.js +59 -105
  374. package/dist/pack-test-runner.d.ts +27 -5
  375. package/dist/pack-test-runner.d.ts.map +1 -1
  376. package/dist/pack-test-runner.js +91 -35
  377. package/dist/pack-typecheck.d.ts +8 -0
  378. package/dist/pack-typecheck.d.ts.map +1 -0
  379. package/dist/pack-typecheck.js +76 -0
  380. package/dist/plan-review.d.ts +2 -0
  381. package/dist/plan-review.d.ts.map +1 -1
  382. package/dist/plan-review.js +17 -5
  383. package/dist/plan-simulation.d.ts.map +1 -1
  384. package/dist/plan-simulation.js +16 -5
  385. package/dist/playbook-load-issue.d.ts +16 -0
  386. package/dist/playbook-load-issue.d.ts.map +1 -0
  387. package/dist/playbook-load-issue.js +1 -0
  388. package/dist/playbook-registry.d.ts +32 -1
  389. package/dist/playbook-registry.d.ts.map +1 -1
  390. package/dist/playbook-registry.js +144 -55
  391. package/dist/policy-declaration.d.ts +18 -0
  392. package/dist/policy-declaration.d.ts.map +1 -0
  393. package/dist/policy-declaration.js +1 -0
  394. package/dist/policy-engine.d.ts +8 -0
  395. package/dist/policy-engine.d.ts.map +1 -1
  396. package/dist/policy-engine.js +26 -9
  397. package/dist/policy-overrides.d.ts.map +1 -1
  398. package/dist/policy-overrides.js +4 -4
  399. package/dist/policy-registry.d.ts +42 -0
  400. package/dist/policy-registry.d.ts.map +1 -0
  401. package/dist/policy-registry.js +131 -0
  402. package/dist/probed-id-fields.d.ts +21 -0
  403. package/dist/probed-id-fields.d.ts.map +1 -0
  404. package/dist/probed-id-fields.js +25 -0
  405. package/dist/probed-id-source.d.ts +11 -0
  406. package/dist/probed-id-source.d.ts.map +1 -0
  407. package/dist/probed-id-source.js +11 -0
  408. package/dist/profile-registry.d.ts +25 -2
  409. package/dist/profile-registry.d.ts.map +1 -1
  410. package/dist/profile-registry.js +59 -6
  411. package/dist/quality-gate-examination.d.ts +15 -0
  412. package/dist/quality-gate-examination.d.ts.map +1 -0
  413. package/dist/quality-gate-examination.js +15 -0
  414. package/dist/quality-gate-row-status.d.ts +19 -0
  415. package/dist/quality-gate-row-status.d.ts.map +1 -0
  416. package/dist/quality-gate-row-status.js +28 -0
  417. package/dist/quality-gate-status.d.ts +16 -0
  418. package/dist/quality-gate-status.d.ts.map +1 -0
  419. package/dist/quality-gate-status.js +16 -0
  420. package/dist/quality-html.d.ts.map +1 -1
  421. package/dist/quality-html.js +14 -3
  422. package/dist/quality-report-coverage.d.ts +26 -0
  423. package/dist/quality-report-coverage.d.ts.map +1 -0
  424. package/dist/quality-report-coverage.js +48 -0
  425. package/dist/quality-report.d.ts +28 -1
  426. package/dist/quality-report.d.ts.map +1 -1
  427. package/dist/quality-report.js +263 -35
  428. package/dist/query-intent-kind.d.ts +18 -0
  429. package/dist/query-intent-kind.d.ts.map +1 -0
  430. package/dist/query-intent-kind.js +18 -0
  431. package/dist/query-intent-result.d.ts +23 -0
  432. package/dist/query-intent-result.d.ts.map +1 -0
  433. package/dist/query-intent-result.js +1 -0
  434. package/dist/query-intent.d.ts +18 -0
  435. package/dist/query-intent.d.ts.map +1 -0
  436. package/dist/query-intent.js +336 -0
  437. package/dist/query-resolver.d.ts +18 -0
  438. package/dist/query-resolver.d.ts.map +1 -1
  439. package/dist/query-resolver.js +15 -12
  440. package/dist/ranked-recommendations.d.ts +36 -0
  441. package/dist/ranked-recommendations.d.ts.map +1 -0
  442. package/dist/ranked-recommendations.js +1 -0
  443. package/dist/ranker-explainability.d.ts.map +1 -1
  444. package/dist/ranker-explainability.js +38 -10
  445. package/dist/recommend-recipe.d.ts +17 -0
  446. package/dist/recommend-recipe.d.ts.map +1 -0
  447. package/dist/recommend-recipe.js +1 -0
  448. package/dist/recommend-recipes.d.ts +9 -0
  449. package/dist/recommend-recipes.d.ts.map +1 -0
  450. package/dist/recommend-recipes.js +106 -0
  451. package/dist/recommendation-candidate.d.ts +30 -0
  452. package/dist/recommendation-candidate.d.ts.map +1 -0
  453. package/dist/recommendation-candidate.js +1 -0
  454. package/dist/recommendation-confidence.d.ts +27 -0
  455. package/dist/recommendation-confidence.d.ts.map +1 -0
  456. package/dist/recommendation-confidence.js +1 -0
  457. package/dist/recommendation-ranking-options.d.ts +24 -0
  458. package/dist/recommendation-ranking-options.d.ts.map +1 -0
  459. package/dist/recommendation-ranking-options.js +1 -0
  460. package/dist/recommendation-ranking.d.ts +50 -0
  461. package/dist/recommendation-ranking.d.ts.map +1 -0
  462. package/dist/recommendation-ranking.js +527 -0
  463. package/dist/recommendation-source.d.ts +23 -0
  464. package/dist/recommendation-source.d.ts.map +1 -0
  465. package/dist/recommendation-source.js +23 -0
  466. package/dist/recommendation-suppression.d.ts +14 -0
  467. package/dist/recommendation-suppression.d.ts.map +1 -0
  468. package/dist/recommendation-suppression.js +14 -0
  469. package/dist/reference-asset-kind.d.ts +14 -0
  470. package/dist/reference-asset-kind.d.ts.map +1 -0
  471. package/dist/reference-asset-kind.js +14 -0
  472. package/dist/reference-content-check.d.ts +32 -0
  473. package/dist/reference-content-check.d.ts.map +1 -0
  474. package/dist/reference-content-check.js +143 -0
  475. package/dist/reference-failure.d.ts +31 -0
  476. package/dist/reference-failure.d.ts.map +1 -0
  477. package/dist/reference-failure.js +31 -0
  478. package/dist/reference-id-status.d.ts +15 -0
  479. package/dist/reference-id-status.d.ts.map +1 -0
  480. package/dist/reference-id-status.js +15 -0
  481. package/dist/reference-kind-declarations.d.ts +42 -0
  482. package/dist/reference-kind-declarations.d.ts.map +1 -0
  483. package/dist/reference-kind-declarations.js +142 -0
  484. package/dist/reference-lookup.d.ts +6 -0
  485. package/dist/reference-lookup.d.ts.map +1 -1
  486. package/dist/reference-lookup.js +13 -5
  487. package/dist/reference-registry.d.ts +210 -0
  488. package/dist/reference-registry.d.ts.map +1 -0
  489. package/dist/reference-registry.js +395 -0
  490. package/dist/reference-subject.d.ts +20 -0
  491. package/dist/reference-subject.d.ts.map +1 -0
  492. package/dist/reference-subject.js +1 -0
  493. package/dist/registration-hint-discovery-status.d.ts +25 -0
  494. package/dist/registration-hint-discovery-status.d.ts.map +1 -0
  495. package/dist/registration-hint-discovery-status.js +25 -0
  496. package/dist/registration-hint-registry.d.ts +80 -0
  497. package/dist/registration-hint-registry.d.ts.map +1 -1
  498. package/dist/registration-hint-registry.js +356 -138
  499. package/dist/registry-lifecycle.d.ts +200 -19
  500. package/dist/registry-lifecycle.d.ts.map +1 -1
  501. package/dist/registry-lifecycle.js +526 -136
  502. package/dist/release-readiness.d.ts.map +1 -1
  503. package/dist/release-readiness.js +10 -7
  504. package/dist/release-smoke.d.ts.map +1 -1
  505. package/dist/release-smoke.js +11 -7
  506. package/dist/report-site.d.ts.map +1 -1
  507. package/dist/report-site.js +25 -7
  508. package/dist/repository-intelligence.d.ts.map +1 -1
  509. package/dist/repository-intelligence.js +3 -2
  510. package/dist/repository-knowledge-model.d.ts.map +1 -1
  511. package/dist/repository-knowledge-model.js +18 -5
  512. package/dist/resolve-project-config.d.ts +64 -0
  513. package/dist/resolve-project-config.d.ts.map +1 -1
  514. package/dist/resolve-project-config.js +258 -32
  515. package/dist/reuse/compute-reuse-coverage.d.ts +29 -0
  516. package/dist/reuse/compute-reuse-coverage.d.ts.map +1 -0
  517. package/dist/reuse/compute-reuse-coverage.js +198 -0
  518. package/dist/reuse/rank-reuse-candidates.d.ts +38 -0
  519. package/dist/reuse/rank-reuse-candidates.d.ts.map +1 -0
  520. package/dist/reuse/rank-reuse-candidates.js +212 -0
  521. package/dist/reuse/rank-reuse-options.d.ts +20 -0
  522. package/dist/reuse/rank-reuse-options.d.ts.map +1 -0
  523. package/dist/reuse/rank-reuse-options.js +1 -0
  524. package/dist/reuse/rank-reuse-suggestions.d.ts +15 -0
  525. package/dist/reuse/rank-reuse-suggestions.d.ts.map +1 -0
  526. package/dist/reuse/rank-reuse-suggestions.js +31 -0
  527. package/dist/reuse/resolve-curated-reuse.d.ts +43 -0
  528. package/dist/reuse/resolve-curated-reuse.d.ts.map +1 -0
  529. package/dist/reuse/resolve-curated-reuse.js +115 -0
  530. package/dist/reuse/reuse-candidate.d.ts +29 -0
  531. package/dist/reuse/reuse-candidate.d.ts.map +1 -0
  532. package/dist/reuse/reuse-candidate.js +1 -0
  533. package/dist/reuse/reuse-coverage-report.d.ts +74 -0
  534. package/dist/reuse/reuse-coverage-report.d.ts.map +1 -0
  535. package/dist/reuse/reuse-coverage-report.js +1 -0
  536. package/dist/reuse/reuse-curated-coverage.d.ts +36 -0
  537. package/dist/reuse/reuse-curated-coverage.d.ts.map +1 -0
  538. package/dist/reuse/reuse-curated-coverage.js +1 -0
  539. package/dist/reuse/reuse-curated-resolution.d.ts +36 -0
  540. package/dist/reuse/reuse-curated-resolution.d.ts.map +1 -0
  541. package/dist/reuse/reuse-curated-resolution.js +1 -0
  542. package/dist/reuse/reuse-curated-status.d.ts +21 -0
  543. package/dist/reuse/reuse-curated-status.d.ts.map +1 -0
  544. package/dist/reuse/reuse-curated-status.js +21 -0
  545. package/dist/reuse/reuse-match-detail.d.ts +15 -0
  546. package/dist/reuse/reuse-match-detail.d.ts.map +1 -0
  547. package/dist/reuse/reuse-match-detail.js +1 -0
  548. package/dist/reuse/reuse-ranking.d.ts +37 -0
  549. package/dist/reuse/reuse-ranking.d.ts.map +1 -0
  550. package/dist/reuse/reuse-ranking.js +1 -0
  551. package/dist/reuse/reuse-suggestion.d.ts +19 -0
  552. package/dist/reuse/reuse-suggestion.d.ts.map +1 -0
  553. package/dist/reuse/reuse-suggestion.js +1 -0
  554. package/dist/reuse/reuse-symbol-lookup.d.ts +28 -0
  555. package/dist/reuse/reuse-symbol-lookup.d.ts.map +1 -0
  556. package/dist/reuse/reuse-symbol-lookup.js +1 -0
  557. package/dist/reuse/reuse-tokenize.d.ts +11 -0
  558. package/dist/reuse/reuse-tokenize.d.ts.map +1 -0
  559. package/dist/reuse/reuse-tokenize.js +26 -0
  560. package/dist/reuse/score-reuse-name.d.ts +16 -0
  561. package/dist/reuse/score-reuse-name.d.ts.map +1 -0
  562. package/dist/reuse/score-reuse-name.js +35 -0
  563. package/dist/reuse/score-reuse-primitive.d.ts +33 -0
  564. package/dist/reuse/score-reuse-primitive.d.ts.map +1 -0
  565. package/dist/reuse/score-reuse-primitive.js +92 -0
  566. package/dist/review-packet.d.ts +2 -0
  567. package/dist/review-packet.d.ts.map +1 -1
  568. package/dist/review-packet.js +13 -6
  569. package/dist/role-views.d.ts.map +1 -1
  570. package/dist/role-views.js +16 -16
  571. package/dist/routing-recommends-channels.d.ts +24 -0
  572. package/dist/routing-recommends-channels.d.ts.map +1 -0
  573. package/dist/routing-recommends-channels.js +19 -0
  574. package/dist/run-boundary-check.d.ts +118 -0
  575. package/dist/run-boundary-check.d.ts.map +1 -0
  576. package/dist/run-boundary-check.js +592 -0
  577. package/dist/safety-audit.js +1 -1
  578. package/dist/scaffold-coverage.js +1 -1
  579. package/dist/scaffold-pattern-doctor-report.d.ts +19 -0
  580. package/dist/scaffold-pattern-doctor-report.d.ts.map +1 -0
  581. package/dist/scaffold-pattern-doctor-report.js +54 -0
  582. package/dist/scaffold-patterns.d.ts +75 -1
  583. package/dist/scaffold-patterns.d.ts.map +1 -1
  584. package/dist/scaffold-patterns.js +375 -84
  585. package/dist/schema-inventory.d.ts.map +1 -1
  586. package/dist/schema-inventory.js +4 -3
  587. package/dist/search-document-id.d.ts +52 -0
  588. package/dist/search-document-id.d.ts.map +1 -0
  589. package/dist/search-document-id.js +72 -0
  590. package/dist/search-document-prefix.d.ts +7 -0
  591. package/dist/search-document-prefix.d.ts.map +1 -0
  592. package/dist/search-document-prefix.js +1 -0
  593. package/dist/search-index.d.ts.map +1 -1
  594. package/dist/search-index.js +20 -23
  595. package/dist/search-tuning-explain.d.ts +6 -0
  596. package/dist/search-tuning-explain.d.ts.map +1 -1
  597. package/dist/search-tuning-explain.js +19 -17
  598. package/dist/search-tuning-key-probes.d.ts +16 -0
  599. package/dist/search-tuning-key-probes.d.ts.map +1 -0
  600. package/dist/search-tuning-key-probes.js +65 -0
  601. package/dist/search-tuning-key-resolution.d.ts +25 -0
  602. package/dist/search-tuning-key-resolution.d.ts.map +1 -0
  603. package/dist/search-tuning-key-resolution.js +1 -0
  604. package/dist/search-tuning-key-resolver.d.ts +4 -0
  605. package/dist/search-tuning-key-resolver.d.ts.map +1 -0
  606. package/dist/search-tuning-key-resolver.js +107 -0
  607. package/dist/search-tuning-key-status.d.ts +24 -0
  608. package/dist/search-tuning-key-status.d.ts.map +1 -0
  609. package/dist/search-tuning-key-status.js +24 -0
  610. package/dist/search-tuning-lint.d.ts +9 -0
  611. package/dist/search-tuning-lint.d.ts.map +1 -0
  612. package/dist/search-tuning-lint.js +468 -0
  613. package/dist/search-tuning-registry.d.ts +43 -0
  614. package/dist/search-tuning-registry.d.ts.map +1 -1
  615. package/dist/search-tuning-registry.js +214 -49
  616. package/dist/self-audit.d.ts +12 -0
  617. package/dist/self-audit.d.ts.map +1 -1
  618. package/dist/self-audit.js +36 -10
  619. package/dist/self-config-doctor-v2.d.ts +145 -3
  620. package/dist/self-config-doctor-v2.d.ts.map +1 -1
  621. package/dist/self-config-doctor-v2.js +1329 -255
  622. package/dist/self-config-doctor.d.ts +20 -1
  623. package/dist/self-config-doctor.d.ts.map +1 -1
  624. package/dist/self-config-doctor.js +65 -309
  625. package/dist/settled-unit-states.d.ts +9 -0
  626. package/dist/settled-unit-states.d.ts.map +1 -0
  627. package/dist/settled-unit-states.js +14 -0
  628. package/dist/sharkcraft-inspector.d.ts +47 -1
  629. package/dist/sharkcraft-inspector.d.ts.map +1 -1
  630. package/dist/sharkcraft-inspector.js +278 -29
  631. package/dist/spec/spec-evidence.d.ts.map +1 -1
  632. package/dist/spec/spec-evidence.js +14 -20
  633. package/dist/split-identifier.d.ts +21 -0
  634. package/dist/split-identifier.d.ts.map +1 -0
  635. package/dist/split-identifier.js +27 -0
  636. package/dist/start-here.d.ts.map +1 -1
  637. package/dist/start-here.js +1 -2
  638. package/dist/substitute-placeholders.d.ts +8 -0
  639. package/dist/substitute-placeholders.d.ts.map +1 -0
  640. package/dist/substitute-placeholders.js +9 -0
  641. package/dist/symbol-index.d.ts +33 -0
  642. package/dist/symbol-index.d.ts.map +1 -1
  643. package/dist/symbol-index.js +241 -3
  644. package/dist/symbol-member-entry.d.ts +26 -0
  645. package/dist/symbol-member-entry.d.ts.map +1 -0
  646. package/dist/symbol-member-entry.js +1 -0
  647. package/dist/symbol-member-kind.d.ts +14 -0
  648. package/dist/symbol-member-kind.d.ts.map +1 -0
  649. package/dist/symbol-member-kind.js +14 -0
  650. package/dist/task-packet.d.ts.map +1 -1
  651. package/dist/task-packet.js +52 -9
  652. package/dist/task-ranker.d.ts +8 -0
  653. package/dist/task-ranker.d.ts.map +1 -1
  654. package/dist/task-ranker.js +25 -13
  655. package/dist/task-risk.js +1 -1
  656. package/dist/task-routing-hint-registry.d.ts +20 -1
  657. package/dist/task-routing-hint-registry.d.ts.map +1 -1
  658. package/dist/task-routing-hint-registry.js +186 -42
  659. package/dist/template-drift.d.ts.map +1 -1
  660. package/dist/template-drift.js +30 -9
  661. package/dist/template-lint.d.ts.map +1 -1
  662. package/dist/template-lint.js +160 -2
  663. package/dist/term-query.d.ts +10 -0
  664. package/dist/term-query.d.ts.map +1 -0
  665. package/dist/term-query.js +1 -0
  666. package/dist/test-definitions.d.ts +6 -3
  667. package/dist/test-definitions.d.ts.map +1 -1
  668. package/dist/test-runner.d.ts +95 -10
  669. package/dist/test-runner.d.ts.map +1 -1
  670. package/dist/test-runner.js +309 -318
  671. package/dist/tuning-query-tokens.d.ts +29 -0
  672. package/dist/tuning-query-tokens.d.ts.map +1 -0
  673. package/dist/tuning-query-tokens.js +51 -0
  674. package/dist/typecheck-files.d.ts +36 -0
  675. package/dist/typecheck-files.d.ts.map +1 -0
  676. package/dist/typecheck-files.js +158 -0
  677. package/dist/uncertainty.js +1 -1
  678. package/dist/universal-search.d.ts.map +1 -1
  679. package/dist/universal-search.js +5 -3
  680. package/dist/unregistered-exports.d.ts +19 -0
  681. package/dist/unregistered-exports.d.ts.map +1 -0
  682. package/dist/unregistered-exports.js +141 -0
  683. package/dist/unresolvable-reason.d.ts +11 -0
  684. package/dist/unresolvable-reason.d.ts.map +1 -0
  685. package/dist/unresolvable-reason.js +11 -0
  686. package/dist/upgrade-advisor.d.ts.map +1 -1
  687. package/dist/upgrade-advisor.js +16 -9
  688. package/dist/validate-contribution-file.d.ts +4 -0
  689. package/dist/validate-contribution-file.d.ts.map +1 -0
  690. package/dist/validate-contribution-file.js +228 -0
  691. package/dist/why-file.d.ts +3 -0
  692. package/dist/why-file.d.ts.map +1 -1
  693. package/dist/why-file.js +7 -3
  694. package/package.json +17 -17
@@ -0,0 +1,71 @@
1
+ import { boundaryRuleScope, BoundaryMarkableList, settleBoundaryRule, unreadEntryMatches, withBoundaryRuleSettlement, } from '@shrkcrft/boundaries';
2
+ /**
3
+ * THE unread re-settle of one boundary rule (round 13; V1-U1, prerequisite P2)
4
+ * — `check boundaries` AND `check boundaries --diff-against` both call it, so an
5
+ * unreadable governed file weighs the same on the gate and on the authoring
6
+ * path. It replaces `withProvableDeadUnits`, which silently DROPPED a claim;
7
+ * the diff path had no such step at all.
8
+ *
9
+ * A "matches nothing" / "does not exist yet" fact is a whole-tree claim made
10
+ * from what was READ. Every negative fact an unread entry could refute is
11
+ * withdrawn (made unknown), and the rule is re-settled through the one boundary
12
+ * settle (`settleBoundaryRule`, `@shrkcrft/boundaries`): such a unit reads
13
+ * Unproven — no dead line, no `accepted by expectEmpty`, a gap in its rule's
14
+ * coverage. What is refutable:
15
+ *
16
+ * - a `forbiddenImports` / `allowedImports` claim ("matches no import
17
+ * anywhere") — by any unread entry the rule's `from` globs match;
18
+ * - a `from` / exemption glob claim ("matched 0 files") — by an unread entry
19
+ * that glob matches;
20
+ * - a unit dead by its SHAPE (`cause`) — never: it is proved from the rule alone.
21
+ *
22
+ * A positive fact (a match seen) is kept. The rule's emptiness is re-settled
23
+ * with `readGap`: a rule whose governed files went unread is partial, never
24
+ * "matched nothing" and never failOnEmpty's 1. Unchanged (same object) when
25
+ * nothing is withdrawn and no governed file is unread.
26
+ */
27
+ export function boundaryUnitLiveness(detail, rule, context) {
28
+ const units = detail.unitLiveness;
29
+ if (units === undefined)
30
+ return detail;
31
+ const scope = boundaryRuleScope(rule);
32
+ const matched = context.unread.filter((u) => unreadEntryMatches(u, scope.include));
33
+ if (matched.length === 0 && !context.readGap)
34
+ return detail;
35
+ const refutable = (u) => {
36
+ if (u.cause !== undefined)
37
+ return false;
38
+ if (u.list === BoundaryMarkableList.ForbiddenImports || u.list === BoundaryMarkableList.AllowedImports) {
39
+ return matched.length > 0;
40
+ }
41
+ const glob = u.unit.startsWith('!') ? u.unit.slice(1) : u.unit;
42
+ return matched.some((entry) => unreadEntryMatches(entry, [glob]));
43
+ };
44
+ const observations = units.map((u) => {
45
+ const withdraw = refutable(u);
46
+ return {
47
+ list: u.list,
48
+ unit: u.unit,
49
+ exists: withdraw && u.exists === false ? undefined : u.exists,
50
+ live: withdraw && u.live === false ? undefined : u.live,
51
+ label: u.label,
52
+ weight: u.weight,
53
+ ...(u.matched !== undefined ? { matched: u.matched } : {}),
54
+ ...(u.liveBecause !== undefined ? { liveBecause: u.liveBecause } : {}),
55
+ ...(u.deadReason !== undefined ? { deadReason: u.deadReason } : {}),
56
+ ...(u.cause !== undefined ? { cause: u.cause } : {}),
57
+ };
58
+ });
59
+ const settlement = settleBoundaryRule({
60
+ rule,
61
+ observations,
62
+ includeGlobs: scope.include,
63
+ filesScanned: context.filesScanned,
64
+ fileUniverse: context.fileUniverse,
65
+ filesInScope: detail.filesInScope,
66
+ exemptFilesInScope: detail.exemptFilesInScope,
67
+ violations: detail.violations,
68
+ unread: context.readGap,
69
+ });
70
+ return withBoundaryRuleSettlement(detail, settlement);
71
+ }
@@ -1,3 +1,4 @@
1
+ import { QueryIntent } from './query-intent-kind.js';
1
2
  import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
2
3
  export declare const CHANGE_INTENT_SCHEMA = "sharkcraft.change-intent/v1";
3
4
  export declare enum ChangeIntentKind {
@@ -30,6 +31,8 @@ export interface IChangeIntent {
30
31
  suggestedFirstCommand: string;
31
32
  confidence: ChangeIntentConfidence;
32
33
  reasons: readonly string[];
34
+ /** THE query-intent classification this kind was checked against (round 11). */
35
+ queryIntent?: QueryIntent;
33
36
  }
34
37
  export declare function classifyChangeIntent(task: string, inspection: ISharkcraftInspection): Promise<IChangeIntent>;
35
38
  export declare function renderChangeIntentText(intent: IChangeIntent): string;
@@ -1 +1 @@
1
- {"version":3,"file":"change-intent.d.ts","sourceRoot":"","sources":["../src/change-intent.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAElE,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,oBAAY,sBAAsB;IAChC,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,oBAAoB,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,UAAU,EAAE,sBAAsB,CAAC;IACnC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B;AA2ID,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,UAA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,UAAU,EAAE,qBAAqB,GAChC,OAAO,CAAC,aAAa,CAAC,CA0FxB;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAsBpE"}
@@ -11,6 +11,10 @@
11
11
  * available.
12
12
  */
13
13
  import { listConstructs, loadConstructs } from "./construct-registry.js";
14
+ import { matchTerm, prepareTermQuery } from "./match-terms.js";
15
+ import { classifyQueryIntent } from "./query-intent.js";
16
+ import { QueryIntent } from "./query-intent-kind.js";
17
+ import { detectSharkcraftRepo } from "./self-audit.js";
14
18
  export const CHANGE_INTENT_SCHEMA = 'sharkcraft.change-intent/v1';
15
19
  export var ChangeIntentKind;
16
20
  (function (ChangeIntentKind) {
@@ -109,22 +113,35 @@ const SUGGESTED_COMMAND = new Map([
109
113
  [ChangeIntentKind.Bugfix, 'shrk impact --since main'],
110
114
  [ChangeIntentKind.Refactor, 'shrk check boundaries --json'],
111
115
  [ChangeIntentKind.Test, 'shrk tests missing --since main'],
112
- [ChangeIntentKind.Docs, 'shrk docs check'],
116
+ // Consumer-applicable: `docs check` / `release readiness` maintain SharkCraft
117
+ // itself and exit 78 outside its repository (round 11 review CLI-7).
118
+ [ChangeIntentKind.Docs, 'shrk docs references check'],
113
119
  [ChangeIntentKind.Migration, 'shrk brief "<task>" && shrk orchestrate "<task>" --mode conservative'],
114
120
  [ChangeIntentKind.Architecture, 'shrk architecture map'],
115
121
  [ChangeIntentKind.Policy, 'shrk policy run --explain-overrides'],
116
- [ChangeIntentKind.Release, 'shrk release readiness --strict'],
122
+ [ChangeIntentKind.Release, 'shrk quality'],
117
123
  [ChangeIntentKind.Unknown, 'shrk start-here'],
118
124
  ]);
119
- function lc(s) {
120
- return s.toLowerCase();
121
- }
125
+ /**
126
+ * Inside SharkCraft's own repository (THE host authority,
127
+ * `detectSharkcraftRepo`) the docs / release intents keep the tool's own
128
+ * gates — there they apply.
129
+ */
130
+ const TOOL_REPO_SUGGESTED_COMMAND = new Map([
131
+ [ChangeIntentKind.Docs, 'shrk docs check'],
132
+ [ChangeIntentKind.Release, 'shrk release readiness --strict'],
133
+ ]);
134
+ /**
135
+ * Domains through THE term matcher: `lower.includes(kw)` fired `ci` on
136
+ * "decide" / "specific" / "pricing" and `sign` (pack) on "design" / "assign",
137
+ * inflating the signal-count confidence below.
138
+ */
122
139
  function detectDomains(task) {
123
- const lower = lc(task);
140
+ const query = prepareTermQuery(task);
124
141
  const out = [];
125
142
  for (const [domain, keywords] of DOMAIN_KEYWORDS) {
126
143
  for (const kw of keywords) {
127
- if (lower.includes(kw)) {
144
+ if (matchTerm(query, kw)) {
128
145
  out.push(domain);
129
146
  break;
130
147
  }
@@ -132,6 +149,14 @@ function detectDomains(task) {
132
149
  }
133
150
  return [...new Set(out)];
134
151
  }
152
+ /** Ids whose (≥ 3 char) segments appear as task terms — THE term matcher, not substring. */
153
+ function idsMentioned(ids, task) {
154
+ const query = prepareTermQuery(task);
155
+ return ids.filter((id) => {
156
+ const tokens = id.split(/[.\-_/]/).filter((t) => t.length >= 3);
157
+ return tokens.some((t) => matchTerm(query, t));
158
+ });
159
+ }
135
160
  function matchKind(task) {
136
161
  let best = {
137
162
  kind: ChangeIntentKind.Unknown,
@@ -175,27 +200,31 @@ export async function classifyChangeIntent(task, inspection) {
175
200
  reasons: ['Empty task string.'],
176
201
  };
177
202
  }
178
- const { kind, riskHints, requiresReview, matchedPatterns } = matchKind(trimmed);
203
+ const matched = matchKind(trimmed);
204
+ let { kind, riskHints, requiresReview } = matched;
205
+ const { matchedPatterns } = matched;
206
+ // Consult THE query-intent classifier: a create word used as a noun or
207
+ // adjective ("fix the broken BUILD", "why does the NEW route fail") must not
208
+ // make a repair / diagnosis query a feature.
209
+ const queryIntent = classifyQueryIntent(trimmed);
210
+ const repairShaped = queryIntent.intent === QueryIntent.Repair || queryIntent.intent === QueryIntent.Diagnose;
211
+ const overridden = repairShaped && (kind === ChangeIntentKind.Feature || kind === ChangeIntentKind.Unknown);
212
+ if (overridden) {
213
+ const bugfix = MATCHERS.find((m) => m.kind === ChangeIntentKind.Bugfix);
214
+ kind = ChangeIntentKind.Bugfix;
215
+ riskHints = bugfix?.riskHints ? [...bugfix.riskHints] : [];
216
+ requiresReview = bugfix?.requiresReview === true;
217
+ }
179
218
  const domains = detectDomains(trimmed);
180
- // Likely constructs: any construct id whose tokens appear in the task.
181
- const constructs = listConstructs(inspection).map((c) => c.id);
182
- const likelyConstructs = constructs.filter((id) => {
183
- const tokens = id.split(/[.\-_/]/).filter((t) => t.length >= 3);
184
- return tokens.some((t) => lc(trimmed).includes(lc(t)));
185
- });
186
- // Likely templates / pipelines: by id token match.
187
- const templates = inspection.templates.map((t) => t.id);
188
- const likelyTemplates = templates.filter((id) => {
189
- const tokens = id.split(/[.\-_/]/).filter((t) => t.length >= 3);
190
- return tokens.some((t) => lc(trimmed).includes(lc(t)));
191
- });
192
- const pipelines = inspection.pipelines.map((p) => p.id);
193
- const likelyPipelines = pipelines.filter((id) => {
194
- const tokens = id.split(/[.\-_/]/).filter((t) => t.length >= 3);
195
- return tokens.some((t) => lc(trimmed).includes(lc(t)));
196
- });
219
+ // Likely constructs / templates / pipelines: any id whose segments appear as task terms.
220
+ const likelyConstructs = idsMentioned(listConstructs(inspection).map((c) => c.id), trimmed);
221
+ const likelyTemplates = idsMentioned(inspection.templates.map((t) => t.id), trimmed);
222
+ const likelyPipelines = idsMentioned(inspection.pipelines.map((p) => p.id), trimmed);
197
223
  const reasons = [];
198
- if (matchedPatterns > 0) {
224
+ if (overridden) {
225
+ reasons.push(`Query intent is "${queryIntent.intent}"${queryIntent.vetoedBy ? ` ("${queryIntent.vetoedBy}" vetoes the create reading)` : ''} — classified as "${kind}".`);
226
+ }
227
+ else if (matchedPatterns > 0) {
199
228
  reasons.push(`Matched ${matchedPatterns} pattern(s) for kind "${kind}".`);
200
229
  }
201
230
  else {
@@ -216,7 +245,11 @@ export async function classifyChangeIntent(task, inspection) {
216
245
  kind === ChangeIntentKind.Policy ||
217
246
  kind === ChangeIntentKind.Release ||
218
247
  kind === ChangeIntentKind.Migration;
219
- const suggestedFirstCommand = SUGGESTED_COMMAND.get(kind) ?? 'shrk start-here';
248
+ const suggestedFirstCommand = (TOOL_REPO_SUGGESTED_COMMAND.has(kind) && detectSharkcraftRepo(inspection.projectRoot)
249
+ ? TOOL_REPO_SUGGESTED_COMMAND.get(kind)
250
+ : undefined) ??
251
+ SUGGESTED_COMMAND.get(kind) ??
252
+ 'shrk start-here';
220
253
  return {
221
254
  schema: CHANGE_INTENT_SCHEMA,
222
255
  task: trimmed,
@@ -230,6 +263,7 @@ export async function classifyChangeIntent(task, inspection) {
230
263
  suggestedFirstCommand,
231
264
  confidence,
232
265
  reasons,
266
+ queryIntent: queryIntent.intent,
233
267
  };
234
268
  }
235
269
  export function renderChangeIntentText(intent) {
@@ -1 +1 @@
1
- {"version":3,"file":"changes-summary.d.ts","sourceRoot":"","sources":["../src/changes-summary.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,oBAAY,UAAU;IACpB,GAAG,QAAQ;IACX,SAAS,eAAe;IACxB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,SAAS,eAAe;IACxB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,WAAW,uBAAuB;IAClC,YAAY,kBAAkB;IAC9B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB;;;;;;OAMG;IACH,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,UAAU,2BAA2B;IACrC,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,MA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;IAC3C,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,qCAAqC;IACrC,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,0CAA0C;IAC1C,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAChC,wCAAwC;IACxC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,qCAAqC;IACrC,2BAA2B,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAyRD,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,qBAAqB,EACjC,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,qBAAqB,CAAC,CA2DhC;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAsDlF"}
@@ -11,7 +11,8 @@
11
11
  *
12
12
  * Read-only; no AI; deterministic. Schema: sharkcraft.changes-summary/v1.
13
13
  */
14
- import { globToRegex } from '@shrkcrft/boundaries';
14
+ import { boundaryRuleScope, boundaryScopeDecision } from '@shrkcrft/boundaries';
15
+ import { createAreaClassifier } from "./area-map.js";
15
16
  import { getChangedFiles } from "./git-helpers.js";
16
17
  import { resolveVerificationCommands } from "./resolve-verification-commands.js";
17
18
  export const CHANGES_SUMMARY_SCHEMA = 'sharkcraft.changes-summary/v1';
@@ -175,27 +176,36 @@ const PACKAGE_ROOT_RE = /^(?:packages|apps|libs|modules|services)\/([^/]+)\//;
175
176
  * is surfaced as a self-diagnostic (`unknownRate`), not a low-risk diff.
176
177
  */
177
178
  function buildAreaResolver(inspection) {
179
+ // Each rule's governed scope, read through THE boundary scope authority
180
+ // (`boundaryRuleScope` / `boundaryScopeDecision`) — the one the evaluator
181
+ // uses. A `!`-prefixed `from` entry is an exemption there, never a literal
182
+ // glob, and a file the rule exempts (`exemptFiles`, `excludeTests`) is not
183
+ // attributed to the rule's area.
178
184
  const boundaryMatchers = [];
179
185
  try {
180
186
  for (const rule of inspection.boundaryRegistry?.list() ?? []) {
181
- const from = rule.from ?? [];
182
- if (from.length === 0)
187
+ const scope = boundaryRuleScope(rule);
188
+ if (scope.include.length === 0)
183
189
  continue;
184
- boundaryMatchers.push({
185
- area: rule.tags?.[0] ?? rule.id,
186
- matchers: from.map((g) => globToRegex(g)),
187
- });
190
+ boundaryMatchers.push({ area: rule.tags?.[0] ?? rule.id, scope });
188
191
  }
189
192
  }
190
193
  catch {
191
194
  // Boundary registry unavailable — fall through to built-ins + package roots.
192
195
  }
196
+ // Project-declared areas (`areaMap.patterns`) win FIRST, through the same
197
+ // classifier the area map uses — one answer to "which area is this file in"
198
+ // for a file the project named, not two tables agreeing by coincidence.
199
+ const configured = createAreaClassifier(inspection.config?.areaMap, { builtIns: false });
193
200
  return (file) => {
201
+ const declared = configured(file);
202
+ if (declared.source === 'config')
203
+ return declared.id ?? declared.kind;
194
204
  const builtin = classifyArea(file);
195
205
  if (builtin !== ChangeArea.Unknown)
196
206
  return builtin;
197
207
  for (const b of boundaryMatchers) {
198
- if (b.matchers.some((re) => re.test(file)))
208
+ if (boundaryScopeDecision(b.scope, file) === 'in')
199
209
  return b.area;
200
210
  }
201
211
  const pkg = PACKAGE_ROOT_RE.exec(file);
@@ -318,7 +328,7 @@ function suggestValidationCommands(files, inspection) {
318
328
  out.add('shrk packs verify');
319
329
  }
320
330
  if (files.some((f) => f.area === ChangeArea.Inspector)) {
321
- out.add('shrk product check');
331
+ out.add('shrk quality');
322
332
  }
323
333
  return Array.from(out);
324
334
  }
@@ -135,7 +135,7 @@ const PROBES = [
135
135
  errors,
136
136
  warnings,
137
137
  summary: `errors=${errors} warnings=${warnings}`,
138
- nextCommand: 'shrk product check',
138
+ nextCommand: 'shrk quality',
139
139
  };
140
140
  },
141
141
  },
@@ -1 +1 @@
1
- {"version":3,"file":"ci-predict.d.ts","sourceRoot":"","sources":["../src/ci-predict.ts"],"names":[],"mappings":"AAUA,OAAO,EAA0B,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE1F,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D,oBAAY,kBAAkB;IAC5B,QAAQ,cAAc;IACtB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO,iBAAiB,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,iEAAiE;IACjE,Q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kB,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,iEAAiE;IACjE,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAC3C;AA2KD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CA8GjF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAmBpE;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAgBxE"}
@@ -43,12 +43,26 @@ const PROBES = {
43
43
  id: 'self-config',
44
44
  title: 'Self-config doctor',
45
45
  reportFile: 'self-config-doctor.json',
46
+ // Round 13: only `ok` is a pass. `unverified` (a dead unit, an id that
47
+ // could not be looked up — the doctor exits 2 NOT VERIFIED, so the CI
48
+ // step `shrk self-config doctor --json` fails) read as PASS here, and so
49
+ // did any verdict this reader does not know. An unmeasured verdict is
50
+ // never a pass.
46
51
  reader: (j) => {
47
52
  const v = j['verdict'];
48
- return {
49
- verdict: v === 'errors' ? CiPredictVerdict.Fail : v === 'warnings' ? CiPredictVerdict.Warn : CiPredictVerdict.Pass,
50
- summary: `verdict=${v ?? 'unknown'}`,
51
- };
53
+ if (v === 'ok')
54
+ return { verdict: CiPredictVerdict.Pass, summary: 'verdict=ok' };
55
+ if (v === 'warnings')
56
+ return { verdict: CiPredictVerdict.Warn, summary: 'verdict=warnings' };
57
+ if (v === 'errors')
58
+ return { verdict: CiPredictVerdict.Fail, summary: 'verdict=errors' };
59
+ if (v === 'unverified') {
60
+ return {
61
+ verdict: CiPredictVerdict.Fail,
62
+ summary: 'verdict=unverified — NOT VERIFIED: the self-config doctor exits 2, so the CI step fails',
63
+ };
64
+ }
65
+ return { verdict: CiPredictVerdict.Unknown, summary: `verdict=${v ?? 'unknown'} — not a verdict this probe reads` };
52
66
  },
53
67
  nextCommand: 'shrk self-config doctor',
54
68
  },
@@ -151,6 +165,25 @@ const PROBES = {
151
165
  },
152
166
  ],
153
167
  };
168
+ /**
169
+ * THE guard over every probe's reading (round 13): a cached report that
170
+ * carries its own non-zero `exitCode` (a verdict verb's `--json`, e.g. the CI
171
+ * scaffold's `self-config doctor --json`) never predicts PASS — nor WARN
172
+ * (review: `verdict: 'warnings'` written by `self-config doctor --strict`,
173
+ * which exits 1 on a warning, read as a non-blocking warn) — whatever field the
174
+ * probe's reader keys on: the CI step that wrote it exited non-zero. `2` is
175
+ * NOT VERIFIED: an unmeasured verdict is never a pass.
176
+ */
177
+ function reportExitVeto(read, json) {
178
+ const exit = json['exitCode'];
179
+ const lenient = read.verdict === CiPredictVerdict.Pass || read.verdict === CiPredictVerdict.Warn;
180
+ if (!lenient || typeof exit !== 'number' || exit === 0)
181
+ return { ...read };
182
+ return {
183
+ verdict: CiPredictVerdict.Fail,
184
+ summary: `${read.summary} — but the report's exitCode is ${exit}${exit === 2 ? ' (NOT VERIFIED)' : ''}, so the CI step fails`,
185
+ };
186
+ }
154
187
  export function buildCiPredictReport(options) {
155
188
  const reportsDir = options.reportsDir
156
189
  ? (nodePath.isAbsolute(options.reportsDir) ? options.reportsDir : nodePath.resolve(options.projectRoot, options.reportsDir))
@@ -173,7 +206,7 @@ export function buildCiPredictReport(options) {
173
206
  }
174
207
  try {
175
208
  const json = JSON.parse(readFileSync(file, 'utf8'));
176
- const r = p.reader(json);
209
+ const r = reportExitVeto(p.reader(json), json);
177
210
  gates.push({
178
211
  id: p.id,
179
212
  title: p.title,
@@ -10,6 +10,46 @@ export interface ICodeIntelligenceDoctorOptions {
10
10
  * to flip a fresh fixture into "stale" without changing mtime.
11
11
  */
12
12
  staleThresholdDays?: number;
13
+ /**
14
+ * How far the graph index has diverged from the working tree.
15
+ *
16
+ * THE freshness verdict. Age is a display detail: an index built five days
17
+ * ago with nothing changed since is current, and one built a minute ago with
18
+ * a file changed since is not. Judging by age alone produced the exact
19
+ * contradiction this input exists to end — `graph status` reporting `stale`
20
+ * while this digest reported `fresh (1m ago)` on the same index in the same
21
+ * second, and every arch/cycle count derived from it inheriting the staleness
22
+ * unmarked.
23
+ *
24
+ * Injected because `detectGraphFreshness` lives in `@shrkcrft/graph`, which
25
+ * sits ABOVE inspector in the layer order. Callers that can see the graph
26
+ * (cli, mcp-server) pass it; when it is absent the checks report
27
+ * "not verified" rather than guessing from a timestamp.
28
+ */
29
+ graphDivergence?: IGraphDivergence;
30
+ }
31
+ /**
32
+ * The working-tree divergence of a stored index.
33
+ *
34
+ * Structurally identical to `@shrkcrft/graph`'s `IGraphFreshness` so a caller
35
+ * can pass that value straight through — declared here because this layer
36
+ * cannot import that package.
37
+ */
38
+ export interface IGraphDivergence {
39
+ /** False when no index has been built at all. */
40
+ readonly hasIndex: boolean;
41
+ /** Indexed files whose content changed since. */
42
+ readonly modified: readonly string[];
43
+ /** Files on disk the index has never seen. */
44
+ readonly added: readonly string[];
45
+ /** Indexed files that no longer exist. */
46
+ readonly deleted: readonly string[];
47
+ /**
48
+ * Workspace packages whose indexed record diverged (a package.json entry
49
+ * edited, a package added / removed / moved) — an index input no file
50
+ * fingerprint covers. Optional: absent reads as none.
51
+ */
52
+ readonly packagesChanged?: readonly string[];
13
53
  }
14
54
  /**
15
55
  * Read every code-intelligence package's persisted state and produce a
@@ -1 +1 @@
1
- {"version":3,"file":"code-intelligence-doctor.d.ts","sourceRoot":"","sources":["../src/code-intelligence-doctor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAoKvE,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,8BAAmC,GAC3C,YAAY,EAAE,CAkBhB"}
1
+ {"version":3,"file":"code-intelligence-doctor.d.ts","sourceRoot":"","sources":["../src/code-intelligence-doctor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAoKvE,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;;;;OAeG;IACH,eAAe,CAAC,EAAE,gBAAgB,CAAC;CACpC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AA8BD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,8BAAmC,GAC3C,YAAY,EAAE,CAkBhB"}
@@ -43,6 +43,36 @@ function sumValues(rec) {
43
43
  }
44
44
  return total;
45
45
  }
46
+ /**
47
+ * Files + workspace packages the index is behind by (`graphFreshnessBehind`'s
48
+ * count, so this and `graph status` agree), or `undefined` when divergence was
49
+ * not measured.
50
+ */
51
+ function behindCount(d) {
52
+ if (!d || !d.hasIndex)
53
+ return undefined;
54
+ return d.modified.length + d.added.length + d.deleted.length + (d.packagesChanged?.length ?? 0);
55
+ }
56
+ /** "N file(s)", plus " and P workspace package(s)" when any package diverged. */
57
+ function behindPhrase(d) {
58
+ const files = d.modified.length + d.added.length + d.deleted.length;
59
+ const pkgs = d.packagesChanged?.length ?? 0;
60
+ return pkgs > 0 ? `${files} file(s) and ${pkgs} workspace package(s)` : `${files} file(s)`;
61
+ }
62
+ /** A human summary of what diverged, for the stale message. */
63
+ function divergenceSummary(d) {
64
+ const parts = [];
65
+ if (d.modified.length > 0)
66
+ parts.push(`${d.modified.length} modified`);
67
+ if (d.added.length > 0)
68
+ parts.push(`${d.added.length} new`);
69
+ if (d.deleted.length > 0)
70
+ parts.push(`${d.deleted.length} deleted`);
71
+ const pkgs = d.packagesChanged ?? [];
72
+ if (pkgs.length > 0)
73
+ parts.push(`package entry changed: ${pkgs.slice(0, 3).join(', ')}${pkgs.length > 3 ? ` +${pkgs.length - 3} more` : ''}`);
74
+ return parts.join(', ');
75
+ }
46
76
  /**
47
77
  * Read every code-intelligence package's persisted state and produce a
48
78
  * compact set of doctor findings. The function is sync (matches the
@@ -53,12 +83,12 @@ export function buildCodeIntelligenceChecks(projectRoot, options = {}) {
53
83
  const nowMs = options.nowMs ?? Date.now();
54
84
  const staleDays = options.staleThresholdDays ?? STALE_THRESHOLD_DAYS;
55
85
  const checks = [];
56
- checks.push(...graphChecks(projectRoot, nowMs, staleDays));
86
+ checks.push(...graphChecks(projectRoot, nowMs, options.graphDivergence));
57
87
  checks.push(...ruleGraphChecks(projectRoot, nowMs, staleDays));
58
88
  checks.push(...apiSurfaceChecks(projectRoot, nowMs, staleDays));
59
89
  checks.push(...qualityGateChecks(projectRoot, nowMs, staleDays));
60
90
  checks.push(...migrationChecks(projectRoot));
61
- checks.push(...architectureChecks(projectRoot, nowMs, staleDays));
91
+ checks.push(...architectureChecks(projectRoot, nowMs, staleDays, options.graphDivergence));
62
92
  checks.push(...impactRunChecks(projectRoot, nowMs, staleDays));
63
93
  checks.push(...frameworkChecks(projectRoot, nowMs, staleDays));
64
94
  checks.push(...structuralRegistryChecks(projectRoot));
@@ -87,7 +117,7 @@ const EXPECTED_SCHEMAS = [
87
117
  { rel: 'structural/patterns.json', expected: 'sharkcraft.structural-pattern-registry/v1', package: '@shrkcrft/structural-search' },
88
118
  { rel: 'context-planner/intent-benchmark.json', expected: 'sharkcraft.intent-benchmark/v1', package: '@shrkcrft/context-planner' },
89
119
  ];
90
- function graphChecks(projectRoot, nowMs, staleDays) {
120
+ function graphChecks(projectRoot, nowMs, divergence) {
91
121
  const metaPath = nodePath.join(projectRoot, '.sharkcraft', 'graph', 'meta.json');
92
122
  if (!existsSync(metaPath)) {
93
123
  return [
@@ -116,8 +146,11 @@ function graphChecks(projectRoot, nowMs, staleDays) {
116
146
  ];
117
147
  }
118
148
  const days = ageDays(manifest.lastIndexedAt, nowMs);
119
- const stale = days !== undefined && days > staleDays;
120
- const ageStr = days !== undefined ? ` (${fmtAge(days)})` : '';
149
+ // Divergence is the verdict; age is a display detail. `behind === undefined`
150
+ // means nobody measured it — which is NOT a pass, so the check says so
151
+ // instead of falling back to the timestamp that caused the contradiction.
152
+ const behind = behindCount(divergence);
153
+ const ageStr = days !== undefined ? ` (indexed ${fmtAge(days)})` : '';
121
154
  const counts = `${manifest.filesIndexed ?? 0} files, ${sumValues(manifest.nodesByKind)} nodes, ${sumValues(manifest.edgesByKind)} edges`;
122
155
  const cycleTag = typeof manifest.cycleCount === 'number' && manifest.cycleCount > 0
123
156
  ? `, ${manifest.cycleCount} cycle${manifest.cycleCount === 1 ? '' : 's'}` +
@@ -126,15 +159,33 @@ function graphChecks(projectRoot, nowMs, staleDays) {
126
159
  : '')
127
160
  : '';
128
161
  const out = [];
129
- if (stale) {
162
+ if (behind === undefined) {
163
+ // Nothing measured the divergence, so "current" would be a guess. The
164
+ // loud-skip contract the six rule planes honour says an unverified result
165
+ // is neither a pass nor a failure — it is "nothing was verified".
166
+ out.push({
167
+ id: 'code-intelligence-graph',
168
+ title: 'Code-intelligence graph index',
169
+ severity: DoctorSeverity.Info,
170
+ advisory: true,
171
+ category: CATEGORY,
172
+ message: `Graph index freshness NOT VERIFIED${ageStr} — ${counts}${cycleTag}.`,
173
+ fix: 'Run `shrk graph status` for the divergence-checked verdict.',
174
+ whyThisMatters: 'Age is not freshness: an index built days ago with nothing changed since is current, and one built a minute ago with a file changed since is not. Reporting the timestamp as a verdict is how a stale index gets read as authoritative.',
175
+ });
176
+ }
177
+ else if (behind > 0) {
130
178
  out.push({
131
179
  id: 'code-intelligence-graph',
132
180
  title: 'Code-intelligence graph index',
133
181
  severity: DoctorSeverity.Warning,
134
182
  advisory: true,
135
183
  category: CATEGORY,
136
- message: `Graph index is stale${ageStr} — ${counts}${cycleTag}.`,
137
- fix: 'Re-index with `shrk graph index --changed` (or `--full`).',
184
+ message: `Graph index STALE — ${behindPhrase(divergence)} changed since index ` +
185
+ `(${divergenceSummary(divergence)})${ageStr}; ${counts}${cycleTag}.`,
186
+ fix: (divergence.packagesChanged?.length ?? 0) > 0
187
+ ? 'Re-index with `shrk graph index` — a workspace package entry changed, and only a full index re-resolves the imports of it.'
188
+ : 'Re-index with `shrk graph index --changed` (or `--full`).',
138
189
  whyThisMatters: 'Stale code graph makes `shrk impact`, `shrk graph callers`, and context packs return outdated answers.',
139
190
  });
140
191
  }
@@ -144,7 +195,7 @@ function graphChecks(projectRoot, nowMs, staleDays) {
144
195
  title: 'Code-intelligence graph index',
145
196
  severity: DoctorSeverity.Ok,
146
197
  category: CATEGORY,
147
- message: `Graph index fresh${ageStr} — ${counts}${cycleTag}.`,
198
+ message: `Graph index current${ageStr} — ${counts}${cycleTag}.`,
148
199
  });
149
200
  }
150
201
  // Cycles ≥ a heuristic threshold of 5 (or any 3+-file cycle) become
@@ -229,7 +280,7 @@ function ruleGraphChecks(projectRoot, nowMs, staleDays) {
229
280
  category: CATEGORY,
230
281
  message: `Rule-graph bridge is stale${ageStr} — ${counts}.`,
231
282
  fix: 'Re-build with `shrk graph index` (bridges build alongside graph).',
232
- whyThisMatters: 'A stale bridge means `shrk rules where applies-to <file>` and rule-aware impact answers may miss recent edits.',
283
+ whyThisMatters: 'A stale bridge means `shrk why <file>` and rule-aware impact answers may miss recent edits.',
233
284
  });
234
285
  }
235
286
  else {
@@ -263,7 +314,7 @@ function ruleGraphChecks(projectRoot, nowMs, staleDays) {
263
314
  advisory: true,
264
315
  category: CATEGORY,
265
316
  message: `${baseMsg} ${uncovered} file(s) have no applicable rule.`,
266
- fix: 'Inspect with `shrk rules where applies-to <file>` and either broaden a rule\'s `appliesTo` / boundary `from`, or accept the gap.',
317
+ fix: 'Inspect with `shrk why <file>` and either broaden a rule\'s `appliesTo` / boundary `from`, or accept the gap.',
267
318
  whyThisMatters: 'Files with no applicable rule are invisible to rule-aware impact, validation hints, and agent context packs. A growing coverage gap usually means the rule registry is drifting behind the codebase.',
268
319
  });
269
320
  }
@@ -400,7 +451,7 @@ function qualityGateChecks(projectRoot, nowMs, staleDays) {
400
451
  },
401
452
  ];
402
453
  }
403
- function architectureChecks(projectRoot, nowMs, staleDays) {
454
+ function architectureChecks(projectRoot, nowMs, staleDays, divergence) {
404
455
  const archDir = nodePath.join(projectRoot, '.sharkcraft', 'architecture');
405
456
  const baselinePath = nodePath.join(archDir, 'baseline.json');
406
457
  const lastPath = nodePath.join(archDir, 'last.json');
@@ -477,6 +528,29 @@ function architectureChecks(projectRoot, nowMs, staleDays) {
477
528
  (baseline.countsBySeverity?.['error'] ?? 0);
478
529
  const warnDelta = (last.countsBySeverity?.['warning'] ?? 0) -
479
530
  (baseline.countsBySeverity?.['warning'] ?? 0);
531
+ // A delta computed from an index the working tree has moved past is neither
532
+ // a green nor a red — it is "nothing was verified". This is the loud-skip
533
+ // contract the six data-defined rule planes already honour, extended to the
534
+ // graph-derived findings. It failed in both directions before: a digest
535
+ // under-reported real architecture debt 5-of-6 while displaying "fresh", and
536
+ // the same stale snapshot can just as easily report a violation that has
537
+ // already been fixed.
538
+ const behind = behindCount(divergence);
539
+ if (behind !== undefined && behind > 0) {
540
+ return [
541
+ {
542
+ id: 'code-intelligence-architecture',
543
+ title: 'Architecture baseline',
544
+ severity: DoctorSeverity.Info,
545
+ advisory: true,
546
+ category: CATEGORY,
547
+ message: `Architecture delta NOT VERIFIED — the graph index is ${behindPhrase(divergence)} behind ` +
548
+ `(${divergenceSummary(divergence)}), so any count derived from it is out of date.`,
549
+ fix: 'Re-index with `shrk graph index --changed`, then `shrk arch check`.',
550
+ whyThisMatters: 'A count from a stale index misses violations in files it never saw AND reports ones already fixed. Presenting it as a number invites acting on both.',
551
+ },
552
+ ];
553
+ }
480
554
  if (newCount === 0 && errDelta <= 0 && warnDelta <= 0) {
481
555
  return [
482
556
  {