kibi-cli 2.4.0 → 2.5.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 (352) hide show
  1. package/dist/cli-json-command.d.ts +6 -0
  2. package/dist/cli-json-command.d.ts.map +1 -1
  3. package/dist/cli-json-command.js +37 -9
  4. package/dist/cli-operation-loader.d.ts.map +1 -1
  5. package/dist/cli-operation-loader.js +7 -0
  6. package/dist/cli-operation-metadata.d.ts +12 -4
  7. package/dist/cli-operation-metadata.d.ts.map +1 -1
  8. package/dist/cli-operation-metadata.js +14 -4
  9. package/dist/cli-protocol.d.ts +14 -0
  10. package/dist/cli-protocol.d.ts.map +1 -1
  11. package/dist/cli-protocol.js +31 -2
  12. package/dist/cli-register-proof.d.ts.map +1 -1
  13. package/dist/cli-register-proof.js +13 -0
  14. package/dist/commands/check.d.ts.map +1 -1
  15. package/dist/commands/check.js +11 -2
  16. package/dist/commands/discovery-shared.d.ts.map +1 -1
  17. package/dist/commands/discovery-shared.js +8 -2
  18. package/dist/commands/engine.d.ts.map +1 -1
  19. package/dist/commands/engine.js +4 -2
  20. package/dist/commands/gc.d.ts.map +1 -1
  21. package/dist/commands/gc.js +7 -0
  22. package/dist/commands/init-helpers.d.ts.map +1 -1
  23. package/dist/commands/init-helpers.js +0 -1
  24. package/dist/commands/migrate.d.ts.map +1 -1
  25. package/dist/commands/migrate.js +281 -14
  26. package/dist/commands/proof-compact.d.ts +9 -0
  27. package/dist/commands/proof-compact.d.ts.map +1 -0
  28. package/dist/commands/proof-compact.js +58 -0
  29. package/dist/commands/prove.d.ts +38 -0
  30. package/dist/commands/prove.d.ts.map +1 -1
  31. package/dist/commands/prove.js +222 -47
  32. package/dist/commands/sync/persistence.d.ts.map +1 -1
  33. package/dist/commands/sync/persistence.js +61 -16
  34. package/dist/commands/sync.d.ts +8 -0
  35. package/dist/commands/sync.d.ts.map +1 -1
  36. package/dist/commands/sync.js +42 -16
  37. package/dist/diagnostics.js +1 -1
  38. package/dist/engine-limits.d.ts +74 -0
  39. package/dist/engine-limits.d.ts.map +1 -0
  40. package/dist/engine-limits.js +201 -0
  41. package/dist/engine.d.ts +10 -0
  42. package/dist/engine.d.ts.map +1 -1
  43. package/dist/engine.js +57 -9
  44. package/dist/extractors/manifest.d.ts +8 -0
  45. package/dist/extractors/manifest.d.ts.map +1 -1
  46. package/dist/extractors/manifest.js +34 -5
  47. package/dist/extractors/markdown.d.ts +8 -0
  48. package/dist/extractors/markdown.d.ts.map +1 -1
  49. package/dist/extractors/markdown.js +57 -0
  50. package/dist/extractors/relationships.d.ts.map +1 -1
  51. package/dist/extractors/relationships.js +2 -0
  52. package/dist/intent-search.d.ts +4 -1
  53. package/dist/intent-search.d.ts.map +1 -1
  54. package/dist/intent-search.js +186 -33
  55. package/dist/operations/bootstrap/candidate-helpers.d.ts.map +1 -1
  56. package/dist/operations/bootstrap/candidate-helpers.js +8 -1
  57. package/dist/operations/bootstrap/candidates.d.ts.map +1 -1
  58. package/dist/operations/bootstrap/candidates.js +54 -38
  59. package/dist/operations/bootstrap/generate.d.ts +2 -0
  60. package/dist/operations/bootstrap/generate.d.ts.map +1 -1
  61. package/dist/operations/bootstrap/generate.js +87 -33
  62. package/dist/operations/bootstrap/intent-claims.d.ts.map +1 -1
  63. package/dist/operations/bootstrap/intent-claims.js +12 -4
  64. package/dist/operations/bootstrap/markdown-candidates.d.ts +2 -0
  65. package/dist/operations/bootstrap/markdown-candidates.d.ts.map +1 -1
  66. package/dist/operations/bootstrap/markdown-candidates.js +32 -10
  67. package/dist/operations/bootstrap/presentation.d.ts.map +1 -1
  68. package/dist/operations/bootstrap/presentation.js +6 -2
  69. package/dist/operations/bootstrap/requirement-claims.d.ts +1 -0
  70. package/dist/operations/bootstrap/requirement-claims.d.ts.map +1 -1
  71. package/dist/operations/bootstrap/requirement-claims.js +13 -1
  72. package/dist/operations/bootstrap/validation.d.ts +4 -0
  73. package/dist/operations/bootstrap/validation.d.ts.map +1 -0
  74. package/dist/operations/bootstrap/validation.js +20 -0
  75. package/dist/operations/migration/inventory-rederive.d.ts +81 -0
  76. package/dist/operations/migration/inventory-rederive.d.ts.map +1 -0
  77. package/dist/operations/migration/inventory-rederive.js +484 -0
  78. package/dist/operations/migration/kb-sources.d.ts +53 -0
  79. package/dist/operations/migration/kb-sources.d.ts.map +1 -0
  80. package/dist/operations/migration/kb-sources.js +233 -0
  81. package/dist/operations/migration/origin-backfill.d.ts +39 -0
  82. package/dist/operations/migration/origin-backfill.d.ts.map +1 -0
  83. package/dist/operations/migration/origin-backfill.js +164 -0
  84. package/dist/operations/migration/polarity-values.d.ts +10 -0
  85. package/dist/operations/migration/polarity-values.d.ts.map +1 -0
  86. package/dist/operations/migration/polarity-values.js +60 -0
  87. package/dist/operations/migration/schema6.d.ts +59 -0
  88. package/dist/operations/migration/schema6.d.ts.map +1 -0
  89. package/dist/operations/migration/schema6.js +379 -0
  90. package/dist/operations/migration/source-paths.d.ts +131 -0
  91. package/dist/operations/migration/source-paths.d.ts.map +1 -0
  92. package/dist/operations/migration/source-paths.js +308 -0
  93. package/dist/operations/migration/superseded-closure.d.ts +54 -0
  94. package/dist/operations/migration/superseded-closure.d.ts.map +1 -0
  95. package/dist/operations/migration/superseded-closure.js +187 -0
  96. package/dist/operations/modeling/logic-modeling.d.ts.map +1 -1
  97. package/dist/operations/modeling/logic-modeling.js +3 -5
  98. package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
  99. package/dist/operations/modeling/model-requirement.js +225 -67
  100. package/dist/operations/mutation/contradictions.d.ts +16 -0
  101. package/dist/operations/mutation/contradictions.d.ts.map +1 -1
  102. package/dist/operations/mutation/contradictions.js +32 -0
  103. package/dist/operations/mutation/delete.d.ts.map +1 -1
  104. package/dist/operations/mutation/delete.js +15 -7
  105. package/dist/operations/mutation/origin.d.ts +21 -0
  106. package/dist/operations/mutation/origin.d.ts.map +1 -0
  107. package/dist/operations/mutation/origin.js +78 -0
  108. package/dist/operations/mutation/plan-apply-journal.d.ts +182 -0
  109. package/dist/operations/mutation/plan-apply-journal.d.ts.map +1 -0
  110. package/dist/operations/mutation/plan-apply-journal.js +613 -0
  111. package/dist/operations/mutation/predicate-vocabulary-guard.d.ts +3 -1
  112. package/dist/operations/mutation/predicate-vocabulary-guard.d.ts.map +1 -1
  113. package/dist/operations/mutation/predicate-vocabulary-guard.js +13 -2
  114. package/dist/operations/mutation/relationships.d.ts +5 -5
  115. package/dist/operations/mutation/relationships.d.ts.map +1 -1
  116. package/dist/operations/mutation/relationships.js +31 -11
  117. package/dist/operations/mutation/serialization.d.ts.map +1 -1
  118. package/dist/operations/mutation/serialization.js +3 -1
  119. package/dist/operations/mutation/source-authoring.d.ts +6 -0
  120. package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
  121. package/dist/operations/mutation/source-authoring.js +7 -1
  122. package/dist/operations/mutation/types.d.ts +14 -0
  123. package/dist/operations/mutation/types.d.ts.map +1 -1
  124. package/dist/operations/mutation/upsert.d.ts +30 -3
  125. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  126. package/dist/operations/mutation/upsert.js +105 -35
  127. package/dist/operations/mutation/validate-upsert.d.ts +6 -0
  128. package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
  129. package/dist/operations/mutation/validate-upsert.js +34 -30
  130. package/dist/operations/planning/apply-plan.d.ts.map +1 -1
  131. package/dist/operations/planning/apply-plan.js +751 -144
  132. package/dist/operations/planning/compile-intent.d.ts +34 -1
  133. package/dist/operations/planning/compile-intent.d.ts.map +1 -1
  134. package/dist/operations/planning/compile-intent.js +314 -98
  135. package/dist/operations/proof/code-scope.d.ts +28 -0
  136. package/dist/operations/proof/code-scope.d.ts.map +1 -1
  137. package/dist/operations/proof/code-scope.js +72 -0
  138. package/dist/operations/proof/compact-receipts.d.ts +49 -0
  139. package/dist/operations/proof/compact-receipts.d.ts.map +1 -0
  140. package/dist/operations/proof/compact-receipts.js +160 -0
  141. package/dist/operations/proof/ingest-proof.d.ts +2 -0
  142. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  143. package/dist/operations/proof/ingest-proof.js +44 -23
  144. package/dist/operations/proof/prune-receipts.d.ts.map +1 -1
  145. package/dist/operations/proof/prune-receipts.js +5 -9
  146. package/dist/operations/proof/receipt-compaction.d.ts +48 -0
  147. package/dist/operations/proof/receipt-compaction.d.ts.map +1 -0
  148. package/dist/operations/proof/receipt-compaction.js +121 -0
  149. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
  150. package/dist/operations/semantic-advisor/analysis-receipt.js +12 -1
  151. package/dist/operations/semantic-advisor/analyze-prose.d.ts +2 -1
  152. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  153. package/dist/operations/semantic-advisor/analyze-prose.js +51 -5
  154. package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
  155. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
  156. package/dist/operations/semantic-advisor/clauses.js +11 -1
  157. package/dist/operations/semantic-advisor/conditional-rules.d.ts +33 -0
  158. package/dist/operations/semantic-advisor/conditional-rules.d.ts.map +1 -0
  159. package/dist/operations/semantic-advisor/conditional-rules.js +262 -0
  160. package/dist/operations/semantic-advisor/ingestion-boundary.d.ts +3 -1
  161. package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
  162. package/dist/operations/semantic-advisor/ingestion-boundary.js +14 -6
  163. package/dist/operations/semantic-advisor/plugin-orchestration.js +1 -1
  164. package/dist/prolog/codec.d.ts.map +1 -1
  165. package/dist/prolog/codec.js +2 -1
  166. package/dist/prolog.d.ts +9 -0
  167. package/dist/prolog.d.ts.map +1 -1
  168. package/dist/prolog.js +56 -10
  169. package/dist/proof/command-test-report.d.ts +74 -0
  170. package/dist/proof/command-test-report.d.ts.map +1 -0
  171. package/dist/proof/command-test-report.js +206 -0
  172. package/dist/public/branch-resolver.d.ts +1 -0
  173. package/dist/public/branch-resolver.d.ts.map +1 -1
  174. package/dist/public/branch-resolver.js +1 -0
  175. package/dist/public/entity-origin.d.ts +69 -0
  176. package/dist/public/entity-origin.d.ts.map +1 -0
  177. package/dist/public/entity-origin.js +142 -0
  178. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  179. package/dist/public/impact/full-kb-quality.js +1 -0
  180. package/dist/public/impact/requirement-quality.js +1 -1
  181. package/dist/public/operations/catalog.d.ts +130 -19
  182. package/dist/public/operations/catalog.d.ts.map +1 -1
  183. package/dist/public/operations/catalog.js +3 -0
  184. package/dist/public/operations/check-executor.d.ts.map +1 -1
  185. package/dist/public/operations/check-executor.js +8 -0
  186. package/dist/public/operations/contracts.d.ts +0 -5
  187. package/dist/public/operations/contracts.d.ts.map +1 -1
  188. package/dist/public/operations/contracts.js +63 -14
  189. package/dist/public/operations/discovery-entities.d.ts +15 -0
  190. package/dist/public/operations/discovery-entities.d.ts.map +1 -1
  191. package/dist/public/operations/discovery-entities.js +59 -0
  192. package/dist/public/operations/discovery-executors.d.ts +6 -1
  193. package/dist/public/operations/discovery-executors.d.ts.map +1 -1
  194. package/dist/public/operations/discovery-executors.js +65 -6
  195. package/dist/public/operations/index.d.ts +1 -0
  196. package/dist/public/operations/index.d.ts.map +1 -1
  197. package/dist/public/operations/index.js +1 -0
  198. package/dist/public/operations/migration-plan.d.ts +5 -0
  199. package/dist/public/operations/migration-plan.d.ts.map +1 -1
  200. package/dist/public/operations/migration-plan.js +26 -1
  201. package/dist/public/operations/node-ports.d.ts.map +1 -1
  202. package/dist/public/operations/node-ports.js +24 -3
  203. package/dist/public/operations/origin-review.d.ts +51 -0
  204. package/dist/public/operations/origin-review.d.ts.map +1 -0
  205. package/dist/public/operations/origin-review.js +307 -0
  206. package/dist/public/operations/predicate-schema-conformance.js +1 -1
  207. package/dist/public/operations/repair-plan.d.ts.map +1 -1
  208. package/dist/public/operations/repair-plan.js +4 -0
  209. package/dist/public/operations/result-envelope.d.ts.map +1 -1
  210. package/dist/public/operations/result-envelope.js +17 -5
  211. package/dist/public/operations/runtime-types.d.ts +9 -0
  212. package/dist/public/operations/runtime-types.d.ts.map +1 -1
  213. package/dist/public/operations/schema6-check-actions.d.ts +127 -0
  214. package/dist/public/operations/schema6-check-actions.d.ts.map +1 -0
  215. package/dist/public/operations/schema6-check-actions.js +575 -0
  216. package/dist/public/operations/source-path-dangling.d.ts +17 -0
  217. package/dist/public/operations/source-path-dangling.d.ts.map +1 -0
  218. package/dist/public/operations/source-path-dangling.js +66 -0
  219. package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
  220. package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
  221. package/dist/public/operations/specs/check-rules.generated.js +15 -1
  222. package/dist/public/operations/specs/check.d.ts +2 -2
  223. package/dist/public/operations/specs/check.js +1 -1
  224. package/dist/public/operations/specs/composite.d.ts +351 -0
  225. package/dist/public/operations/specs/composite.d.ts.map +1 -0
  226. package/dist/public/operations/specs/composite.js +96 -0
  227. package/dist/public/operations/specs/discovery.d.ts +8 -3
  228. package/dist/public/operations/specs/discovery.d.ts.map +1 -1
  229. package/dist/public/operations/specs/discovery.js +8 -3
  230. package/dist/public/operations/specs/modeling.d.ts +2 -2
  231. package/dist/public/operations/specs/modeling.js +2 -2
  232. package/dist/public/operations/specs/mutation-schemas.d.ts +73 -8
  233. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  234. package/dist/public/operations/specs/mutation-schemas.js +43 -7
  235. package/dist/public/operations/specs/mutation.d.ts +1 -1
  236. package/dist/public/operations/specs/mutation.js +1 -1
  237. package/dist/public/operations/specs/planning.d.ts +2 -2
  238. package/dist/public/operations/specs/planning.js +4 -4
  239. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  240. package/dist/public/operations/specs/reporting.js +13 -26
  241. package/dist/public/operations/specs/upsert.d.ts +79 -9
  242. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  243. package/dist/public/operations/specs/upsert.js +6 -1
  244. package/dist/public/operations/types.d.ts +1 -1
  245. package/dist/public/operations/types.d.ts.map +1 -1
  246. package/dist/public/proof-receipt.d.ts +1 -0
  247. package/dist/public/proof-receipt.d.ts.map +1 -1
  248. package/dist/public/schemas/entity.d.ts.map +1 -1
  249. package/dist/public/schemas/entity.js +52 -0
  250. package/dist/public/schemas/relationship.d.ts.map +1 -1
  251. package/dist/public/schemas/relationship.js +2 -0
  252. package/dist/public/skills/kibi-bootstrap/SKILL.md +6 -1
  253. package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +6 -0
  254. package/dist/public/skills/kibi-usage/SKILL.md +68 -18
  255. package/dist/public/skills/kibi-usage/resources/fact-lanes.md +5 -5
  256. package/dist/public/skills/kibi-usage/resources/kb-improvement.md +1 -1
  257. package/dist/public/skills/kibi-usage/resources/logic-ir.md +2 -2
  258. package/dist/public/skills/kibi-usage/resources/operation-access.md +25 -1
  259. package/dist/public/skills/kibi-usage/resources/ui-requirements.md +4 -4
  260. package/dist/public/skills/kibi-usage/resources/workflows.md +42 -25
  261. package/dist/public/telemetry-acceptance.d.ts +58 -2
  262. package/dist/public/telemetry-acceptance.d.ts.map +1 -1
  263. package/dist/public/telemetry-acceptance.js +136 -10
  264. package/dist/public/telemetry-remediation.d.ts.map +1 -1
  265. package/dist/public/telemetry-remediation.js +26 -10
  266. package/dist/relationships/shards.d.ts +13 -0
  267. package/dist/relationships/shards.d.ts.map +1 -1
  268. package/dist/relationships/shards.js +54 -28
  269. package/dist/runtime/cli-runtime.d.ts.map +1 -1
  270. package/dist/runtime/cli-runtime.js +44 -3
  271. package/dist/runtime/detached-snapshot.d.ts +38 -0
  272. package/dist/runtime/detached-snapshot.d.ts.map +1 -0
  273. package/dist/runtime/detached-snapshot.js +92 -0
  274. package/dist/schemas/entity.schema.json +122 -0
  275. package/dist/search-answer.d.ts +157 -0
  276. package/dist/search-answer.d.ts.map +1 -0
  277. package/dist/search-answer.js +846 -0
  278. package/dist/traceability/impact-knowledge.d.ts.map +1 -1
  279. package/dist/traceability/impact-knowledge.js +7 -0
  280. package/dist/traceability/symbol-extract.js +3 -3
  281. package/dist/traceability/temp-kb.d.ts.map +1 -1
  282. package/dist/traceability/temp-kb.js +12 -0
  283. package/dist/types/entities.d.ts +13 -0
  284. package/dist/types/entities.d.ts.map +1 -1
  285. package/dist/types/relationships.d.ts +1 -1
  286. package/dist/types/relationships.d.ts.map +1 -1
  287. package/dist/utils/branch-resolver.d.ts +37 -1
  288. package/dist/utils/branch-resolver.d.ts.map +1 -1
  289. package/dist/utils/branch-resolver.js +130 -3
  290. package/dist/utils/repo-relative-path.d.ts +18 -0
  291. package/dist/utils/repo-relative-path.d.ts.map +1 -0
  292. package/dist/utils/repo-relative-path.js +58 -0
  293. package/dist/utils/rule-registry.generated.d.ts +75 -3
  294. package/dist/utils/rule-registry.generated.d.ts.map +1 -1
  295. package/dist/utils/rule-registry.generated.js +89 -3
  296. package/dist/utils/schema-version.d.ts +1 -1
  297. package/dist/utils/schema-version.d.ts.map +1 -1
  298. package/dist/utils/schema-version.js +4 -3
  299. package/dist/utils/strict-modeling.d.ts +1 -1
  300. package/dist/utils/strict-modeling.d.ts.map +1 -1
  301. package/dist/utils/strict-modeling.js +23 -3
  302. package/package.json +3 -3
  303. package/schema/entities.pl +22 -0
  304. package/schema/relationships.pl +14 -0
  305. package/schema/validation.pl +45 -1
  306. package/src/public/branch-resolver.ts +1 -0
  307. package/src/public/entity-origin.ts +175 -0
  308. package/src/public/impact/full-kb-quality.ts +1 -0
  309. package/src/public/impact/requirement-quality.ts +1 -1
  310. package/src/public/operations/catalog.ts +3 -0
  311. package/src/public/operations/check-executor.ts +15 -0
  312. package/src/public/operations/contracts.ts +75 -15
  313. package/src/public/operations/discovery-entities.ts +74 -0
  314. package/src/public/operations/discovery-executors.ts +88 -10
  315. package/src/public/operations/index.ts +1 -0
  316. package/src/public/operations/migration-plan.ts +30 -1
  317. package/src/public/operations/node-ports.ts +24 -3
  318. package/src/public/operations/origin-review.ts +375 -0
  319. package/src/public/operations/predicate-schema-conformance.ts +1 -1
  320. package/src/public/operations/repair-plan.ts +4 -0
  321. package/src/public/operations/result-envelope.ts +18 -6
  322. package/src/public/operations/runtime-types.ts +9 -0
  323. package/src/public/operations/schema6-check-actions.ts +699 -0
  324. package/src/public/operations/source-path-dangling.ts +81 -0
  325. package/src/public/operations/specs/check-rules.generated.ts +15 -1
  326. package/src/public/operations/specs/check.ts +1 -1
  327. package/src/public/operations/specs/composite.ts +141 -0
  328. package/src/public/operations/specs/discovery.ts +9 -3
  329. package/src/public/operations/specs/modeling.ts +2 -2
  330. package/src/public/operations/specs/mutation-schemas.ts +49 -7
  331. package/src/public/operations/specs/mutation.ts +1 -1
  332. package/src/public/operations/specs/planning.ts +4 -4
  333. package/src/public/operations/specs/reporting.ts +13 -38
  334. package/src/public/operations/specs/upsert.ts +7 -1
  335. package/src/public/operations/types.ts +2 -0
  336. package/src/public/proof-receipt.ts +1 -0
  337. package/src/public/schemas/entity.ts +57 -0
  338. package/src/public/schemas/relationship.ts +2 -0
  339. package/src/public/skills/kibi-bootstrap/SKILL.md +6 -1
  340. package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +6 -0
  341. package/src/public/skills/kibi-usage/SKILL.md +68 -18
  342. package/src/public/skills/kibi-usage/resources/fact-lanes.md +5 -5
  343. package/src/public/skills/kibi-usage/resources/kb-improvement.md +1 -1
  344. package/src/public/skills/kibi-usage/resources/logic-ir.md +2 -2
  345. package/src/public/skills/kibi-usage/resources/operation-access.md +25 -1
  346. package/src/public/skills/kibi-usage/resources/ui-requirements.md +4 -4
  347. package/src/public/skills/kibi-usage/resources/workflows.md +42 -25
  348. package/src/public/telemetry-acceptance-types.d.ts +4 -1
  349. package/src/public/telemetry-acceptance.ts +204 -10
  350. package/src/public/telemetry-remediation.ts +39 -10
  351. package/src/schemas/entity.schema.json +122 -0
  352. package/src/schemas/relationship.schema.json +2 -0
