kibi-cli 2.1.0 → 2.3.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 (398) hide show
  1. package/dist/cli-operation-loader.d.ts.map +1 -1
  2. package/dist/cli-operation-loader.js +3 -0
  3. package/dist/cli-operation-metadata.d.ts +4 -0
  4. package/dist/cli-operation-metadata.d.ts.map +1 -1
  5. package/dist/cli-operation-metadata.js +5 -0
  6. package/dist/cli-protocol.d.ts.map +1 -1
  7. package/dist/cli-protocol.js +3 -2
  8. package/dist/cli-register-reporting.d.ts.map +1 -1
  9. package/dist/cli-register-reporting.js +4 -0
  10. package/dist/commands/aggregated-checks.d.ts +7 -0
  11. package/dist/commands/aggregated-checks.d.ts.map +1 -1
  12. package/dist/commands/aggregated-checks.js +25 -1
  13. package/dist/commands/check-diff.d.ts +5 -0
  14. package/dist/commands/check-diff.d.ts.map +1 -0
  15. package/dist/commands/check-diff.js +62 -0
  16. package/dist/commands/check-generated.d.ts.map +1 -1
  17. package/dist/commands/check-generated.js +41 -18
  18. package/dist/commands/check.d.ts.map +1 -1
  19. package/dist/commands/check.js +231 -86
  20. package/dist/commands/doctor.d.ts.map +1 -1
  21. package/dist/commands/doctor.js +168 -53
  22. package/dist/commands/github-init.d.ts +1 -1
  23. package/dist/commands/github-init.d.ts.map +1 -1
  24. package/dist/commands/github-init.js +10 -3
  25. package/dist/commands/init-helpers.d.ts +17 -2
  26. package/dist/commands/init-helpers.d.ts.map +1 -1
  27. package/dist/commands/init-helpers.js +123 -23
  28. package/dist/commands/init.d.ts.map +1 -1
  29. package/dist/commands/init.js +110 -15
  30. package/dist/commands/prove.d.ts.map +1 -1
  31. package/dist/commands/prove.js +10 -18
  32. package/dist/commands/sync/cache.d.ts +20 -1
  33. package/dist/commands/sync/cache.d.ts.map +1 -1
  34. package/dist/commands/sync/cache.js +51 -2
  35. package/dist/commands/sync/discovery.d.ts.map +1 -1
  36. package/dist/commands/sync/discovery.js +1 -1
  37. package/dist/commands/sync/manifest.d.ts.map +1 -1
  38. package/dist/commands/sync/manifest.js +3 -1
  39. package/dist/commands/sync/persistence.d.ts.map +1 -1
  40. package/dist/commands/sync/persistence.js +8 -0
  41. package/dist/commands/sync.d.ts.map +1 -1
  42. package/dist/commands/sync.js +11 -3
  43. package/dist/engine.d.ts +41 -1
  44. package/dist/engine.d.ts.map +1 -1
  45. package/dist/engine.js +377 -80
  46. package/dist/extractors/manifest.d.ts.map +1 -1
  47. package/dist/extractors/manifest.js +66 -28
  48. package/dist/extractors/markdown.d.ts +2 -0
  49. package/dist/extractors/markdown.d.ts.map +1 -1
  50. package/dist/extractors/markdown.js +14 -3
  51. package/dist/extractors/relationships.d.ts.map +1 -1
  52. package/dist/extractors/relationships.js +1 -0
  53. package/dist/extractors/symbols-coordinator.d.ts +7 -0
  54. package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
  55. package/dist/extractors/symbols-coordinator.js +75 -39
  56. package/dist/intent-search.d.ts.map +1 -1
  57. package/dist/intent-search.js +68 -29
  58. package/dist/operations/bootstrap/generate.d.ts.map +1 -1
  59. package/dist/operations/bootstrap/generate.js +4 -3
  60. package/dist/operations/modeling/model-requirement.d.ts +1 -1
  61. package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
  62. package/dist/operations/modeling/model-requirement.js +176 -10
  63. package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
  64. package/dist/operations/modeling/predicate-applyplan.js +14 -2
  65. package/dist/operations/modeling/predicate-inference-1.js +1 -1
  66. package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
  67. package/dist/operations/modeling/predicate-loader.js +24 -0
  68. package/dist/operations/modeling/predicate-types.d.ts +4 -0
  69. package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
  70. package/dist/operations/modeling/predicate-vocabulary.d.ts +54 -0
  71. package/dist/operations/modeling/predicate-vocabulary.d.ts.map +1 -0
  72. package/dist/operations/modeling/predicate-vocabulary.js +169 -0
  73. package/dist/operations/modeling/requirement-types.d.ts +5 -0
  74. package/dist/operations/modeling/requirement-types.d.ts.map +1 -1
  75. package/dist/operations/modeling/vocabulary-alignment.d.ts +60 -0
  76. package/dist/operations/modeling/vocabulary-alignment.d.ts.map +1 -0
  77. package/dist/operations/modeling/vocabulary-alignment.js +178 -0
  78. package/dist/operations/mutation/contradictions.d.ts +3 -0
  79. package/dist/operations/mutation/contradictions.d.ts.map +1 -1
  80. package/dist/operations/mutation/contradictions.js +29 -0
  81. package/dist/operations/mutation/delete.d.ts.map +1 -1
  82. package/dist/operations/mutation/delete.js +33 -1
  83. package/dist/operations/mutation/predicate-vocabulary-guard.d.ts +8 -0
  84. package/dist/operations/mutation/predicate-vocabulary-guard.d.ts.map +1 -0
  85. package/dist/operations/mutation/predicate-vocabulary-guard.js +64 -0
  86. package/dist/operations/mutation/relationships.d.ts +1 -1
  87. package/dist/operations/mutation/relationships.d.ts.map +1 -1
  88. package/dist/operations/mutation/relationships.js +1 -0
  89. package/dist/operations/mutation/saga.d.ts +5 -0
  90. package/dist/operations/mutation/saga.d.ts.map +1 -1
  91. package/dist/operations/mutation/saga.js +10 -0
  92. package/dist/operations/mutation/serialization.d.ts.map +1 -1
  93. package/dist/operations/mutation/serialization.js +2 -0
  94. package/dist/operations/mutation/source-authoring.d.ts +6 -0
  95. package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
  96. package/dist/operations/mutation/source-authoring.js +213 -52
  97. package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
  98. package/dist/operations/mutation/strict-fact.js +5 -0
  99. package/dist/operations/mutation/types.d.ts +17 -0
  100. package/dist/operations/mutation/types.d.ts.map +1 -1
  101. package/dist/operations/mutation/upsert.d.ts +6 -0
  102. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  103. package/dist/operations/mutation/upsert.js +77 -11
  104. package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
  105. package/dist/operations/mutation/validate-upsert.js +24 -1
  106. package/dist/operations/mutation/validation.d.ts.map +1 -1
  107. package/dist/operations/mutation/validation.js +16 -3
  108. package/dist/operations/planning/apply-plan.d.ts.map +1 -1
  109. package/dist/operations/planning/apply-plan.js +66 -26
  110. package/dist/operations/planning/compile-intent.d.ts.map +1 -1
  111. package/dist/operations/planning/compile-intent.js +3 -1
  112. package/dist/operations/proof/code-scope.d.ts +17 -0
  113. package/dist/operations/proof/code-scope.d.ts.map +1 -0
  114. package/dist/operations/proof/code-scope.js +60 -0
  115. package/dist/operations/proof/ingest-proof.d.ts +4 -2
  116. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  117. package/dist/operations/proof/ingest-proof.js +208 -74
  118. package/dist/operations/proof/migrate-legacy-receipts.d.ts.map +1 -1
  119. package/dist/operations/proof/migrate-legacy-receipts.js +7 -5
  120. package/dist/operations/proof/prune-receipts.d.ts.map +1 -1
  121. package/dist/operations/proof/prune-receipts.js +7 -5
  122. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
  123. package/dist/operations/semantic-advisor/analysis-receipt.js +7 -1
  124. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  125. package/dist/operations/semantic-advisor/analyze-prose.js +26 -4
  126. package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
  127. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
  128. package/dist/operations/semantic-advisor/clauses.js +7 -1
  129. package/dist/performance-trace.d.ts +17 -0
  130. package/dist/performance-trace.d.ts.map +1 -0
  131. package/dist/performance-trace.js +134 -0
  132. package/dist/plugins/approved-source-analyzers.d.ts +13 -0
  133. package/dist/plugins/approved-source-analyzers.d.ts.map +1 -0
  134. package/dist/plugins/approved-source-analyzers.generated.d.ts +71 -0
  135. package/dist/plugins/approved-source-analyzers.generated.d.ts.map +1 -0
  136. package/dist/plugins/approved-source-analyzers.generated.js +77 -0
  137. package/dist/plugins/approved-source-analyzers.js +3 -0
  138. package/dist/plugins/compose-semantic-classifier.d.ts +6 -1
  139. package/dist/plugins/compose-semantic-classifier.d.ts.map +1 -1
  140. package/dist/plugins/compose-semantic-classifier.js +8 -3
  141. package/dist/plugins/compose-vocabulary-alignment.d.ts +23 -0
  142. package/dist/plugins/compose-vocabulary-alignment.d.ts.map +1 -0
  143. package/dist/plugins/compose-vocabulary-alignment.js +141 -0
  144. package/dist/plugins/external-allowlist.d.ts +7 -0
  145. package/dist/plugins/external-allowlist.d.ts.map +1 -1
  146. package/dist/plugins/external-allowlist.js +13 -0
  147. package/dist/plugins/index.d.ts +2 -0
  148. package/dist/plugins/index.d.ts.map +1 -1
  149. package/dist/plugins/index.js +4 -0
  150. package/dist/plugins/maintenance-source-analysis.d.ts +14 -0
  151. package/dist/plugins/maintenance-source-analysis.d.ts.map +1 -0
  152. package/dist/plugins/maintenance-source-analysis.js +191 -0
  153. package/dist/plugins/registry.d.ts +3 -1
  154. package/dist/plugins/registry.d.ts.map +1 -1
  155. package/dist/plugins/registry.js +27 -1
  156. package/dist/plugins/source-analysis-service.d.ts +36 -1
  157. package/dist/plugins/source-analysis-service.d.ts.map +1 -1
  158. package/dist/plugins/source-analysis-service.js +184 -27
  159. package/dist/plugins/source-change-analysis.d.ts +15 -0
  160. package/dist/plugins/source-change-analysis.d.ts.map +1 -0
  161. package/dist/plugins/source-change-analysis.js +54 -0
  162. package/dist/plugins/source-classification.d.ts +41 -0
  163. package/dist/plugins/source-classification.d.ts.map +1 -0
  164. package/dist/plugins/source-classification.js +490 -0
  165. package/dist/prolog/codec.d.ts.map +1 -1
  166. package/dist/prolog/codec.js +2 -0
  167. package/dist/prolog/swipl-resolver.d.ts +88 -0
  168. package/dist/prolog/swipl-resolver.d.ts.map +1 -0
  169. package/dist/prolog/swipl-resolver.js +446 -0
  170. package/dist/prolog.d.ts +51 -1
  171. package/dist/prolog.d.ts.map +1 -1
  172. package/dist/prolog.js +145 -15
  173. package/dist/public/diagnostic-usage.d.ts.map +1 -1
  174. package/dist/public/diagnostic-usage.js +7 -25
  175. package/dist/public/impact/analyzer.d.ts.map +1 -1
  176. package/dist/public/impact/analyzer.js +56 -5
  177. package/dist/public/impact/diagnostics.d.ts.map +1 -1
  178. package/dist/public/impact/diagnostics.js +3 -1
  179. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  180. package/dist/public/impact/full-kb-quality.js +4 -12
  181. package/dist/public/impact/manifest.d.ts.map +1 -1
  182. package/dist/public/impact/manifest.js +15 -1
  183. package/dist/public/impact/source-changes.d.ts.map +1 -1
  184. package/dist/public/impact/source-changes.js +35 -27
  185. package/dist/public/impact/types.d.ts +2 -0
  186. package/dist/public/impact/types.d.ts.map +1 -1
  187. package/dist/public/operations/catalog.d.ts +80 -7
  188. package/dist/public/operations/catalog.d.ts.map +1 -1
  189. package/dist/public/operations/catalog.js +2 -0
  190. package/dist/public/operations/check-executor.d.ts.map +1 -1
  191. package/dist/public/operations/check-executor.js +10 -2
  192. package/dist/public/operations/check-helpers.d.ts +6 -0
  193. package/dist/public/operations/check-helpers.d.ts.map +1 -1
  194. package/dist/public/operations/check-helpers.js +21 -1
  195. package/dist/public/operations/contracts.d.ts.map +1 -1
  196. package/dist/public/operations/contracts.js +325 -8
  197. package/dist/public/operations/discovery-entities.d.ts +42 -2
  198. package/dist/public/operations/discovery-entities.d.ts.map +1 -1
  199. package/dist/public/operations/discovery-entities.js +195 -22
  200. package/dist/public/operations/discovery-executors.d.ts +1 -0
  201. package/dist/public/operations/discovery-executors.d.ts.map +1 -1
  202. package/dist/public/operations/discovery-executors.js +75 -46
  203. package/dist/public/operations/impact-review-preparation.d.ts +14 -0
  204. package/dist/public/operations/impact-review-preparation.d.ts.map +1 -0
  205. package/dist/public/operations/impact-review-preparation.js +379 -0
  206. package/dist/public/operations/index.d.ts +2 -0
  207. package/dist/public/operations/index.d.ts.map +1 -1
  208. package/dist/public/operations/index.js +2 -0
  209. package/dist/public/operations/migration-plan.d.ts +2 -0
  210. package/dist/public/operations/migration-plan.d.ts.map +1 -1
  211. package/dist/public/operations/migration-plan.js +50 -0
  212. package/dist/public/operations/node-ports.d.ts.map +1 -1
  213. package/dist/public/operations/node-ports.js +1 -35
  214. package/dist/public/operations/predicate-schema-conformance.d.ts +41 -0
  215. package/dist/public/operations/predicate-schema-conformance.d.ts.map +1 -0
  216. package/dist/public/operations/predicate-schema-conformance.js +242 -0
  217. package/dist/public/operations/prolog-json.d.ts.map +1 -1
  218. package/dist/public/operations/prolog-json.js +9 -3
  219. package/dist/public/operations/proof-receipt-projection.d.ts +5 -0
  220. package/dist/public/operations/proof-receipt-projection.d.ts.map +1 -0
  221. package/dist/public/operations/proof-receipt-projection.js +36 -0
  222. package/dist/public/operations/result-envelope.d.ts +34 -1
  223. package/dist/public/operations/result-envelope.d.ts.map +1 -1
  224. package/dist/public/operations/result-envelope.js +78 -2
  225. package/dist/public/operations/runtime-types.d.ts +1 -1
  226. package/dist/public/operations/runtime-types.d.ts.map +1 -1
  227. package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
  228. package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
  229. package/dist/public/operations/specs/check-rules.generated.js +8 -1
  230. package/dist/public/operations/specs/check.d.ts +1 -1
  231. package/dist/public/operations/specs/discovery.d.ts +7 -1
  232. package/dist/public/operations/specs/discovery.d.ts.map +1 -1
  233. package/dist/public/operations/specs/discovery.js +7 -1
  234. package/dist/public/operations/specs/impact-review-preparation.d.ts +47 -0
  235. package/dist/public/operations/specs/impact-review-preparation.d.ts.map +1 -0
  236. package/dist/public/operations/specs/impact-review-preparation.js +43 -0
  237. package/dist/public/operations/specs/mutation-schemas.d.ts +27 -4
  238. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  239. package/dist/public/operations/specs/mutation-schemas.js +21 -3
  240. package/dist/public/operations/specs/reporting.d.ts +8 -0
  241. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  242. package/dist/public/operations/specs/reporting.js +46 -15
  243. package/dist/public/operations/specs/upsert.d.ts +28 -5
  244. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  245. package/dist/public/operations/specs/upsert.js +1 -1
  246. package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
  247. package/dist/public/operations/symbol-repair-plan.js +8 -3
  248. package/dist/public/operations/types.d.ts +1 -1
  249. package/dist/public/operations/types.d.ts.map +1 -1
  250. package/dist/public/schemas/entity.d.ts.map +1 -1
  251. package/dist/public/schemas/entity.js +22 -0
  252. package/dist/public/schemas/relationship.d.ts.map +1 -1
  253. package/dist/public/schemas/relationship.js +1 -0
  254. package/dist/public/skills/kibi-usage/SKILL.md +7 -3
  255. package/dist/public/skills/kibi-usage/resources/fact-lanes.md +4 -0
  256. package/dist/public/skills/kibi-usage/resources/operation-access.md +1 -0
  257. package/dist/public/skills/kibi-usage/resources/relationship-directions.md +35 -17
  258. package/dist/public/skills/kibi-usage/resources/source-authoring.md +36 -0
  259. package/dist/public/skills/kibi-usage/resources/workflows.md +52 -1
  260. package/dist/public/telemetry-acceptance.d.ts.map +1 -1
  261. package/dist/public/telemetry-acceptance.js +21 -5
  262. package/dist/relationships/shards.d.ts +6 -0
  263. package/dist/relationships/shards.d.ts.map +1 -1
  264. package/dist/relationships/shards.js +26 -19
  265. package/dist/schemas/entity.schema.json +32 -0
  266. package/dist/traceability/analysis-gate.d.ts +39 -0
  267. package/dist/traceability/analysis-gate.d.ts.map +1 -0
  268. package/dist/traceability/analysis-gate.js +51 -0
  269. package/dist/traceability/git-change-snapshot.d.ts +27 -0
  270. package/dist/traceability/git-change-snapshot.d.ts.map +1 -0
  271. package/dist/traceability/git-change-snapshot.js +411 -0
  272. package/dist/traceability/git-staged.d.ts +5 -1
  273. package/dist/traceability/git-staged.d.ts.map +1 -1
  274. package/dist/traceability/git-staged.js +16 -11
  275. package/dist/traceability/impact-evaluator.d.ts +54 -0
  276. package/dist/traceability/impact-evaluator.d.ts.map +1 -0
  277. package/dist/traceability/impact-evaluator.js +270 -0
  278. package/dist/traceability/impact-git-tree.d.ts +12 -0
  279. package/dist/traceability/impact-git-tree.d.ts.map +1 -0
  280. package/dist/traceability/impact-git-tree.js +46 -0
  281. package/dist/traceability/impact-knowledge.d.ts +16 -0
  282. package/dist/traceability/impact-knowledge.d.ts.map +1 -0
  283. package/dist/traceability/impact-knowledge.js +165 -0
  284. package/dist/traceability/impact-policy.d.ts +15 -0
  285. package/dist/traceability/impact-policy.d.ts.map +1 -0
  286. package/dist/traceability/impact-policy.js +48 -0
  287. package/dist/traceability/impact-policy.v1.schema.json +48 -0
  288. package/dist/traceability/impact-pr-diff.d.ts +5 -0
  289. package/dist/traceability/impact-pr-diff.d.ts.map +1 -0
  290. package/dist/traceability/impact-pr-diff.js +83 -0
  291. package/dist/traceability/impact-record-validation.d.ts +9 -0
  292. package/dist/traceability/impact-record-validation.d.ts.map +1 -0
  293. package/dist/traceability/impact-record-validation.js +113 -0
  294. package/dist/traceability/impact-review.d.ts +148 -0
  295. package/dist/traceability/impact-review.d.ts.map +1 -0
  296. package/dist/traceability/impact-review.js +494 -0
  297. package/dist/traceability/impact-review.schema.json +365 -0
  298. package/dist/traceability/impact-side-evidence.d.ts +13 -0
  299. package/dist/traceability/impact-side-evidence.d.ts.map +1 -0
  300. package/dist/traceability/impact-side-evidence.js +240 -0
  301. package/dist/traceability/reviewed-coordinate-refresh.d.ts +10 -0
  302. package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +1 -0
  303. package/dist/traceability/reviewed-coordinate-refresh.js +49 -0
  304. package/dist/traceability/snapshot-knowledge.d.ts +4 -0
  305. package/dist/traceability/snapshot-knowledge.d.ts.map +1 -0
  306. package/dist/traceability/snapshot-knowledge.js +98 -0
  307. package/dist/traceability/staged-diagnostics.d.ts +1 -1
  308. package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
  309. package/dist/traceability/staged-entity-id-style.d.ts +12 -0
  310. package/dist/traceability/staged-entity-id-style.d.ts.map +1 -0
  311. package/dist/traceability/staged-entity-id-style.js +68 -0
  312. package/dist/traceability/staged-file-coverage.d.ts +23 -0
  313. package/dist/traceability/staged-file-coverage.d.ts.map +1 -1
  314. package/dist/traceability/staged-impact-contract.d.ts.map +1 -1
  315. package/dist/traceability/staged-impact-contract.js +2 -16
  316. package/dist/traceability/staged-symbols-manifest.d.ts +4 -0
  317. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  318. package/dist/traceability/staged-symbols-manifest.js +17 -6
  319. package/dist/traceability/symbol-extract.d.ts +3 -5
  320. package/dist/traceability/symbol-extract.d.ts.map +1 -1
  321. package/dist/traceability/symbol-extract.js +49 -34
  322. package/dist/traceability/temp-kb.d.ts +1 -1
  323. package/dist/traceability/temp-kb.d.ts.map +1 -1
  324. package/dist/traceability/temp-kb.js +57 -13
  325. package/dist/traceability/trusted-pr-event.d.ts +13 -0
  326. package/dist/traceability/trusted-pr-event.d.ts.map +1 -0
  327. package/dist/traceability/trusted-pr-event.js +105 -0
  328. package/dist/traceability/validate.js +1 -1
  329. package/dist/types/entities.d.ts +2 -0
  330. package/dist/types/entities.d.ts.map +1 -1
  331. package/dist/types/relationships.d.ts +1 -1
  332. package/dist/types/relationships.d.ts.map +1 -1
  333. package/dist/utils/canonical-path.d.ts +3 -0
  334. package/dist/utils/canonical-path.d.ts.map +1 -0
  335. package/dist/utils/canonical-path.js +33 -0
  336. package/dist/utils/entity-id-style.d.ts +27 -0
  337. package/dist/utils/entity-id-style.d.ts.map +1 -0
  338. package/dist/utils/entity-id-style.js +81 -0
  339. package/dist/utils/git-repository-context.d.ts +50 -0
  340. package/dist/utils/git-repository-context.d.ts.map +1 -0
  341. package/dist/utils/git-repository-context.js +259 -0
  342. package/dist/utils/rule-registry.d.ts +5 -0
  343. package/dist/utils/rule-registry.d.ts.map +1 -1
  344. package/dist/utils/rule-registry.generated.d.ts +37 -0
  345. package/dist/utils/rule-registry.generated.d.ts.map +1 -1
  346. package/dist/utils/rule-registry.generated.js +44 -0
  347. package/dist/utils/strict-modeling.d.ts +7 -0
  348. package/dist/utils/strict-modeling.d.ts.map +1 -1
  349. package/dist/utils/strict-modeling.js +11 -0
  350. package/package.json +14 -5
  351. package/schema/entities.pl +60 -1
  352. package/schema/relationships.pl +17 -4
  353. package/schema/validation.pl +118 -20
  354. package/src/public/diagnostic-usage.ts +16 -24
  355. package/src/public/impact/analyzer.ts +88 -5
  356. package/src/public/impact/diagnostics.ts +7 -5
  357. package/src/public/impact/full-kb-quality.ts +4 -16
  358. package/src/public/impact/manifest.ts +14 -1
  359. package/src/public/impact/source-changes.ts +39 -34
  360. package/src/public/impact/types.ts +5 -0
  361. package/src/public/operations/catalog.ts +2 -0
  362. package/src/public/operations/check-executor.ts +12 -1
  363. package/src/public/operations/check-helpers.ts +27 -1
  364. package/src/public/operations/contracts.ts +404 -9
  365. package/src/public/operations/discovery-entities.ts +292 -23
  366. package/src/public/operations/discovery-executors.ts +91 -55
  367. package/src/public/operations/impact-review-preparation.ts +548 -0
  368. package/src/public/operations/index.ts +2 -0
  369. package/src/public/operations/migration-plan.ts +57 -0
  370. package/src/public/operations/node-ports.ts +1 -39
  371. package/src/public/operations/predicate-schema-conformance.ts +362 -0
  372. package/src/public/operations/prolog-json.ts +9 -3
  373. package/src/public/operations/proof-receipt-projection.ts +39 -0
  374. package/src/public/operations/result-envelope.ts +114 -2
  375. package/src/public/operations/runtime-types.ts +1 -1
  376. package/src/public/operations/specs/check-rules.generated.ts +8 -1
  377. package/src/public/operations/specs/discovery.ts +8 -1
  378. package/src/public/operations/specs/impact-review-preparation.ts +46 -0
  379. package/src/public/operations/specs/mutation-schemas.ts +23 -3
  380. package/src/public/operations/specs/reporting.ts +69 -22
  381. package/src/public/operations/specs/upsert.ts +1 -1
  382. package/src/public/operations/symbol-repair-plan.ts +13 -3
  383. package/src/public/operations/types.ts +1 -0
  384. package/src/public/schemas/entity.ts +22 -0
  385. package/src/public/schemas/relationship.ts +1 -0
  386. package/src/public/skills/kibi-usage/SKILL.md +7 -3
  387. package/src/public/skills/kibi-usage/resources/fact-lanes.md +4 -0
  388. package/src/public/skills/kibi-usage/resources/operation-access.md +1 -0
  389. package/src/public/skills/kibi-usage/resources/relationship-directions.md +35 -17
  390. package/src/public/skills/kibi-usage/resources/source-authoring.md +36 -0
  391. package/src/public/skills/kibi-usage/resources/workflows.md +52 -1
  392. package/src/public/telemetry-acceptance.ts +37 -6
  393. package/src/schemas/entity.schema.json +32 -0
  394. package/src/schemas/relationship.schema.json +1 -0
  395. package/src/traceability/impact-policy.v1.schema.json +48 -0
  396. package/src/traceability/impact-review.schema.json +365 -0
  397. package/templates/github/kibi-badge.yml +0 -4
  398. package/templates/github/kibi-report.yml +0 -4
