kibi-cli 2.0.0 → 2.2.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 (377) hide show
  1. package/dist/cli-protocol.d.ts.map +1 -1
  2. package/dist/cli-protocol.js +3 -2
  3. package/dist/cli-register-proof.d.ts.map +1 -1
  4. package/dist/cli-register-proof.js +25 -1
  5. package/dist/cli-register-reporting.d.ts.map +1 -1
  6. package/dist/cli-register-reporting.js +6 -0
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +2 -0
  9. package/dist/commands/aggregated-checks.d.ts +7 -0
  10. package/dist/commands/aggregated-checks.d.ts.map +1 -1
  11. package/dist/commands/aggregated-checks.js +25 -1
  12. package/dist/commands/check-generated.d.ts +7 -0
  13. package/dist/commands/check-generated.d.ts.map +1 -0
  14. package/dist/commands/check-generated.js +192 -0
  15. package/dist/commands/check.d.ts.map +1 -1
  16. package/dist/commands/check.js +24 -15
  17. package/dist/commands/doctor.d.ts.map +1 -1
  18. package/dist/commands/doctor.js +227 -25
  19. package/dist/commands/engine.d.ts.map +1 -1
  20. package/dist/commands/engine.js +3 -1
  21. package/dist/commands/github-init.d.ts +1 -1
  22. package/dist/commands/github-init.d.ts.map +1 -1
  23. package/dist/commands/github-init.js +1 -1
  24. package/dist/commands/init-helpers.d.ts +17 -2
  25. package/dist/commands/init-helpers.d.ts.map +1 -1
  26. package/dist/commands/init-helpers.js +136 -30
  27. package/dist/commands/init.d.ts.map +1 -1
  28. package/dist/commands/init.js +110 -15
  29. package/dist/commands/proof-explain.d.ts +10 -0
  30. package/dist/commands/proof-explain.d.ts.map +1 -0
  31. package/dist/commands/proof-explain.js +45 -0
  32. package/dist/commands/proof-impact.d.ts +7 -0
  33. package/dist/commands/proof-impact.d.ts.map +1 -0
  34. package/dist/commands/proof-impact.js +39 -0
  35. package/dist/commands/proof-migrate-legacy.js +1 -1
  36. package/dist/commands/proof-prune.js +1 -1
  37. package/dist/commands/prove.d.ts.map +1 -1
  38. package/dist/commands/prove.js +14 -22
  39. package/dist/commands/report.d.ts.map +1 -1
  40. package/dist/commands/report.js +17 -2
  41. package/dist/commands/sync/cache.d.ts +20 -1
  42. package/dist/commands/sync/cache.d.ts.map +1 -1
  43. package/dist/commands/sync/cache.js +51 -2
  44. package/dist/commands/sync/discovery.d.ts.map +1 -1
  45. package/dist/commands/sync/discovery.js +1 -1
  46. package/dist/commands/sync/manifest.d.ts +1 -0
  47. package/dist/commands/sync/manifest.d.ts.map +1 -1
  48. package/dist/commands/sync/manifest.js +18 -16
  49. package/dist/commands/sync/persistence.d.ts.map +1 -1
  50. package/dist/commands/sync/persistence.js +14 -0
  51. package/dist/commands/sync.d.ts.map +1 -1
  52. package/dist/commands/sync.js +11 -3
  53. package/dist/engine.d.ts +29 -1
  54. package/dist/engine.d.ts.map +1 -1
  55. package/dist/engine.js +259 -89
  56. package/dist/env/bootstrap.d.ts +84 -0
  57. package/dist/env/bootstrap.d.ts.map +1 -0
  58. package/dist/env/bootstrap.js +310 -0
  59. package/dist/extractors/manifest.d.ts.map +1 -1
  60. package/dist/extractors/manifest.js +67 -29
  61. package/dist/extractors/markdown.d.ts +4 -0
  62. package/dist/extractors/markdown.d.ts.map +1 -1
  63. package/dist/extractors/markdown.js +33 -3
  64. package/dist/extractors/relationships.d.ts.map +1 -1
  65. package/dist/extractors/relationships.js +1 -0
  66. package/dist/extractors/symbols-coordinator.d.ts +8 -0
  67. package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
  68. package/dist/extractors/symbols-coordinator.js +40 -0
  69. package/dist/extractors/symbols-ts.d.ts +8 -19
  70. package/dist/extractors/symbols-ts.d.ts.map +1 -1
  71. package/dist/extractors/symbols-ts.js +33 -503
  72. package/dist/intent-search.d.ts.map +1 -1
  73. package/dist/intent-search.js +68 -30
  74. package/dist/operations/bootstrap/generate.d.ts.map +1 -1
  75. package/dist/operations/bootstrap/generate.js +4 -3
  76. package/dist/operations/modeling/model-requirement.d.ts +1 -1
  77. package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
  78. package/dist/operations/modeling/model-requirement.js +179 -9
  79. package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
  80. package/dist/operations/modeling/predicate-applyplan.js +14 -2
  81. package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
  82. package/dist/operations/modeling/predicate-loader.js +24 -0
  83. package/dist/operations/modeling/predicate-types.d.ts +4 -0
  84. package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
  85. package/dist/operations/modeling/predicate-vocabulary.d.ts +54 -0
  86. package/dist/operations/modeling/predicate-vocabulary.d.ts.map +1 -0
  87. package/dist/operations/modeling/predicate-vocabulary.js +169 -0
  88. package/dist/operations/modeling/requirement-types.d.ts +5 -0
  89. package/dist/operations/modeling/requirement-types.d.ts.map +1 -1
  90. package/dist/operations/modeling/suggest-predicates.d.ts +1 -1
  91. package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
  92. package/dist/operations/modeling/suggest-predicates.js +30 -3
  93. package/dist/operations/modeling/vocabulary-alignment.d.ts +60 -0
  94. package/dist/operations/modeling/vocabulary-alignment.d.ts.map +1 -0
  95. package/dist/operations/modeling/vocabulary-alignment.js +178 -0
  96. package/dist/operations/mutation/contradictions.d.ts +3 -0
  97. package/dist/operations/mutation/contradictions.d.ts.map +1 -1
  98. package/dist/operations/mutation/contradictions.js +29 -0
  99. package/dist/operations/mutation/delete.d.ts.map +1 -1
  100. package/dist/operations/mutation/delete.js +33 -1
  101. package/dist/operations/mutation/predicate-vocabulary-guard.d.ts +8 -0
  102. package/dist/operations/mutation/predicate-vocabulary-guard.d.ts.map +1 -0
  103. package/dist/operations/mutation/predicate-vocabulary-guard.js +64 -0
  104. package/dist/operations/mutation/relationships.d.ts +1 -1
  105. package/dist/operations/mutation/relationships.d.ts.map +1 -1
  106. package/dist/operations/mutation/relationships.js +1 -0
  107. package/dist/operations/mutation/saga.d.ts +5 -0
  108. package/dist/operations/mutation/saga.d.ts.map +1 -1
  109. package/dist/operations/mutation/saga.js +10 -0
  110. package/dist/operations/mutation/serialization.d.ts.map +1 -1
  111. package/dist/operations/mutation/serialization.js +2 -0
  112. package/dist/operations/mutation/source-authoring.d.ts +6 -0
  113. package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
  114. package/dist/operations/mutation/source-authoring.js +65 -26
  115. package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
  116. package/dist/operations/mutation/strict-fact.js +5 -0
  117. package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
  118. package/dist/operations/mutation/symbol-granularity.js +9 -87
  119. package/dist/operations/mutation/types.d.ts +17 -0
  120. package/dist/operations/mutation/types.d.ts.map +1 -1
  121. package/dist/operations/mutation/upsert.d.ts +6 -0
  122. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  123. package/dist/operations/mutation/upsert.js +72 -4
  124. package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
  125. package/dist/operations/mutation/validate-upsert.js +24 -1
  126. package/dist/operations/mutation/validation.d.ts.map +1 -1
  127. package/dist/operations/mutation/validation.js +16 -3
  128. package/dist/operations/planning/apply-plan.d.ts.map +1 -1
  129. package/dist/operations/planning/apply-plan.js +61 -17
  130. package/dist/operations/planning/compile-intent.d.ts +49 -0
  131. package/dist/operations/planning/compile-intent.d.ts.map +1 -1
  132. package/dist/operations/planning/compile-intent.js +66 -4
  133. package/dist/operations/proof/baseline-diff.d.ts +41 -0
  134. package/dist/operations/proof/baseline-diff.d.ts.map +1 -0
  135. package/dist/operations/proof/baseline-diff.js +153 -0
  136. package/dist/operations/proof/code-scope.d.ts +17 -0
  137. package/dist/operations/proof/code-scope.d.ts.map +1 -0
  138. package/dist/operations/proof/code-scope.js +60 -0
  139. package/dist/operations/proof/explain.d.ts +75 -0
  140. package/dist/operations/proof/explain.d.ts.map +1 -0
  141. package/dist/operations/proof/explain.js +294 -0
  142. package/dist/operations/proof/impact.d.ts +45 -0
  143. package/dist/operations/proof/impact.d.ts.map +1 -0
  144. package/dist/operations/proof/impact.js +118 -0
  145. package/dist/operations/proof/ingest-proof.d.ts +4 -2
  146. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  147. package/dist/operations/proof/ingest-proof.js +251 -77
  148. package/dist/operations/proof/migrate-legacy-receipts.d.ts.map +1 -1
  149. package/dist/operations/proof/migrate-legacy-receipts.js +28 -22
  150. package/dist/operations/proof/prune-receipts.d.ts.map +1 -1
  151. package/dist/operations/proof/prune-receipts.js +8 -6
  152. package/dist/operations/proof/receipt-document.js +2 -2
  153. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
  154. package/dist/operations/semantic-advisor/analysis-receipt.js +3 -9
  155. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  156. package/dist/operations/semantic-advisor/analyze-prose.js +18 -67
  157. package/dist/operations/semantic-advisor/plugin-orchestration.d.ts +63 -0
  158. package/dist/operations/semantic-advisor/plugin-orchestration.d.ts.map +1 -0
  159. package/dist/operations/semantic-advisor/plugin-orchestration.js +489 -0
  160. package/dist/operations/semantic-advisor/predicate-rules-core.d.ts +15 -2
  161. package/dist/operations/semantic-advisor/predicate-rules-core.d.ts.map +1 -1
  162. package/dist/operations/semantic-advisor/predicate-rules-core.js +7 -140
  163. package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts +11 -12
  164. package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts.map +1 -1
  165. package/dist/operations/semantic-advisor/predicate-rules-launcher.js +6 -94
  166. package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts +16 -0
  167. package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts.map +1 -1
  168. package/dist/operations/semantic-advisor/predicate-rules-policy.js +7 -150
  169. package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts +9 -0
  170. package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts.map +1 -1
  171. package/dist/operations/semantic-advisor/predicate-rules-product-tail.js +7 -102
  172. package/dist/operations/semantic-advisor/predicate-rules-product.d.ts +13 -0
  173. package/dist/operations/semantic-advisor/predicate-rules-product.d.ts.map +1 -1
  174. package/dist/operations/semantic-advisor/predicate-rules-product.js +7 -133
  175. package/dist/operations/semantic-advisor/types.d.ts +1 -0
  176. package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
  177. package/dist/plugins/compose-ontology-packs.d.ts +51 -0
  178. package/dist/plugins/compose-ontology-packs.d.ts.map +1 -0
  179. package/dist/plugins/compose-ontology-packs.js +257 -0
  180. package/dist/plugins/compose-semantic-classifier.d.ts +47 -0
  181. package/dist/plugins/compose-semantic-classifier.d.ts.map +1 -0
  182. package/dist/plugins/compose-semantic-classifier.js +216 -0
  183. package/dist/plugins/compose-vocabulary-alignment.d.ts +23 -0
  184. package/dist/plugins/compose-vocabulary-alignment.d.ts.map +1 -0
  185. package/dist/plugins/compose-vocabulary-alignment.js +141 -0
  186. package/dist/plugins/external-allowlist.d.ts +17 -0
  187. package/dist/plugins/external-allowlist.d.ts.map +1 -0
  188. package/dist/plugins/external-allowlist.js +29 -0
  189. package/dist/plugins/index.d.ts +11 -0
  190. package/dist/plugins/index.d.ts.map +1 -0
  191. package/dist/plugins/index.js +37 -0
  192. package/dist/plugins/load-plugin.d.ts +19 -0
  193. package/dist/plugins/load-plugin.d.ts.map +1 -0
  194. package/dist/plugins/load-plugin.js +59 -0
  195. package/dist/plugins/project-config.d.ts +28 -0
  196. package/dist/plugins/project-config.d.ts.map +1 -0
  197. package/dist/plugins/project-config.js +90 -0
  198. package/dist/plugins/registry.d.ts +94 -0
  199. package/dist/plugins/registry.d.ts.map +1 -0
  200. package/dist/plugins/registry.js +359 -0
  201. package/dist/plugins/resolve-package.d.ts +47 -0
  202. package/dist/plugins/resolve-package.d.ts.map +1 -0
  203. package/dist/plugins/resolve-package.js +262 -0
  204. package/dist/plugins/source-analysis-service.d.ts +44 -0
  205. package/dist/plugins/source-analysis-service.d.ts.map +1 -0
  206. package/dist/plugins/source-analysis-service.js +232 -0
  207. package/dist/prolog/codec.d.ts.map +1 -1
  208. package/dist/prolog/codec.js +2 -0
  209. package/dist/prolog/janitor.d.ts.map +1 -1
  210. package/dist/prolog/janitor.js +1 -1
  211. package/dist/prolog/store-lock.d.ts +1 -1
  212. package/dist/prolog/store-lock.d.ts.map +1 -1
  213. package/dist/prolog.d.ts +36 -0
  214. package/dist/prolog.d.ts.map +1 -1
  215. package/dist/prolog.js +78 -9
  216. package/dist/proof/inspect.js +1 -1
  217. package/dist/proof/producers/playwright-case-id.js +2 -2
  218. package/dist/proof/producers/playwright-reporter.js +4 -4
  219. package/dist/public/diagnostic-usage.d.ts.map +1 -1
  220. package/dist/public/diagnostic-usage.js +7 -25
  221. package/dist/public/extractors/symbols-coordinator.d.ts +1 -1
  222. package/dist/public/extractors/symbols-coordinator.d.ts.map +1 -1
  223. package/dist/public/extractors/symbols-coordinator.js +1 -1
  224. package/dist/public/impact/analyzer.d.ts +1 -1
  225. package/dist/public/impact/analyzer.d.ts.map +1 -1
  226. package/dist/public/impact/analyzer.js +6 -4
  227. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  228. package/dist/public/impact/full-kb-quality.js +4 -12
  229. package/dist/public/operations/catalog.d.ts +39 -7
  230. package/dist/public/operations/catalog.d.ts.map +1 -1
  231. package/dist/public/operations/check-executor.d.ts.map +1 -1
  232. package/dist/public/operations/check-executor.js +11 -3
  233. package/dist/public/operations/check-helpers.d.ts +7 -1
  234. package/dist/public/operations/check-helpers.d.ts.map +1 -1
  235. package/dist/public/operations/check-helpers.js +22 -2
  236. package/dist/public/operations/contracts.d.ts.map +1 -1
  237. package/dist/public/operations/contracts.js +51 -12
  238. package/dist/public/operations/discovery-entities.d.ts +53 -1
  239. package/dist/public/operations/discovery-entities.d.ts.map +1 -1
  240. package/dist/public/operations/discovery-entities.js +219 -12
  241. package/dist/public/operations/discovery-executors.d.ts +1 -0
  242. package/dist/public/operations/discovery-executors.d.ts.map +1 -1
  243. package/dist/public/operations/discovery-executors.js +93 -59
  244. package/dist/public/operations/migration-plan.d.ts +2 -0
  245. package/dist/public/operations/migration-plan.d.ts.map +1 -1
  246. package/dist/public/operations/migration-plan.js +50 -0
  247. package/dist/public/operations/predicate-schema-conformance.d.ts +41 -0
  248. package/dist/public/operations/predicate-schema-conformance.d.ts.map +1 -0
  249. package/dist/public/operations/predicate-schema-conformance.js +242 -0
  250. package/dist/public/operations/prolog-json.d.ts +1 -1
  251. package/dist/public/operations/prolog-json.d.ts.map +1 -1
  252. package/dist/public/operations/prolog-json.js +16 -10
  253. package/dist/public/operations/result-envelope.d.ts +34 -1
  254. package/dist/public/operations/result-envelope.d.ts.map +1 -1
  255. package/dist/public/operations/result-envelope.js +78 -2
  256. package/dist/public/operations/runtime-types.d.ts +17 -2
  257. package/dist/public/operations/runtime-types.d.ts.map +1 -1
  258. package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
  259. package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
  260. package/dist/public/operations/specs/check-rules.generated.js +9 -1
  261. package/dist/public/operations/specs/check.d.ts +1 -1
  262. package/dist/public/operations/specs/discovery.d.ts +10 -1
  263. package/dist/public/operations/specs/discovery.d.ts.map +1 -1
  264. package/dist/public/operations/specs/discovery.js +10 -1
  265. package/dist/public/operations/specs/mutation-schemas.d.ts +27 -4
  266. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  267. package/dist/public/operations/specs/mutation-schemas.js +21 -3
  268. package/dist/public/operations/specs/proof.js +1 -1
  269. package/dist/public/operations/specs/reporting.d.ts +9 -0
  270. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  271. package/dist/public/operations/specs/reporting.js +48 -17
  272. package/dist/public/operations/specs/semantic.d.ts +1 -1
  273. package/dist/public/operations/specs/semantic.d.ts.map +1 -1
  274. package/dist/public/operations/specs/semantic.js +54 -4
  275. package/dist/public/operations/specs/upsert.d.ts +28 -5
  276. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  277. package/dist/public/operations/specs/upsert.js +1 -1
  278. package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
  279. package/dist/public/operations/symbol-repair-plan.js +11 -4
  280. package/dist/public/operations/types.d.ts +5 -0
  281. package/dist/public/operations/types.d.ts.map +1 -1
  282. package/dist/public/proof-protocol.js +4 -4
  283. package/dist/public/schemas/entity.d.ts.map +1 -1
  284. package/dist/public/schemas/entity.js +22 -0
  285. package/dist/public/schemas/relationship.d.ts.map +1 -1
  286. package/dist/public/schemas/relationship.js +1 -0
  287. package/dist/public/skills/kibi-usage/SKILL.md +10 -3
  288. package/dist/public/skills/kibi-usage/resources/fact-lanes.md +4 -0
  289. package/dist/public/skills/kibi-usage/resources/proof.md +45 -0
  290. package/dist/public/skills/kibi-usage/resources/relationship-directions.md +35 -17
  291. package/dist/public/skills/kibi-usage/resources/source-authoring.md +36 -0
  292. package/dist/public/skills/kibi-usage/resources/workflows.md +52 -1
  293. package/dist/public/symbol-granularity.d.ts +1 -1
  294. package/dist/public/symbol-granularity.d.ts.map +1 -1
  295. package/dist/public/symbol-granularity.generated.d.ts.map +1 -1
  296. package/dist/public/symbol-granularity.generated.js +38 -5
  297. package/dist/public/telemetry-acceptance.d.ts.map +1 -1
  298. package/dist/public/telemetry-acceptance.js +21 -5
  299. package/dist/relationships/shards.d.ts +6 -0
  300. package/dist/relationships/shards.d.ts.map +1 -1
  301. package/dist/relationships/shards.js +26 -19
  302. package/dist/report/html-report.css +1239 -281
  303. package/dist/runtime/cli-runtime.d.ts.map +1 -1
  304. package/dist/runtime/cli-runtime.js +18 -0
  305. package/dist/schemas/entity.schema.json +32 -0
  306. package/dist/traceability/staged-diagnostics.d.ts +1 -1
  307. package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
  308. package/dist/traceability/staged-entity-id-style.d.ts +12 -0
  309. package/dist/traceability/staged-entity-id-style.d.ts.map +1 -0
  310. package/dist/traceability/staged-entity-id-style.js +68 -0
  311. package/dist/traceability/symbol-extract.d.ts +24 -7
  312. package/dist/traceability/symbol-extract.d.ts.map +1 -1
  313. package/dist/traceability/symbol-extract.js +64 -208
  314. package/dist/traceability/temp-kb.d.ts.map +1 -1
  315. package/dist/traceability/temp-kb.js +8 -0
  316. package/dist/traceability/validate.js +1 -1
  317. package/dist/types/entities.d.ts +2 -0
  318. package/dist/types/entities.d.ts.map +1 -1
  319. package/dist/types/relationships.d.ts +1 -1
  320. package/dist/types/relationships.d.ts.map +1 -1
  321. package/dist/utils/entity-id-style.d.ts +27 -0
  322. package/dist/utils/entity-id-style.d.ts.map +1 -0
  323. package/dist/utils/entity-id-style.js +81 -0
  324. package/dist/utils/git-repository-context.d.ts +50 -0
  325. package/dist/utils/git-repository-context.d.ts.map +1 -0
  326. package/dist/utils/git-repository-context.js +259 -0
  327. package/dist/utils/rule-registry.d.ts +5 -0
  328. package/dist/utils/rule-registry.d.ts.map +1 -1
  329. package/dist/utils/rule-registry.generated.d.ts +42 -0
  330. package/dist/utils/rule-registry.generated.d.ts.map +1 -1
  331. package/dist/utils/rule-registry.generated.js +50 -0
  332. package/dist/utils/strict-modeling.d.ts +7 -0
  333. package/dist/utils/strict-modeling.d.ts.map +1 -1
  334. package/dist/utils/strict-modeling.js +11 -0
  335. package/package.json +14 -11
  336. package/schema/entities.pl +60 -1
  337. package/schema/relationships.pl +17 -4
  338. package/schema/validation.pl +118 -20
  339. package/src/public/diagnostic-usage.ts +16 -24
  340. package/src/public/extractors/symbols-coordinator.ts +1 -0
  341. package/src/public/impact/analyzer.ts +15 -12
  342. package/src/public/impact/full-kb-quality.ts +4 -16
  343. package/src/public/operations/check-executor.ts +13 -2
  344. package/src/public/operations/check-helpers.ts +29 -3
  345. package/src/public/operations/contracts.ts +59 -12
  346. package/src/public/operations/discovery-entities.ts +327 -12
  347. package/src/public/operations/discovery-executors.ts +110 -61
  348. package/src/public/operations/migration-plan.ts +57 -0
  349. package/src/public/operations/predicate-schema-conformance.ts +362 -0
  350. package/src/public/operations/prolog-json.ts +22 -8
  351. package/src/public/operations/result-envelope.ts +114 -2
  352. package/src/public/operations/runtime-types.ts +22 -3
  353. package/src/public/operations/specs/check-rules.generated.ts +9 -1
  354. package/src/public/operations/specs/discovery.ts +11 -1
  355. package/src/public/operations/specs/mutation-schemas.ts +23 -3
  356. package/src/public/operations/specs/proof.ts +1 -1
  357. package/src/public/operations/specs/reporting.ts +71 -24
  358. package/src/public/operations/specs/semantic.ts +79 -17
  359. package/src/public/operations/specs/upsert.ts +1 -1
  360. package/src/public/operations/symbol-repair-plan.ts +16 -7
  361. package/src/public/operations/types.ts +5 -0
  362. package/src/public/proof-fingerprint.ts +1 -1
  363. package/src/public/proof-protocol-types.d.ts +1 -1
  364. package/src/public/proof-protocol.ts +4 -4
  365. package/src/public/schemas/entity.ts +22 -0
  366. package/src/public/schemas/relationship.ts +1 -0
  367. package/src/public/skills/kibi-usage/SKILL.md +10 -3
  368. package/src/public/skills/kibi-usage/resources/fact-lanes.md +4 -0
  369. package/src/public/skills/kibi-usage/resources/proof.md +45 -0
  370. package/src/public/skills/kibi-usage/resources/relationship-directions.md +35 -17
  371. package/src/public/skills/kibi-usage/resources/source-authoring.md +36 -0
  372. package/src/public/skills/kibi-usage/resources/workflows.md +52 -1
  373. package/src/public/symbol-granularity.generated.ts +45 -12
  374. package/src/public/symbol-granularity.ts +3 -3
  375. package/src/public/telemetry-acceptance.ts +37 -6
  376. package/src/schemas/entity.schema.json +32 -0
  377. package/src/schemas/relationship.schema.json +1 -0