@@ -45,6 +45,36 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
45
45
  readonly type: "string";
46
46
  readonly description: "Optional text anchor/reference. Example: 'requirements.md#L40'.";
47
47
  };
48
+ readonly origin: {
49
+ readonly description: "Optional provenance: who authored the entity (kind: human, agent, migration, import) and on what authority (ref, approved_by, recorded_at). Omit it to keep an existing entity's origin; a new entity written without one is recorded as {kind: agent, recorded_at: <write time>}. A supplied origin without recorded_at gets the write time.";
50
+ readonly type: "object";
51
+ readonly required: readonly ["kind"];
52
+ readonly properties: {
53
+ readonly kind: {
54
+ readonly type: "string";
55
+ readonly enum: readonly ["human", "agent", "migration", "import"];
56
+ readonly description: "Who authored the entity: human, agent, migration (backfilled by kibi migrate) or import.";
57
+ };
58
+ readonly ref: {
59
+ readonly type: "string";
60
+ readonly minLength: 1;
61
+ readonly pattern: "\\S";
62
+ readonly description: "Source reference for the authored content: URL, document path, ticket, commit or conversation id.";
63
+ };
64
+ readonly approved_by: {
65
+ readonly type: "string";
66
+ readonly minLength: 1;
67
+ readonly pattern: "\\S";
68
+ readonly description: "The person who reviewed and approved this entity's content. Distinct from the requirement-level approved_by of an exception.";
69
+ };
70
+ readonly recorded_at: {
71
+ readonly type: "string";
72
+ readonly pattern: "^\\d{4}-\\d{2}-\\d{2}(?:[T ]\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?(?:Z|[+-]\\d{2}:?\\d{2})?)?$";
73
+ readonly description: "ISO-8601 time the provenance was recorded.";
74
+ };
75
+ };
76
+ readonly additionalProperties: false;
77
+ };
48
78
  readonly semantic_text: {
49
79
  readonly type: "string";
50
80
  readonly description: "Requirement-only authored prose used for semantic inventory hashes and UTF-8 spans. Keep text_ref available for independent document or code evidence.";
@@ -57,7 +87,7 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
57
87
  readonly type: "string";
58
88
  readonly pattern: "^CLAIM-[A-F0-9]{16}$";
59
89
  };