@@ -0,0 +1,47 @@
1
+ import { executePrepareImpactReview } from "../impact-review-preparation.js";
2
+ export declare const prepareImpactReviewSpec: {
3
+ readonly name: "kb_prepare_impact_review";
4
+ readonly cliName: "prepare-impact-review";
5
+ readonly description: "Prepare complete content-bound impact-review authoring inputs from the current staged snapshot or explicitly selected immutable Git commits. Returns strict reviewer schemas and an unauthored template; it does not decide, approve, sign, stage, or prove the review.";
6
+ readonly businessInputSchema: {
7
+ readonly type: "object";
8
+ readonly additionalProperties: false;
9
+ readonly required: readonly ["scope"];
10
+ readonly properties: {
11
+ readonly scope: {
12
+ readonly oneOf: readonly [{
13
+ readonly type: "object";
14
+ readonly additionalProperties: false;
15
+ readonly required: readonly ["kind"];
16
+ readonly properties: {
17
+ readonly kind: {
18
+ readonly const: "staged";
19
+ };
20
+ };
21
+ }, {
22
+ readonly type: "object";
23
+ readonly additionalProperties: false;
24
+ readonly required: readonly ["kind", "baseCommit", "headCommit"];
25
+ readonly properties: {
26
+ readonly kind: {
27
+ readonly const: "diff";
28
+ };
29
+ readonly baseCommit: {
30
+ readonly type: "string";
31
+ readonly pattern: "^(?:[a-f0-9]{40}|[a-f0-9]{64})$";
32
+ };
33
+ readonly headCommit: {
34
+ readonly type: "string";
35
+ readonly pattern: "^(?:[a-f0-9]{40}|[a-f0-9]{64})$";
36
+ };
37
+ };
38
+ }];
39
+ };
40
+ };
41
+ };
42
+ readonly requiresProlog: false;
43
+ readonly effects: readonly ["workspace-read", "kb-read"];
44
+ readonly agentVisibleStructuredData: true;
45
+ readonly execute: typeof executePrepareImpactReview;
46
+ };
47
+ //# sourceMappingURL=impact-review-preparation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impact-review-preparation.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/impact-review-preparation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAG7E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CF,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { executePrepareImpactReview } from "../impact-review-preparation.js";
2
+ export const prepareImpactReviewSpec = {
3
+ name: "kb_prepare_impact_review",
4
+ cliName: "prepare-impact-review",
5
+ description: "Prepare complete content-bound impact-review authoring inputs from the current staged snapshot or explicitly selected immutable Git commits. Returns strict reviewer schemas and an unauthored template; it does not decide, approve, sign, stage, or prove the review.",
6
+ businessInputSchema: {
7
+ type: "object",
8
+ additionalProperties: false,
9
+ required: ["scope"],
10
+ properties: {
11
+ scope: {
12
+ oneOf: [
13
+ {
14
+ type: "object",
15
+ additionalProperties: false,
16
+ required: ["kind"],
17
+ properties: { kind: { const: "staged" } },
18
+ },
19
+ {
20
+ type: "object",
21
+ additionalProperties: false,
22
+ required: ["kind", "baseCommit", "headCommit"],
23
+ properties: {
24
+ kind: { const: "diff" },
25
+ baseCommit: {
26
+ type: "string",
27
+ pattern: "^(?:[a-f0-9]{40}|[a-f0-9]{64})$",
28
+ },
29
+ headCommit: {
30
+ type: "string",
31
+ pattern: "^(?:[a-f0-9]{40}|[a-f0-9]{64})$",
32
+ },
33
+ },
34
+ },
35
+ ],
36
+ },
37
+ },
38
+ },
39
+ requiresProlog: false,
40
+ effects: ["workspace-read", "kb-read"],
41
+ agentVisibleStructuredData: true,
42
+ execute: executePrepareImpactReview,
43
+ };
@@ -13,7 +13,7 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
13
13
  };
