@ai-primitives-hub/core 0.2.1 → 0.2.2-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/dist/domain/bundle/version.d.ts +13 -0
  2. package/dist/domain/bundle/version.d.ts.map +1 -1
  3. package/dist/domain/bundle/version.js +27 -0
  4. package/dist/domain/bundle/version.js.map +1 -1
  5. package/dist/domain/collection/apm-release-plan.d.ts +39 -0
  6. package/dist/domain/collection/apm-release-plan.d.ts.map +1 -0
  7. package/dist/domain/collection/apm-release-plan.js +185 -0
  8. package/dist/domain/collection/apm-release-plan.js.map +1 -0
  9. package/dist/domain/collection/contribution.d.ts +126 -0
  10. package/dist/domain/collection/contribution.d.ts.map +1 -0
  11. package/dist/domain/collection/contribution.js +462 -0
  12. package/dist/domain/collection/contribution.js.map +1 -0
  13. package/dist/domain/collection/diagnostics.d.ts +166 -0
  14. package/dist/domain/collection/diagnostics.d.ts.map +1 -0
  15. package/dist/domain/collection/diagnostics.js +3 -0
  16. package/dist/domain/collection/diagnostics.js.map +1 -0
  17. package/dist/domain/collection/manifest-validator.d.ts +3 -2
  18. package/dist/domain/collection/manifest-validator.d.ts.map +1 -1
  19. package/dist/domain/collection/manifest-validator.js +99 -17
  20. package/dist/domain/collection/manifest-validator.js.map +1 -1
  21. package/dist/domain/collection/release-manifest-plan.d.ts +9 -0
  22. package/dist/domain/collection/release-manifest-plan.d.ts.map +1 -1
  23. package/dist/domain/collection/release-manifest-plan.js +45 -14
  24. package/dist/domain/collection/release-manifest-plan.js.map +1 -1
  25. package/dist/domain/collection/validate.d.ts +5 -0
  26. package/dist/domain/collection/validate.d.ts.map +1 -1
  27. package/dist/domain/collection/validate.js +7 -2
  28. package/dist/domain/collection/validate.js.map +1 -1
  29. package/dist/domain/diagnostics/primitives/catalogue.d.ts +40 -0
  30. package/dist/domain/diagnostics/primitives/catalogue.d.ts.map +1 -0
  31. package/dist/domain/diagnostics/primitives/catalogue.js +78 -0
  32. package/dist/domain/diagnostics/primitives/catalogue.js.map +1 -0
  33. package/dist/domain/diagnostics/primitives/classifier.d.ts +81 -0
  34. package/dist/domain/diagnostics/primitives/classifier.d.ts.map +1 -0
  35. package/dist/domain/diagnostics/primitives/classifier.js +138 -0
  36. package/dist/domain/diagnostics/primitives/classifier.js.map +1 -0
  37. package/dist/domain/diagnostics/primitives/evaluators.d.ts +138 -0
  38. package/dist/domain/diagnostics/primitives/evaluators.d.ts.map +1 -0
  39. package/dist/domain/diagnostics/primitives/evaluators.js +485 -0
  40. package/dist/domain/diagnostics/primitives/evaluators.js.map +1 -0
  41. package/dist/domain/diagnostics/primitives/fixture.d.ts +97 -0
  42. package/dist/domain/diagnostics/primitives/fixture.d.ts.map +1 -0
  43. package/dist/domain/diagnostics/primitives/fixture.js +265 -0
  44. package/dist/domain/diagnostics/primitives/fixture.js.map +1 -0
  45. package/dist/domain/diagnostics/primitives/index.d.ts +18 -0
  46. package/dist/domain/diagnostics/primitives/index.d.ts.map +1 -0
  47. package/dist/domain/diagnostics/primitives/index.js +34 -0
  48. package/dist/domain/diagnostics/primitives/index.js.map +1 -0
  49. package/dist/domain/diagnostics/primitives/known-gaps.d.ts +50 -0
  50. package/dist/domain/diagnostics/primitives/known-gaps.d.ts.map +1 -0
  51. package/dist/domain/diagnostics/primitives/known-gaps.js +148 -0
  52. package/dist/domain/diagnostics/primitives/known-gaps.js.map +1 -0
  53. package/dist/domain/diagnostics/primitives/manifest-view.d.ts +28 -0
  54. package/dist/domain/diagnostics/primitives/manifest-view.d.ts.map +1 -0
  55. package/dist/domain/diagnostics/primitives/manifest-view.js +50 -0
  56. package/dist/domain/diagnostics/primitives/manifest-view.js.map +1 -0
  57. package/dist/domain/diagnostics/primitives/placements.d.ts +51 -0
  58. package/dist/domain/diagnostics/primitives/placements.d.ts.map +1 -0
  59. package/dist/domain/diagnostics/primitives/placements.js +76 -0
  60. package/dist/domain/diagnostics/primitives/placements.js.map +1 -0
  61. package/dist/domain/diagnostics/primitives/planner.d.ts +60 -0
  62. package/dist/domain/diagnostics/primitives/planner.d.ts.map +1 -0
  63. package/dist/domain/diagnostics/primitives/planner.js +60 -0
  64. package/dist/domain/diagnostics/primitives/planner.js.map +1 -0
  65. package/dist/domain/diagnostics/primitives/plugin-projection.d.ts +38 -0
  66. package/dist/domain/diagnostics/primitives/plugin-projection.d.ts.map +1 -0
  67. package/dist/domain/diagnostics/primitives/plugin-projection.js +173 -0
  68. package/dist/domain/diagnostics/primitives/plugin-projection.js.map +1 -0
  69. package/dist/domain/diagnostics/primitives/report.d.ts +122 -0
  70. package/dist/domain/diagnostics/primitives/report.d.ts.map +1 -0
  71. package/dist/domain/diagnostics/primitives/report.js +85 -0
  72. package/dist/domain/diagnostics/primitives/report.js.map +1 -0
  73. package/dist/domain/diagnostics/primitives/sandbox.d.ts +59 -0
  74. package/dist/domain/diagnostics/primitives/sandbox.d.ts.map +1 -0
  75. package/dist/domain/diagnostics/primitives/sandbox.js +193 -0
  76. package/dist/domain/diagnostics/primitives/sandbox.js.map +1 -0
  77. package/dist/domain/diagnostics/primitives/support-matrix.d.ts +36 -0
  78. package/dist/domain/diagnostics/primitives/support-matrix.d.ts.map +1 -0
  79. package/dist/domain/diagnostics/primitives/support-matrix.js +69 -0
  80. package/dist/domain/diagnostics/primitives/support-matrix.js.map +1 -0
  81. package/dist/domain/diagnostics/primitives/types.d.ts +117 -0
  82. package/dist/domain/diagnostics/primitives/types.d.ts.map +1 -0
  83. package/dist/domain/diagnostics/primitives/types.js +62 -0
  84. package/dist/domain/diagnostics/primitives/types.js.map +1 -0
  85. package/dist/domain/governance/catalogue.d.ts +11 -0
  86. package/dist/domain/governance/catalogue.d.ts.map +1 -0
  87. package/dist/domain/governance/catalogue.js +45 -0
  88. package/dist/domain/governance/catalogue.js.map +1 -0
  89. package/dist/domain/governance/effective-rules.d.ts +19 -0
  90. package/dist/domain/governance/effective-rules.d.ts.map +1 -0
  91. package/dist/domain/governance/effective-rules.js +49 -0
  92. package/dist/domain/governance/effective-rules.js.map +1 -0
  93. package/dist/domain/governance/evaluate.d.ts +16 -0
  94. package/dist/domain/governance/evaluate.d.ts.map +1 -0
  95. package/dist/domain/governance/evaluate.js +34 -0
  96. package/dist/domain/governance/evaluate.js.map +1 -0
  97. package/dist/domain/governance/hub-scope.d.ts +74 -0
  98. package/dist/domain/governance/hub-scope.d.ts.map +1 -0
  99. package/dist/domain/governance/hub-scope.js +202 -0
  100. package/dist/domain/governance/hub-scope.js.map +1 -0
  101. package/dist/domain/governance/hub-scoped-inventory.d.ts +22 -0
  102. package/dist/domain/governance/hub-scoped-inventory.d.ts.map +1 -0
  103. package/dist/domain/governance/hub-scoped-inventory.js +59 -0
  104. package/dist/domain/governance/hub-scoped-inventory.js.map +1 -0
  105. package/dist/domain/governance/index.d.ts +15 -0
  106. package/dist/domain/governance/index.d.ts.map +1 -0
  107. package/dist/domain/governance/index.js +31 -0
  108. package/dist/domain/governance/index.js.map +1 -0
  109. package/dist/domain/governance/rule-registry.d.ts +20 -0
  110. package/dist/domain/governance/rule-registry.d.ts.map +1 -0
  111. package/dist/domain/governance/rule-registry.js +40 -0
  112. package/dist/domain/governance/rule-registry.js.map +1 -0
  113. package/dist/domain/governance/rules/collection.d.ts +32 -0
  114. package/dist/domain/governance/rules/collection.d.ts.map +1 -0
  115. package/dist/domain/governance/rules/collection.js +153 -0
  116. package/dist/domain/governance/rules/collection.js.map +1 -0
  117. package/dist/domain/governance/rules/config.d.ts +15 -0
  118. package/dist/domain/governance/rules/config.d.ts.map +1 -0
  119. package/dist/domain/governance/rules/config.js +38 -0
  120. package/dist/domain/governance/rules/config.js.map +1 -0
  121. package/dist/domain/governance/rules/hub.d.ts +7 -0
  122. package/dist/domain/governance/rules/hub.d.ts.map +1 -0
  123. package/dist/domain/governance/rules/hub.js +10 -0
  124. package/dist/domain/governance/rules/hub.js.map +1 -0
  125. package/dist/domain/governance/types.d.ts +70 -0
  126. package/dist/domain/governance/types.d.ts.map +1 -0
  127. package/dist/domain/governance/types.js +7 -0
  128. package/dist/domain/governance/types.js.map +1 -0
  129. package/dist/domain/hub/diagnostics.d.ts +92 -0
  130. package/dist/domain/hub/diagnostics.d.ts.map +1 -0
  131. package/dist/domain/hub/diagnostics.js +11 -0
  132. package/dist/domain/hub/diagnostics.js.map +1 -0
  133. package/dist/domain/hub/profile-requirements.d.ts +16 -0
  134. package/dist/domain/hub/profile-requirements.d.ts.map +1 -0
  135. package/dist/domain/hub/profile-requirements.js +16 -0
  136. package/dist/domain/hub/profile-requirements.js.map +1 -0
  137. package/dist/domain/hub/replicate.d.ts +23 -0
  138. package/dist/domain/hub/replicate.d.ts.map +1 -1
  139. package/dist/domain/hub/replicate.js +13 -0
  140. package/dist/domain/hub/replicate.js.map +1 -1
  141. package/dist/domain/hub/types.d.ts +2 -0
  142. package/dist/domain/hub/types.d.ts.map +1 -1
  143. package/dist/domain/hub/validate.d.ts +150 -2
  144. package/dist/domain/hub/validate.d.ts.map +1 -1
  145. package/dist/domain/hub/validate.js +421 -37
  146. package/dist/domain/hub/validate.js.map +1 -1
  147. package/dist/domain/index.d.ts +17 -0
  148. package/dist/domain/index.d.ts.map +1 -1
  149. package/dist/domain/index.js +17 -0
  150. package/dist/domain/index.js.map +1 -1
  151. package/dist/domain/install/category.d.ts +31 -0
  152. package/dist/domain/install/category.d.ts.map +1 -0
  153. package/dist/domain/install/category.js +33 -0
  154. package/dist/domain/install/category.js.map +1 -0
  155. package/dist/domain/install/file-mode.d.ts +49 -0
  156. package/dist/domain/install/file-mode.d.ts.map +1 -0
  157. package/dist/domain/install/file-mode.js +54 -0
  158. package/dist/domain/install/file-mode.js.map +1 -0
  159. package/dist/domain/install/git-exclude.d.ts +22 -0
  160. package/dist/domain/install/git-exclude.d.ts.map +1 -0
  161. package/dist/domain/install/git-exclude.js +56 -0
  162. package/dist/domain/install/git-exclude.js.map +1 -0
  163. package/dist/domain/install/installable.d.ts +2 -0
  164. package/dist/domain/install/installable.d.ts.map +1 -1
  165. package/dist/domain/install/kind-route.d.ts +80 -0
  166. package/dist/domain/install/kind-route.d.ts.map +1 -0
  167. package/dist/domain/install/kind-route.js +135 -0
  168. package/dist/domain/install/kind-route.js.map +1 -0
  169. package/dist/domain/install/record-errors.d.ts +53 -0
  170. package/dist/domain/install/record-errors.d.ts.map +1 -0
  171. package/dist/domain/install/record-errors.js +104 -0
  172. package/dist/domain/install/record-errors.js.map +1 -0
  173. package/dist/domain/install/record-object.d.ts +21 -0
  174. package/dist/domain/install/record-object.d.ts.map +1 -0
  175. package/dist/domain/install/record-object.js +38 -0
  176. package/dist/domain/install/record-object.js.map +1 -0
  177. package/dist/domain/install/record-parse.d.ts +23 -0
  178. package/dist/domain/install/record-parse.d.ts.map +1 -0
  179. package/dist/domain/install/record-parse.js +73 -0
  180. package/dist/domain/install/record-parse.js.map +1 -0
  181. package/dist/domain/install/record-path.d.ts +26 -0
  182. package/dist/domain/install/record-path.d.ts.map +1 -0
  183. package/dist/domain/install/record-path.js +130 -0
  184. package/dist/domain/install/record-path.js.map +1 -0
  185. package/dist/domain/install/record-types.d.ts +183 -0
  186. package/dist/domain/install/record-types.d.ts.map +1 -0
  187. package/dist/domain/install/record-types.js +92 -0
  188. package/dist/domain/install/record-types.js.map +1 -0
  189. package/dist/domain/install/types.d.ts +2 -0
  190. package/dist/domain/install/types.d.ts.map +1 -1
  191. package/dist/domain/mcp/index.d.ts +1 -0
  192. package/dist/domain/mcp/index.d.ts.map +1 -1
  193. package/dist/domain/mcp/index.js +1 -0
  194. package/dist/domain/mcp/index.js.map +1 -1
  195. package/dist/domain/mcp/server-key.d.ts +35 -0
  196. package/dist/domain/mcp/server-key.d.ts.map +1 -0
  197. package/dist/domain/mcp/server-key.js +44 -0
  198. package/dist/domain/mcp/server-key.js.map +1 -0
  199. package/dist/domain/plugin/agent-plugin-spec.d.ts +8 -0
  200. package/dist/domain/plugin/agent-plugin-spec.d.ts.map +1 -1
  201. package/dist/domain/plugin/agent-plugin-spec.js +22 -8
  202. package/dist/domain/plugin/agent-plugin-spec.js.map +1 -1
  203. package/dist/domain/registry-error.d.ts +1 -1
  204. package/dist/domain/registry-error.d.ts.map +1 -1
  205. package/dist/domain/registry-error.js +2 -1
  206. package/dist/domain/registry-error.js.map +1 -1
  207. package/dist/domain/security/fingerprint.d.ts +18 -0
  208. package/dist/domain/security/fingerprint.d.ts.map +1 -0
  209. package/dist/domain/security/fingerprint.js +34 -0
  210. package/dist/domain/security/fingerprint.js.map +1 -0
  211. package/dist/domain/security/high-impact-rules.d.ts +30 -0
  212. package/dist/domain/security/high-impact-rules.d.ts.map +1 -0
  213. package/dist/domain/security/high-impact-rules.js +160 -0
  214. package/dist/domain/security/high-impact-rules.js.map +1 -0
  215. package/dist/domain/security/index.d.ts +10 -0
  216. package/dist/domain/security/index.d.ts.map +1 -0
  217. package/dist/domain/security/index.js +26 -0
  218. package/dist/domain/security/index.js.map +1 -0
  219. package/dist/domain/security/markdown-context.d.ts +17 -0
  220. package/dist/domain/security/markdown-context.d.ts.map +1 -0
  221. package/dist/domain/security/markdown-context.js +74 -0
  222. package/dist/domain/security/markdown-context.js.map +1 -0
  223. package/dist/domain/security/policy.d.ts +17 -0
  224. package/dist/domain/security/policy.d.ts.map +1 -0
  225. package/dist/domain/security/policy.js +31 -0
  226. package/dist/domain/security/policy.js.map +1 -0
  227. package/dist/domain/security/rating/findings-document.d.ts +22 -0
  228. package/dist/domain/security/rating/findings-document.d.ts.map +1 -0
  229. package/dist/domain/security/rating/findings-document.js +57 -0
  230. package/dist/domain/security/rating/findings-document.js.map +1 -0
  231. package/dist/domain/security/rating/index.d.ts +5 -0
  232. package/dist/domain/security/rating/index.d.ts.map +1 -0
  233. package/dist/domain/security/rating/index.js +21 -0
  234. package/dist/domain/security/rating/index.js.map +1 -0
  235. package/dist/domain/security/rating/scoring.d.ts +83 -0
  236. package/dist/domain/security/rating/scoring.d.ts.map +1 -0
  237. package/dist/domain/security/rating/scoring.js +115 -0
  238. package/dist/domain/security/rating/scoring.js.map +1 -0
  239. package/dist/domain/security/rating/security-rating-report.d.ts +111 -0
  240. package/dist/domain/security/rating/security-rating-report.d.ts.map +1 -0
  241. package/dist/domain/security/rating/security-rating-report.js +152 -0
  242. package/dist/domain/security/rating/security-rating-report.js.map +1 -0
  243. package/dist/domain/security/rating/types.d.ts +22 -0
  244. package/dist/domain/security/rating/types.d.ts.map +1 -0
  245. package/dist/domain/security/rating/types.js +11 -0
  246. package/dist/domain/security/rating/types.js.map +1 -0
  247. package/dist/domain/security/remediations.d.ts +17 -0
  248. package/dist/domain/security/remediations.d.ts.map +1 -0
  249. package/dist/domain/security/remediations.js +61 -0
  250. package/dist/domain/security/remediations.js.map +1 -0
  251. package/dist/domain/security/rule-engine.d.ts +8 -0
  252. package/dist/domain/security/rule-engine.d.ts.map +1 -0
  253. package/dist/domain/security/rule-engine.js +875 -0
  254. package/dist/domain/security/rule-engine.js.map +1 -0
  255. package/dist/domain/security/suppression.d.ts +19 -0
  256. package/dist/domain/security/suppression.d.ts.map +1 -0
  257. package/dist/domain/security/suppression.js +78 -0
  258. package/dist/domain/security/suppression.js.map +1 -0
  259. package/dist/domain/security/types.d.ts +91 -0
  260. package/dist/domain/security/types.d.ts.map +1 -0
  261. package/dist/domain/security/types.js +10 -0
  262. package/dist/domain/security/types.js.map +1 -0
  263. package/dist/index.d.ts +8 -0
  264. package/dist/index.d.ts.map +1 -1
  265. package/dist/index.js +12 -1
  266. package/dist/index.js.map +1 -1
  267. package/dist/ports/app-storage.d.ts +11 -15
  268. package/dist/ports/app-storage.d.ts.map +1 -1
  269. package/dist/ports/app-storage.js +8 -8
  270. package/dist/ports/argv-process-runner.d.ts +6 -0
  271. package/dist/ports/argv-process-runner.d.ts.map +1 -0
  272. package/dist/ports/argv-process-runner.js +3 -0
  273. package/dist/ports/argv-process-runner.js.map +1 -0
  274. package/dist/ports/bundle-extractor.d.ts +16 -3
  275. package/dist/ports/bundle-extractor.d.ts.map +1 -1
  276. package/dist/ports/collection-contribution.d.ts +36 -0
  277. package/dist/ports/collection-contribution.d.ts.map +1 -0
  278. package/dist/ports/collection-contribution.js +3 -0
  279. package/dist/ports/collection-contribution.js.map +1 -0
  280. package/dist/ports/filesystem.d.ts +12 -0
  281. package/dist/ports/filesystem.d.ts.map +1 -1
  282. package/dist/ports/hub-collection-index.d.ts +27 -0
  283. package/dist/ports/hub-collection-index.d.ts.map +1 -0
  284. package/dist/ports/hub-collection-index.js +3 -0
  285. package/dist/ports/hub-collection-index.js.map +1 -0
  286. package/dist/ports/hub-contribution.d.ts +158 -0
  287. package/dist/ports/hub-contribution.d.ts.map +1 -0
  288. package/dist/ports/hub-contribution.js +3 -0
  289. package/dist/ports/hub-contribution.js.map +1 -0
  290. package/dist/ports/index.d.ts +12 -0
  291. package/dist/ports/index.d.ts.map +1 -1
  292. package/dist/ports/index.js +12 -0
  293. package/dist/ports/index.js.map +1 -1
  294. package/dist/ports/primitive-diagnostics-driver.d.ts +96 -0
  295. package/dist/ports/primitive-diagnostics-driver.d.ts.map +1 -0
  296. package/dist/ports/primitive-diagnostics-driver.js +3 -0
  297. package/dist/ports/primitive-diagnostics-driver.js.map +1 -0
  298. package/dist/ports/record-fs.d.ts +46 -0
  299. package/dist/ports/record-fs.d.ts.map +1 -0
  300. package/dist/ports/record-fs.js +9 -0
  301. package/dist/ports/record-fs.js.map +1 -0
  302. package/dist/ports/registry-operations.d.ts +3 -2
  303. package/dist/ports/registry-operations.d.ts.map +1 -1
  304. package/dist/ports/release-lookup.d.ts +24 -0
  305. package/dist/ports/release-lookup.d.ts.map +1 -0
  306. package/dist/ports/release-lookup.js +7 -0
  307. package/dist/ports/release-lookup.js.map +1 -0
  308. package/dist/ports/release-source.d.ts +17 -3
  309. package/dist/ports/release-source.d.ts.map +1 -1
  310. package/dist/ports/repository-exclusion.d.ts +30 -0
  311. package/dist/ports/repository-exclusion.d.ts.map +1 -0
  312. package/dist/ports/repository-exclusion.js +3 -0
  313. package/dist/ports/repository-exclusion.js.map +1 -0
  314. package/dist/ports/schema-validator.d.ts +25 -0
  315. package/dist/ports/schema-validator.d.ts.map +1 -0
  316. package/dist/ports/schema-validator.js +7 -0
  317. package/dist/ports/schema-validator.js.map +1 -0
  318. package/dist/ports/security-report-store.d.ts +9 -0
  319. package/dist/ports/security-report-store.d.ts.map +1 -0
  320. package/dist/ports/security-report-store.js +4 -0
  321. package/dist/ports/security-report-store.js.map +1 -0
  322. package/dist/ports/security-scan-engine.d.ts +32 -0
  323. package/dist/ports/security-scan-engine.d.ts.map +1 -0
  324. package/dist/ports/security-scan-engine.js +6 -0
  325. package/dist/ports/security-scan-engine.js.map +1 -0
  326. package/dist/ports/security-scan-input.d.ts +63 -0
  327. package/dist/ports/security-scan-input.d.ts.map +1 -0
  328. package/dist/ports/security-scan-input.js +3 -0
  329. package/dist/ports/security-scan-input.js.map +1 -0
  330. package/dist/ports/source-adapter.d.ts +11 -0
  331. package/dist/ports/source-adapter.d.ts.map +1 -1
  332. package/dist/public/schemas/collection.schema.json +0 -1
  333. package/dist/public/schemas/hub-governance.schema.json +21 -0
  334. package/dist/public/schemas/install-record.schema.json +343 -0
  335. package/dist/public/schemas/security-rating-report.schema.json +113 -0
  336. package/package.json +2 -2
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Domain layer — primitive diagnostics vocabulary (`doctor diagnostics --primitives`).
3
+ *
4
+ * Scopes, invariant ids, check outcomes and the command observation shape
5
+ * shared by the planner, the evaluators, the classifier and the report.
6
+ * Pure data and types: no I/O.
7
+ * @module domain/diagnostics/primitives/types
8
+ */
9
+ /** Install scopes a diagnostic case is run at. */
10
+ export declare const DIAGNOSTIC_SCOPES: readonly ["user", "repository"];
11
+ /** Install scope of a diagnostic case. */
12
+ export type DiagnosticScope = typeof DIAGNOSTIC_SCOPES[number];
13
+ /**
14
+ * Invariants evaluated by the diagnostics. Ids are stable report values.
15
+ * `HARNESS` marks a defect of the diagnostic run itself (never absorbed by
16
+ * a known gap).
17
+ */
18
+ export declare const INVARIANTS: readonly [{
19
+ readonly id: "I0";
20
+ readonly level: "bundle";
21
+ }, {
22
+ readonly id: "I1";
23
+ readonly level: "bundle";
24
+ }, {
25
+ readonly id: "I2";
26
+ readonly level: "bundle";
27
+ }, {
28
+ readonly id: "I3";
29
+ readonly level: "bundle";
30
+ }, {
31
+ readonly id: "I4";
32
+ readonly level: "case";
33
+ }, {
34
+ readonly id: "I5";
35
+ readonly level: "bundle";
36
+ }, {
37
+ readonly id: "I6";
38
+ readonly level: "case";
39
+ }, {
40
+ readonly id: "I7";
41
+ readonly level: "case";
42
+ }, {
43
+ readonly id: "I8";
44
+ readonly level: "case";
45
+ }, {
46
+ readonly id: "I9";
47
+ readonly level: "case";
48
+ }, {
49
+ readonly id: "I10";
50
+ readonly level: "any";
51
+ }, {
52
+ readonly id: "I11";
53
+ readonly level: "case";
54
+ }, {
55
+ readonly id: "I12";
56
+ readonly level: "case";
57
+ }, {
58
+ readonly id: "I13";
59
+ readonly level: "case";
60
+ }, {
61
+ readonly id: "I14";
62
+ readonly level: "case";
63
+ }, {
64
+ readonly id: "HARNESS";
65
+ readonly level: "any";
66
+ }];
67
+ /** Invariant identifier. */
68
+ export type InvariantId = typeof INVARIANTS[number]['id'];
69
+ /** JSON-serialisable value, used for the deterministic `expected` / `observed` facts. */
70
+ export type JsonValue = string | number | boolean | null | JsonValue[] | {
71
+ [k: string]: JsonValue;
72
+ };
73
+ /** Outcome of one check. */
74
+ export type CheckOutcome = 'pass' | 'known-gap' | 'fail' | 'not-applicable';
75
+ /** Outcome of a bundle or a case: `fail` > `known-gap` > `pass`. */
76
+ export type RollupOutcome = 'pass' | 'known-gap' | 'fail';
77
+ /** Marker for cascade checks that were not evaluated. Never matched by a gap. */
78
+ export declare const NOT_EVALUATED: {
79
+ readonly notEvaluated: true;
80
+ };
81
+ /**
82
+ * Whether an `observed` value is the {@link NOT_EVALUATED} marker.
83
+ * @param value - Observed value of a check.
84
+ * @returns True for the not-evaluated marker.
85
+ */
86
+ export declare const isNotEvaluated: (value: unknown) => boolean;
87
+ /** One invariant check on a bundle or a case. */
88
+ export interface DiagnosticCheck {
89
+ invariant: InvariantId;
90
+ outcome: CheckOutcome;
91
+ /** Collection item path, for per-item bundle checks (I1, I2). */
92
+ item?: string;
93
+ gapIds?: string[];
94
+ expected?: JsonValue;
95
+ /** Exactly the facts the invariant compares; deterministic (no raw messages, no absolute paths). */
96
+ observed?: JsonValue;
97
+ /** Human-readable reason; may contain command messages and absolute paths (not deterministic, unlike `observed`). */
98
+ detail?: string;
99
+ /**
100
+ * Non-blocking findings of a passing check. I0 carries only the
101
+ * kind/route mismatch warnings of `collection validate`; the key is
102
+ * omitted when there are none.
103
+ */
104
+ warnings?: string[];
105
+ }
106
+ /** What a command produced, as seen by the evaluators (filled from `DriverCommandResult`). */
107
+ export interface CommandObservation {
108
+ exitCode: number;
109
+ status?: 'ok' | 'warning' | 'error';
110
+ warnings: readonly string[];
111
+ errorCode?: string;
112
+ /** All failure reasons the command reported. Empty on success. */
113
+ errorMessages: readonly string[];
114
+ /** Archive-relative paths an install rejected as unsupported content, when it listed them. */
115
+ rejectedPaths?: readonly string[];
116
+ }
117
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/domain/diagnostics/primitives/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,kDAAkD;AAClD,eAAO,MAAM,iBAAiB,iCAAkC,CAAC;AAEjE,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCb,CAAC;AAEX,4BAA4B;AAC5B,MAAM,MAAM,WAAW,GAAG,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAE1D,yFAAyF;AACzF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEpG,4BAA4B;AAC5B,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,gBAAgB,CAAC;AAE5E,oEAAoE;AACpE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAE1D,iFAAiF;AACjF,eAAO,MAAM,aAAa;;CAAkC,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,OAEa,CAAC;AAE9D,iDAAiD;AACjD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,WAAW,CAAC;IACvB,OAAO,EAAE,YAAY,CAAC;IACtB,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oGAAoG;IACpG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qHAAqH;IACrH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,8FAA8F;AAC9F,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC;IACpC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,8FAA8F;IAC9F,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /**
3
+ * Domain layer — primitive diagnostics vocabulary (`doctor diagnostics --primitives`).
4
+ *
5
+ * Scopes, invariant ids, check outcomes and the command observation shape
6
+ * shared by the planner, the evaluators, the classifier and the report.
7
+ * Pure data and types: no I/O.
8
+ * @module domain/diagnostics/primitives/types
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.isNotEvaluated = exports.NOT_EVALUATED = exports.INVARIANTS = exports.DIAGNOSTIC_SCOPES = void 0;
12
+ /** Install scopes a diagnostic case is run at. */
13
+ exports.DIAGNOSTIC_SCOPES = ['user', 'repository'];
14
+ /**
15
+ * Invariants evaluated by the diagnostics. Ids are stable report values.
16
+ * `HARNESS` marks a defect of the diagnostic run itself (never absorbed by
17
+ * a known gap).
18
+ */
19
+ exports.INVARIANTS = [
20
+ /** validate and build succeed and produce a governed manifest with the bundle's id and version. */
21
+ { id: 'I0', level: 'bundle' },
22
+ /** Every source file of an item is in the archive. */
23
+ { id: 'I1', level: 'bundle' },
24
+ /** The manifest lists each item exactly once, with its kind and expected id. */
25
+ { id: 'I2', level: 'bundle' },
26
+ /** The manifest's file inventory matches the archive (validateManifest). */
27
+ { id: 'I3', level: 'bundle' },
28
+ /** The install status matches the support matrix. */
29
+ { id: 'I4', level: 'case' },
30
+ /** An invalid bundle is rejected by validate and build with the documented message, and writes no archive. */
31
+ { id: 'I5', level: 'bundle' },
32
+ /** Uninstall removes every placed file. */
33
+ { id: 'I6', level: 'case' },
34
+ /** A rejected or failed install writes nothing user-facing. */
35
+ { id: 'I7', level: 'case' },
36
+ /** The target honours the requested scope. */
37
+ { id: 'I8', level: 'case' },
38
+ /** A rejected install reports exactly the items of the kinds the target does not support. */
39
+ { id: 'I9', level: 'case' },
40
+ /** Executable fixture files stay executable: in the archive (bundle) and where install places them (case). */
41
+ { id: 'I10', level: 'any' },
42
+ /** Each skill of an installed plugin is projected into the target's skills route. */
43
+ { id: 'I11', level: 'case' },
44
+ /** Each MCP server of an installed plugin is projected into a target config file. */
45
+ { id: 'I12', level: 'case' },
46
+ /** Every archived installable file lands at its expected destination. */
47
+ { id: 'I13', level: 'case' },
48
+ /** `${PLUGIN_ROOT}` in each projected plugin MCP server is resolved to the installed plugin root. */
49
+ { id: 'I14', level: 'case' },
50
+ { id: 'HARNESS', level: 'any' }
51
+ ];
52
+ /** Marker for cascade checks that were not evaluated. Never matched by a gap. */
53
+ exports.NOT_EVALUATED = { notEvaluated: true };
54
+ /**
55
+ * Whether an `observed` value is the {@link NOT_EVALUATED} marker.
56
+ * @param value - Observed value of a check.
57
+ * @returns True for the not-evaluated marker.
58
+ */
59
+ const isNotEvaluated = (value) => value !== null && typeof value === 'object' && !Array.isArray(value)
60
+ && value.notEvaluated === true;
61
+ exports.isNotEvaluated = isNotEvaluated;
62
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/domain/diagnostics/primitives/types.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,kDAAkD;AACrC,QAAA,iBAAiB,GAAG,CAAC,MAAM,EAAE,YAAY,CAAU,CAAC;AAKjE;;;;GAIG;AACU,QAAA,UAAU,GAAG;IACxB,mGAAmG;IACnG,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC7B,sDAAsD;IACtD,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC7B,gFAAgF;IAChF,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC7B,4EAA4E;IAC5E,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC7B,qDAAqD;IACrD,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3B,8GAA8G;IAC9G,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC7B,2CAA2C;IAC3C,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3B,+DAA+D;IAC/D,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3B,8CAA8C;IAC9C,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3B,6FAA6F;IAC7F,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3B,8GAA8G;IAC9G,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC3B,qFAAqF;IACrF,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE;IAC5B,qFAAqF;IACrF,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE;IAC5B,yEAAyE;IACzE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE;IAC5B,qGAAqG;IACrG,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE;IAC5B,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE;CACvB,CAAC;AAcX,iFAAiF;AACpE,QAAA,aAAa,GAAG,EAAE,YAAY,EAAE,IAAI,EAAW,CAAC;AAE7D;;;;GAIG;AACI,MAAM,cAAc,GAAG,CAAC,KAAc,EAAW,EAAE,CACxD,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;OAChE,KAAiC,CAAC,YAAY,KAAK,IAAI,CAAC;AAFjD,QAAA,cAAc,kBAEmC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Render the contributor-facing rule catalogue from the registry.
3
+ * @module domain/governance/catalogue
4
+ */
5
+ import type { GovernanceRule } from './types';
6
+ /**
7
+ * Markdown catalogue. Deterministic, so the committed document can be checked for staleness.
8
+ * @param rules The rule registry.
9
+ */
10
+ export declare function renderRuleCatalogue(rules: readonly GovernanceRule[]): string;
11
+ //# sourceMappingURL=catalogue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalogue.d.ts","sourceRoot":"","sources":["../../../src/domain/governance/catalogue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,cAAc,EACf,MAAM,SAAS,CAAC;AAcjB;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,CAyB5E"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renderRuleCatalogue = renderRuleCatalogue;
4
+ /**
5
+ * Escape Markdown table, emphasis and MDX expression characters.
6
+ * @param value
7
+ */
8
+ const cell = (value) => value.replaceAll(/[|*{}]/g, (character) => `\\${character}`).replaceAll('<', '&lt;');
9
+ const floorCell = (rule) => {
10
+ if (!rule.configurable) {
11
+ return '—';
12
+ }
13
+ return rule.disableable ? 'no' : 'yes';
14
+ };
15
+ /**
16
+ * Markdown catalogue. Deterministic, so the committed document can be checked for staleness.
17
+ * @param rules The rule registry.
18
+ */
19
+ function renderRuleCatalogue(rules) {
20
+ const lines = [
21
+ '# Governance rule catalogue',
22
+ '',
23
+ // Plain text, not an HTML comment: the docs site renders Markdown as MDX.
24
+ 'Generated from `packages/core/src/domain/governance/rule-registry.ts`. Do not edit by hand;',
25
+ 'build the required packages with `pnpm --filter @ai-primitives-hub/app... run build`,',
26
+ 'then regenerate with `pnpm -C packages/app run generate:rule-catalogue`.',
27
+ '',
28
+ 'Any error fails the run. Warnings do not fail the run.',
29
+ 'Unverified findings retain their severity and can fail the run when reported as errors.',
30
+ '',
31
+ 'Floor rules cannot be disabled or downgraded in `hub-governance.yml`. Configuration rules (CFG)',
32
+ 'are evaluated before any policy applies and cannot be configured.',
33
+ '',
34
+ '| Rule | Applies to | Default | Floor | Configurable | Needs network | Description |',
35
+ '| --- | --- | --- | --- | --- | --- | --- |'
36
+ ];
37
+ for (const rule of rules) {
38
+ const columns = [rule.id, rule.subjects.join(', '), rule.defaultSeverity, floorCell(rule),
39
+ rule.configurable ? 'yes' : 'no', rule.needsNetwork ? 'yes' : 'no', cell(rule.description)];
40
+ lines.push(`| ${columns.join(' | ')} |`);
41
+ }
42
+ lines.push('');
43
+ return lines.join('\n');
44
+ }
45
+ //# sourceMappingURL=catalogue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalogue.js","sourceRoot":"","sources":["../../../src/domain/governance/catalogue.ts"],"names":[],"mappings":";;AAwBA,kDAyBC;AAzCD;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC7H,MAAM,SAAS,GAAG,CAAC,IAAoB,EAAU,EAAE;IACjD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AACzC,CAAC,CAAC;AAEF;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,KAAgC;IAClE,MAAM,KAAK,GAAG;QACZ,6BAA6B;QAC7B,EAAE;QACF,0EAA0E;QAC1E,6FAA6F;QAC7F,uFAAuF;QACvF,0EAA0E;QAC1E,EAAE;QACF,wDAAwD;QACxD,yFAAyF;QACzF,EAAE;QACF,iGAAiG;QACjG,mEAAmE;QACnE,EAAE;QACF,sFAAsF;QACtF,6CAA6C;KAC9C,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,IAAI,CAAC;YACvF,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAC9F,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { GovernanceFinding, GovernanceNotChecked, GovernancePolicy, GovernanceSubject, GovernanceSuppression } from './types';
2
+ /**
3
+ * Overrides that changed something, sorted by rule id, so reports list every suppression.
4
+ * @param policy A policy that already passed the configuration rules.
5
+ */
6
+ export declare function policySuppressions(policy: GovernancePolicy): GovernanceSuppression[];
7
+ /**
8
+ * Drop disabled findings and apply severity overrides. Non-configurable (CFG) findings pass through.
9
+ * @param findings Raw findings from the rules.
10
+ * @param policy A policy that already passed the configuration rules.
11
+ */
12
+ export declare function applyPolicy(findings: readonly GovernanceFinding[], policy: GovernancePolicy): GovernanceFinding[];
13
+ /**
14
+ * Enabled network rules for the subject that an offline run did not execute.
15
+ * @param subject
16
+ * @param policy A policy that already passed the configuration rules.
17
+ */
18
+ export declare function offlineNotChecked(subject: GovernanceSubject, policy: GovernancePolicy): GovernanceNotChecked[];
19
+ //# sourceMappingURL=effective-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effective-rules.d.ts","sourceRoot":"","sources":["../../../src/domain/governance/effective-rules.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,qBAAqB,EAAE,CAQpF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EAAE,MAAM,EAAE,gBAAgB,GAAG,iBAAiB,EAAE,CASjH;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,gBAAgB,GAAG,oBAAoB,EAAE,CAI9G"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.policySuppressions = policySuppressions;
4
+ exports.applyPolicy = applyPolicy;
5
+ exports.offlineNotChecked = offlineNotChecked;
6
+ /**
7
+ * Apply a policy over rule defaults, guarded by the floor and configurability flags.
8
+ * @module domain/governance/effective-rules
9
+ */
10
+ const rule_registry_1 = require("./rule-registry");
11
+ /**
12
+ * Overrides that changed something, sorted by rule id, so reports list every suppression.
13
+ * @param policy A policy that already passed the configuration rules.
14
+ */
15
+ function policySuppressions(policy) {
16
+ const suppressions = [];
17
+ for (const [ruleId, override] of Object.entries(policy.rules ?? {}).toSorted(([a], [b]) => a.localeCompare(b))) {
18
+ if (override.enabled === false || override.severity !== undefined) {
19
+ suppressions.push({ ruleId, action: override.enabled === false ? 'disabled' : `severity: ${override.severity}`, reason: override.reason });
20
+ }
21
+ }
22
+ return suppressions;
23
+ }
24
+ /**
25
+ * Drop disabled findings and apply severity overrides. Non-configurable (CFG) findings pass through.
26
+ * @param findings Raw findings from the rules.
27
+ * @param policy A policy that already passed the configuration rules.
28
+ */
29
+ function applyPolicy(findings, policy) {
30
+ const result = [];
31
+ for (const finding of findings) {
32
+ const override = finding.ruleId.startsWith('CFG') ? undefined : policy.rules?.[finding.ruleId];
33
+ if (override?.enabled !== false) {
34
+ result.push({ ...finding, severity: override?.severity ?? finding.severity });
35
+ }
36
+ }
37
+ return result;
38
+ }
39
+ /**
40
+ * Enabled network rules for the subject that an offline run did not execute.
41
+ * @param subject
42
+ * @param policy A policy that already passed the configuration rules.
43
+ */
44
+ function offlineNotChecked(subject, policy) {
45
+ return (0, rule_registry_1.rulesForSubject)(subject)
46
+ .filter((rule) => rule.needsNetwork && policy.rules?.[rule.id]?.enabled !== false)
47
+ .map((rule) => ({ ruleId: rule.id, reason: 'Not checked (offline). Enable source checks to verify.' }));
48
+ }
49
+ //# sourceMappingURL=effective-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effective-rules.js","sourceRoot":"","sources":["../../../src/domain/governance/effective-rules.ts"],"names":[],"mappings":";;AAmBA,gDAQC;AAOD,kCASC;AAOD,8CAIC;AAtDD;;;GAGG;AACH,mDAEyB;AASzB;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,MAAwB;IACzD,MAAM,YAAY,GAA4B,EAAE,CAAC;IACjD,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/G,IAAI,QAAQ,CAAC,OAAO,KAAK,KAAK,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAClE,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,QAAQ,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7I,CAAC;IACH,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAC,QAAsC,EAAE,MAAwB;IAC1F,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/F,IAAI,QAAQ,EAAE,OAAO,KAAK,KAAK,EAAE,CAAC;YAChC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,OAA0B,EAAE,MAAwB;IACpF,OAAO,IAAA,+BAAe,EAAC,OAAO,CAAC;SAC5B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,KAAK,KAAK,CAAC;SACjF,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,wDAAwD,EAAE,CAAC,CAAC,CAAC;AAC5G,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { GovernanceFinding, GovernancePolicy, GovernanceReport, GovernanceSubject } from './types';
2
+ export interface EvaluateOptions {
3
+ /** Whether network rules ran. Offline runs list them under `notChecked`. Defaults to offline. */
4
+ mode?: GovernanceReport['mode'];
5
+ /** Display path of the configuration file, used on CFG findings. */
6
+ configFile?: string;
7
+ }
8
+ /**
9
+ * Evaluate findings into a report. A policy with any CFG finding is ignored for the run.
10
+ * @param subject What was validated.
11
+ * @param input Raw rule findings (including CFG001 from the parser, if any).
12
+ * @param policy Parsed, schema-valid policy.
13
+ * @param options Mode and configuration file path.
14
+ */
15
+ export declare function evaluateGovernance(subject: GovernanceSubject, input: readonly GovernanceFinding[], policy?: GovernancePolicy, options?: EvaluateOptions): GovernanceReport;
16
+ //# sourceMappingURL=evaluate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../../src/domain/governance/evaluate.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,eAAe;IAC9B,iGAAiG;IACjG,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,SAAS,iBAAiB,EAAE,EACnC,MAAM,GAAE,gBAAqB,EAC7B,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CAelB"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.evaluateGovernance = evaluateGovernance;
4
+ /**
5
+ * One deterministic gate: configuration rules, policy and error-based verdict.
6
+ * @module domain/governance/evaluate
7
+ */
8
+ const effective_rules_1 = require("./effective-rules");
9
+ const rule_registry_1 = require("./rule-registry");
10
+ const config_1 = require("./rules/config");
11
+ /**
12
+ * Evaluate findings into a report. A policy with any CFG finding is ignored for the run.
13
+ * @param subject What was validated.
14
+ * @param input Raw rule findings (including CFG001 from the parser, if any).
15
+ * @param policy Parsed, schema-valid policy.
16
+ * @param options Mode and configuration file path.
17
+ */
18
+ function evaluateGovernance(subject, input, policy = {}, options = {}) {
19
+ const mode = options.mode ?? 'offline';
20
+ const configErrors = (0, config_1.configFindings)(policy, rule_registry_1.GOVERNANCE_RULES, options.configFile);
21
+ const parserErrors = input.some((finding) => finding.ruleId === 'CFG001');
22
+ const effective = configErrors.length > 0 || parserErrors ? {} : policy;
23
+ const findings = [...configErrors, ...(0, effective_rules_1.applyPolicy)(input, effective)];
24
+ return {
25
+ schemaVersion: 1,
26
+ subject,
27
+ mode,
28
+ verdict: findings.some((finding) => finding.severity === 'error') ? 'fail' : 'pass',
29
+ findings,
30
+ suppressions: (0, effective_rules_1.policySuppressions)(effective),
31
+ notChecked: mode === 'offline' ? (0, effective_rules_1.offlineNotChecked)(subject, effective) : []
32
+ };
33
+ }
34
+ //# sourceMappingURL=evaluate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluate.js","sourceRoot":"","sources":["../../../src/domain/governance/evaluate.ts"],"names":[],"mappings":";;AAoCA,gDAoBC;AAxDD;;;GAGG;AACH,uDAI2B;AAC3B,mDAEyB;AACzB,2CAEwB;AAexB;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAChC,OAA0B,EAC1B,KAAmC,EACnC,SAA2B,EAAE,EAC7B,UAA2B,EAAE;IAE7B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,SAAS,CAAC;IACvC,MAAM,YAAY,GAAG,IAAA,uBAAc,EAAC,MAAM,EAAE,gCAAgB,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAClF,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC;IAC1E,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IACxE,MAAM,QAAQ,GAAG,CAAC,GAAG,YAAY,EAAE,GAAG,IAAA,6BAAW,EAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;IACrE,OAAO;QACL,aAAa,EAAE,CAAC;QAChB,OAAO;QACP,IAAI;QACJ,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QACnF,QAAQ;QACR,YAAY,EAAE,IAAA,oCAAkB,EAAC,SAAS,CAAC;QAC3C,UAAU,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAA,mCAAiB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;KAC5E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,74 @@
1
+ /** Pure semantic selection. No checkout state, IO, or defaults are consulted. */
2
+ export type HubEntity = Record<string, unknown> & {
3
+ id: string;
4
+ };
5
+ export interface HubScopeDocument extends Record<string, unknown> {
6
+ sources: HubEntity[];
7
+ profiles: HubEntity[];
8
+ }
9
+ export interface HubScopeReference {
10
+ profileId: string;
11
+ source: string;
12
+ id: string;
13
+ version: string;
14
+ }
15
+ export interface HubScope {
16
+ schemaVersion: 1;
17
+ sources: {
18
+ added: string[];
19
+ modified: string[];
20
+ removed: string[];
21
+ };
22
+ profiles: {
23
+ added: string[];
24
+ modified: string[];
25
+ removed: string[];
26
+ };
27
+ sourceIds: string[];
28
+ profileIds: string[];
29
+ references: HubScopeReference[];
30
+ removedReferences: HubScopeReference[];
31
+ reasons: {
32
+ entity: 'source' | 'profile';
33
+ id: string;
34
+ reason: string;
35
+ }[];
36
+ globalChanged: boolean;
37
+ noOp: boolean;
38
+ }
39
+ /**
40
+ * Stable serialization ignores mapping order, but preserves meaningful array order.
41
+ * @param value
42
+ */
43
+ export declare function semanticHubValue(value: unknown): string;
44
+ /**
45
+ * Validate identity before building maps: duplicates must never be overwritten.
46
+ * @param value
47
+ */
48
+ export declare function assertHubScopeDocument(value: unknown): asserts value is HubScopeDocument;
49
+ /**
50
+ * Compute changed identities and the surviving dependency closure against explicit head data.
51
+ * @param base
52
+ * @param head
53
+ * @param explicit
54
+ * @param explicit.sourceIds
55
+ * @param explicit.profileIds
56
+ */
57
+ export declare function computeHubScope(base: unknown, head: unknown, explicit?: {
58
+ sourceIds: string[];
59
+ profileIds: string[];
60
+ }): HubScope;
61
+ /**
62
+ * Project only selected head entities/references; retain global settings verbatim.
63
+ * @param head
64
+ * @param scope
65
+ */
66
+ export declare function selectHubScope(head: HubScopeDocument, scope: HubScope): HubScopeDocument;
67
+ /**
68
+ * Validators see the projected (scoped) document, so their messages carry its indexes.
69
+ * Map every source, profile and bundle index back to the real hub configuration.
70
+ * @param projected The document the validator saw.
71
+ * @param head The full head hub configuration.
72
+ */
73
+ export declare function hubScopeLocationMapper(projected: HubScopeDocument, head: HubScopeDocument): (message: string) => string;
74
+ //# sourceMappingURL=hub-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hub-scope.d.ts","sourceRoot":"","sources":["../../../src/domain/governance/hub-scope.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AACjE,MAAM,WAAW,gBAAiB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC/D,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,QAAQ,EAAE,SAAS,EAAE,CAAC;CACvB;AACD,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB;AACD,MAAM,WAAW,QAAQ;IACvB,aAAa,EAAE,CAAC,CAAC;IACjB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACpE,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACrE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,iBAAiB,EAAE,iBAAiB,EAAE,CAAC;IACvC,OAAO,EAAE;QAAE,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxE,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQvD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,gBAAgB,CA+BxF;AAOD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE;IAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,QAAQ,CAsEhI;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,QAAQ,GAAG,gBAAgB,CAOxF;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CA2CvH"}