60
- readonly description: "Requirement-only manifest of every atomic normative claim key returned by kb_semantic_advisor. A requirement is logic-complete only when every key is grounded by a linked property_value or predicate fact with the same claim_key.";
90
+ readonly description: "Requirement-only manifest of every atomic normative claim key returned by kb_model mode analyze (CLI: semantic-advisor). A requirement is logic-complete only when every key is grounded by a linked property_value or predicate fact with the same claim_key.";
61
91
  };
62
92
  readonly semantic_clauses: {
63
93
  readonly type: "array";
@@ -66,18 +96,43 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
66
96
  readonly type: "string";
67
97
  readonly minLength: 1;
68
98
  };
69
- readonly description: "Optional complete atomic decomposition used by kb_semantic_advisor and proposition-complete ingestion. Preserve it when automatic sentence splitting needs a reviewed override.";
99
+ readonly description: "Optional complete atomic decomposition used by kb_model mode analyze and proposition-complete ingestion. Preserve it when automatic sentence splitting needs a reviewed override.";
70
100
  };
71
101
  readonly semantic_inventory_version: {
72
102
  readonly type: "string";
73
103
  readonly const: "kibi.semantic-inventory.v1";
74
- readonly description: "Requirement-only proposition ledger contract version returned by kb_semantic_advisor.";
104
+ readonly description: "Requirement-only proposition ledger contract version returned by kb_model mode analyze (CLI: semantic-advisor).";
75
105
  };