14
14
  readonly source: {
15
15
  readonly type: "string";
16
- readonly description: "Optional provenance string. Example: 'docs/requirements/REQ-123.md'. Defaults to 'mcp://kibi/upsert'.";
16
+ readonly description: "Optional provenance string. Example: '.kb/requirements/REQ-cli-gc.md'. Defaults to 'mcp://kibi/upsert'.";
17
17
  };
18
18
  readonly tags: {
19
19
  readonly type: "array";
@@ -39,7 +39,7 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
39
39
  readonly items: {
40
40
  readonly type: "string";
41
41
  };
42
- readonly description: "Optional references. Example: ['REQ-010','https://example.com/spec'].";
42
+ readonly description: "Optional references. Example: ['REQ-cli-gc','https://example.com/spec'].";
43
43
  };
44
44
  readonly text_ref: {
45
45
  readonly type: "string";
@@ -514,6 +514,29 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
514
514
  };
515
515
  readonly description: "Optional ordered argument explanations.";
516
516
  };
517
+ readonly argument_constants: {
518
+ readonly type: "object";
519
+ readonly additionalProperties: {
520
+ readonly type: "array";
521
+ readonly items: {
522
+ readonly type: "string";
523
+ readonly minLength: 1;
524
+ };
525
+ readonly minItems: 1;
526
+ };
527
+ readonly description: "predicate_schema only: allowed constants keyed by argument name, e.g. {\"severity\": [\"warning\", \"info\"]}. Predicate facts must use a listed constant for those arguments; unlisted arguments stay open.";
528
+ };
529
+ readonly argument_aliases: {
530
+ readonly type: "object";
531
+ readonly additionalProperties: {
532
+ readonly type: "object";
533
+ readonly additionalProperties: {
534
+ readonly type: "string";
535
+ readonly minLength: 1;
536
+ };
537
+ };
538
+ readonly description: "predicate_schema only: legacy spellings keyed by argument name, each mapped to a declared constant, e.g. {\"severity\": {\"warn\": \"warning\"}}. kibi migrate rewrites facts that still use an alias.";
539
+ };
517
540
  readonly aliases: {
518
541
  readonly type: "array";
519
542
  readonly items: {
@@ -583,7 +606,7 @@ export declare const RELATIONSHIPS_SCHEMA: {
583
606
  readonly properties: {
584
607
  readonly type: {
585
608
  readonly type: "string";
586
- readonly enum: readonly ["depends_on", "specified_by", "verified_by", "validates", "implements", "covered_by", "executable_for", "constrained_by", "constrains", "requires_property", "requires_predicate", "requires_rule", "guards", "publishes", "consumes", "supersedes", "relates_to"];
609
+ readonly enum: readonly ["depends_on", "specified_by", "verified_by", "validates", "implements", "covered_by", "executable_for", "constrained_by", "constrains", "requires_property", "requires_predicate", "requires_rule", "guards", "publishes", "consumes", "supersedes", "restates", "relates_to"];
587
610
  readonly description: "Relationship type enum. Use only supported values. Direction semantics follow KB model (e.g., implements symbol->req, verified_by req/scenario->test, executable_for symbol->test).";
588
611
  };
589
612
  readonly from: {
@@ -592,7 +615,7 @@ export declare const RELATIONSHIPS_SCHEMA: {
592
615
  };
593
616
  readonly to: {
594
617
  readonly type: "string";
595
- readonly description: "Target entity ID (must exist). Example: 'REQ-001'.";
618
+ readonly description: "Target entity ID (must exist). Example: 'REQ-cli-gc'.";
596
619
  };
597
620
  };
598
621
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mutation-schemas.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/mutation-schemas.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY,gFASf,CAAC;AAYX,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;CA4CvB,CAAC"}
@@ -33,7 +33,7 @@ export const ENTITY_PROPERTIES_SCHEMA = {
33
33
  },
34
34
  source: {
35
35
  type: "string",
36
- description: "Optional provenance string. Example: 'docs/requirements/REQ-123.md'. Defaults to 'mcp://kibi/upsert'.",
36
+ description: "Optional provenance string. Example: '.kb/requirements/REQ-cli-gc.md'. Defaults to 'mcp://kibi/upsert'.",
37
37
  },
38
38
  tags: {
39
39
  type: "array",
@@ -55,7 +55,7 @@ export const ENTITY_PROPERTIES_SCHEMA = {
55
55
  links: {
56
56
  type: "array",
57
57
  items: { type: "string" },
58
- description: "Optional references. Example: ['REQ-010','https://example.com/spec'].",
58
+ description: "Optional references. Example: ['REQ-cli-gc','https://example.com/spec'].",
59
59
  },
60
60
  text_ref: {
61
61
  type: "string",
@@ -255,6 +255,23 @@ export const ENTITY_PROPERTIES_SCHEMA = {
255
255
  items: { type: "string" },
256
256
  description: "Optional ordered argument explanations.",
257
257
  },
258
+ argument_constants: {
259
+ type: "object",
260
+ additionalProperties: {
261
+ type: "array",
262
+ items: { type: "string", minLength: 1 },
263
+ minItems: 1,
264
+ },
265
+ description: 'predicate_schema only: allowed constants keyed by argument name, e.g. {"severity": ["warning", "info"]}. Predicate facts must use a listed constant for those arguments; unlisted arguments stay open.',
266
+ },
267
+ argument_aliases: {
268
+ type: "object",
269
+ additionalProperties: {
270
+ type: "object",
271
+ additionalProperties: { type: "string", minLength: 1 },
272
+ },
273
+ description: 'predicate_schema only: legacy spellings keyed by argument name, each mapped to a declared constant, e.g. {"severity": {"warn": "warning"}}. kibi migrate rewrites facts that still use an alias.',
274
+ },
258
275
  aliases: {
259
276
  type: "array",
260
277
  items: { type: "string" },
@@ -326,6 +343,7 @@ export const RELATIONSHIPS_SCHEMA = {
326
343
  "publishes",
327
344
  "consumes",
328
345
  "supersedes",
346
+ "restates",
329
347
  "relates_to",
330
348
  ],
331
349
  description: "Relationship type enum. Use only supported values. Direction semantics follow KB model (e.g., implements symbol->req, verified_by req/scenario->test, executable_for symbol->test).",
@@ -336,7 +354,7 @@ export const RELATIONSHIPS_SCHEMA = {
336
354
  },
337
355
  to: {
338
356
  type: "string",
339
- description: "Target entity ID (must exist). Example: 'REQ-001'.",
357
+ description: "Target entity ID (must exist). Example: 'REQ-cli-gc'.",
340
358
  },
341
359
  },
342
360
  },
@@ -113,6 +113,14 @@ export declare const findGapsSpec: {
113
113
  */
114
114
  export declare function currentProofBindingMode(): "per_contract" | "strict_snapshot";
115
115
  export declare function perContractTestBindings(context: OperationContext): Promise<string | null>;
116
+ /**
117
+ * Coverage rows can be large (full proof stages per requirement), so a
118
+ * whole-KB report in one answer approaches the engine's bounded output cap.
119
+ * Fetch it in small row pages instead; the engine memoizes the computed
120
+ * report per store generation, so later pages only paginate and encode.
121
+ */
122
+ export declare const COVERAGE_ROW_PAGE_SIZE = 10;
123
+ export declare function readCoveragePages(prolog: NonNullable<OperationContext["prolog"]>, goalFor: (limit: number, offset: number) => string, limit: number, offset: number): Promise<CoveragePayload>;
116
124
  export declare function executeCoverage(input: CoverageInput, context: OperationContext): Promise<OperationResult<CoveragePayload>>;
117
125
  export declare const coverageSpec: {
118
126
  readonly name: "kb_coverage";
@@ -1 +1 @@
1
- {"version":3,"file":"reporting.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/reporting.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,aAAa,EAInB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAK5D,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,aAAa,CAAC;AAelE,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,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AM,EAAE,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EAC/C,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,EAClD,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,eAAe,CAAC,CAoB1B;AAED,wBAAsB,eAAe,CACnC,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CA2H3C;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEyC,CAAC;AAEnE,wBAAsB,YAAY,CAChC,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CA8BxC;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBsC,CAAC"}
@@ -107,13 +107,26 @@ export async function perContractTestBindings(context) {
107
107
  const { loadEntities } = await import("../discovery-entities.js");
108
108
  const { receiptBindingHash } = await import("../../proof-fingerprint.js");
109
109
  const { removeFrontmatterBlock } = await import("../../../operations/proof/receipt-document.js");
110
+ const { loadCoveredBySymbolsByTest, receiptCodeScopeSymbolIds } = await import("../../../operations/proof/code-scope.js");
111
+ // Only the contract, scoped code, and authored source feed the binding
112
+ // hash. The paged projection never materializes receipt histories, which
113
+ // grow without bound and previously overflowed the bounded Prolog output
114
+ // on real stores. Engine failures must surface: silently dropping to strict
115
+ // snapshot semantics would hide an unhealthy engine behind stale receipts.
110
116
  let tests;
111
117
  try {
112
- tests = await loadEntities(context.prolog, { type: "test" });
118
+ tests = await loadEntities(requireProlog(context), {
119
+ type: "test",
120
+ projection: "proof_contract",
121
+ });
113
122
  }
114
- catch {
115
- return null;
123
+ catch (error) {
124
+ const message = error instanceof Error ? error.message : String(error);
125
+ throw new Error(`Per-contract receipt binding query failed: ${message}`);
116
126
  }
127
+ const coveredBy = tests.length
128
+ ? await loadCoveredBySymbolsByTest(requireProlog(context))
129
+ : new Map();
117
130
  const entries = [];
118
131
  const manifestPath = join(context.workspaceRoot, ".kb", "symbols.yaml");
119
132
  for (const test of tests) {
@@ -134,13 +147,7 @@ export async function perContractTestBindings(context) {
134
147
  const absolute = join(context.workspaceRoot, source);
135
148
  const authored = await context.fs.readFile(absolute);
136
149
  const stripped = removeFrontmatterBlock(authored, "proof_receipts");
137
- const rawBindings = Array.isArray(test.proof_bindings)
138
- ? test.proof_bindings
139
- : [];
140
- const boundIds = rawBindings
141
- .map((binding) => typeof binding.symbol_id === "string" ? binding.symbol_id : "")
142
- .filter((id) => id !== "");
143
- const codeScope = resolveBoundSymbolScope(manifestPath, boundIds);
150
+ const codeScope = resolveBoundSymbolScope(manifestPath, receiptCodeScopeSymbolIds(contract, test.proof_bindings, coveredBy.get(testId) ?? []));
144
151
  const binding = receiptBindingHash(contract, stripped ?? authored, codeScope);
145
152
  entries.push(`${toPrologAtom(testId)}: ${toPrologAtom(binding)}`);
146
153
  }
@@ -152,6 +159,30 @@ export async function perContractTestBindings(context) {
152
159
  return null;
153
160
  return `_{${entries.join(", ")}}`;
154
161
  }
162
+ /**
163
+ * Coverage rows can be large (full proof stages per requirement), so a
164
+ * whole-KB report in one answer approaches the engine's bounded output cap.
165
+ * Fetch it in small row pages instead; the engine memoizes the computed
166
+ * report per store generation, so later pages only paginate and encode.
167
+ */
168
+ export const COVERAGE_ROW_PAGE_SIZE = 10;
169
+ // implements REQ-kibi-verification-evidence-contract
170
+ export async function readCoveragePages(prolog, goalFor, limit, offset) {
171
+ const read = (pageLimit, pageOffset) => runOperationJsonQuery(prolog, "discovery.pl", goalFor(pageLimit, pageOffset), "Coverage execution");
172
+ if (limit <= COVERAGE_ROW_PAGE_SIZE)
173
+ return read(limit, offset);
174
+ const first = await read(COVERAGE_ROW_PAGE_SIZE, offset);
175
+ const rows = [...first.rows];
176
+ let lastPageSize = first.rows.length;
177
+ let lastPageLimit = COVERAGE_ROW_PAGE_SIZE;
178
+ while (lastPageSize === lastPageLimit && rows.length < limit) {
179
+ lastPageLimit = Math.min(COVERAGE_ROW_PAGE_SIZE, limit - rows.length);
180
+ const page = await read(lastPageLimit, offset + rows.length);
181
+ rows.push(...page.rows);
182
+ lastPageSize = page.rows.length;
183
+ }
184
+ return { ...first, rows };
185
+ }
155
186
  export async function executeCoverage(input, context) {
156
187
  try {
157
188
  const snapshotEvidence = await readWorkspaceSnapshot(context);
@@ -163,12 +194,12 @@ export async function executeCoverage(input, context) {
163
194
  const bindingsDict = statuses.length === 0 && (input.by ?? "req") === "req"
164
195
  ? await perContractTestBindings(context)
165
196
  : null;
166
- const goal = bindingsDict !== null
167
- ? `discovery:coverage_report_json('${input.by ?? "req"}', ${toPrologList(input.tags)}, ${input.includePassing ?? false}, per_contract, ${bindingsDict}, ${input.includeTransitive ?? true}, ${input.limit ?? 100}, ${input.offset ?? 0}, ${toPrologAtom(codeSnapshot)}, ${toPrologAtom(checkedAt)}, ${PROOF_RECEIPT_MAX_AGE_SECONDS}, JsonString)`
197
+ const goalFor = (limit, offset) => bindingsDict !== null
198
+ ? `discovery:coverage_report_json('${input.by ?? "req"}', ${toPrologList(input.tags)}, ${input.includePassing ?? false}, per_contract, ${bindingsDict}, ${input.includeTransitive ?? true}, ${limit}, ${offset}, ${toPrologAtom(codeSnapshot)}, ${toPrologAtom(checkedAt)}, ${PROOF_RECEIPT_MAX_AGE_SECONDS}, JsonString)`
168
199
  : statuses.length > 0
169
- ? `discovery:coverage_report_json('${input.by ?? "req"}', ${toPrologList(input.tags)}, ${input.includePassing ?? false}, ${toPrologList(statuses)}, ${input.includeTransitive ?? true}, ${input.limit ?? 100}, ${input.offset ?? 0}, ${toPrologAtom(codeSnapshot)}, ${toPrologAtom(checkedAt)}, ${PROOF_RECEIPT_MAX_AGE_SECONDS}, JsonString)`
170
- : `discovery:coverage_report_json('${input.by ?? "req"}', ${toPrologList(input.tags)}, ${input.includePassing ?? false}, ${input.includeTransitive ?? true}, ${input.limit ?? 100}, ${input.offset ?? 0}, ${toPrologAtom(codeSnapshot)}, ${toPrologAtom(checkedAt)}, ${PROOF_RECEIPT_MAX_AGE_SECONDS}, JsonString)`;
171
- const payload = await runOperationJsonQuery(requireProlog(context), "discovery.pl", goal, "Coverage execution");
200
+ ? `discovery:coverage_report_json('${input.by ?? "req"}', ${toPrologList(input.tags)}, ${input.includePassing ?? false}, ${toPrologList(statuses)}, ${input.includeTransitive ?? true}, ${limit}, ${offset}, ${toPrologAtom(codeSnapshot)}, ${toPrologAtom(checkedAt)}, ${PROOF_RECEIPT_MAX_AGE_SECONDS}, JsonString)`
201
+ : `discovery:coverage_report_json('${input.by ?? "req"}', ${toPrologList(input.tags)}, ${input.includePassing ?? false}, ${input.includeTransitive ?? true}, ${limit}, ${offset}, ${toPrologAtom(codeSnapshot)}, ${toPrologAtom(checkedAt)}, ${PROOF_RECEIPT_MAX_AGE_SECONDS}, JsonString)`;
202
+ const payload = await readCoveragePages(requireProlog(context), goalFor, input.limit ?? 100, input.offset ?? 0);
172
203
  const rows = (input.by ?? "req") === "req"
173
204
  ? await addCoordinateRepairEvidence(payload.rows, context)
174
205
  : payload.rows;
@@ -14,7 +14,7 @@ export declare const upsertSpec: {
14
14
  };
15
15
  readonly id: {
16
16
  readonly type: "string";
17
- readonly description: "Unique entity ID (string). Example: 'REQ-123'. Existing ID updates the entity; new ID creates it.";
17
+ readonly description: "Unique entity ID (string). Example: 'REQ-cli-gc'. Name entities by the behavior they govern (<TYPE>-<area>-<behavior>), never by the next free number. Existing ID updates the entity; new ID creates it.";
18
18
  };
19
19
  readonly properties: {
20
20
  readonly type: "object";
@@ -30,7 +30,7 @@ export declare const upsertSpec: {
30
30
  };
31
31
  readonly source: {
32
32
  readonly type: "string";
33
- readonly description: "Optional provenance string. Example: 'docs/requirements/REQ-123.md'. Defaults to 'mcp://kibi/upsert'.";
33
+ readonly description: "Optional provenance string. Example: '.kb/requirements/REQ-cli-gc.md'. Defaults to 'mcp://kibi/upsert'.";
34
34
  };
35
35
  readonly tags: {
36
36
  readonly type: "array";
@@ -56,7 +56,7 @@ export declare const upsertSpec: {
56
56
  readonly items: {
57
57
  readonly type: "string";
58
58
  };
59
- readonly description: "Optional references. Example: ['REQ-010','https://example.com/spec'].";
59
+ readonly description: "Optional references. Example: ['REQ-cli-gc','https://example.com/spec'].";
60
60
  };
61
61
  readonly text_ref: {
62
62
  readonly type: "string";
@@ -531,6 +531,29 @@ export declare const upsertSpec: {
531
531
  };
532
532
  readonly description: "Optional ordered argument explanations.";
533
533
  };
534
+ readonly argument_constants: {
535
+ readonly type: "object";
536
+ readonly additionalProperties: {
537
+ readonly type: "array";
538
+ readonly items: {
539
+ readonly type: "string";
540
+ readonly minLength: 1;
541
+ };
542
+ readonly minItems: 1;
543
+ };
544
+ readonly description: "predicate_schema only: allowed constants keyed by argument name, e.g. {\"severity\": [\"warning\", \"info\"]}. Predicate facts must use a listed constant for those arguments; unlisted arguments stay open.";
545
+ };
546
+ readonly argument_aliases: {
547
+ readonly type: "object";
548
+ readonly additionalProperties: {
549
+ readonly type: "object";
550
+ readonly additionalProperties: {
551
+ readonly type: "string";
552
+ readonly minLength: 1;
553
+ };
554
+ };
555
+ readonly description: "predicate_schema only: legacy spellings keyed by argument name, each mapped to a declared constant, e.g. {\"severity\": {\"warn\": \"warning\"}}. kibi migrate rewrites facts that still use an alias.";
556
+ };
534
557
  readonly aliases: {
535
558
  readonly type: "array";
536
559
  readonly items: {
@@ -600,7 +623,7 @@ export declare const upsertSpec: {
600
623
  readonly properties: {
601
624
  readonly type: {
602
625
  readonly type: "string";
603
- readonly enum: readonly ["depends_on", "specified_by", "verified_by", "validates", "implements", "covered_by", "executable_for", "constrained_by", "constrains", "requires_property", "requires_predicate", "requires_rule", "guards", "publishes", "consumes", "supersedes", "relates_to"];
626
+ readonly enum: readonly ["depends_on", "specified_by", "verified_by", "validates", "implements", "covered_by", "executable_for", "constrained_by", "constrains", "requires_property", "requires_predicate", "requires_rule", "guards", "publishes", "consumes", "supersedes", "restates", "relates_to"];
604
627
  readonly description: "Relationship type enum. Use only supported values. Direction semantics follow KB model (e.g., implements symbol->req, verified_by req/scenario->test, executable_for symbol->test).";
605
628
  };
606
629
  readonly from: {
@@ -609,7 +632,7 @@ export declare const upsertSpec: {
609
632
  };
610
633
  readonly to: {
611
634
  readonly type: "string";
612
- readonly description: "Target entity ID (must exist). Example: 'REQ-001'.";
635
+ readonly description: "Target entity ID (must exist). Example: 'REQ-cli-gc'.";
613
636
  };
614
637
  };
615
638
  };
@@ -1 +1 @@
1
- {"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/upsert.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAQvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCuC,CAAC"}
1
+ {"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/upsert.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAQvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCuC,CAAC"}
@@ -15,7 +15,7 @@ export const upsertSpec = {
15
15
  },
16
16
  id: {
17
17
  type: "string",
18
- description: "Unique entity ID (string). Example: 'REQ-123'. Existing ID updates the entity; new ID creates it.",
18
+ description: "Unique entity ID (string). Example: 'REQ-cli-gc'. Name entities by the behavior they govern (<TYPE>-<area>-<behavior>), never by the next free number. Existing ID updates the entity; new ID creates it.",
19
19
  },
20
20
  properties: ENTITY_PROPERTIES_SCHEMA,
21
21
  relationships: RELATIONSHIPS_SCHEMA,
@@ -1 +1 @@
1
- {"version":3,"file":"symbol-repair-plan.d.ts","sourceRoot":"","sources":["../../../src/public/operations/symbol-repair-plan.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,eAAO,MAAM,0BAA0B,EAAG,4BAAqC,CAAC;AAEhF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,OAAO,EAAE,OAAO,0BAA0B,CAAC;IAC3C,QAAQ,EAAE,IAAI,CAAC;IACf,cAAc,EAAE,KAAK,CAAC;IACtB,OAAO,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CACvD,CAAC,CAAC;AAoBH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EACF,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,oBAAoB,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,gFAAgF;AAChF,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,EACrD,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CA2DhD;AAED,kFAAkF;AAClF,wBAAsB,2BAA2B,CAC/C,IA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E,OAAO,CAAC,CAAC,EAAE,EACrD,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CA2DhD;AAED,kFAAkF;AAClF,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,EAClD,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CA+DvD;AAwCD,sEAAsE;AACtE,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,EAClD,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAmGvC"}
@@ -3,7 +3,12 @@ import path from "node:path";
3
3
  import { coarseCoordinateSpan } from "../../extractors/symbol-coordinates.js";
4
4
  import { analyzeSourceText, enrichSymbolCoordinates, } from "../../extractors/symbols-coordinator.js";
5
5
  import { isCoarseGranularityReason } from "../symbol-granularity.js";
6
- import { loadEntities } from "./discovery-entities.js";
6
+ import { loadEntitiesPaged } from "./discovery-entities.js";
7
+ /**
8
+ * Symbol pages for repair planning. The full symbol inventory is already half
9
+ * of the bounded engine output on large workspaces, so it is read in pages.
10
+ */
11
+ const SYMBOL_PAGE_SIZE = 250;
7
12
  export const SYMBOL_REPAIR_PLAN_VERSION = "kibi.symbol-repair-plan.v1";
8
13
  function sourceFileOf(entity) {
9
14
  const value = entity.sourceFile ?? entity.source;
@@ -83,7 +88,7 @@ export async function addCoordinateRepairEvidence(rows, context) {
83
88
  const ids = new Set(missingByRow.flat());
84
89
  if (ids.size === 0 || !context.prolog)
85
90
  return rows;
86
- const symbols = (await loadEntities(context.prolog, { type: "symbol" })).filter((symbol) => ids.has(String(symbol.id)));
91
+ const symbols = (await loadEntitiesPaged(context.prolog, "symbol", SYMBOL_PAGE_SIZE)).filter((symbol) => ids.has(String(symbol.id)));
87
92
  const evidence = await inspectCoordinateRepairs(symbols, context.workspaceRoot);
88
93
  return rows.map((row, index) => {
89
94
  const missing = missingByRow[index] ?? [];
@@ -152,7 +157,7 @@ function currentCandidates(entity, symbols, extractedByPath) {
152
157
  export async function buildSymbolRepairPlan(rows, context) {
153
158
  if (!context.prolog || rows.length === 0)
154
159
  return undefined;
155
- const symbols = await loadEntities(context.prolog, { type: "symbol" });
160
+ const symbols = await loadEntitiesPaged(context.prolog, "symbol", SYMBOL_PAGE_SIZE);
156
161
  const extractedByPath = new Map();
157
162
  for (const symbol of symbols) {
158
163
  const source = sourceFileOf(symbol);
@@ -1,6 +1,6 @@
1
1
  import type { OperationContext } from "./runtime-types.js";
2
2
  export type { OperationContext };
3
- export type OperationName = "kb_query" | "kb_search" | "kb_status" | "kb_skills_list" | "kb_skills_load" | "kb_skills_read" | "kb_find_gaps" | "kb_coverage" | "kb_graph" | "kb_sparql_remote" | "kb_semantic_advisor" | "kb_upsert" | "kb_validate_upsert" | "kb_delete" | "kb_check" | "kb_model_requirement" | "kb_suggest_predicates" | "kb_plan_bootstrap" | "kb_compile_intent" | "kb_apply_plan" | "kb_ingest_proof";
3
+ export type OperationName = "kb_query" | "kb_search" | "kb_status" | "kb_skills_list" | "kb_skills_load" | "kb_skills_read" | "kb_find_gaps" | "kb_coverage" | "kb_graph" | "kb_sparql_remote" | "kb_semantic_advisor" | "kb_upsert" | "kb_validate_upsert" | "kb_delete" | "kb_check" | "kb_prepare_impact_review" | "kb_model_requirement" | "kb_suggest_predicates" | "kb_plan_bootstrap" | "kb_compile_intent" | "kb_apply_plan" | "kb_ingest_proof";
4
4
  export type OperationEffect = "local-read" | "kb-read" | "workspace-read" | "network-read" | "kb-write" | "workspace-write";
5
5
  export type OperationEffectDeclaration = Readonly<{
6
6
  kind: OperationEffect;
@@ -1 +1 @@
1
- {"version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AQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACrC,CAAC,GAAG,OAAO,IACT,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IACxB,QAAQ,CAAC,eAAe,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAChE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC1D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/entity.ts"],"names":[],"mappings":"AA4TA,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA8UzC,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/entity.ts"],"names":[],"mappings":"AA4TA,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAoWzC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -503,6 +503,26 @@ const entitySchema = {
503
503
  aliases: { type: "array", items: { type: "string" } },
504
504
  examples: { type: "array", items: { type: "string" } },
505
505
  predicate_args: { type: "array", items: { type: "string" } },
506
+ // predicate_schema only: allowed constants per argument name. Arguments
507
+ // without an entry stay open; predicate facts must use a listed constant.
508
+ argument_constants: {
509
+ type: "object",
510
+ additionalProperties: {
511
+ type: "array",
512
+ minItems: 1,
513
+ uniqueItems: true,
514
+ items: { type: "string", minLength: 1 },
515
+ },
516
+ },
517
+ // predicate_schema only: legacy spellings per argument name, each mapped
518
+ // to one declared constant. kibi migrate rewrites facts that use them.
519
+ argument_aliases: {
520
+ type: "object",
521
+ additionalProperties: {
522
+ type: "object",
523
+ additionalProperties: { type: "string", minLength: 1 },
524
+ },
525
+ },
506
526
  rule_ir: { $ref: "#/$defs/logicRule" },
507
527
  rule_hash: { type: "string", pattern: "^[a-f0-9]{64}$" },
508
528
  rule_schema_id: { type: "string", minLength: 1 },
@@ -566,6 +586,8 @@ const entitySchema = {
566
586
  { required: ["aliases"] },
567
587
  { required: ["examples"] },
568
588
  { required: ["predicate_args"] },
589
+ { required: ["argument_constants"] },
590
+ { required: ["argument_aliases"] },
569
591
  { required: ["rule_ir"] },
570
592
  { required: ["rule_hash"] },
571
593
  { required: ["rule_schema_id"] },
@@ -1 +1 @@
1
- {"version":3,"file":"relationship.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/relationship.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"relationship.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/relationship.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -39,6 +39,7 @@ const relationshipSchema = {
39
39
  "publishes",
40
40
  "consumes",
41
41
  "supersedes",
42
+ "restates",
42
43
  "relates_to",
43
44
  ],
44
45
  },
@@ -2,7 +2,7 @@
2
2
  id: kibi-usage
3
3
  name: Kibi Usage
4
4
  description: Use Kibi's source-first, exact-Git, migration-aware, proof-aware operations safely across MCP or the trusted local CLI, including partial completion repair.
5
- version: 2.1.3
5
+ version: 2.2.0
6
6
  kibiCompatibility: ">=1.0.0"
7
7
  tags:
8
8
  - kibi
@@ -59,7 +59,11 @@ mutability, and Prolog requirements of each operation.
59
59
  ## Safe workflow
60
60
 
61
61
  1. Always discover before you mutate: start with `kb_search`, then exact-filter with `kb_query`. Use
62
- `kb_status` when branch or freshness confidence matters.
62
+ `kb_status` when branch or freshness confidence matters. `kb_search` ranks
63
+ lexically unless you pass `rankingMode: "intent-v1"`, `semanticFacets`, or
64
+ `sourceLocations`; use intent mode with grounded facets for conceptual
65
+ questions and before changing a source file, and keep lexical search for
66
+ literal identifiers. See `resources/workflows.md` for the mode recipe.
63
67
  2. Resolve genuine ambiguity with the human; use semantic advisor/modeling
64
68
  operations for deterministic interpretation and typed facts.
65
69
  3. Create endpoints before relationships and upsert small batches sequentially.
@@ -160,7 +164,7 @@ Represent implementation ownership with a `symbol` entity that has
160
164
  `sourceFile`, `implements` to the requirement, and `covered_by` to the test.
161
165
  Prolog `symbol-coverage` also requires the test to `validates` the requirement
162
166
  (or the requirement `verified_by` the test). `covered_by` alone is not
163
- enough. Do not rely on legacy `// implements REQ-xxx` comments as the
167
+ enough. Do not rely on legacy `// implements REQ-<area>-<behavior>` comments as the
164
168
  traceability record.
165
169
 
166
170
  ## Complete Logical Coverage
@@ -55,6 +55,10 @@ relationship: { type: requires_predicate, from: REQ-EDITOR-DRAFT-AUTOSAVE, to: F
55
55
 
56
56
  The project-local schema endpoint must exist before this fact is linked. When ontology extension is explicitly authorized, define it first with `fact_kind: predicate_schema`, `predicate_name`, `predicate_arity`, and equally sized `argument_names` and `argument_types`. Without an authorized stable signature, record `review:ontology-gap` instead of inventing a schema.
57
57
 
58
+ ### Closed argument vocabularies
59
+
60
+ A schema can close an argument with `argument_constants` (allowed values keyed by argument name) and map older spellings with `argument_aliases`. Reuse a declared constant; `kb_upsert` rejects any other value and names the constant to use for an alias. When a genuinely new value is needed, extend `argument_constants` on the schema first. To converge existing facts, declare aliases for their spellings and let `kibi migrate` rewrite them (`predicate_schema_alignment` actions). Close only arguments with a natural shared vocabulary, such as the governed component or a severity; forcing distinct obligations into a few constants makes different requirements share one ground term.
61
+
58
62
  ### Deny predicate
59
63
 
60
64
  Claim: “Suspended users must not publish articles.” When `permission_rule` fits, preserve its positive schema name and encode prohibition as polarity: