@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
@@ -1,18 +1,115 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import * as nodePath from 'node:path';
3
- import { importModuleViaLoader } from '@shrkcrft/core';
3
+ import { describeEntryValue, importModuleViaLoader, indexListPath, isMarkerObject, MARKABLE_UNIT_LISTS, MarkableUnitList, normalizeUnitMap, readContributionExport, RejectionCause, stampUnitMarks, unitProblemsOf, } from '@shrkcrft/core';
4
+ import { isSearchDocumentPrefix, parseSearchDocumentId, SEARCH_DOCUMENT_PREFIXES, searchKindForPrefix, } from "./search-document-id.js";
4
5
  export const SEARCH_TUNING_SCHEMA = 'sharkcraft.search-tuning-registry/v1';
5
6
  const CACHE = new Map();
6
7
  const MAX_BOOST = 5;
7
- async function importDefault(file) {
8
- const mod = (await importModuleViaLoader(file));
9
- if (Array.isArray(mod.default))
10
- return mod.default;
11
- if (mod.default && typeof mod.default === 'object')
12
- return [mod.default];
13
- if (Array.isArray(mod.searchTuning))
14
- return mod.searchTuning;
15
- return [];
8
+ /** The per-boost clamp: every single boost value is clamped to ±this. */
9
+ export const SEARCH_TUNING_BOOST_CLAMP = MAX_BOOST;
10
+ /** The global cap: the total tuning delta on ONE document is clamped to ±this. */
11
+ export const SEARCH_TUNING_TOTAL_CAP = MAX_BOOST * 2;
12
+ async function importTunings(file) {
13
+ return readContributionExport(await importModuleViaLoader(file), { namedKeys: ['searchTuning'] });
14
+ }
15
+ /** THE list paths of the markable boost maps — the loader's marks and the lint's observations share them. */
16
+ export const SEARCH_TUNING_BOOST_IDS = MARKABLE_UNIT_LISTS[MarkableUnitList.SearchTuningBoostIds].listPath;
17
+ const TASK_HINT_BOOST_IDS = MARKABLE_UNIT_LISTS[MarkableUnitList.SearchTuningTaskHintBoostIds].listPath;
18
+ /** `taskHints[<i>].boostIds` — THE path a task hint's marks and observations are keyed by. */
19
+ export function searchTuningTaskHintBoostIdsPath(index) {
20
+ return indexListPath(TASK_HINT_BOOST_IDS, index);
21
+ }
22
+ /**
23
+ * A markable boost map (`boostIds`, `taskHints[i].boostIds`): THE core parser's
24
+ * problems (a value neither a number nor a `{ weight, expectEmpty: true }`
25
+ * marker — alpha.30 silently clamped such a value to 0), plus a marker on a key
26
+ * that can NEVER fire (no `<kind>:` search-document prefix, or a kind the
27
+ * entry's `appliesToKinds` excludes): those are defects, and an expectEmpty
28
+ * marker accepts only a target that does not exist yet.
29
+ */
30
+ function markableBoostProblems(record, listPath, appliesToKinds) {
31
+ const n = normalizeUnitMap(record, listPath);
32
+ if (!n.ok)
33
+ return [...unitProblemsOf(n.error)];
34
+ const out = [];
35
+ for (const m of n.value.marks) {
36
+ const at = `${listPath}[${JSON.stringify(m.unit)}]`;
37
+ const parsed = parseSearchDocumentId(m.unit);
38
+ if (!parsed || !isSearchDocumentPrefix(parsed.prefix)) {
39
+ out.push(`${at}: an expectEmpty marker on a key that can never fire — a boost key is a search-document id \`<kind>:<id>\` (${SEARCH_DOCUMENT_PREFIXES.join(', ')}); fix the key (a marker accepts only a target that does not exist yet)`);
40
+ continue;
41
+ }
42
+ const kind = searchKindForPrefix(parsed.prefix) ?? parsed.prefix;
43
+ if (Array.isArray(appliesToKinds) && !appliesToKinds.includes(kind)) {
44
+ out.push(`${at}: an expectEmpty marker on a ${kind} key its entry's appliesToKinds [${appliesToKinds.join(', ')}] excludes, so the boost can never fire — fix the key or appliesToKinds`);
45
+ }
46
+ }
47
+ return out;
48
+ }
49
+ /** A plain boost map (`boostTags`, `boostSources`, `taskHints[i].boostTags|boostKinds`): numbers only. */
50
+ function plainBoostProblems(record, field) {
51
+ if (!isMarkerObject(record))
52
+ return [`${field}: must be a map of name → number (got ${describeEntryValue(record)})`];
53
+ const out = [];
54
+ for (const [key, value] of Object.entries(record)) {
55
+ if (typeof value === 'number')
56
+ continue;
57
+ out.push(`${field}[${JSON.stringify(key)}]: must be a number (got ${describeEntryValue(value)})${isMarkerObject(value)
58
+ ? ' — an expectEmpty marker is accepted only in boostIds and taskHints[].boostIds, whose keys name documents'
59
+ : ''}`);
60
+ }
61
+ return out;
62
+ }
63
+ /**
64
+ * THE search-tuning acceptance predicate (round 12, 12.1; round 13): a
65
+ * non-empty string `id`, and — so an older engine's silent clamp-to-0 can never
66
+ * recur here — every boost value a number (or, in `boostIds` /
67
+ * `taskHints[].boostIds`, a well-formed `{ weight, expectEmpty: true, reason? }`
68
+ * marker on a key that can fire), `taskHints` an array of objects with string
69
+ * `whenTokens`, and no authored `expectEmptyUnits` (the loader derives it).
70
+ * `[]` means accepted.
71
+ */
72
+ export function searchTuningRejectionReasons(raw) {
73
+ if (!raw || typeof raw !== 'object' || Array.isArray(raw))
74
+ return ['(entry): must be an object'];
75
+ const o = raw;
76
+ const out = [];
77
+ if (!(typeof o.id === 'string' && o.id.length > 0))
78
+ out.push('id: must be a non-empty string');
79
+ if ('expectEmptyUnits' in o) {
80
+ out.push(`expectEmptyUnits: derived by the loader — mark the boost itself: boostIds: { '<kind>:<id>': { weight, expectEmpty: true } }`);
81
+ }
82
+ if (o.boostIds !== undefined)
83
+ out.push(...markableBoostProblems(o.boostIds, SEARCH_TUNING_BOOST_IDS, o.appliesToKinds));
84
+ for (const field of ['boostTags', 'boostSources']) {
85
+ if (o[field] !== undefined)
86
+ out.push(...plainBoostProblems(o[field], field));
87
+ }
88
+ if (o.taskHints !== undefined) {
89
+ if (!Array.isArray(o.taskHints)) {
90
+ out.push(`taskHints: must be an array (got ${describeEntryValue(o.taskHints)})`);
91
+ }
92
+ else {
93
+ o.taskHints.forEach((h, i) => {
94
+ if (!isMarkerObject(h)) {
95
+ out.push(`taskHints[${i}]: must be an object (got ${describeEntryValue(h)})`);
96
+ return;
97
+ }
98
+ const tokens = h['whenTokens'];
99
+ if (tokens !== undefined && (!Array.isArray(tokens) || tokens.some((t) => typeof t !== 'string'))) {
100
+ out.push(`taskHints[${i}].whenTokens: must be an array of strings (got ${describeEntryValue(tokens)})`);
101
+ }
102
+ if (h['boostIds'] !== undefined) {
103
+ out.push(...markableBoostProblems(h['boostIds'], searchTuningTaskHintBoostIdsPath(i), o.appliesToKinds));
104
+ }
105
+ for (const field of ['boostTags', 'boostKinds']) {
106
+ if (h[field] !== undefined)
107
+ out.push(...plainBoostProblems(h[field], `taskHints[${i}].${field}`));
108
+ }
109
+ });
110
+ }
111
+ }
112
+ return out;
16
113
  }
17
114
  function localTuningFiles(inspection) {
18
115
  const out = [];
@@ -24,10 +121,9 @@ function localTuningFiles(inspection) {
24
121
  if (existsSync(full))
25
122
  out.push(full);
26
123
  }
27
- const cfg = inspection.config;
28
- for (const rel of cfg?.searchTuningFiles ?? []) {
29
- out.push(nodePath.join(dir, rel));
30
- }
124
+ // More tuning files come from pack manifests (`contributions.searchTuningFiles`,
125
+ // loaded below; docs/search-tuning.md) — there is no local-config key for
126
+ // them; the strict config schema rejects one, so a local read could never run.
31
127
  return out;
32
128
  }
33
129
  function clampBoost(value) {
@@ -39,14 +135,62 @@ function clampBoost(value) {
39
135
  return -MAX_BOOST;
40
136
  return value;
41
137
  }
42
- function sanitize(raw, source, packageName, sourceFile, issues) {
43
- if (typeof raw.id !== 'string' || raw.id.length === 0) {
138
+ function sanitize(input, source, packageName, sourceFile, issues, rejected, at) {
139
+ const reasons = searchTuningRejectionReasons(input);
140
+ if (reasons.length > 0) {
141
+ // `search tuning doctor` keeps its `missing-id` warning; THE rejection
142
+ // channel carries the structured record every other surface reads. An
143
+ // entry refused for anything else (round 13: a boost value that is neither
144
+ // a number nor a well-formed marker, a marker on a key that can never
145
+ // fire) is an ERROR — it used to load with the value clamped to 0.
146
+ const rawId = input.id;
147
+ const entryId = typeof rawId === 'string' && rawId.length > 0 ? rawId : undefined;
148
+ const where = `${sourceFile} (${at.exportName ?? 'default'}[${at.index}])`;
149
+ issues.push(entryId === undefined
150
+ ? { severity: 'warning', code: 'missing-id', message: `Tuning entry ${where} has no id; skipped.`, source: sourceFile }
151
+ : {
152
+ severity: 'error',
153
+ code: 'invalid-entry',
154
+ message: `Tuning entry "${entryId}" in ${where} was rejected — ${reasons.join('; ')}.`,
155
+ tuningId: entryId,
156
+ source: sourceFile,
157
+ });
158
+ rejected.push({ ...at, ...(entryId !== undefined ? { entryId } : {}), reasons, cause: RejectionCause.Invalid });
159
+ return null;
160
+ }
161
+ const raw = input;
162
+ // THE value-form parser BEFORE the clamp (round 13): a `{ weight, expectEmpty }`
163
+ // value keeps its weight and joins the ledger — it is never clamped to 0 again.
164
+ const marks = [];
165
+ const idMaps = [];
166
+ const idMapProblems = [];
167
+ for (const [record, listPath] of [
168
+ [raw.boostIds, SEARCH_TUNING_BOOST_IDS],
169
+ ...(raw.taskHints ?? []).map((h, i) => [h.boostIds, searchTuningTaskHintBoostIdsPath(i)]),
170
+ ]) {
171
+ if (record === undefined) {
172
+ idMaps.push(undefined);
173
+ continue;
174
+ }
175
+ const n = normalizeUnitMap(record, listPath);
176
+ if (!n.ok) {
177
+ idMapProblems.push(...unitProblemsOf(n.error));
178
+ idMaps.push(undefined);
179
+ continue;
180
+ }
181
+ marks.push(...n.value.marks);
182
+ idMaps.push({ ...n.value.values });
183
+ }
184
+ if (idMapProblems.length > 0) {
185
+ // Unreachable past the predicate; a refusal, never a silent clamp.
44
186
  issues.push({
45
- severity: 'warning',
46
- code: 'missing-id',
47
- message: 'Tuning entry has no id; skipped.',
187
+ severity: 'error',
188
+ code: 'invalid-entry',
189
+ message: `Tuning entry "${raw.id}" in ${sourceFile} was rejected — ${idMapProblems.join('; ')}.`,
190
+ tuningId: raw.id,
48
191
  source: sourceFile,
49
192
  });
193
+ rejected.push({ ...at, entryId: raw.id, reasons: idMapProblems, cause: RejectionCause.Invalid });
50
194
  return null;
51
195
  }
52
196
  const out = {
@@ -55,12 +199,17 @@ function sanitize(raw, source, packageName, sourceFile, issues) {
55
199
  ...(packageName ? { packageName } : {}),
56
200
  sourceFile,
57
201
  };
202
+ const stamped = stampUnitMarks(marks, packageName);
203
+ if (stamped.length > 0)
204
+ out.expectEmptyUnits = stamped;
58
205
  if (raw.appliesToKinds)
59
206
  out.appliesToKinds = raw.appliesToKinds;
60
207
  if (raw.mergeStrategy === 'sum' || raw.mergeStrategy === 'max') {
61
208
  out.mergeStrategy = raw.mergeStrategy;
62
209
  }
63
- const sanitizeRecord = (rec) => {
210
+ // `field` names the map a clamped key came from, so a consumer can tell a
211
+ // search-document id (`boostIds`) from a tag / source / kind name.
212
+ const sanitizeRecord = (rec, field) => {
64
213
  if (!rec)
65
214
  return undefined;
66
215
  const result = {};
@@ -73,28 +222,35 @@ function sanitize(raw, source, packageName, sourceFile, issues) {
73
222
  message: `Boost for "${k}" clamped to ${clamped} (was ${v}).`,
74
223
  tuningId: raw.id,
75
224
  source: sourceFile,
225
+ key: k,
226
+ field,
227
+ original: v,
228
+ clamped,
76
229
  });
77
230
  }
78
231
  result[k] = clamped;
79
232
  }
80
233
  return result;
81
234
  };
82
- const boostTags = sanitizeRecord(raw.boostTags);
235
+ const boostTags = sanitizeRecord(raw.boostTags, 'boostTags');
83
236
  if (boostTags)
84
237
  out.boostTags = boostTags;
85
- const boostIds = sanitizeRecord(raw.boostIds);
238
+ const boostIds = sanitizeRecord(idMaps[0], SEARCH_TUNING_BOOST_IDS);
86
239
  if (boostIds)
87
240
  out.boostIds = boostIds;
88
- const boostSources = sanitizeRecord(raw.boostSources);
241
+ const boostSources = sanitizeRecord(raw.boostSources, 'boostSources');
89
242
  if (boostSources)
90
243
  out.boostSources = boostSources;
91
244
  if (raw.taskHints) {
92
- out.taskHints = raw.taskHints.map((h) => ({
93
- ...(h.whenTokens ? { whenTokens: h.whenTokens.map((t) => t.toLowerCase()) } : {}),
94
- ...(h.boostTags ? { boostTags: sanitizeRecord(h.boostTags) } : {}),
95
- ...(h.boostKinds ? { boostKinds: sanitizeRecord(h.boostKinds) } : {}),
96
- ...(h.boostIds ? { boostIds: sanitizeRecord(h.boostIds) } : {}),
97
- }));
245
+ out.taskHints = raw.taskHints.map((h, i) => {
246
+ const ids = idMaps[i + 1];
247
+ return {
248
+ ...(h.whenTokens ? { whenTokens: h.whenTokens.map((t) => t.toLowerCase()) } : {}),
249
+ ...(h.boostTags ? { boostTags: sanitizeRecord(h.boostTags, `taskHints[${i}].boostTags`) } : {}),
250
+ ...(h.boostKinds ? { boostKinds: sanitizeRecord(h.boostKinds, `taskHints[${i}].boostKinds`) } : {}),
251
+ ...(ids ? { boostIds: sanitizeRecord(ids, searchTuningTaskHintBoostIdsPath(i)) } : {}),
252
+ };
253
+ });
98
254
  }
99
255
  return out;
100
256
  }
@@ -104,18 +260,25 @@ export async function loadSearchTuning(inspection) {
104
260
  .join(',')}`;
105
261
  const cached = CACHE.get(inspection.projectRoot);
106
262
  if (cached && cached.cacheKey === cacheKey) {
107
- return { entries: cached.entries, issues: cached.issues };
263
+ return { entries: cached.entries, issues: cached.issues, rejected: cached.rejected };
108
264
  }
109
265
  const entries = [];
110
266
  const issues = [];
267
+ const rejected = [];
268
+ const ingestAll = (exp, file, source, packageName, sourceFile) => {
269
+ exp.items.forEach((raw, i) => {
270
+ const ent = sanitize(raw, source, packageName, sourceFile, issues, rejected, {
271
+ file,
272
+ index: exp.single ? -1 : i,
273
+ ...(exp.exportName ? { exportName: exp.exportName } : {}),
274
+ });
275
+ if (ent)
276
+ entries.push(ent);
277
+ });
278
+ };
111
279
  for (const file of localTuningFiles(inspection)) {
112
280
  try {
113
- const list = await importDefault(file);
114
- for (const raw of list) {
115
- const ent = sanitize(raw, 'local', undefined, nodePath.relative(inspection.projectRoot, file), issues);
116
- if (ent)
117
- entries.push(ent);
118
- }
281
+ ingestAll(await importTunings(file), file, 'local', undefined, nodePath.relative(inspection.projectRoot, file));
119
282
  }
120
283
  catch (e) {
121
284
  issues.push({
@@ -140,12 +303,7 @@ export async function loadSearchTuning(inspection) {
140
303
  continue;
141
304
  }
142
305
  try {
143
- const list = await importDefault(file);
144
- for (const raw of list) {
145
- const ent = sanitize(raw, 'pack', pack.packageName, rel, issues);
146
- if (ent)
147
- entries.push(ent);
148
- }
306
+ ingestAll(await importTunings(file), file, 'pack', pack.packageName, rel);
149
307
  }
150
308
  catch (e) {
151
309
  issues.push({
@@ -157,8 +315,8 @@ export async function loadSearchTuning(inspection) {
157
315
  }
158
316
  }
159
317
  }
160
- CACHE.set(inspection.projectRoot, { cacheKey, entries, issues });
161
- return { entries, issues };
318
+ CACHE.set(inspection.projectRoot, { cacheKey, entries, issues, rejected });
319
+ return { entries, issues, rejected };
162
320
  }
163
321
  export function listSearchTuning(inspection) {
164
322
  const cached = CACHE.get(inspection.projectRoot);
@@ -286,10 +444,17 @@ export function tuningBoostFor(doc, tokens, entries) {
286
444
  reasons.push(`tuning:${c.tuningId} ${key} ${c.value > 0 ? '+' : ''}${c.value}${contributors.length > 1 ? ' (strategy=' + strategy + ')' : ''}`);
287
445
  }
288
446
  }
289
- // Global cap so tuning can't dominate the natural signal.
290
- if (delta > MAX_BOOST * 2)
291
- delta = MAX_BOOST * 2;
292
- if (delta < -MAX_BOOST * 2)
293
- delta = -MAX_BOOST * 2;
447
+ // Global cap so tuning can't dominate the natural signal — reported, never
448
+ // silent: the reason names what was discarded.
449
+ const raw = delta;
450
+ if (delta > SEARCH_TUNING_TOTAL_CAP)
451
+ delta = SEARCH_TUNING_TOTAL_CAP;
452
+ if (delta < -SEARCH_TUNING_TOTAL_CAP)
453
+ delta = -SEARCH_TUNING_TOTAL_CAP;
454
+ if (delta !== raw) {
455
+ const signed = (n) => `${n > 0 ? '+' : ''}${n}`;
456
+ reasons.push(`tuning-cap: raw ${signed(raw)} -> ${signed(delta)}`);
457
+ return { delta, reasons, composition, capped: { raw, applied: delta } };
458
+ }
294
459
  return { delta, reasons, composition };
295
460
  }
@@ -35,6 +35,18 @@ export interface ISelfAuditReport {
35
35
  findings: readonly ISelfAuditFinding[];
36
36
  ok: boolean;
37
37
  }
38
+ /**
39
+ * THE host authority: is `projectRoot` SharkCraft's OWN repository? Every
40
+ * "is this the tool repo" decision reads it — `self audit`, `install smoke`,
41
+ * the MCP self-audit tool, and the surface tier resolver that gates
42
+ * tool-maintenance commands (round 11 §5.1) everywhere else.
43
+ *
44
+ * The tool's identity is its CLI package: `packages/cli/package.json` named
45
+ * `@shrkcrft/cli`, plus either the root package named `sharkcraft` or the
46
+ * sibling inspector + mcp-server packages. Directory markers alone would
47
+ * misfire on any consumer monorepo that happens to have `packages/cli`,
48
+ * `packages/inspector` and `packages/mcp-server`.
49
+ */
38
50
  export declare function detectSharkcraftRepo(projectRoot: string): boolean;
39
51
  export interface ISelfAuditInput {
40
52
  /** Caller can pass pre-computed verdicts. */
@@ -1 +1 @@
1
- {"version":3,"file":"self-audit.d.ts","sourceRoot":"","sources":["../src/self-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,iBAAiB,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACvC,EAAE,EAAE,OAAO,CAAC;CACb;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAajE;AAED,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gEAAgE;IAChE,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,wDAAwD;IACxD,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,qBAAqB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,GAAE,eAAoB,GAAG,gBAAgB,CAgIjG;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAWpE"}
1
+ {"version":3,"file":"self-audit.d.ts","sourceRoot":"","sources":["../src/self-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,iBAAiB,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACvC,EAAE,EAAE,OAAO,CAAC;CACb;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAYjE;AAYD,MAAM,WAAW,eAAe;IAC9B,6CAA6C;IAC7C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gEAAgE;IAChE,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACjC,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,wDAAwD;IACxD,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,qBAAqB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,GAAE,eAAoB,GAAG,gBAAgB,CAkIjG;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAWpE"}
@@ -21,20 +21,44 @@
21
21
  import { existsSync, readFileSync } from 'node:fs';
22
22
  import * as nodePath from 'node:path';
23
23
  export const SELF_AUDIT_SCHEMA = 'sharkcraft.self-audit/v1';
24
+ /** The package name of the CLI inside SharkCraft's own repository. */
25
+ const TOOL_CLI_PACKAGE = '@shrkcrft/cli';
26
+ /**
27
+ * THE host authority: is `projectRoot` SharkCraft's OWN repository? Every
28
+ * "is this the tool repo" decision reads it — `self audit`, `install smoke`,
29
+ * the MCP self-audit tool, and the surface tier resolver that gates
30
+ * tool-maintenance commands (round 11 §5.1) everywhere else.
31
+ *
32
+ * The tool's identity is its CLI package: `packages/cli/package.json` named
33
+ * `@shrkcrft/cli`, plus either the root package named `sharkcraft` or the
34
+ * sibling inspector + mcp-server packages. Directory markers alone would
35
+ * misfire on any consumer monorepo that happens to have `packages/cli`,
36
+ * `packages/inspector` and `packages/mcp-server`.
37
+ */
24
38
  export function detectSharkcraftRepo(projectRoot) {
25
39
  const pkgFile = nodePath.join(projectRoot, 'package.json');
26
40
  if (!existsSync(pkgFile))
27
41
  return false;
28
42
  try {
29
43
  const pkg = JSON.parse(readFileSync(pkgFile, 'utf8'));
44
+ if (!hasToolCliPackage(projectRoot))
45
+ return false;
30
46
  if (pkg.name === 'sharkcraft')
31
47
  return true;
32
- // Heuristic: monorepo with packages/cli + packages/inspector + packages/mcp-server.
33
- const markers = ['packages/cli', 'packages/inspector', 'packages/mcp-server'];
34
- if (markers.every((m) => existsSync(nodePath.join(projectRoot, m))))
35
- return true;
48
+ const markers = ['packages/inspector', 'packages/mcp-server'];
49
+ return markers.every((m) => existsSync(nodePath.join(projectRoot, m)));
50
+ }
51
+ catch {
36
52
  return false;
37
53
  }
54
+ }
55
+ function hasToolCliPackage(projectRoot) {
56
+ const cliPkg = nodePath.join(projectRoot, 'packages', 'cli', 'package.json');
57
+ if (!existsSync(cliPkg))
58
+ return false;
59
+ try {
60
+ return JSON.parse(readFileSync(cliPkg, 'utf8')).name === TOOL_CLI_PACKAGE;
61
+ }
38
62
  catch {
39
63
  return false;
40
64
  }
@@ -52,8 +76,10 @@ export function buildSelfAudit(projectRoot, input = {}) {
52
76
  id: 'not-sharkcraft-repo',
53
77
  title: 'Self audit applies only to the SharkCraft monorepo',
54
78
  status: 'skipped',
55
- message: 'Run `shrk release readiness` instead for a generic readiness verdict.',
56
- nextCommand: 'shrk release readiness',
79
+ // `release readiness` is itself a tool-maintenance command (gated
80
+ // outside the tool repo); `quality` is the consumer's own gate.
81
+ message: 'Run `shrk quality` instead for this repository\'s own pre-push verdict.',
82
+ nextCommand: 'shrk quality',
57
83
  },
58
84
  ],
59
85
  ok: true,
@@ -129,8 +155,8 @@ export function buildSelfAudit(projectRoot, input = {}) {
129
155
  id: 'mcp-audit',
130
156
  title: 'MCP audit — no write tools',
131
157
  status: 'skipped',
132
- message: 'No verdict supplied — run `shrk mcp audit`.',
133
- nextCommand: 'shrk mcp audit',
158
+ message: 'No verdict supplied — run `shrk safety audit`.',
159
+ nextCommand: 'shrk safety audit',
134
160
  });
135
161
  }
136
162
  else if (input.mcpAuditWriteToolCount === 0) {
@@ -147,7 +173,7 @@ export function buildSelfAudit(projectRoot, input = {}) {
147
173
  title: 'MCP audit — no write tools',
148
174
  status: 'fail',
149
175
  message: `${input.mcpAuditWriteToolCount} MCP tool(s) report write capability — this breaks the safety contract.`,
150
- nextCommand: 'shrk mcp audit',
176
+ nextCommand: 'shrk safety audit',
151
177
  });
152
178
  }
153
179
  const flag = (id, title, ok, nextCommand) => {
@@ -166,7 +192,7 @@ export function buildSelfAudit(projectRoot, input = {}) {
166
192
  flag('runtime-doctor', 'Runtime doctor', input.runtimeDoctorOk ?? null, 'shrk runtime doctor');
167
193
  flag('compat-node', 'compat:node', input.compatNodeOk ?? null, 'bun run compat:node');
168
194
  flag('packs-doctor', 'Packs doctor', input.packsDoctorOk ?? null, 'shrk packs doctor --release');
169
- flag('demo-package-validate', 'Demo package validate', input.demoPackageValidateOk ?? null, 'shrk demo package --validate');
195
+ flag('demo-package-validate', 'Demo package validate', input.demoPackageValidateOk ?? null, 'shrk release smoke');
170
196
  const ok = findings.filter((f) => f.status === 'fail').length === 0;
171
197
  return {
172
198
  schema: SELF_AUDIT_SCHEMA,
@@ -1,3 +1,9 @@
1
+ import { RejectionCause, type IUnitLiveness } from '@shrkcrft/core';
2
+ import { ContributionKind } from './contribution-kind.js';
3
+ import type { IUnresolvableReference } from './i-unresolvable-reference.js';
4
+ import type { IUnresolvableReferenceScan } from './i-unresolvable-reference-scan.js';
5
+ import type { IVerdictCoverage } from '@shrkcrft/core';
6
+ import type { IDeclaredXrefReport } from './i-declared-xref-report.js';
1
7
  import type { ISharkcraftInspection } from './sharkcraft-inspector.js';
2
8
  export declare const SELF_CONFIG_DOCTOR_V2_SCHEMA = "sharkcraft.self-config-doctor/v2";
3
9
  export declare enum SelfConfigSeverityV2 {
@@ -7,9 +13,23 @@ export declare enum SelfConfigSeverityV2 {
7
13
  }
8
14
  /**
9
15
  * Source / target kind taxonomy. Open string for forward-compat with
10
- * pack-contributed kinds, but the engine emits one of these values.
16
+ * pack-contributed kinds, but the engine emits one of these values:
17
+ *
18
+ * - every reference kind maps onto ITSELF (THE table behind `selfKindOf`);
19
+ * - `search-document` — a `<prefix>:<id>` search document whose prefix has no
20
+ * id registry (`doc:README.md`), or the cap summary's "N more document(s)":
21
+ * it exists (or cannot be checked) — it is never "unknown";
22
+ * - `schema` — a declaration-shape finding (relation `validates`) whose target
23
+ * id is the field path (`taskHints[1].whenTokens`, `facets.bad-kind[k1]`);
24
+ * - `self-config` — the doctor itself (its own probe summaries);
25
+ * - every contribution kind maps onto a finding kind (THE table behind
26
+ * `rejectionFindingOf`), so a rejected entry of any loader-backed slot —
27
+ * a construct facet, a feedback rule, a gate-plane rule — has a kind;
28
+ * - `unknown` — RESERVED for a target id that resolves in NO registry, as THE
29
+ * id resolver / THE key resolver answered. Only `selfKindOf(undefined)`
30
+ * produces it (a source lock holds that; round 12, 12.4).
11
31
  */
12
- export type SelfConfigKind = 'knowledge' | 'command' | 'helper' | 'template' | 'playbook' | 'pipeline' | 'policy' | 'rule' | 'path' | 'convention' | 'registration-hint' | 'routing-hint' | 'agent-test' | 'decision' | 'profile' | 'migration-profile' | 'contract-template' | 'pack' | 'schema' | 'file' | 'unknown';
32
+ export type SelfConfigKind = 'knowledge' | 'command' | 'helper' | 'template' | 'playbook' | 'pipeline' | 'policy' | 'rule' | 'path' | 'convention' | 'registration-hint' | 'routing-hint' | 'agent-test' | 'decision' | 'construct' | 'preset' | 'migration-profile' | 'workspace-profile' | 'contract-template' | 'pack' | 'schema' | 'file' | 'directory' | 'symbol' | 'package' | 'url' | 'path-convention' | 'boundary-rule' | 'scaffold-pattern' | 'search-tuning' | 'search-document' | 'self-config' | 'construct-facet' | 'feedback-rule' | 'context-test' | 'docs' | 'delegate-recipe' | 'framework-extractor' | 'wiring-rule' | 'registry' | 'registration-idiom' | 'policy-rule' | 'reuse-primitive' | 'baseline' | 'generated-artifact' | 'doc-reference' | 'unknown';
13
33
  /**
14
34
  * Edge relation taxonomy. Open string to allow future relations.
15
35
  */
@@ -34,6 +54,11 @@ export interface ISelfConfigFindingV2 {
34
54
  * - low — derived from regex / fallback parsing
35
55
  */
36
56
  readonly confidence: 'high' | 'medium' | 'low';
57
+ /**
58
+ * How many times the same (source, relation, target, code) was found — one
59
+ * finding per repeat, never N identical ones sharing a "unique" id.
60
+ */
61
+ readonly occurrences?: number;
37
62
  }
38
63
  export interface ISelfConfigDoctorReportV2 {
39
64
  readonly schema: typeof SELF_CONFIG_DOCTOR_V2_SCHEMA;
@@ -48,10 +73,127 @@ export interface ISelfConfigDoctorReportV2 {
48
73
  bySourceKind: Readonly<Record<string, number>>;
49
74
  byTargetKind: Readonly<Record<string, number>>;
50
75
  }>;
51
- readonly verdict: 'ok' | 'warnings' | 'errors';
76
+ /**
77
+ * `errors` when any error finding; else `unverified` when any `coverage`
78
+ * record has a shortfall (a dead or unverifiable unit — the CLI exits 2);
79
+ * else `warnings` / `ok`.
80
+ */
81
+ readonly verdict: 'ok' | 'warnings' | 'errors' | 'unverified';
52
82
  readonly nextCommands: readonly string[];
83
+ /**
84
+ * Per-unit coverage of every probe family — the ONE list both the verdict
85
+ * above and the CLI's settled exit are derived from (core's
86
+ * `coverageShortfall`): `command strings`, `search tuning` boost keys and
87
+ * task hints, `routing hints` and their recommended ids, `registration
88
+ * hints` discovery selectors and related ids, `scaffold patterns` globs and
89
+ * patterns. A family with no units contributes no record.
90
+ */
91
+ readonly coverage: readonly IVerdictCoverage[];
92
+ /** Every UNMARKED dead unit (a selector that matches nothing, a boost that never fires), labelled — THE families' settled `dead`. */
93
+ readonly deadUnits: readonly string[];
94
+ /**
95
+ * Round 13: every selector unit THE families' settles did not find live —
96
+ * dead, intended-empty (its acceptance rides in {@link coverage}), went-live
97
+ * (a stale `expectEmpty` marker) or unproven — with its state and marker.
98
+ * What `--fail-on-dead-units` decides on (`selectorUnitFails`, through
99
+ * `assetDoctorProposedExit`), so a stale LOCAL marker fails there too.
100
+ */
101
+ readonly selectorUnits: readonly IUnitLiveness[];
102
+ /**
103
+ * Every declared reference the REFERENCE probes could not check — its kind's
104
+ * registry is empty here (`registry-empty`), or nothing can ever fill it
105
+ * (`undeclarable-kind`) — attributed to its file and field (round 12,
106
+ * ONE-CHANGE). Each is an unexamined unit of a coverage record above; `shrk
107
+ * packs contributions` groups the same list per contributed file.
108
+ */
109
+ readonly unresolvableReferences: readonly IUnresolvableReference[];
110
+ /**
111
+ * What the probe passes looked at. `command` covers every command string an
112
+ * asset prescribes (agent tests, routing / registration hints, pipeline
113
+ * steps, playbooks, constructs, presets, knowledge action hints and
114
+ * references, decisions), deduped per (asset, command), each resolved
115
+ * through the injected command resolver. `unverified > 0` means no resolver
116
+ * was injected (outside the CLI): those strings were NOT checked.
117
+ */
118
+ readonly probes: Readonly<{
119
+ command: Readonly<{
120
+ probed: number;
121
+ /** Resolved to a real command (`ok`). */
122
+ exists: number;
123
+ /** Verb proven, internally-dispatched tail not provable — counted, never flagged. */
124
+ prefixOnly: number;
125
+ /** Not a command this engine checks (git, tsc, …) — skipped, counted. */
126
+ notShrk: number;
127
+ /** Did not resolve — one `unknown-command` finding each. */
128
+ unknown: number;
129
+ /** Not checked: no command resolver injected. */
130
+ unverified: number;
131
+ }>;
132
+ /**
133
+ * Distinct search-tuning boost keys (`<kind>:<id>` search-document ids),
134
+ * resolved within the named kind through THE key resolver.
135
+ */
136
+ 'search-tuning-target': Readonly<{
137
+ probed: number;
138
+ resolved: number;
139
+ missing: number;
140
+ unprefixed: number;
141
+ unknownKind: number;
142
+ unverified: number;
143
+ }>;
144
+ /** Non-command routing-hint `recommends` ids, one per (hint, channel, id). */
145
+ 'routing-hint-target': Readonly<{
146
+ probed: number;
147
+ resolved: number;
148
+ missing: number;
149
+ unverified: number;
150
+ }>;
151
+ }>;
152
+ /**
153
+ * The declared cross-reference pass (round 11, 4.2): every id in a
154
+ * `related`-style asset field, resolved through the reference registry by
155
+ * THE collector (`declared-cross-references.ts`). What it examined is
156
+ * reported even when nothing dangles, so a pass over zero ids never reads as
157
+ * a clean one; its coverage record rides in {@link coverage}.
158
+ */
159
+ readonly crossReferences?: Readonly<{
160
+ examined: IDeclaredXrefReport['examined'];
161
+ counts: IDeclaredXrefReport['counts'];
162
+ summary: string;
163
+ }>;
53
164
  }
165
+ /** A rejected entry's finding kind and code — THE table above, never a fallback. */
166
+ export declare function rejectionFindingOf(kind: ContributionKind, cause: RejectionCause): {
167
+ readonly kind: SelfConfigKind;
168
+ readonly code: string;
169
+ readonly doctor: string;
170
+ };
171
+ /**
172
+ * THE "this finding reports a reference that resolved nowhere" predicate: a
173
+ * `*-missing` code (an id, or a referenced file), any severity — the family
174
+ * r73 reads as "unknown id". The CLI's exit-0 line counts the INFO-severity
175
+ * ones instead of certifying "every checked probe resolved" over them.
176
+ */
177
+ export declare function isUnresolvedReferenceFinding(finding: Pick<ISelfConfigFindingV2, 'code'>): boolean;
178
+ /**
179
+ * THE "this reference resolved, but only as a kind its field does not accept"
180
+ * predicate: a `*-wrong-kind` code (`xref-wrong-kind`, a pipeline step naming a
181
+ * construct). Not unresolved — `unknown:` is reserved for that — and not a
182
+ * clean resolution either, so the CLI's exit-0 line counts an info-severity one
183
+ * instead of certifying "every checked probe resolved".
184
+ */
185
+ export declare function isWrongKindReferenceFinding(finding: Pick<ISelfConfigFindingV2, 'code'>): boolean;
54
186
  export declare function buildSelfConfigDoctorReportV2(inspection: ISharkcraftInspection): Promise<ISelfConfigDoctorReportV2>;
187
+ /**
188
+ * Every declared reference that could not be resolved because its kind's
189
+ * registry is empty here, or can never be filled (round 12, ONE-CHANGE) —
190
+ * running EXACTLY the doctor's reference probes (template metadata, routing
191
+ * `recommends`, registration-hint and convention id fields, declared
192
+ * cross-references) over a warmed inspection, without the rest of the doctor.
193
+ * `buildSelfConfigDoctorReportV2` carries the same list, so the doctor and
194
+ * `shrk packs contributions` cannot disagree.
195
+ */
196
+ export declare function collectUnresolvableReferences(inspection: ISharkcraftInspection): Promise<IUnresolvableReferenceScan>;
55
197
  export declare function renderSelfConfigDoctorV2Text(report: ISelfConfigDoctorReportV2): string;
56
198
  export declare function renderSelfConfigDoctorV2Markdown(report: ISelfConfigDoctorReportV2): string;
57
199
  //# sourceMappingURL=self-config-doctor-v2.d.ts.map