76
106
  readonly semantic_source_field: {
77
107
  readonly type: "string";
78
108
  readonly enum: readonly ["semantic_text", "text_ref", "title"];
79
109
  readonly description: "Requirement field whose exact UTF-8 bytes anchor semantic_inventory spans.";
80
110
  };
111
+ readonly approved_by: {
112
+ readonly type: "string";
113
+ readonly minLength: 1;
114
+ readonly description: "Requirement-only. The human who approved this exception requirement. An exception that exempts a requirement and is specified_by a success scenario makes that scenario feasible only when approved_by is set.";
115
+ };
116
+ readonly approval_ref: {
117
+ readonly type: "string";
118
+ readonly minLength: 1;
119
+ readonly description: "Requirement-only. Optional reference to the exception's approval decision record.";
120
+ };
121
+ readonly rationale: {
122
+ readonly type: "string";
123
+ readonly minLength: 1;
124
+ readonly description: "Requirement-only. Why the requirement exists, in one or two sentences from whoever stated the intent; not part of the checked meaning.";
125
+ };
126
+ readonly exempts_claims: {
127
+ readonly type: "array";
128
+ readonly minItems: 1;
129
+ readonly uniqueItems: true;
130
+ readonly items: {
131
+ readonly type: "string";
132
+ readonly pattern: "^CLAIM-[A-F0-9]{16}$";
133
+ };
134
+ readonly description: "Requirement-only. Claim keys of the exempted requirement whose constraints this exception waives; omit to waive the whole requirement.";
135
+ };
81
136
  readonly semantic_source_hash: {
82
137
  readonly type: "string";
83
138
  readonly pattern: "^[a-f0-9]{64}$";
@@ -407,7 +462,7 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
407
462
  readonly fact_kind: {
408
463
  readonly type: "string";
409
464
  readonly enum: readonly ["subject", "property_value", "observation", "meta", "predicate_schema", "predicate", "rule_schema", "rule"];
410
- readonly description: "Optional fact lane kind for fact entities. Strict lane uses 'subject' and 'property_value'; context lane uses 'observation' or 'meta'; ontology lane uses 'predicate_schema' or 'predicate'. Use kb_model_requirement or kb_suggest_predicates when starting from prose.";
465
+ readonly description: "Optional fact lane kind for fact entities. Strict lane uses 'subject' and 'property_value'; context lane uses 'observation' or 'meta'; ontology lane uses 'predicate_schema' or 'predicate'. Use kb_model (mode requirement or predicates) when starting from prose.";
411
466
  };
412
467
  readonly subject_key: {
413
468
  readonly type: "string";
@@ -475,14 +530,14 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
475
530
  };
476
531
  readonly predicate_name: {
477
532
  readonly type: "string";
478
- readonly description: "Optional predicate name for ontology predicate facts. Prefer kb_suggest_predicates before hand-writing predicate_name.";
533
+ readonly description: "Optional predicate name for ontology predicate facts. Prefer kb_model mode predicates before hand-writing predicate_name.";
479
534
  };
480
535
  readonly predicate_args: {
481
536
  readonly type: "array";
482
537
  readonly items: {
483
538
  readonly type: "string";
484
539
  };
485
- readonly description: "Optional ordered predicate arguments for ontology predicate facts. Prefer kb_suggest_predicates before hand-writing predicate_args.";
540
+ readonly description: "Optional ordered predicate arguments for ontology predicate facts. Prefer kb_model mode predicates before hand-writing predicate_args.";
486
541
  };
487
542
  readonly predicate_namespace: {
488
543
  readonly type: "string";
@@ -514,6 +569,16 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
514
569
  };
515
570
  readonly description: "Optional ordered argument explanations.";
516
571
  };