@@ -2,7 +2,7 @@ import { mkdir, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { PROOF_RUN_VERSION, } from "../../public/proof-protocol.js";
4
4
  import { normalizePlaywrightSourceFile, playwrightCaseId, } from "./playwright-case-id.js";
5
- // implements REQ-kibi-proof-evidence-protocol
5
+ // implements REQ-kibi-verification-evidence-contract
6
6
  export { PROOF_RUN_VERSION };
7
7
  function outputPath(options) {
8
8
  const configured = options.outputPath ?? process.env.KIBI_PROOF_OUTPUT;
@@ -53,11 +53,11 @@ export class KibiPlaywrightProducer {
53
53
  this.options = options;
54
54
  this.startedAt = (options.now ?? (() => new Date()))().toISOString();
55
55
  }
56
- // implements REQ-kibi-proof-evidence-protocol
56
+ // implements REQ-kibi-verification-evidence-contract
57
57
  onBegin() {
58
58
  this.startedAt = (this.options.now ?? (() => new Date()))().toISOString();
59
59
  }
60
- // implements REQ-kibi-proof-evidence-protocol
60
+ // implements REQ-kibi-verification-evidence-contract
61
61
  onTestEnd(test, result) {
62
62
  const resultValue = result;
63
63
  const titles = titlePath(test);
@@ -101,7 +101,7 @@ export class KibiPlaywrightProducer {
101
101
  attempts: { status: "complete", entries: [attempt] },
102
102
  });
103
103
  }
104
- // implements REQ-kibi-proof-evidence-protocol
104
+ // implements REQ-kibi-verification-evidence-contract
105
105
  async onEnd(result) {
106
106
  const now = this.options.now ?? (() => new Date());
107
107
  const status = result?.status;
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostic-usage.d.ts","sourceRoot":"","sources":["../../src/public/diagnostic-usage.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAC7D,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,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;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAuBD,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACtC,MAAM,CAIR;AAkHD,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACvC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,EACnD,MAAM,EAAE,OAAO,GACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAwEzB;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAgC1E"}
@@ -1,21 +1,10 @@
1
1
  import { createHash, randomUUID } from "node:crypto";
2
2
  import { appendFileSync, mkdirSync } from "node:fs";
3
3
  import path from "node:path";
4
+ import { appendPayloadCountField, normalizeResultPayload, } from "./operations/result-envelope.js";
4
5
  function isRecord(value) {
5
6
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
6
7
  }
7
- function resultRecord(result) {
8
- if (!isRecord(result))
9
- return undefined;
10
- if (isRecord(result.structuredContent))
11
- return result.structuredContent;
12
- // CLI JSON operations return the same versioned KibiResult envelope as MCP
13
- // structuredContent. Unwrap its data before deriving operation-specific
14
- // telemetry fields (coverage/proof fields in particular).
15
- if (result.kibiProtocol === 1 && isRecord(result.data))
16
- return result.data;
17
- return result;
18
- }
19
8
  function stringArray(value) {
20
9
  return Array.isArray(value)
21
10
  ? value.filter((item) => typeof item === "string")
@@ -141,10 +130,7 @@ export function deriveDiagnosticUsageFields(tool, args, telemetry, result) {
141
130
  fields.actor_id = telemetry.actor_id;
142
131
  }
143
132
  }
144
- const structured = resultRecord(result);
145
- const envelope = isRecord(structured) && structured.kibiProtocol === 1
146
- ? structured
147
- : undefined;
133
+ const { envelope, data: structured } = normalizeResultPayload(result);
148
134
  if (envelope) {
149
135
  fields.protocol_version = envelope.kibiProtocol;
150
136
  fields.result_version =
@@ -162,18 +148,14 @@ export function deriveDiagnosticUsageFields(tool, args, telemetry, result) {
162
148
  fields.unsafe_original_retry = telemetry?.unsafe_original_retry === true;
163
149
  }
164
150
  if (tool === "kb_query" || tool === "kb_search") {
165
- const resultCount = Number(structured?.count ?? 0);
166
- fields.result_count = resultCount;
167
- fields.zero_results = resultCount === 0;
168
- fields.result_summary =
169
- resultCount === 0 ? "0 results" : `${resultCount} results`;
151
+ appendPayloadCountField(fields, "result_count", "results", structured);
152
+ if (typeof fields.result_count === "number") {
153
+ fields.zero_results = fields.result_count === 0;
154
+ }
170
155
  }
171
156
  if (tool === "kb_check") {
172
- const count = Number(structured?.count ?? 0);
173
- fields.violation_count = count;
157
+ appendPayloadCountField(fields, "violation_count", "violations", structured);
174
158
  fields.requested_rules = Array.isArray(args.rules) ? args.rules : [];
175
- fields.result_summary =
176
- count === 0 ? "0 violations" : `${count} violations`;
177
159
  }
178
160
  if (tool === "kb_coverage" && structured) {
179
161
  appendCoverageFields(fields, args, structured);
@@ -1,2 +1,2 @@
1
- export { analyzeSourceText, enrichSymbolCoordinates, type ManifestSymbolEntry, type AnalyzeSourceTextOptions, type SourceAnalysisProvider, type SourceAnalysisResult, type SourceModuleAnalysis, type SourceSymbolAnalysis, type SourceSymbolKind, } from "../../extractors/symbols-coordinator.js";
1
+ export { analyzeSourceText, analyzeSourceTextWithRegistry, enrichSymbolCoordinates, type ManifestSymbolEntry, type AnalyzeSourceTextOptions, type SourceAnalysisProvider, type SourceAnalysisResult, type SourceModuleAnalysis, type SourceSymbolAnalysis, type SourceSymbolKind, } from "../../extractors/symbols-coordinator.js";
2
2
  //# sourceMappingURL=symbols-coordinator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"symbols-coordinator.d.ts","sourceRoot":"","sources":["../../../src/public/extractors/symbols-coordinator.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,yCAAyC,CAAC"}
1
+ {"version":3,"file":"symbols-coordinator.d.ts","sourceRoot":"","sources":["../../../src/public/extractors/symbols-coordinator.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,iBAAiB,EACjB,6BAA6B,EAC7B,uBAAuB,EACvB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,yCAAyC,CAAC"}
@@ -15,4 +15,4 @@
15
15
  You should have received a copy of the GNU Affero General Public License
16
16
  along with this program. If not, see <https://www.gnu.org/licenses/>.
17
17
  */
18
- export { analyzeSourceText, enrichSymbolCoordinates, } from "../../extractors/symbols-coordinator.js";
18
+ export { analyzeSourceText, analyzeSourceTextWithRegistry, enrichSymbolCoordinates, } from "../../extractors/symbols-coordinator.js";
@@ -1,3 +1,3 @@
1
1
  import type { ChangedFileImpactOptions, ChangedFileImpactResult } from "./types.js";
2
- export declare function analyzeChangedFileImpact(options: ChangedFileImpactOptions): ChangedFileImpactResult;
2
+ export declare function analyzeChangedFileImpact(options: ChangedFileImpactOptions): Promise<ChangedFileImpactResult>;
3
3
  //# sourceMappingURL=analyzer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../src/public/impact/analyzer.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,wBAAwB,GAChC,uBAAuB,CAgEzB"}
1
+ {"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../src/public/impact/analyzer.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAEpB,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,uBAAuB,CAAC,CAmElC"}
@@ -1,11 +1,11 @@
1
1
  import * as path from "node:path";
2
- import { extractSymbolsFromStagedFile } from "../../traceability/symbol-extract.js";
2
+ import { extractSymbolsFromStagedFileAsync } from "../../traceability/symbol-extract.js";
3
3
  import { createSemanticReviewDiagnostics, createSymbolGranularityDiagnostics, } from "./diagnostics.js";
4
4
  import { createImpactManifestLookup, readImpactManifestResults, } from "./manifest.js";
5
5
  import { collectSourceChanges, uniqueSorted } from "./source-changes.js";
6
6
  import { buildNextActions, collectLinkedEntities, formatExtractedSymbols, } from "./summaries.js";
7
7
  import { createSymbolQualityDiagnostics } from "./symbol-quality.js";
8
- export function analyzeChangedFileImpact(options) {
8
+ export async function analyzeChangedFileImpact(options) {
9
9
  const workspaceRoot = path.resolve(options.workspaceRoot);
10
10
  const sourceChanges = collectSourceChanges({ ...options, workspaceRoot });
11
11
  const sourceFiles = uniqueSorted(sourceChanges.map((change) => change.file));
@@ -15,12 +15,14 @@ export function analyzeChangedFileImpact(options) {
15
15
  const sourceContentByFile = new Map();
16
16
  for (const change of sourceChanges) {
17
17
  sourceContentByFile.set(change.file, change.content);
18
- symbolsByFile.set(change.file, extractSymbolsFromStagedFile({
18
+ // Maintenance path: builtin-only (do not pass registry / workspaceRoot).
19
+ const extracted = await extractSymbolsFromStagedFileAsync({
19
20
  path: change.file,
20
21
  status: change.status,
21
22
  hunkRanges: [...change.hunkRanges],
22
23
  content: change.content,
23
- }, manifestLookup).filter((symbol) => symbol.hunkRanges.length > 0));
24
+ }, manifestLookup, {});
25
+ symbolsByFile.set(change.file, extracted.filter((symbol) => symbol.hunkRanges.length > 0));
24
26
  }
25
27
  const activeSourceFiles = new Set(sourceFiles);
26
28
  const activeManifestResults = manifestResults.filter((result) => result.sourceFile !== undefined &&
@@ -1 +1 @@
1
- {"version":3,"file":"full-kb-quality.d.ts","sourceRoot":"","sources":["../../../src/public/impact/full-kb-quality.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAatC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAWjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AASpD,KAAK,+BAA+B,GAAG;IACrC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,eAAe,CAAC,CAAC;IAC7D,QAAQ,CAAC,sBAAsB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAmgBF,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,eAAe,CAAC,GAClD,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA0D7B;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,OAAO,GAClB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAM/C;AA2ID,wBAAsB,+BAA+B,CACnD,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAkCvC"}
1
+ {"version":3,"file":"full-kb-quality.d.ts","sourceRoot":"","sources":["../../../src/public/impact/full-kb-quality.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAatC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAWjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AASpD,KAAK,+BAA+B,GAAG;IACrC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,eAAe,CAAC,CAAC;IAC7D,QAAQ,CAAC,sBAAsB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAmgBF,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,eAAe,CAAC,GAClD,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA8C7B;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,OAAO,GAClB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAM/C;AA2ID,wBAAsB,+BAA+B,CACnD,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAkCvC"}
@@ -404,18 +404,10 @@ export async function loadKbExtractionResults(prolog) {
404
404
  entities = await loadIndexedEntityProjection(prolog.queryEntities.bind(prolog));
405
405
  }
406
406
  else {
407
- const entityResult = await prolog.query("findall([Id,Type,Props], kb_entity(Id, Type, Props), Results)");
408
- if (entityResult.success) {
409
- entities = entityResult.bindings.Results
410
- ? parseListOfLists(entityResult.bindings.Results).map(parseEntityFromList)
411
- : [];
412
- }
413
- else if (isOutputCapacityError(entityResult.error)) {
414
- entities = await loadBoundedEntityProjection(prolog);
415
- }
416
- else {
417
- throw new Error(`Full KB entity projection query failed: ${entityResult.error ?? "Unknown error"}`);
418
- }
407
+ // Never probe with an unbounded all-entities findall: receipt histories
408
+ // make that answer grow without limit, and an overflow terminates the
409
+ // interactive Prolog process that serves every later query.
410
+ entities = await loadBoundedEntityProjection(prolog);
419
411
  }
420
412
  const relationships = new Map();
421
413
  for (const relationshipType of RELATIONSHIP_TYPES) {
@@ -72,7 +72,7 @@ export declare const OPERATION_CATALOG: readonly [{
72
72
  };
73
73
  readonly id: {
74
74
  readonly type: "string";
75
- readonly description: "Optional exact entity ID. Example: 'REQ-001'. If omitted, returns matching entities by other filters.";
75
+ readonly description: "Optional exact entity ID. Example: 'REQ-cli-gc'. If omitted, returns matching entities by other filters.";
76
76
  };
77
77
  readonly tags: {
78
78
  readonly type: "array";
@@ -99,6 +99,7 @@ export declare const OPERATION_CATALOG: readonly [{
99
99
  };
100
100
  readonly requiresProlog: true;
101
101
  readonly effects: readonly ["kb-read"];
102
+ readonly agentVisibleStructuredData: true;
102
103
  readonly execute: typeof import("./discovery-executors.js").executeQuery;
103
104
  }, {
104
105
  readonly name: "kb_search";
@@ -215,10 +216,17 @@ export declare const OPERATION_CATALOG: readonly [{
215
216
  readonly default: 0.18;
216
217
  readonly description: "Intent-v1 acceptance threshold between 0 and 1. Low-confidence queries abstain instead of returning misleading matches.";
217
218
  };
219
+ readonly fields: {
220
+ readonly type: "string";
221
+ readonly enum: readonly ["summary", "full"];
222
+ readonly default: "summary";
223
+ readonly description: "Optional result detail. 'summary' returns identifying metadata plus the match snippet for discovery. Use 'full' to include complete entity bodies, or follow up with kb_query for the exact entities you need.";
224
+ };
218
225
  };
219
226
  };
220
227
  readonly requiresProlog: true;
221
228
  readonly effects: readonly ["kb-read"];
229
+ readonly agentVisibleStructuredData: true;
222
230
  readonly execute: typeof import("./discovery-executors.js").executeSearch;
223
231
  }, {
224
232
  readonly name: "kb_status";
@@ -230,6 +238,7 @@ export declare const OPERATION_CATALOG: readonly [{
230
238
  };
231
239
  readonly requiresProlog: false;
232
240
  readonly effects: readonly ["kb-read", "workspace-read"];
241
+ readonly agentVisibleStructuredData: true;
233
242
  readonly execute: typeof import("./discovery-executors.js").executeStatus;
234
243
  }, {
235
244
  readonly name: "kb_find_gaps";
@@ -756,7 +765,7 @@ export declare const OPERATION_CATALOG: readonly [{
756
765
  };
757
766
  readonly id: {
758
767
  readonly type: "string";
759
- readonly description: "Unique entity ID (string). Example: 'REQ-123'. Existing ID updates the entity; new ID creates it.";
768
+ 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.";
760
769
  };
761
770
  readonly properties: {
762
771
  readonly type: "object";
@@ -772,7 +781,7 @@ export declare const OPERATION_CATALOG: readonly [{
772
781
  };
773
782
  readonly source: {
774
783
  readonly type: "string";
775
- readonly description: "Optional provenance string. Example: 'docs/requirements/REQ-123.md'. Defaults to 'mcp://kibi/upsert'.";
784
+ readonly description: "Optional provenance string. Example: '.kb/requirements/REQ-cli-gc.md'. Defaults to 'mcp://kibi/upsert'.";
776
785
  };
777
786
  readonly tags: {
778
787
  readonly type: "array";
@@ -798,7 +807,7 @@ export declare const OPERATION_CATALOG: readonly [{
798
807
  readonly items: {
799
808
  readonly type: "string";
800
809
  };
801
- readonly description: "Optional references. Example: ['REQ-010','https://example.com/spec'].";
810
+ readonly description: "Optional references. Example: ['REQ-cli-gc','https://example.com/spec'].";
802
811
  };
803
812
  readonly text_ref: {
804
813
  readonly type: "string";
@@ -1273,6 +1282,29 @@ export declare const OPERATION_CATALOG: readonly [{
1273
1282
  };
1274
1283
  readonly description: "Optional ordered argument explanations.";
1275
1284
  };
1285
+ readonly argument_constants: {
1286
+ readonly type: "object";
1287
+ readonly additionalProperties: {
1288
+ readonly type: "array";
1289
+ readonly items: {
1290
+ readonly type: "string";
1291
+ readonly minLength: 1;
1292
+ };
1293
+ readonly minItems: 1;
1294
+ };
1295
+ 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.";
1296
+ };
1297
+ readonly argument_aliases: {
1298
+ readonly type: "object";
1299
+ readonly additionalProperties: {
1300
+ readonly type: "object";
1301
+ readonly additionalProperties: {
1302
+ readonly type: "string";
1303
+ readonly minLength: 1;
1304
+ };
1305
+ };
1306
+ 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.";
1307
+ };
1276
1308
  readonly aliases: {
1277
1309
  readonly type: "array";
1278
1310
  readonly items: {
@@ -1342,7 +1374,7 @@ export declare const OPERATION_CATALOG: readonly [{
1342
1374
  readonly properties: {
1343
1375
  readonly type: {
1344
1376
  readonly type: "string";
1345
- 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"];
1377
+ 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"];
1346
1378
  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).";
1347
1379
  };
1348
1380
  readonly from: {
@@ -1351,7 +1383,7 @@ export declare const OPERATION_CATALOG: readonly [{
1351
1383
  };
1352
1384
  readonly to: {
1353
1385
  readonly type: "string";
1354
- readonly description: "Target entity ID (must exist). Example: 'REQ-001'.";
1386
+ readonly description: "Target entity ID (must exist). Example: 'REQ-cli-gc'.";
1355
1387
  };
1356
1388
  };
1357
1389
  };
@@ -1448,7 +1480,7 @@ export declare const OPERATION_CATALOG: readonly [{
1448
1480
  readonly type: "string";
1449
1481
  readonly enum: readonly string[];
1450
1482
  };
1451
- readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, no-cycles, required-fields, deprecated-adr-no-successor, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness. If omitted, server runs canonical and advisory rules plus the full-KB qualityDiagnostics audit scan, including usage telemetry acceptance when evidence exists; migration rules run only when explicitly selected. Advisory and migration findings are non-blocking qualityDiagnostics. If supplied, server preserves scoped validation and skips the full-KB advisory scan.";
1483
+ readonly description: "Optional rule subset. Allowed: must-priority-coverage, symbol-coverage, symbol-traceability, no-dangling-refs, source-relationship-parity, no-cycles, required-fields, deprecated-adr-no-successor, domain-contradictions, logic-coverage, rule-safety, rule-verifiability, query-plan-safety, req-status-vocabulary, strict-fact-shape, strict-req-fact-pairing, predicate-verifiability, strict-readiness, semantic-completeness, proof-contract-symbols, entity-id-style, domain-redundancy, domain-implication, subject-key-identity, subject-key-shape, ontology-quality, predicate-schema-conformance. If omitted, server runs canonical and advisory rules plus the full-KB qualityDiagnostics audit scan, including usage telemetry acceptance when evidence exists; migration rules run only when explicitly selected. Advisory and migration findings are non-blocking qualityDiagnostics. If supplied, server preserves scoped validation and skips the full-KB advisory scan.";
1452
1484
  };
1453
1485
  readonly sourceFiles: {
1454
1486
  readonly type: "array";
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/public/operations/catalog.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB;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AAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAC1C,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAC5C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,sBAAsB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,GAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,6CAA6C,CAAC,EAAE,OAAO,CAAC;CAClE,CAAC;AAqDF,wBAAsB,YAAY,CAChC,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,gBAAgB,EACzB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CA4JxC"}
@@ -1,9 +1,10 @@
1
1
  import { runAggregatedChecks } from "../../commands/aggregated-checks.js";
2
2
  import { collectFullKbQualityDiagnostics } from "../impact-diagnostics.js";
3
3
  import { buildStructuredContent, buildSummary, } from "./check-format-shared.js";
4
- import { analyzeKbCheckImpact, collectQueryPlanSafetyViolations, getEffectiveRules, partitionCheckFindings, qualityDiagnosticsFromImpact, resolveCheckRules, } from "./check-helpers.js";
4
+ import { analyzeKbCheckImpact, collectQueryPlanSafetyViolations, getEffectiveRules, partitionCheckFindings, qualityDiagnosticsFromImpact, resolveCheckRules, stagedEntityIdStyleDiagnostics, } from "./check-helpers.js";
5
5
  import { executeStatus } from "./discovery-executors.js";
6
6
  import { buildActionsFromCheck, buildMigrationPlan, mergeMigrationPlans, } from "./migration-plan.js";
7
+ import { collectPredicateSchemaConformanceViolations } from "./predicate-schema-conformance.js";
7
8
  import { collectSourceRelationshipParityViolations } from "./source-relationship-parity.js";
8
9
  import { readWorkspaceSnapshot } from "./workspace-snapshot.js";
9
10
  export { buildStructuredContent, buildSummary, getEffectiveRules, resolveCheckRules, };
@@ -60,8 +61,11 @@ export async function executeCheck(args, context, options = {}) {
60
61
  // version. `args.rules` is an invocation-time diagnostic selector only.
61
62
  const rulesAllowlist = resolveCheckRules(args);
62
63
  const hasExplicitRules = args.rules !== undefined;
63
- const impactResult = analyzeKbCheckImpact(workspaceRoot, args);
64
- const impactQualityDiagnostics = qualityDiagnosticsFromImpact(impactResult);
64
+ const impactResult = await analyzeKbCheckImpact(workspaceRoot, args);
65
+ const impactQualityDiagnostics = [
66
+ ...qualityDiagnosticsFromImpact(impactResult),
67
+ ...stagedEntityIdStyleDiagnostics(workspaceRoot, args),
68
+ ];
65
69
  const maxDiagnosticsOption = args.maxDiagnostics !== undefined
66
70
  ? { maxDiagnostics: args.maxDiagnostics }
67
71
  : {};
@@ -109,10 +113,14 @@ export async function executeCheck(args, context, options = {}) {
109
113
  const sourceRelationshipParityViolations = rulesAllowlist.has("source-relationship-parity")
110
114
  ? await collectSourceRelationshipParityViolations(workspaceRoot, prolog)
111
115
  : [];
116
+ const predicateConformanceFindings = rulesAllowlist.has("predicate-schema-conformance")
117
+ ? await collectPredicateSchemaConformanceViolations(prolog)
118
+ : [];
112
119
  const partitioned = partitionCheckFindings([
113
120
  ...aggregatedFindings,
114
121
  ...queryPlanViolations,
115
122
  ...sourceRelationshipParityViolations,
123
+ ...predicateConformanceFindings,
116
124
  ]);
117
125
  const violations = partitioned.violations;
118
126
  const diagnostics = violations.map((v) => ({
@@ -30,6 +30,12 @@ export declare function resolveCheckRules(args: Pick<CheckInput, "rules">): Set<
30
30
  */
31
31
  export declare function readLegacyChecksHint(workspaceRoot: string): Promise<string | null>;
32
32
  export declare function hasImpactOptions(args: CheckInput): boolean;
33
- export declare function analyzeKbCheckImpact(workspaceRoot: string, args: CheckInput): ChangedFileImpactResult | undefined;
33
+ export declare function analyzeKbCheckImpact(workspaceRoot: string, args: CheckInput): Promise<ChangedFileImpactResult | undefined>;
34
+ /**
35
+ * Advisory naming-style review for entity Markdown staged as new. Runs only
36
+ * for `staged: true`, the creation boundary where a purely numeric ID can
37
+ * still be renamed cheaply; committed legacy entities are never evaluated.
38
+ */
39
+ export declare function stagedEntityIdStyleDiagnostics(workspaceRoot: string, args: Pick<CheckInput, "staged">): readonly QualityDiagnostic[];
34
40
  export declare function qualityDiagnosticsFromImpact(impactResult: ChangedFileImpactResult | undefined): readonly QualityDiagnostic[];
35
41
  //# sourceMappingURL=check-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-helpers.d.ts","sourceRoot":"","sources":["../../../src/public/operations/check-helpers.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,UAAU,EACV,KAAK,SAAS,EACd,iBAAiB,EAGlB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC;AAEzC;;;;;;;GAOG;AAEH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,GAAG;IACtE,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACzC,CA0BA;AAQD,wBAAgB,gCAAgC,IAAI,SAAS,EAAE,CAU9D;AAED;;;;;;GAMG;AAEH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,GAC9B,GAAG,CAAC,MAAM,CAAC,CAQb;AAED;;;;GAIG;AAEH,wBAAsB,oBAAoB,CACxC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAGD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O,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAoB9C;AAED;;;;GAIG;AAEH,wBAAgB,8BAA8B,CAC5C,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,GAC/B,SAAS,iBAAiB,EAAE,CAY9B;AAGD,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,uBAAuB,GAAG,SAAS,GAChD,SAAS,iBAAiB,EAAE,CAK9B"}
@@ -1,3 +1,4 @@
1
+ import { execSync } from "node:child_process";
1
2
  import { readFileSync } from "node:fs";
2
3
  import { readFile } from "node:fs/promises";
3
4
  import path from "node:path";
@@ -20,6 +21,8 @@ import path from "node:path";
20
21
  */
21
22
  import { getKbPlPathOverride } from "../../env.js";
22
23
  import { resolveKbPlPath } from "../../prolog.js";
24
+ import { getStagedFiles } from "../../traceability/git-staged.js";
25
+ import { createStagedEntityIdStyleDiagnostics } from "../../traceability/staged-entity-id-style.js";
23
26
  import { analyzePrologQueryPlanSafety } from "../../utils/prolog-query-plan-safety.js";
24
27
  import { RULE_NAMES, getEffectiveRules, getRuleDefinition, getRuleEnforcementClass, } from "../../utils/rule-registry.js";
25
28
  import { analyzeChangedFileImpact, } from "../impact-diagnostics.js";
@@ -45,7 +48,7 @@ export function partitionCheckFindings(findings) {
45
48
  const definition = getRuleDefinition(finding.rule);
46
49
  qualityDiagnostics.push({
47
50
  id: `rule.${finding.rule}`,
48
- severity: "warning",
51
+ severity: definition?.diagnosticSeverity ?? "warning",
49
52
  blocking: false,
50
53
  category: definition?.category ?? "integrity",
51
54
  ...(finding.entityId !== undefined ? { entityId: finding.entityId } : {}),
@@ -114,7 +117,7 @@ export function hasImpactOptions(args) {
114
117
  (args.sourceFiles !== undefined && args.sourceFiles.length > 0));
115
118
  }
116
119
  // implements REQ-mcp-tool-check
117
- export function analyzeKbCheckImpact(workspaceRoot, args) {
120
+ export async function analyzeKbCheckImpact(workspaceRoot, args) {
118
121
  if (!hasImpactOptions(args)) {
119
122
  return undefined;
120
123
  }
@@ -135,6 +138,23 @@ export function analyzeKbCheckImpact(workspaceRoot, args) {
135
138
  : {}),
136
139
  });
137
140
  }
141
+ /**
142
+ * Advisory naming-style review for entity Markdown staged as new. Runs only
143
+ * for `staged: true`, the creation boundary where a purely numeric ID can
144
+ * still be renamed cheaply; committed legacy entities are never evaluated.
145
+ */
146
+ // implements REQ-kibi-entity-id-style
147
+ export function stagedEntityIdStyleDiagnostics(workspaceRoot, args) {
148
+ if (args.staged !== true)
149
+ return [];
150
+ try {
151
+ return createStagedEntityIdStyleDiagnostics(getStagedFiles((command, options) => execSync(command, { ...options, cwd: workspaceRoot })));
152
+ }
153
+ catch {
154
+ // Outside a Git work tree there is no staged creation boundary.
155
+ return [];
156
+ }
157
+ }
138
158
  // implements REQ-mcp-tool-check
139
159
  export function qualityDiagnosticsFromImpact(impactResult) {
140
160
  if (impactResult === undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/public/operations/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAqCpE;;uEAEuE;AACvE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAMrB;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,CA6O3C,CAAC;AAgDF,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,EAClD,YAAY,EAAE,MAAM,GACnB,IAAI,CAIN;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,SAAS,0BAA0B,EAAE,CAoBvC"}
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/public/operations/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,oEAAoE;AACpE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAwDpE;;uEAEuE;AACvE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAMrB;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAC3C,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAyQ3C,CAAC;AAgDF,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,EAClD,YAAY,EAAE,MAAM,GACnB,IAAI,CAIN;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,SAAS,0BAA0B,EAAE,CAoBvC"}
@@ -19,6 +19,21 @@ function objectData(properties, required = []) {
19
19
  properties,
20
20
  };
21
21
  }
22
+ /**
23
+ * kibi.job.v1 receipt returned by async-mode operations (kb_check with
24
+ * `async: true`) instead of the synchronous payload. Agents poll
25
+ * kb_job_status with the jobId. Declared as a union member of the operation
26
+ * data contract so hosts validating tool output against the declared schema
27
+ * accept the receipt without weakening the synchronous payload contract.
28
+ */
29
+ const jobReceiptData = objectData({
30
+ kibiProtocol: { const: 1 },
31
+ jobVersion: { const: "kibi.job.v1" },
32
+ jobId: { type: "string" },
33
+ tool: { type: "string" },
34
+ status: { type: "string" },
35
+ pollWith: { const: "kb_job_status" },
36
+ }, ["kibiProtocol", "jobVersion", "jobId", "tool", "status", "pollWith"]);
22
37
  const stringValue = { type: "string" };
23
38
  const integerValue = { type: "integer" };
24
39
  const numberValue = { type: "number" };
@@ -112,6 +127,7 @@ export const OPERATION_DATA_SCHEMAS = {
112
127
  kb_semantic_advisor: objectData({
113
128
  receipt: recordValue,
114
129
  warnings: stringArray,
130
+ capabilityPlugins: recordValue,
115
131
  }),
116
132
  kb_model_requirement: objectData({
117
133
  statement: stringValue,
@@ -129,6 +145,21 @@ export const OPERATION_DATA_SCHEMAS = {
129
145
  warnings: recordArray,
130
146
  migrationWarning: { type: ["string", "null"] },
131
147
  logic: recordValue,
148
+ vocabularyAlignment: objectData({
149
+ subject: recordValue,
150
+ redundancyCandidates: recordArray,
151
+ reviewPlan: recordArray,
152
+ stamps: recordArray,
153
+ fallbackUsed: booleanValue,
154
+ diagnostics: recordArray,
155
+ }, [
156
+ "subject",
157
+ "redundancyCandidates",
158
+ "reviewPlan",
159
+ "stamps",
160
+ "fallbackUsed",
161
+ "diagnostics",
162
+ ]),
132
163
  }),
133
164
  kb_suggest_predicates: objectData({
134
165
  text: stringValue,
@@ -210,22 +241,29 @@ export const OPERATION_DATA_SCHEMAS = {
210
241
  sourceWrites: recordArray,
211
242
  deletionPlan: recordValue,
212
243
  supersessionPlan: recordValue,
244
+ skippedEffects: stringArray,
213
245
  status: stringValue,
214
246
  effectFailures: recordArray,
215
247
  nextActions: recordArray,
216
248
  }),
217
- kb_check: objectData({
218
- violations: valueArray,
219
- count: integerValue,
220
- diagnostics: recordArray,
221
- qualityDiagnostics: recordArray,
222
- impactDiagnostics: recordArray,
223
- sourceFiles: stringArray,
224
- extractedSymbols: recordArray,
225
- linkedEntities: recordArray,
226
- nextActions: valueArray,
227
- migrationPlan: recordValue,
228
- }),
249
+ kb_check: {
250
+ description: "Synchronous check payload, or a kibi.job.v1 receipt when async:true detached the check into a background job (poll kb_job_status with the jobId).",
251
+ anyOf: [
252
+ objectData({
253
+ violations: valueArray,
254
+ count: integerValue,
255
+ diagnostics: recordArray,
256
+ qualityDiagnostics: recordArray,
257
+ impactDiagnostics: recordArray,
258
+ sourceFiles: stringArray,
259
+ extractedSymbols: recordArray,
260
+ linkedEntities: recordArray,
261
+ nextActions: valueArray,
262
+ migrationPlan: recordValue,
263
+ }),
264
+ jobReceiptData,
265
+ ],
266
+ },
229
267
  kb_compile_intent: objectData({
230
268
  version: stringValue,
231
269
  planHash: stringValue,
@@ -239,6 +277,7 @@ export const OPERATION_DATA_SCHEMAS = {
239
277
  steps: valueArray,
240
278
  sourceWrites: recordArray,
241
279
  diagnostics: stringArray,
280
+ capabilityPlugins: recordValue,
242
281
  }),
243
282
  kb_apply_plan: objectData({
244
283
  version: stringValue,