572
+ readonly key_arguments: {
573
+ readonly type: "array";
574
+ readonly items: {
575
+ readonly type: "string";
576
+ readonly minLength: 1;
577
+ };
578
+ readonly minItems: 1;
579
+ readonly uniqueItems: true;
580
+ readonly description: "predicate_schema only: argument names that determine the remaining arguments (a functional dependency), e.g. [\"sensor\"] for reading(sensor, value). Rule contradiction analysis treats two atoms with identical keys as the same fact; without it the predicate is multivalued and opposing rules stay unresolved instead of disjoint.";
581
+ };
517
582
  readonly argument_constants: {
518
583
  readonly type: "object";
519
584
  readonly additionalProperties: {
@@ -553,7 +618,7 @@ export declare const ENTITY_PROPERTIES_SCHEMA: {
553
618
  };
554
619
  readonly semantic_inventory: {
555
620
  readonly type: "array";
556
- readonly description: "Requirement proposition ledger returned by kb_semantic_advisor; preserve entries while modeling each assertive span.";
621
+ readonly description: "Requirement proposition ledger returned by kb_model mode analyze (CLI: semantic-advisor); preserve entries while modeling each assertive span.";
557
622
  readonly items: {
558
623
  readonly type: "object";
559
624
  };
@@ -606,7 +671,7 @@ export declare const RELATIONSHIPS_SCHEMA: {
606
671
  readonly properties: {
607
672
  readonly type: {
608
673
  readonly type: "string";
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"];
674
+ 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", "assumes", "exempts", "relates_to"];
610
675
  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).";
611
676
  };
612
677
  readonly from: {
@@ -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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoX3B,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;CA8CvB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { ENTITY_ORIGIN_SCHEMA } from "../../entity-origin.js";
1
2
  import { PROOF_BINDINGS_SCHEMA, PROOF_CONTRACT_SCHEMA, } from "../../proof-protocol.js";
2
3
  import { MAX_PROOF_RECEIPTS, PROOF_RECEIPT_SCHEMA, } from "../../proof-receipt.js";
3
4
  export const ENTITY_TYPES = [
@@ -61,6 +62,10 @@ export const ENTITY_PROPERTIES_SCHEMA = {
61
62
  type: "string",
62
63
  description: "Optional text anchor/reference. Example: 'requirements.md#L40'.",
63
64
  },
65
+ origin: {
66
+ ...ENTITY_ORIGIN_SCHEMA,
67
+ description: "Optional provenance: who authored the entity (kind: human, agent, migration, import) and on what authority (ref, approved_by, recorded_at). Omit it to keep an existing entity's origin; a new entity written without one is recorded as {kind: agent, recorded_at: <write time>}. A supplied origin without recorded_at gets the write time.",
68
+ },
64
69
  semantic_text: {
65
70
  type: "string",
66
71
  description: "Requirement-only authored prose used for semantic inventory hashes and UTF-8 spans. Keep text_ref available for independent document or code evidence.",
@@ -70,24 +75,46 @@ export const ENTITY_PROPERTIES_SCHEMA = {
70
75
  minItems: 1,
71
76
  uniqueItems: true,
72
77
  items: { type: "string", pattern: "^CLAIM-[A-F0-9]{16}$" },
73
- description: "Requirement-only manifest of every atomic normative claim key returned by kb_semantic_advisor. A requirement is logic-complete only when every key is grounded by a linked property_value or predicate fact with the same claim_key.",
78
+ description: "Requirement-only manifest of every atomic normative claim key returned by kb_model mode analyze (CLI: semantic-advisor). A requirement is logic-complete only when every key is grounded by a linked property_value or predicate fact with the same claim_key.",
74
79
  },
75
80
  semantic_clauses: {
76
81
  type: "array",
77
82
  minItems: 1,
78
83
  items: { type: "string", minLength: 1 },
79
- description: "Optional complete atomic decomposition used by kb_semantic_advisor and proposition-complete ingestion. Preserve it when automatic sentence splitting needs a reviewed override.",
84
+ description: "Optional complete atomic decomposition used by kb_model mode analyze and proposition-complete ingestion. Preserve it when automatic sentence splitting needs a reviewed override.",
80
85
  },
81
86
  semantic_inventory_version: {
82
87
  type: "string",
83
88
  const: "kibi.semantic-inventory.v1",
84
- description: "Requirement-only proposition ledger contract version returned by kb_semantic_advisor.",
89
+ description: "Requirement-only proposition ledger contract version returned by kb_model mode analyze (CLI: semantic-advisor).",
85
90
  },
86
91
  semantic_source_field: {
87
92
  type: "string",
88
93
  enum: ["semantic_text", "text_ref", "title"],
89
94
  description: "Requirement field whose exact UTF-8 bytes anchor semantic_inventory spans.",
90
95
  },
96
+ approved_by: {
97
+ type: "string",
98
+ minLength: 1,
99
+ description: "Requirement-only. The human who approved this exception requirement. An exception that exempts a requirement and is specified_by a success scenario makes that scenario feasible only when approved_by is set.",
100
+ },
101
+ approval_ref: {
102
+ type: "string",
103
+ minLength: 1,
104
+ description: "Requirement-only. Optional reference to the exception's approval decision record.",
105
+ },
106
+ rationale: {
107
+ type: "string",
108
+ minLength: 1,
109
+ description: "Requirement-only. Why the requirement exists, in one or two sentences from whoever stated the intent; not part of the checked meaning.",
110
+ },
111
+ exempts_claims: {
112
+ type: "array",
113
+ minItems: 1,
114
+ uniqueItems: true,
115
+ items: { type: "string", pattern: "^CLAIM-[A-F0-9]{16}$" },
116
+ description: "Requirement-only. Claim keys of the exempted requirement whose constraints this exception waives; omit to waive the whole requirement.",
117
+ },
91
118
  semantic_source_hash: {
92
119
  type: "string",
93
120
  pattern: "^[a-f0-9]{64}$",
@@ -156,7 +183,7 @@ export const ENTITY_PROPERTIES_SCHEMA = {
156
183
  "rule_schema",
157
184
  "rule",
158
185
  ],
159
- description: "Optional fact lane kind for fact entities. Strict lane uses 'subject' and 'property_value'; context lane uses 'observation' or 'meta'; ontology lane uses 'predicate_schema' or 'predicate'. Use kb_model_requirement or kb_suggest_predicates when starting from prose.",
186
+ description: "Optional fact lane kind for fact entities. Strict lane uses 'subject' and 'property_value'; context lane uses 'observation' or 'meta'; ontology lane uses 'predicate_schema' or 'predicate'. Use kb_model (mode requirement or predicates) when starting from prose.",
160
187
  },
161
188
  subject_key: {
162
189
  type: "string",
@@ -224,12 +251,12 @@ export const ENTITY_PROPERTIES_SCHEMA = {
224
251
  },
225
252
  predicate_name: {
226
253
  type: "string",
227
- description: "Optional predicate name for ontology predicate facts. Prefer kb_suggest_predicates before hand-writing predicate_name.",
254
+ description: "Optional predicate name for ontology predicate facts. Prefer kb_model mode predicates before hand-writing predicate_name.",
228
255
  },
229
256
  predicate_args: {
230
257
  type: "array",
231
258
  items: { type: "string" },
232
- description: "Optional ordered predicate arguments for ontology predicate facts. Prefer kb_suggest_predicates before hand-writing predicate_args.",
259
+ description: "Optional ordered predicate arguments for ontology predicate facts. Prefer kb_model mode predicates before hand-writing predicate_args.",
233
260
  },
234
261
  predicate_namespace: {
235
262
  type: "string",
@@ -255,6 +282,13 @@ export const ENTITY_PROPERTIES_SCHEMA = {
255
282
  items: { type: "string" },
256
283
  description: "Optional ordered argument explanations.",
257
284
  },
285
+ key_arguments: {
286
+ type: "array",
287
+ items: { type: "string", minLength: 1 },
288
+ minItems: 1,
289
+ uniqueItems: true,
290
+ description: 'predicate_schema only: argument names that determine the remaining arguments (a functional dependency), e.g. ["sensor"] for reading(sensor, value). Rule contradiction analysis treats two atoms with identical keys as the same fact; without it the predicate is multivalued and opposing rules stay unresolved instead of disjoint.',
291
+ },
258
292
  argument_constants: {
259
293
  type: "object",
260
294
  additionalProperties: {
@@ -284,7 +318,7 @@ export const ENTITY_PROPERTIES_SCHEMA = {
284
318
  },
285
319
  semantic_inventory: {
286
320
  type: "array",
287
- description: "Requirement proposition ledger returned by kb_semantic_advisor; preserve entries while modeling each assertive span.",
321
+ description: "Requirement proposition ledger returned by kb_model mode analyze (CLI: semantic-advisor); preserve entries while modeling each assertive span.",
288
322
  items: { type: "object" },
289
323
  },
290
324
  rule_ir: {
@@ -344,6 +378,8 @@ export const RELATIONSHIPS_SCHEMA = {
344
378
  "consumes",
345
379
  "supersedes",
346
380
  "restates",
381
+ "assumes",
382
+ "exempts",
347
383
  "relates_to",
348
384
  ],
349
385
  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).",
@@ -4,7 +4,7 @@ export { upsertSpec } from "./upsert.js";
4
4
  export declare const validateUpsertSpec: {
5
5
  readonly name: "kb_validate_upsert";
6
6
  readonly cliName: "validate-upsert";
7
- readonly description: "Validate a kb_upsert payload without mutating the KB. Use this read-only preflight before kb_upsert, especially for requirements, because it returns schema/modeling errors plus semantic advisor receipts that identify prose likely needing kb_model_requirement, kb_suggest_predicates, ambiguity review, or an ontology-gap observation.";
7
+ readonly description: "Validate a kb_upsert payload without mutating the KB. Use this read-only preflight before kb_upsert, especially for requirements, because it returns schema/modeling errors plus semantic advisor receipts that identify prose likely needing kb_model mode requirement or predicates, ambiguity review, or an ontology-gap observation.";
8
8
  readonly businessInputSchema: {
9
9
  readonly type: "object";
10
10
  readonly required: readonly ["type", "id", "properties"];
@@ -5,7 +5,7 @@ export { upsertSpec } from "./upsert.js";
5
5
  export const validateUpsertSpec = {
6
6
  name: "kb_validate_upsert",
7
7
  cliName: "validate-upsert",
8
- description: "Validate a kb_upsert payload without mutating the KB. Use this read-only preflight before kb_upsert, especially for requirements, because it returns schema/modeling errors plus semantic advisor receipts that identify prose likely needing kb_model_requirement, kb_suggest_predicates, ambiguity review, or an ontology-gap observation.",
8
+ description: "Validate a kb_upsert payload without mutating the KB. Use this read-only preflight before kb_upsert, especially for requirements, because it returns schema/modeling errors plus semantic advisor receipts that identify prose likely needing kb_model mode requirement or predicates, ambiguity review, or an ontology-gap observation.",
9
9
  businessInputSchema: {
10
10
  type: "object",
11
11
  required: ["type", "id", "properties"],
@@ -228,7 +228,7 @@ export declare const compileIntentSpec: {
228
228
  export declare const applyPlanSpec: {
229
229
  readonly name: "kb_apply_plan";
230
230
  readonly cliName: "apply-plan";
231
- readonly description: "Apply an explicitly approved kibi.bootstrap-plan.v1, kibi.compile-plan.v1, kibi.migration-plan.v2, or entity-deletion plan after revalidating its canonical hash and live snapshots. Bootstrap actions are dependency-ordered, sequential, source-first, and recoverable from a typed journal.";
231
+ readonly description: "Apply an explicitly approved kibi.bootstrap-plan.v1, kibi.compile-plan.v1, kibi.migration-plan.v2, or entity-deletion plan after revalidating its canonical hash and live snapshots. Compile plans apply all-or-nothing: a durable journal records every source write and store mutation before the first write, all steps commit in one store transaction, and an interrupted application is completed or rolled back by the next mutating call. Bootstrap actions are dependency-ordered, sequential, source-first, and recoverable from a typed journal.";
232
232
  readonly businessInputSchema: {
233
233
  readonly type: "object";
234
234
  readonly oneOf: readonly [{
@@ -268,7 +268,7 @@ export declare const applyPlanSpec: {
268
268
  readonly recoveryJournalId: {
269
269
  readonly type: "string";
270
270
  readonly pattern: "^[A-Za-z0-9._-]+$";
271
- readonly description: "Typed recovery journal identifier returned by a committed_with_repairs result. Recovery replays only the immutable journal and never the original plan request.";
271
+ readonly description: "Typed recovery journal identifier returned by a committed_with_repairs result or a PLAN_APPLY_RECOVERY_REQUIRED error. Recovery replays only the immutable journal and never the original plan request; a compile-plan journal (plan-apply-*) is completed or rolled back deterministically and reports which.";
272
272
  };
273
273
  };
274
274
  };
@@ -2,7 +2,7 @@ import { executeApplyPlan, } from "../../../operations/planning/apply-plan.js";
2
2
  import { executeCompileIntent, } from "../../../operations/planning/compile-intent.js";
3
3
  export { executeApplyPlan } from "../../../operations/planning/apply-plan.js";
4
4
  export { executeCompileIntent } from "../../../operations/planning/compile-intent.js";
5
- // implements REQ-kibi-change-to-proof-plan-compiler
5
+ // implements REQ-kibi-change-to-proof-plan-compiler-v2
6
6
  export const compileIntentSpec = {
7
7
  name: "kb_compile_intent",
8
8
  cliName: "compile-intent",
@@ -145,11 +145,11 @@ export const compileIntentSpec = {
145
145
  effects: ["kb-read", "workspace-read"],
146
146
  execute: executeCompileIntent,
147
147
  };
148
- // implements REQ-kibi-change-to-proof-plan-compiler
148
+ // implements REQ-kibi-change-to-proof-plan-compiler-v2
149
149
  export const applyPlanSpec = {
150
150
  name: "kb_apply_plan",
151
151
  cliName: "apply-plan",
152
- description: "Apply an explicitly approved kibi.bootstrap-plan.v1, kibi.compile-plan.v1, kibi.migration-plan.v2, or entity-deletion plan after revalidating its canonical hash and live snapshots. Bootstrap actions are dependency-ordered, sequential, source-first, and recoverable from a typed journal.",
152
+ description: "Apply an explicitly approved kibi.bootstrap-plan.v1, kibi.compile-plan.v1, kibi.migration-plan.v2, or entity-deletion plan after revalidating its canonical hash and live snapshots. Compile plans apply all-or-nothing: a durable journal records every source write and store mutation before the first write, all steps commit in one store transaction, and an interrupted application is completed or rolled back by the next mutating call. Bootstrap actions are dependency-ordered, sequential, source-first, and recoverable from a typed journal.",
153
153
  businessInputSchema: {
154
154
  type: "object",
155
155
  oneOf: [
@@ -183,7 +183,7 @@ export const applyPlanSpec = {
183
183
  recoveryJournalId: {
184
184
  type: "string",
185
185
  pattern: "^[A-Za-z0-9._-]+$",
186
- description: "Typed recovery journal identifier returned by a committed_with_repairs result. Recovery replays only the immutable journal and never the original plan request.",
186
+ description: "Typed recovery journal identifier returned by a committed_with_repairs result or a PLAN_APPLY_RECOVERY_REQUIRED error. Recovery replays only the immutable journal and never the original plan request; a compile-plan journal (plan-apply-*) is completed or rolled back deterministically and reports which.",
187
187
  },
188
188
  },
189
189
  },
@@ -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,CAAC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClD,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,IAAI,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,MAA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,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"}
@@ -1,5 +1,3 @@
1
- import { join } from "node:path";
2
- import { resolveBoundSymbolScope } from "../../../extractors/manifest.js";
3
1
  import { PROOF_RECEIPT_MAX_AGE_SECONDS } from "../../proof-receipt.js";
4
2
  import { executeStatus } from "../discovery-executors.js";
5
3
  import { buildLegacyMigrationPlanFromContext, } from "../legacy-migration-plan.js";
@@ -101,13 +99,12 @@ export function currentProofBindingMode() {
101
99
  ? "strict_snapshot"
102
100
  : "per_contract";
103
101
  }
102
+ // implements REQ-kibi-verification-evidence-contract
104
103
  export async function perContractTestBindings(context) {
105
104
  if (currentProofBindingMode() !== "per_contract")
106
105
  return null;
107
106
  const { loadEntities } = await import("../discovery-entities.js");
108
- const { receiptBindingHash } = await import("../../proof-fingerprint.js");
109
- const { removeFrontmatterBlock } = await import("../../../operations/proof/receipt-document.js");
110
- const { loadCoveredBySymbolsByTest, receiptCodeScopeSymbolIds } = await import("../../../operations/proof/code-scope.js");
107
+ const { currentReceiptBindingHash, loadCoveredBySymbolsByTest } = await import("../../../operations/proof/code-scope.js");
111
108
  // Only the contract, scoped code, and authored source feed the binding
112
109
  // hash. The paged projection never materializes receipt histories, which
113
110
  // grow without bound and previously overflowed the bounded Prolog output
@@ -128,32 +125,22 @@ export async function perContractTestBindings(context) {
128
125
  ? await loadCoveredBySymbolsByTest(requireProlog(context))
129
126
  : new Map();
130
127
  const entries = [];
131
- const manifestPath = join(context.workspaceRoot, ".kb", "symbols.yaml");
128
+ const fs = context.fs;
132
129
  for (const test of tests) {
133
130
  const testId = typeof test.id === "string" ? test.id : "";
134
- const contract = test.proof_contract !== undefined &&
135
- test.proof_contract !== null &&
136
- typeof test.proof_contract === "object"
137
- ? test.proof_contract
138
- : undefined;
139
- const source = typeof test.source === "string" ? test.source : "";
140
- if (testId === "" || contract === undefined || source === "")
141
- continue;
142
- if (!/\.(md|mdx)$/i.test(source))
143
- continue;
144
- if (!context.fs)
131
+ if (testId === "" || fs === undefined)
145
132
  continue;
146
- try {
147
- const absolute = join(context.workspaceRoot, source);
148
- const authored = await context.fs.readFile(absolute);
149
- const stripped = removeFrontmatterBlock(authored, "proof_receipts");
150
- const codeScope = resolveBoundSymbolScope(manifestPath, receiptCodeScopeSymbolIds(contract, test.proof_bindings, coveredBy.get(testId) ?? []));
151
- const binding = receiptBindingHash(contract, stripped ?? authored, codeScope);
133
+ // The same computation ingest uses to write binding_hash. Unreadable or
134
+ // non-markdown documents keep strict snapshot semantics for that test.
135
+ const binding = await currentReceiptBindingHash({
136
+ workspaceRoot: context.workspaceRoot,
137
+ readFile: (absolute) => fs.readFile(absolute),
138
+ test,
139
+ coveredBySymbols: coveredBy.get(testId) ?? [],
140
+ });
141
+ if (binding !== undefined) {
152
142
  entries.push(`${toPrologAtom(testId)}: ${toPrologAtom(binding)}`);
153
143
  }
154
- catch {
155
- // Unreadable documents keep strict semantics for that test.
156
- }
157
144
  }
158
145
  if (entries.length === 0)
159
146
  return null;
@@ -2,7 +2,7 @@ import { executeUpsert } from "../../../operations/mutation/upsert.js";
2
2
  export declare const upsertSpec: {
3
3
  readonly name: "kb_upsert";
4
4
  readonly cliName: "upsert";
5
- readonly description: "Create or update one entity and optional relationships. Use for KB mutations after validating intent; prefer kb_validate_upsert first because it returns semantic advisor receipts for prose-heavy requirements. Use kb_model_requirement before hand-writing strict property facts from prose, and kb_suggest_predicates before hand-writing ontology predicate facts. Use the `relationships` array for batch creation of multiple links in a single call (e.g., linking a requirement to multiple tests or facts). Prefer modeling requirements as reusable fact links (`constrains`, `requires_property`, or `requires_predicate`) so consistency and contradiction checks remain queryable. Relationship endpoints must already exist in KB. For requirements, the write will be rejected if it contradicts existing current requirements that constrain the same subject with incompatible properties. To replace a conflicting requirement, include a `supersedes` relationship from the new requirement to the old one in the same request. Successful writes may return non-blocking semantic advisor warnings; inspect and repair those warnings before treating prose as contradiction-checkable. Do not use for read-only inspection. Side effects: writes KB, may refresh symbol coordinates.";
5
+ readonly description: "Create or update one entity and optional relationships. Use for KB mutations after validating intent; prefer a dryRun:true call first because it validates without writing and returns semantic advisor receipts for prose-heavy requirements. Use kb_model (mode requirement) before hand-writing strict property facts from prose, and kb_model (mode predicates) before hand-writing ontology predicate facts. Use the `relationships` array for batch creation of multiple links in a single call (e.g., linking a requirement to multiple tests or facts). Prefer modeling requirements as reusable fact links (`constrains`, `requires_property`, or `requires_predicate`) so consistency and contradiction checks remain queryable. Relationship endpoints must already exist in KB. For requirements, the write will be rejected if it contradicts existing current requirements that constrain the same subject with incompatible properties. To replace a conflicting requirement, include a `supersedes` relationship from the new requirement to the old one in the same request, then upsert the old requirement with status closed (kb_check blocks a superseded requirement that is not closed). Successful writes may return non-blocking semantic advisor warnings; inspect and repair those warnings before treating prose as contradiction-checkable. Do not use for read-only inspection. Side effects: writes KB, may refresh symbol coordinates; dryRun:true writes nothing.";
6
6
  readonly businessInputSchema: {
7
7
  readonly type: "object";
8
8
  readonly required: readonly ["type", "id", "properties"];
@@ -62,6 +62,36 @@ export declare const upsertSpec: {
62
62
  readonly type: "string";
63
63
  readonly description: "Optional text anchor/reference. Example: 'requirements.md#L40'.";
64
64
  };
65
+ readonly origin: {
66
+ readonly description: "Optional provenance: who authored the entity (kind: human, agent, migration, import) and on what authority (ref, approved_by, recorded_at). Omit it to keep an existing entity's origin; a new entity written without one is recorded as {kind: agent, recorded_at: <write time>}. A supplied origin without recorded_at gets the write time.";
67
+ readonly type: "object";
68
+ readonly required: readonly ["kind"];
69
+ readonly properties: {
70
+ readonly kind: {
71
+ readonly type: "string";
72
+ readonly enum: readonly ["human", "agent", "migration", "import"];
73
+ readonly description: "Who authored the entity: human, agent, migration (backfilled by kibi migrate) or import.";
74
+ };
75
+ readonly ref: {
76
+ readonly type: "string";
77
+ readonly minLength: 1;
78
+ readonly pattern: "\\S";
79
+ readonly description: "Source reference for the authored content: URL, document path, ticket, commit or conversation id.";
80
+ };
81
+ readonly approved_by: {
82
+ readonly type: "string";
83
+ readonly minLength: 1;
84
+ readonly pattern: "\\S";
85
+ readonly description: "The person who reviewed and approved this entity's content. Distinct from the requirement-level approved_by of an exception.";
86
+ };
87
+ readonly recorded_at: {
88
+ readonly type: "string";
89
+ readonly pattern: "^\\d{4}-\\d{2}-\\d{2}(?:[T ]\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?(?:Z|[+-]\\d{2}:?\\d{2})?)?$";
90
+ readonly description: "ISO-8601 time the provenance was recorded.";
91
+ };
92
+ };
93
+ readonly additionalProperties: false;
94
+ };
65
95
  readonly semantic_text: {
66
96
  readonly type: "string";
67
97
  readonly description: "Requirement-only authored prose used for semantic inventory hashes and UTF-8 spans. Keep text_ref available for independent document or code evidence.";
@@ -74,7 +104,7 @@ export declare const upsertSpec: {
74
104
  readonly type: "string";
75
105
  readonly pattern: "^CLAIM-[A-F0-9]{16}$";
76
106
  };
77
- readonly description: "Requirement-only manifest of every atomic normative claim key returned by kb_semantic_advisor. A requirement is logic-complete only when every key is grounded by a linked property_value or predicate fact with the same claim_key.";
107
+ readonly description: "Requirement-only manifest of every atomic normative claim key returned by kb_model mode analyze (CLI: semantic-advisor). A requirement is logic-complete only when every key is grounded by a linked property_value or predicate fact with the same claim_key.";
78
108
  };
79
109
  readonly semantic_clauses: {
80
110
  readonly type: "array";
@@ -83,18 +113,43 @@ export declare const upsertSpec: {
83
113
  readonly type: "string";
84
114
  readonly minLength: 1;
85
115
  };
86
- readonly description: "Optional complete atomic decomposition used by kb_semantic_advisor and proposition-complete ingestion. Preserve it when automatic sentence splitting needs a reviewed override.";
116
+ readonly description: "Optional complete atomic decomposition used by kb_model mode analyze and proposition-complete ingestion. Preserve it when automatic sentence splitting needs a reviewed override.";
87
117
  };
88
118
  readonly semantic_inventory_version: {
89
119
  readonly type: "string";
90
120
  readonly const: "kibi.semantic-inventory.v1";
91
- readonly description: "Requirement-only proposition ledger contract version returned by kb_semantic_advisor.";
121
+ readonly description: "Requirement-only proposition ledger contract version returned by kb_model mode analyze (CLI: semantic-advisor).";
92
122
  };
93
123
  readonly semantic_source_field: {
94
124
  readonly type: "string";
95
125
  readonly enum: readonly ["semantic_text", "text_ref", "title"];
96
126
  readonly description: "Requirement field whose exact UTF-8 bytes anchor semantic_inventory spans.";
97
127
  };
128
+ readonly approved_by: {
129
+ readonly type: "string";
130
+ readonly minLength: 1;
131
+ readonly description: "Requirement-only. The human who approved this exception requirement. An exception that exempts a requirement and is specified_by a success scenario makes that scenario feasible only when approved_by is set.";
132
+ };
133
+ readonly approval_ref: {
134
+ readonly type: "string";
135
+ readonly minLength: 1;
136
+ readonly description: "Requirement-only. Optional reference to the exception's approval decision record.";
137
+ };
138
+ readonly rationale: {
139
+ readonly type: "string";
140
+ readonly minLength: 1;
141
+ readonly description: "Requirement-only. Why the requirement exists, in one or two sentences from whoever stated the intent; not part of the checked meaning.";
142
+ };
143
+ readonly exempts_claims: {
144
+ readonly type: "array";
145
+ readonly minItems: 1;
146
+ readonly uniqueItems: true;
147
+ readonly items: {
148
+ readonly type: "string";
149
+ readonly pattern: "^CLAIM-[A-F0-9]{16}$";
150
+ };
151
+ readonly description: "Requirement-only. Claim keys of the exempted requirement whose constraints this exception waives; omit to waive the whole requirement.";
152
+ };
98
153
  readonly semantic_source_hash: {
99
154
  readonly type: "string";
100
155
  readonly pattern: "^[a-f0-9]{64}$";
@@ -424,7 +479,7 @@ export declare const upsertSpec: {
424
479
  readonly fact_kind: {
425
480
  readonly type: "string";
426
481
  readonly enum: readonly ["subject", "property_value", "observation", "meta", "predicate_schema", "predicate", "rule_schema", "rule"];
427
- readonly description: "Optional fact lane kind for fact entities. Strict lane uses 'subject' and 'property_value'; context lane uses 'observation' or 'meta'; ontology lane uses 'predicate_schema' or 'predicate'. Use kb_model_requirement or kb_suggest_predicates when starting from prose.";
482
+ readonly description: "Optional fact lane kind for fact entities. Strict lane uses 'subject' and 'property_value'; context lane uses 'observation' or 'meta'; ontology lane uses 'predicate_schema' or 'predicate'. Use kb_model (mode requirement or predicates) when starting from prose.";
428
483
  };
429
484
  readonly subject_key: {
430
485
  readonly type: "string";
@@ -492,14 +547,14 @@ export declare const upsertSpec: {
492
547
  };
493
548
  readonly predicate_name: {
494
549
  readonly type: "string";
495
- readonly description: "Optional predicate name for ontology predicate facts. Prefer kb_suggest_predicates before hand-writing predicate_name.";
550
+ readonly description: "Optional predicate name for ontology predicate facts. Prefer kb_model mode predicates before hand-writing predicate_name.";
496
551
  };
497
552
  readonly predicate_args: {
498
553
  readonly type: "array";
499
554
  readonly items: {
500
555
  readonly type: "string";
501
556
  };
502
- readonly description: "Optional ordered predicate arguments for ontology predicate facts. Prefer kb_suggest_predicates before hand-writing predicate_args.";
557
+ readonly description: "Optional ordered predicate arguments for ontology predicate facts. Prefer kb_model mode predicates before hand-writing predicate_args.";
503
558
  };
504
559
  readonly predicate_namespace: {
505
560
  readonly type: "string";
@@ -531,6 +586,16 @@ export declare const upsertSpec: {
531
586
  };
532
587
  readonly description: "Optional ordered argument explanations.";
533
588
  };
589
+ readonly key_arguments: {
590
+ readonly type: "array";
591
+ readonly items: {
592
+ readonly type: "string";
593
+ readonly minLength: 1;
594
+ };
595
+ readonly minItems: 1;
596
+ readonly uniqueItems: true;
597
+ readonly description: "predicate_schema only: argument names that determine the remaining arguments (a functional dependency), e.g. [\"sensor\"] for reading(sensor, value). Rule contradiction analysis treats two atoms with identical keys as the same fact; without it the predicate is multivalued and opposing rules stay unresolved instead of disjoint.";
598
+ };
534
599
  readonly argument_constants: {
535
600
  readonly type: "object";
536
601
  readonly additionalProperties: {
@@ -570,7 +635,7 @@ export declare const upsertSpec: {
570
635
  };
571
636
  readonly semantic_inventory: {
572
637
  readonly type: "array";
573
- readonly description: "Requirement proposition ledger returned by kb_semantic_advisor; preserve entries while modeling each assertive span.";
638
+ readonly description: "Requirement proposition ledger returned by kb_model mode analyze (CLI: semantic-advisor); preserve entries while modeling each assertive span.";
574
639
  readonly items: {
575
640
  readonly type: "object";
576
641
  };
@@ -623,7 +688,7 @@ export declare const upsertSpec: {
623
688
  readonly properties: {
624
689
  readonly type: {
625
690
  readonly type: "string";
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"];
691
+ 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", "assumes", "exempts", "relates_to"];
627
692
  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).";
628
693
  };
629
694
  readonly from: {
@@ -637,6 +702,11 @@ export declare const upsertSpec: {
637
702
  };
638
703
  };
639
704
  };
705
+ readonly dryRun: {
706
+ readonly type: "boolean";
707
+ readonly default: false;
708
+ readonly description: "Validate the payload and return schema/modeling errors, a normalized preview and the semantic advisor receipt without writing the KB or workspace. Use it as the preflight before the real write.";
709
+ };
640
710
  readonly document: {
641
711
  readonly type: "object";
642
712
  readonly additionalProperties: false;