kibi-cli 0.14.0 → 0.17.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 (456) hide show
  1. package/bin/kibi +3 -1
  2. package/dist/cli-command.d.ts +5 -0
  3. package/dist/cli-command.d.ts.map +1 -0
  4. package/dist/cli-command.js +9 -0
  5. package/dist/cli-errors.d.ts +13 -0
  6. package/dist/cli-errors.d.ts.map +1 -0
  7. package/dist/cli-errors.js +26 -0
  8. package/dist/cli-input.d.ts +6 -0
  9. package/dist/cli-input.d.ts.map +1 -0
  10. package/dist/cli-input.js +54 -0
  11. package/dist/cli-json-command.d.ts +14 -0
  12. package/dist/cli-json-command.d.ts.map +1 -0
  13. package/dist/cli-json-command.js +96 -0
  14. package/dist/cli-protocol.d.ts +12 -0
  15. package/dist/cli-protocol.d.ts.map +1 -0
  16. package/dist/cli-protocol.js +37 -0
  17. package/dist/cli-register-foundation.d.ts +3 -0
  18. package/dist/cli-register-foundation.d.ts.map +1 -0
  19. package/dist/cli-register-foundation.js +90 -0
  20. package/dist/cli-register-maintenance.d.ts +3 -0
  21. package/dist/cli-register-maintenance.d.ts.map +1 -0
  22. package/dist/cli-register-maintenance.js +36 -0
  23. package/dist/cli-register-reporting.d.ts +3 -0
  24. package/dist/cli-register-reporting.d.ts.map +1 -0
  25. package/dist/cli-register-reporting.js +101 -0
  26. package/dist/cli-register-skills.d.ts +3 -0
  27. package/dist/cli-register-skills.d.ts.map +1 -0
  28. package/dist/cli-register-skills.js +71 -0
  29. package/dist/cli-validate.d.ts +18 -0
  30. package/dist/cli-validate.d.ts.map +1 -0
  31. package/dist/cli-validate.js +45 -0
  32. package/dist/cli.d.ts +4 -4
  33. package/dist/cli.d.ts.map +1 -1
  34. package/dist/cli.js +48 -211
  35. package/dist/commands/aggregated-checks.d.ts +1 -1
  36. package/dist/commands/aggregated-checks.d.ts.map +1 -1
  37. package/dist/commands/aggregated-checks.js +28 -34
  38. package/dist/commands/check.d.ts +1 -1
  39. package/dist/commands/check.d.ts.map +1 -1
  40. package/dist/commands/check.js +53 -95
  41. package/dist/commands/coverage.d.ts.map +1 -1
  42. package/dist/commands/coverage.js +12 -17
  43. package/dist/commands/discovery-shared.d.ts +2 -1
  44. package/dist/commands/discovery-shared.d.ts.map +1 -1
  45. package/dist/commands/discovery-shared.js +6 -18
  46. package/dist/commands/gaps.d.ts.map +1 -1
  47. package/dist/commands/gaps.js +15 -19
  48. package/dist/commands/graph.d.ts.map +1 -1
  49. package/dist/commands/graph.js +15 -21
  50. package/dist/commands/query.d.ts +7 -7
  51. package/dist/commands/query.d.ts.map +1 -1
  52. package/dist/commands/query.js +98 -204
  53. package/dist/commands/search.d.ts +4 -4
  54. package/dist/commands/search.d.ts.map +1 -1
  55. package/dist/commands/search.js +14 -27
  56. package/dist/commands/status.d.ts +1 -1
  57. package/dist/commands/status.d.ts.map +1 -1
  58. package/dist/commands/status.js +6 -7
  59. package/dist/commands/sync/manifest.d.ts +13 -2
  60. package/dist/commands/sync/manifest.d.ts.map +1 -1
  61. package/dist/commands/sync/manifest.js +31 -22
  62. package/dist/commands/sync/persistence.d.ts.map +1 -1
  63. package/dist/commands/sync/persistence.js +39 -1
  64. package/dist/extractors/markdown.d.ts +22 -2
  65. package/dist/extractors/markdown.d.ts.map +1 -1
  66. package/dist/extractors/markdown.js +50 -1
  67. package/dist/extractors/symbols-ts.d.ts.map +1 -1
  68. package/dist/extractors/symbols-ts.js +11 -1
  69. package/dist/logic/ir.d.ts +112 -0
  70. package/dist/logic/ir.d.ts.map +1 -0
  71. package/dist/logic/ir.js +729 -0
  72. package/dist/operations/autopilot/activation.d.ts +4 -0
  73. package/dist/operations/autopilot/activation.d.ts.map +1 -0
  74. package/dist/operations/autopilot/activation.js +130 -0
  75. package/dist/operations/autopilot/candidate-helpers.d.ts +13 -0
  76. package/dist/operations/autopilot/candidate-helpers.d.ts.map +1 -0
  77. package/dist/operations/autopilot/candidate-helpers.js +55 -0
  78. package/dist/operations/autopilot/candidates.d.ts +4 -0
  79. package/dist/operations/autopilot/candidates.d.ts.map +1 -0
  80. package/dist/operations/autopilot/candidates.js +114 -0
  81. package/dist/operations/autopilot/discovery-evidence.d.ts +10 -0
  82. package/dist/operations/autopilot/discovery-evidence.d.ts.map +1 -0
  83. package/dist/operations/autopilot/discovery-evidence.js +158 -0
  84. package/dist/operations/autopilot/discovery.d.ts +4 -0
  85. package/dist/operations/autopilot/discovery.d.ts.map +1 -0
  86. package/dist/operations/autopilot/discovery.js +100 -0
  87. package/dist/operations/autopilot/generate.d.ts +8 -0
  88. package/dist/operations/autopilot/generate.d.ts.map +1 -0
  89. package/dist/operations/autopilot/generate.js +112 -0
  90. package/dist/operations/autopilot/guidance-actions.d.ts +3 -0
  91. package/dist/operations/autopilot/guidance-actions.d.ts.map +1 -0
  92. package/dist/operations/autopilot/guidance-actions.js +79 -0
  93. package/dist/operations/autopilot/guidance.d.ts +14 -0
  94. package/dist/operations/autopilot/guidance.d.ts.map +1 -0
  95. package/dist/operations/autopilot/guidance.js +124 -0
  96. package/dist/operations/autopilot/markdown-candidates.d.ts +7 -0
  97. package/dist/operations/autopilot/markdown-candidates.d.ts.map +1 -0
  98. package/dist/operations/autopilot/markdown-candidates.js +134 -0
  99. package/dist/operations/autopilot/presentation.d.ts +13 -0
  100. package/dist/operations/autopilot/presentation.d.ts.map +1 -0
  101. package/dist/operations/autopilot/presentation.js +91 -0
  102. package/dist/operations/autopilot/requirement-claims.d.ts +3 -0
  103. package/dist/operations/autopilot/requirement-claims.d.ts.map +1 -0
  104. package/dist/operations/autopilot/requirement-claims.js +48 -0
  105. package/dist/operations/autopilot/types.d.ts +117 -0
  106. package/dist/operations/autopilot/types.d.ts.map +1 -0
  107. package/dist/operations/autopilot/types.js +8 -0
  108. package/dist/operations/modeling/logic-modeling.d.ts +22 -0
  109. package/dist/operations/modeling/logic-modeling.d.ts.map +1 -0
  110. package/dist/operations/modeling/logic-modeling.js +111 -0
  111. package/dist/operations/modeling/model-requirement.d.ts +10 -0
  112. package/dist/operations/modeling/model-requirement.d.ts.map +1 -0
  113. package/dist/operations/modeling/model-requirement.js +164 -0
  114. package/dist/operations/modeling/predicate-applyplan.d.ts +6 -0
  115. package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -0
  116. package/dist/operations/modeling/predicate-applyplan.js +117 -0
  117. package/dist/operations/modeling/predicate-catalog-1.d.ts +3 -0
  118. package/dist/operations/modeling/predicate-catalog-1.d.ts.map +1 -0
  119. package/dist/operations/modeling/predicate-catalog-1.js +200 -0
  120. package/dist/operations/modeling/predicate-catalog-2.d.ts +3 -0
  121. package/dist/operations/modeling/predicate-catalog-2.d.ts.map +1 -0
  122. package/dist/operations/modeling/predicate-catalog-2.js +197 -0
  123. package/dist/operations/modeling/predicate-catalog-3.d.ts +3 -0
  124. package/dist/operations/modeling/predicate-catalog-3.d.ts.map +1 -0
  125. package/dist/operations/modeling/predicate-catalog-3.js +193 -0
  126. package/dist/operations/modeling/predicate-catalog-4.d.ts +3 -0
  127. package/dist/operations/modeling/predicate-catalog-4.d.ts.map +1 -0
  128. package/dist/operations/modeling/predicate-catalog-4.js +149 -0
  129. package/dist/operations/modeling/predicate-catalog.d.ts +5 -0
  130. package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -0
  131. package/dist/operations/modeling/predicate-catalog.js +29 -0
  132. package/dist/operations/modeling/predicate-inference-1.d.ts +16 -0
  133. package/dist/operations/modeling/predicate-inference-1.d.ts.map +1 -0
  134. package/dist/operations/modeling/predicate-inference-1.js +161 -0
  135. package/dist/operations/modeling/predicate-inference-2.d.ts +19 -0
  136. package/dist/operations/modeling/predicate-inference-2.d.ts.map +1 -0
  137. package/dist/operations/modeling/predicate-inference-2.js +169 -0
  138. package/dist/operations/modeling/predicate-inference-3.d.ts +15 -0
  139. package/dist/operations/modeling/predicate-inference-3.d.ts.map +1 -0
  140. package/dist/operations/modeling/predicate-inference-3.js +163 -0
  141. package/dist/operations/modeling/predicate-inference.d.ts +5 -0
  142. package/dist/operations/modeling/predicate-inference.d.ts.map +1 -0
  143. package/dist/operations/modeling/predicate-inference.js +163 -0
  144. package/dist/operations/modeling/predicate-loader.d.ts +10 -0
  145. package/dist/operations/modeling/predicate-loader.d.ts.map +1 -0
  146. package/dist/operations/modeling/predicate-loader.js +94 -0
  147. package/dist/operations/modeling/predicate-ranker.d.ts +3 -0
  148. package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -0
  149. package/dist/operations/modeling/predicate-ranker.js +62 -0
  150. package/dist/operations/modeling/predicate-score-1.d.ts +3 -0
  151. package/dist/operations/modeling/predicate-score-1.d.ts.map +1 -0
  152. package/dist/operations/modeling/predicate-score-1.js +121 -0
  153. package/dist/operations/modeling/predicate-score-2.d.ts +3 -0
  154. package/dist/operations/modeling/predicate-score-2.d.ts.map +1 -0
  155. package/dist/operations/modeling/predicate-score-2.js +122 -0
  156. package/dist/operations/modeling/predicate-score-3.d.ts +3 -0
  157. package/dist/operations/modeling/predicate-score-3.d.ts.map +1 -0
  158. package/dist/operations/modeling/predicate-score-3.js +54 -0
  159. package/dist/operations/modeling/predicate-types.d.ts +64 -0
  160. package/dist/operations/modeling/predicate-types.d.ts.map +1 -0
  161. package/dist/operations/modeling/predicate-types.js +1 -0
  162. package/dist/operations/modeling/predicate-usage-hints-1.d.ts +3 -0
  163. package/dist/operations/modeling/predicate-usage-hints-1.d.ts.map +1 -0
  164. package/dist/operations/modeling/predicate-usage-hints-1.js +211 -0
  165. package/dist/operations/modeling/predicate-usage-hints-2.d.ts +3 -0
  166. package/dist/operations/modeling/predicate-usage-hints-2.d.ts.map +1 -0
  167. package/dist/operations/modeling/predicate-usage-hints-2.js +209 -0
  168. package/dist/operations/modeling/predicate-usage-hints-3.d.ts +3 -0
  169. package/dist/operations/modeling/predicate-usage-hints-3.d.ts.map +1 -0
  170. package/dist/operations/modeling/predicate-usage-hints-3.js +45 -0
  171. package/dist/operations/modeling/predicate-utils.d.ts +23 -0
  172. package/dist/operations/modeling/predicate-utils.d.ts.map +1 -0
  173. package/dist/operations/modeling/predicate-utils.js +187 -0
  174. package/dist/operations/modeling/requirement-applyplan.d.ts +4 -0
  175. package/dist/operations/modeling/requirement-applyplan.d.ts.map +1 -0
  176. package/dist/operations/modeling/requirement-applyplan.js +44 -0
  177. package/dist/operations/modeling/requirement-heuristics.d.ts +4 -0
  178. package/dist/operations/modeling/requirement-heuristics.d.ts.map +1 -0
  179. package/dist/operations/modeling/requirement-heuristics.js +114 -0
  180. package/dist/operations/modeling/requirement-modeler.d.ts +8 -0
  181. package/dist/operations/modeling/requirement-modeler.d.ts.map +1 -0
  182. package/dist/operations/modeling/requirement-modeler.js +70 -0
  183. package/dist/operations/modeling/requirement-types.d.ts +61 -0
  184. package/dist/operations/modeling/requirement-types.d.ts.map +1 -0
  185. package/dist/operations/modeling/requirement-types.js +1 -0
  186. package/dist/operations/modeling/requirement-utils.d.ts +10 -0
  187. package/dist/operations/modeling/requirement-utils.d.ts.map +1 -0
  188. package/dist/operations/modeling/requirement-utils.js +65 -0
  189. package/dist/operations/modeling/suggest-predicates.d.ts +6 -0
  190. package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -0
  191. package/dist/operations/modeling/suggest-predicates.js +64 -0
  192. package/dist/operations/mutation/audit.d.ts +6 -0
  193. package/dist/operations/mutation/audit.d.ts.map +1 -0
  194. package/dist/operations/mutation/audit.js +22 -0
  195. package/dist/operations/mutation/contradictions.d.ts +10 -0
  196. package/dist/operations/mutation/contradictions.d.ts.map +1 -0
  197. package/dist/operations/mutation/contradictions.js +40 -0
  198. package/dist/operations/mutation/delete.d.ts +5 -0
  199. package/dist/operations/mutation/delete.d.ts.map +1 -0
  200. package/dist/operations/mutation/delete.js +67 -0
  201. package/dist/operations/mutation/relationships.d.ts +17 -0
  202. package/dist/operations/mutation/relationships.d.ts.map +1 -0
  203. package/dist/operations/mutation/relationships.js +142 -0
  204. package/dist/operations/mutation/save.d.ts +4 -0
  205. package/dist/operations/mutation/save.d.ts.map +1 -0
  206. package/dist/operations/mutation/save.js +14 -0
  207. package/dist/operations/mutation/serialization.d.ts +5 -0
  208. package/dist/operations/mutation/serialization.d.ts.map +1 -0
  209. package/dist/operations/mutation/serialization.js +88 -0
  210. package/dist/operations/mutation/strict-fact.d.ts +4 -0
  211. package/dist/operations/mutation/strict-fact.d.ts.map +1 -0
  212. package/dist/operations/mutation/strict-fact.js +132 -0
  213. package/dist/operations/mutation/symbol-granularity.d.ts +4 -0
  214. package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -0
  215. package/dist/operations/mutation/symbol-granularity.js +109 -0
  216. package/dist/operations/mutation/symbol-refresh.d.ts +10 -0
  217. package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -0
  218. package/dist/operations/mutation/symbol-refresh.js +105 -0
  219. package/dist/operations/mutation/types.d.ts +43 -0
  220. package/dist/operations/mutation/types.d.ts.map +1 -0
  221. package/dist/operations/mutation/types.js +1 -0
  222. package/dist/operations/mutation/upsert.d.ts +5 -0
  223. package/dist/operations/mutation/upsert.d.ts.map +1 -0
  224. package/dist/operations/mutation/upsert.js +103 -0
  225. package/dist/operations/mutation/validate-upsert.d.ts +5 -0
  226. package/dist/operations/mutation/validate-upsert.d.ts.map +1 -0
  227. package/dist/operations/mutation/validate-upsert.js +50 -0
  228. package/dist/operations/mutation/validation.d.ts +5 -0
  229. package/dist/operations/mutation/validation.d.ts.map +1 -0
  230. package/dist/operations/mutation/validation.js +107 -0
  231. package/dist/operations/mutation/warnings.d.ts +4 -0
  232. package/dist/operations/mutation/warnings.d.ts.map +1 -0
  233. package/dist/operations/mutation/warnings.js +17 -0
  234. package/dist/operations/semantic-advisor/analysis-receipt.d.ts +5 -0
  235. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -0
  236. package/dist/operations/semantic-advisor/analysis-receipt.js +120 -0
  237. package/dist/operations/semantic-advisor/analyze-prose.d.ts +5 -0
  238. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -0
  239. package/dist/operations/semantic-advisor/analyze-prose.js +693 -0
  240. package/dist/operations/semantic-advisor/clauses.d.ts +10 -0
  241. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -0
  242. package/dist/operations/semantic-advisor/clauses.js +43 -0
  243. package/dist/operations/semantic-advisor/observation-plan.d.ts +3 -0
  244. package/dist/operations/semantic-advisor/observation-plan.d.ts.map +1 -0
  245. package/dist/operations/semantic-advisor/observation-plan.js +31 -0
  246. package/dist/operations/semantic-advisor/predicate-rule.d.ts +14 -0
  247. package/dist/operations/semantic-advisor/predicate-rule.d.ts.map +1 -0
  248. package/dist/operations/semantic-advisor/predicate-rule.js +22 -0
  249. package/dist/operations/semantic-advisor/predicate-rules-core.d.ts +79 -0
  250. package/dist/operations/semantic-advisor/predicate-rules-core.d.ts.map +1 -0
  251. package/dist/operations/semantic-advisor/predicate-rules-core.js +140 -0
  252. package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts +83 -0
  253. package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts.map +1 -0
  254. package/dist/operations/semantic-advisor/predicate-rules-policy.js +150 -0
  255. package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts +48 -0
  256. package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts.map +1 -0
  257. package/dist/operations/semantic-advisor/predicate-rules-product-tail.js +102 -0
  258. package/dist/operations/semantic-advisor/predicate-rules-product.d.ts +71 -0
  259. package/dist/operations/semantic-advisor/predicate-rules-product.d.ts.map +1 -0
  260. package/dist/operations/semantic-advisor/predicate-rules-product.js +133 -0
  261. package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts +29 -0
  262. package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts.map +1 -0
  263. package/dist/operations/semantic-advisor/prose-coverage-evaluator.js +54 -0
  264. package/dist/operations/semantic-advisor/shared.d.ts +19 -0
  265. package/dist/operations/semantic-advisor/shared.d.ts.map +1 -0
  266. package/dist/operations/semantic-advisor/shared.js +209 -0
  267. package/dist/operations/semantic-advisor/strict-count-rules.d.ts +4 -0
  268. package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -0
  269. package/dist/operations/semantic-advisor/strict-count-rules.js +62 -0
  270. package/dist/operations/semantic-advisor/strict-rules.d.ts +4 -0
  271. package/dist/operations/semantic-advisor/strict-rules.d.ts.map +1 -0
  272. package/dist/operations/semantic-advisor/strict-rules.js +106 -0
  273. package/dist/operations/semantic-advisor/types.d.ts +195 -0
  274. package/dist/operations/semantic-advisor/types.d.ts.map +1 -0
  275. package/dist/operations/semantic-advisor/types.js +1 -0
  276. package/dist/prolog/codec.d.ts.map +1 -1
  277. package/dist/prolog/codec.js +20 -3
  278. package/dist/prolog.d.ts +5 -0
  279. package/dist/prolog.d.ts.map +1 -1
  280. package/dist/prolog.js +89 -32
  281. package/dist/public/impact/diagnostics.d.ts.map +1 -1
  282. package/dist/public/impact/diagnostics.js +8 -4
  283. package/dist/public/impact/full-kb-quality.d.ts +1 -1
  284. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  285. package/dist/public/impact/full-kb-quality.js +34 -1
  286. package/dist/public/impact/requirement-quality.d.ts.map +1 -1
  287. package/dist/public/impact/requirement-quality.js +6 -23
  288. package/dist/public/operations/catalog.d.ts +986 -0
  289. package/dist/public/operations/catalog.d.ts.map +1 -0
  290. package/dist/public/operations/catalog.js +42 -0
  291. package/dist/public/operations/check-executor.d.ts +21 -0
  292. package/dist/public/operations/check-executor.d.ts.map +1 -0
  293. package/dist/public/operations/check-executor.js +111 -0
  294. package/dist/public/operations/check-format-shared.d.ts +36 -0
  295. package/dist/public/operations/check-format-shared.d.ts.map +1 -0
  296. package/dist/public/operations/check-format-shared.js +107 -0
  297. package/dist/public/operations/check-helpers.d.ts +10 -0
  298. package/dist/public/operations/check-helpers.d.ts.map +1 -0
  299. package/dist/public/operations/check-helpers.js +107 -0
  300. package/dist/public/operations/discovery-entities.d.ts +14 -0
  301. package/dist/public/operations/discovery-entities.d.ts.map +1 -0
  302. package/dist/public/operations/discovery-entities.js +91 -0
  303. package/dist/public/operations/discovery-executors.d.ts +39 -0
  304. package/dist/public/operations/discovery-executors.d.ts.map +1 -0
  305. package/dist/public/operations/discovery-executors.js +101 -0
  306. package/dist/public/operations/index.d.ts +21 -0
  307. package/dist/public/operations/index.d.ts.map +1 -0
  308. package/dist/public/operations/index.js +19 -0
  309. package/dist/public/operations/node-ports.d.ts +15 -0
  310. package/dist/public/operations/node-ports.d.ts.map +1 -0
  311. package/dist/public/operations/node-ports.js +57 -0
  312. package/dist/public/operations/prolog-json.d.ts +5 -0
  313. package/dist/public/operations/prolog-json.d.ts.map +1 -0
  314. package/dist/public/operations/prolog-json.js +44 -0
  315. package/dist/public/operations/runtime-types.d.ts +69 -0
  316. package/dist/public/operations/runtime-types.d.ts.map +1 -0
  317. package/dist/public/operations/runtime-types.js +17 -0
  318. package/dist/public/operations/specs/autopilot.d.ts +82 -0
  319. package/dist/public/operations/specs/autopilot.d.ts.map +1 -0
  320. package/dist/public/operations/specs/autopilot.js +72 -0
  321. package/dist/public/operations/specs/check.d.ts +51 -0
  322. package/dist/public/operations/specs/check.d.ts.map +1 -0
  323. package/dist/public/operations/specs/check.js +65 -0
  324. package/dist/public/operations/specs/discovery.d.ts +94 -0
  325. package/dist/public/operations/specs/discovery.d.ts.map +1 -0
  326. package/dist/public/operations/specs/discovery.js +98 -0
  327. package/dist/public/operations/specs/modeling.d.ts +142 -0
  328. package/dist/public/operations/specs/modeling.d.ts.map +1 -0
  329. package/dist/public/operations/specs/modeling.js +133 -0
  330. package/dist/public/operations/specs/mutation-schemas.d.ts +268 -0
  331. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -0
  332. package/dist/public/operations/specs/mutation-schemas.js +294 -0
  333. package/dist/public/operations/specs/mutation.d.ts +56 -0
  334. package/dist/public/operations/specs/mutation.d.ts.map +1 -0
  335. package/dist/public/operations/specs/mutation.js +44 -0
  336. package/dist/public/operations/specs/reporting.d.ts +185 -0
  337. package/dist/public/operations/specs/reporting.d.ts.map +1 -0
  338. package/dist/public/operations/specs/reporting.js +158 -0
  339. package/dist/public/operations/specs/semantic.d.ts +81 -0
  340. package/dist/public/operations/specs/semantic.d.ts.map +1 -0
  341. package/dist/public/operations/specs/semantic.js +137 -0
  342. package/dist/public/operations/specs/skills.d.ts +70 -0
  343. package/dist/public/operations/specs/skills.d.ts.map +1 -0
  344. package/dist/public/operations/specs/skills.js +107 -0
  345. package/dist/public/operations/specs/sparql.d.ts +39 -0
  346. package/dist/public/operations/specs/sparql.d.ts.map +1 -0
  347. package/dist/public/operations/specs/sparql.js +121 -0
  348. package/dist/public/operations/specs/upsert.d.ts +291 -0
  349. package/dist/public/operations/specs/upsert.d.ts.map +1 -0
  350. package/dist/public/operations/specs/upsert.js +27 -0
  351. package/dist/public/operations/types.d.ts +24 -0
  352. package/dist/public/operations/types.d.ts.map +1 -0
  353. package/dist/public/operations/types.js +1 -0
  354. package/dist/public/schemas/entity.d.ts.map +1 -1
  355. package/dist/public/schemas/entity.js +317 -0
  356. package/dist/public/schemas/relationship.d.ts.map +1 -1
  357. package/dist/public/schemas/relationship.js +1 -0
  358. package/dist/public/skill-system/errors.d.ts +19 -0
  359. package/dist/public/skill-system/errors.d.ts.map +1 -0
  360. package/dist/public/skill-system/errors.js +36 -0
  361. package/dist/public/skill-system/loader.d.ts +9 -0
  362. package/dist/public/skill-system/loader.d.ts.map +1 -0
  363. package/dist/public/skill-system/loader.js +76 -0
  364. package/dist/public/skill-system/paths.d.ts +6 -0
  365. package/dist/public/skill-system/paths.d.ts.map +1 -0
  366. package/dist/public/skill-system/paths.js +25 -0
  367. package/dist/public/skill-system/types.d.ts +15 -0
  368. package/dist/public/skill-system/types.d.ts.map +1 -0
  369. package/dist/public/skill-system/types.js +1 -0
  370. package/dist/public/skill-system/validation.d.ts +10 -0
  371. package/dist/public/skill-system/validation.d.ts.map +1 -0
  372. package/dist/public/skill-system/validation.js +119 -0
  373. package/dist/public/skills/init-kibi/SKILL.md +62 -0
  374. package/dist/public/skills/kibi-freshness/SKILL.md +44 -0
  375. package/dist/public/skills/kibi-traceability/SKILL.md +54 -0
  376. package/dist/public/skills/kibi-usage/SKILL.md +145 -99
  377. package/dist/public/skills/kibi-usage/resources/fact-lanes.md +112 -0
  378. package/dist/public/skills/kibi-usage/resources/logic-ir.md +43 -0
  379. package/dist/public/skills/kibi-usage/resources/operation-access.md +44 -0
  380. package/dist/public/skills/kibi-usage/resources/ui-requirements.md +96 -0
  381. package/dist/public/skills/kibi-usage/resources/workflows.md +41 -3
  382. package/dist/public/skills.d.ts +4 -41
  383. package/dist/public/skills.d.ts.map +1 -1
  384. package/dist/public/skills.js +3 -270
  385. package/dist/public/symbol-granularity.d.ts +9 -0
  386. package/dist/public/symbol-granularity.d.ts.map +1 -1
  387. package/dist/public/symbol-granularity.js +16 -0
  388. package/dist/runtime/cli-runtime.d.ts +3 -0
  389. package/dist/runtime/cli-runtime.d.ts.map +1 -0
  390. package/dist/runtime/cli-runtime.js +96 -0
  391. package/dist/schemas/entity.schema.json +329 -3
  392. package/dist/traceability/staged-diagnostics.d.ts +2 -2
  393. package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
  394. package/dist/traceability/staged-diagnostics.js +17 -10
  395. package/dist/traceability/staged-impact-contract.js +1 -1
  396. package/dist/traceability/staged-symbols-manifest.d.ts +1 -0
  397. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  398. package/dist/traceability/staged-symbols-manifest.js +53 -24
  399. package/dist/traceability/symbol-extract.d.ts.map +1 -1
  400. package/dist/traceability/symbol-extract.js +17 -1
  401. package/dist/traceability/temp-kb.d.ts.map +1 -1
  402. package/dist/traceability/temp-kb.js +47 -1
  403. package/dist/types/entities.d.ts +3 -0
  404. package/dist/types/entities.d.ts.map +1 -1
  405. package/dist/types/relationships.d.ts +1 -1
  406. package/dist/types/relationships.d.ts.map +1 -1
  407. package/dist/utils/rule-registry.d.ts.map +1 -1
  408. package/dist/utils/rule-registry.js +24 -0
  409. package/dist/utils/schema-version.d.ts +1 -1
  410. package/dist/utils/schema-version.js +1 -1
  411. package/package.json +60 -2
  412. package/src/public/impact/diagnostics.ts +18 -11
  413. package/src/public/impact/full-kb-quality.ts +30 -3
  414. package/src/public/impact/requirement-quality.ts +6 -26
  415. package/src/public/operations/catalog.ts +60 -0
  416. package/src/public/operations/check-executor.ts +185 -0
  417. package/src/public/operations/check-format-shared.ts +178 -0
  418. package/src/public/operations/check-helpers.ts +141 -0
  419. package/src/public/operations/discovery-entities.ts +122 -0
  420. package/src/public/operations/discovery-executors.ts +176 -0
  421. package/src/public/operations/index.ts +20 -0
  422. package/src/public/operations/node-ports.ts +78 -0
  423. package/src/public/operations/prolog-json.ts +71 -0
  424. package/src/public/operations/runtime-types.ts +106 -0
  425. package/src/public/operations/specs/autopilot.ts +98 -0
  426. package/src/public/operations/specs/check.ts +75 -0
  427. package/src/public/operations/specs/discovery.ts +126 -0
  428. package/src/public/operations/specs/modeling.ts +174 -0
  429. package/src/public/operations/specs/mutation-schemas.ts +326 -0
  430. package/src/public/operations/specs/mutation.ts +58 -0
  431. package/src/public/operations/specs/reporting.ts +249 -0
  432. package/src/public/operations/specs/semantic.ts +174 -0
  433. package/src/public/operations/specs/skills.ts +142 -0
  434. package/src/public/operations/specs/sparql.ts +149 -0
  435. package/src/public/operations/specs/upsert.ts +40 -0
  436. package/src/public/operations/types.ts +57 -0
  437. package/src/public/schemas/entity.ts +324 -1
  438. package/src/public/schemas/relationship.ts +1 -0
  439. package/src/public/skill-system/errors.ts +38 -0
  440. package/src/public/skill-system/loader.ts +108 -0
  441. package/src/public/skill-system/paths.ts +27 -0
  442. package/src/public/skill-system/types.ts +14 -0
  443. package/src/public/skill-system/validation.ts +175 -0
  444. package/src/public/skills/init-kibi/SKILL.md +62 -0
  445. package/src/public/skills/kibi-freshness/SKILL.md +44 -0
  446. package/src/public/skills/kibi-traceability/SKILL.md +54 -0
  447. package/src/public/skills/kibi-usage/SKILL.md +145 -99
  448. package/src/public/skills/kibi-usage/resources/fact-lanes.md +112 -0
  449. package/src/public/skills/kibi-usage/resources/logic-ir.md +43 -0
  450. package/src/public/skills/kibi-usage/resources/operation-access.md +44 -0
  451. package/src/public/skills/kibi-usage/resources/ui-requirements.md +96 -0
  452. package/src/public/skills/kibi-usage/resources/workflows.md +41 -3
  453. package/src/public/skills.ts +18 -427
  454. package/src/public/symbol-granularity.ts +25 -0
  455. package/src/schemas/entity.schema.json +329 -3
  456. package/src/schemas/relationship.schema.json +1 -0
@@ -2,6 +2,209 @@
2
2
  "$id": "entity.schema.json",
3
3
  "title": "Entity",
4
4
  "type": "object",
5
+ "$defs": {
6
+ "logicTerm": {
7
+ "oneOf": [
8
+ {
9
+ "type": "object",
10
+ "required": ["kind", "name", "type"],
11
+ "properties": {
12
+ "kind": { "const": "var" },
13
+ "name": { "type": "string", "pattern": "^[A-Z][A-Za-z0-9_]*$" },
14
+ "type": { "type": "string", "pattern": "^[a-z][a-z0-9_:.\\/-]*$" }
15
+ },
16
+ "additionalProperties": false
17
+ },
18
+ {
19
+ "type": "object",
20
+ "required": ["kind", "value"],
21
+ "properties": {
22
+ "kind": { "const": "const" },
23
+ "value": { "type": "string", "minLength": 1 },
24
+ "type": { "type": "string", "pattern": "^[a-z][a-z0-9_:.\\/-]*$" }
25
+ },
26
+ "additionalProperties": false
27
+ },
28
+ {
29
+ "type": "object",
30
+ "required": ["kind", "value"],
31
+ "properties": {
32
+ "kind": { "const": "number" },
33
+ "value": { "type": "number" },
34
+ "unit": { "type": "string", "pattern": "^[a-z][a-z0-9_:.\\/-]*$" }
35
+ },
36
+ "additionalProperties": false
37
+ },
38
+ {
39
+ "type": "object",
40
+ "required": ["kind", "value", "unit"],
41
+ "properties": {
42
+ "kind": { "const": "duration" },
43
+ "value": { "type": "number", "minimum": 0 },
44
+ "unit": {
45
+ "type": "string",
46
+ "enum": ["ms", "s", "m", "h", "d", "w"]
47
+ }
48
+ },
49
+ "additionalProperties": false
50
+ },
51
+ {
52
+ "type": "object",
53
+ "required": ["kind", "value"],
54
+ "properties": {
55
+ "kind": { "const": "timestamp" },
56
+ "value": { "type": "string" }
57
+ },
58
+ "additionalProperties": false
59
+ },
60
+ {
61
+ "type": "object",
62
+ "required": ["kind", "start", "end"],
63
+ "properties": {
64
+ "kind": { "const": "interval" },
65
+ "start": { "type": "string" },
66
+ "end": { "type": "string" }
67
+ },
68
+ "additionalProperties": false
69
+ }
70
+ ]
71
+ },
72
+ "logicAtom": {
73
+ "type": "object",
74
+ "required": ["kind", "name", "args"],
75
+ "properties": {
76
+ "kind": { "const": "atom" },
77
+ "namespace": { "type": "string", "pattern": "^[a-z][a-z0-9_:.\\/-]*$" },
78
+ "name": { "type": "string", "pattern": "^[a-z][a-z0-9_:.\\/-]*$" },
79
+ "args": {
80
+ "type": "array",
81
+ "maxItems": 8,
82
+ "items": { "$ref": "#/$defs/logicTerm" }
83
+ },
84
+ "polarity": { "enum": ["positive", "negative"] },
85
+ "closedWorld": { "type": "boolean" }
86
+ },
87
+ "additionalProperties": false
88
+ },
89
+ "logicExpression": {
90
+ "oneOf": [
91
+ { "$ref": "#/$defs/logicAtom" },
92
+ {
93
+ "type": "object",
94
+ "required": ["kind", "items"],
95
+ "properties": {
96
+ "kind": { "enum": ["all", "any"] },
97
+ "items": {
98
+ "type": "array",
99
+ "minItems": 1,
100
+ "maxItems": 32,
101
+ "items": { "$ref": "#/$defs/logicExpression" }
102
+ }
103
+ },
104
+ "additionalProperties": false
105
+ },
106
+ {
107
+ "type": "object",
108
+ "required": ["kind", "item"],
109
+ "properties": {
110
+ "kind": { "const": "not" },
111
+ "item": { "$ref": "#/$defs/logicAtom" }
112
+ },
113
+ "additionalProperties": false
114
+ },
115
+ {
116
+ "type": "object",
117
+ "required": ["kind", "operator", "left", "right"],
118
+ "properties": {
119
+ "kind": { "const": "compare" },
120
+ "operator": { "enum": ["eq", "neq", "lt", "lte", "gt", "gte"] },
121
+ "left": { "$ref": "#/$defs/logicTerm" },
122
+ "right": { "$ref": "#/$defs/logicTerm" }
123
+ },
124
+ "additionalProperties": false
125
+ },
126
+ {
127
+ "type": "object",
128
+ "required": ["kind", "atom", "operator", "value"],
129
+ "properties": {
130
+ "kind": { "const": "count" },
131
+ "atom": { "$ref": "#/$defs/logicAtom" },
132
+ "operator": { "enum": ["eq", "neq", "lt", "lte", "gt", "gte"] },
133
+ "value": { "type": "integer", "minimum": 0 }
134
+ },
135
+ "additionalProperties": false
136
+ },
137
+ {
138
+ "type": "object",
139
+ "required": ["kind", "relation", "left", "right"],
140
+ "properties": {
141
+ "kind": { "const": "temporal" },
142
+ "relation": {
143
+ "enum": [
144
+ "before",
145
+ "after",
146
+ "during",
147
+ "overlaps",
148
+ "starts",
149
+ "finishes"
150
+ ]
151
+ },
152
+ "left": { "$ref": "#/$defs/logicTerm" },
153
+ "right": { "$ref": "#/$defs/logicTerm" }
154
+ },
155
+ "additionalProperties": false
156
+ }
157
+ ]
158
+ },
159
+ "logicRule": {
160
+ "type": "object",
161
+ "required": ["version", "kind", "modality"],
162
+ "properties": {
163
+ "version": { "const": "kibi.logic.v1" },
164
+ "kind": { "enum": ["atom", "rule", "constraint"] },
165
+ "modality": {
166
+ "enum": ["assert", "deny", "oblige", "permit", "forbid"]
167
+ },
168
+ "head": { "$ref": "#/$defs/logicAtom" },
169
+ "body": { "$ref": "#/$defs/logicExpression" },
170
+ "variables": {
171
+ "type": "array",
172
+ "maxItems": 32,
173
+ "items": {
174
+ "type": "object",
175
+ "required": ["name", "type"],
176
+ "properties": {
177
+ "name": { "type": "string", "pattern": "^[A-Z][A-Za-z0-9_]*$" },
178
+ "type": {
179
+ "type": "string",
180
+ "pattern": "^[a-z][a-z0-9_:.\\/-]*$"
181
+ },
182
+ "quantifier": { "enum": ["forall", "exists"] }
183
+ },
184
+ "additionalProperties": false
185
+ }
186
+ },
187
+ "exceptions": {
188
+ "type": "array",
189
+ "maxItems": 16,
190
+ "items": { "$ref": "#/$defs/logicExpression" }
191
+ },
192
+ "scope": {
193
+ "type": "object",
194
+ "properties": {
195
+ "authority": { "type": "string" },
196
+ "name": { "type": "string" },
197
+ "tags": { "type": "array", "items": { "type": "string" } }
198
+ },
199
+ "additionalProperties": false
200
+ },
201
+ "validFrom": { "type": "string" },
202
+ "validTo": { "type": "string" },
203
+ "ruleSchemaId": { "type": "string", "minLength": 1 }
204
+ },
205
+ "additionalProperties": false
206
+ }
207
+ },
5
208
  "properties": {
6
209
  "id": { "type": "string" },
7
210
  "title": { "type": "string" },
@@ -38,6 +241,59 @@
38
241
  "severity": { "type": "string" },
39
242
  "links": { "type": "array", "items": { "type": "string" } },
40
243
  "text_ref": { "type": "string" },
244
+ "logic_claims": {
245
+ "type": "array",
246
+ "minItems": 1,
247
+ "uniqueItems": true,
248
+ "items": { "type": "string", "pattern": "^CLAIM-[A-F0-9]{16}$" }
249
+ },
250
+ "semantic_inventory": {
251
+ "type": "array",
252
+ "items": {
253
+ "type": "object",
254
+ "required": ["claim_key", "claim_text", "role", "status", "span"],
255
+ "properties": {
256
+ "claim_key": { "type": "string", "pattern": "^CLAIM-[A-F0-9]{16}$" },
257
+ "claim_text": { "type": "string", "minLength": 1 },
258
+ "role": {
259
+ "type": "string",
260
+ "enum": [
261
+ "normative",
262
+ "definition",
263
+ "descriptive",
264
+ "condition",
265
+ "exception",
266
+ "rationale",
267
+ "example",
268
+ "subjective"
269
+ ]
270
+ },
271
+ "status": {
272
+ "type": "string",
273
+ "enum": [
274
+ "modeled",
275
+ "ambiguous",
276
+ "ontology_gap",
277
+ "nonlogical",
278
+ "missing"
279
+ ]
280
+ },
281
+ "span": {
282
+ "type": "object",
283
+ "required": ["start", "end"],
284
+ "properties": {
285
+ "start": { "type": "integer", "minimum": 0 },
286
+ "end": { "type": "integer", "minimum": 0 }
287
+ },
288
+ "additionalProperties": false
289
+ },
290
+ "semantic_key": { "type": "string" },
291
+ "payload_hash": { "type": "string" },
292
+ "reason": { "type": "string" }
293
+ },
294
+ "additionalProperties": false
295
+ }
296
+ },
41
297
  "sourceFile": { "type": "string" },
42
298
  "granularity_reason": {
43
299
  "type": "string",
@@ -88,7 +344,9 @@
88
344
  "observation",
89
345
  "meta",
90
346
  "predicate_schema",
91
- "predicate"
347
+ "predicate",
348
+ "rule_schema",
349
+ "rule"
92
350
  ]
93
351
  },
94
352
  "subject_key": { "type": "string" },
@@ -115,6 +373,8 @@
115
373
  "valid_from": { "type": "string" },
116
374
  "valid_to": { "type": "string" },
117
375
  "canonical_key": { "type": "string" },
376
+ "claim_key": { "type": "string", "pattern": "^CLAIM-[A-F0-9]{16}$" },
377
+ "claim_text": { "type": "string" },
118
378
  "predicate_name": { "type": "string" },
119
379
  "predicate_namespace": { "type": "string" },
120
380
  "predicate_arity": { "type": "integer", "minimum": 1 },
@@ -126,7 +386,14 @@
126
386
  },
127
387
  "aliases": { "type": "array", "items": { "type": "string" } },
128
388
  "examples": { "type": "array", "items": { "type": "string" } },
129
- "predicate_args": { "type": "array", "items": { "type": "string" } }
389
+ "predicate_args": { "type": "array", "items": { "type": "string" } },
390
+ "rule_ir": { "$ref": "#/$defs/logicRule" },
391
+ "rule_hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
392
+ "rule_schema_id": { "type": "string", "minLength": 1 },
393
+ "rule_name": { "type": "string", "minLength": 1 },
394
+ "semantic_key": { "type": "string", "pattern": "^SEM-[A-F0-9]{24}$" },
395
+ "claim_span_start": { "type": "integer", "minimum": 0 },
396
+ "claim_span_end": { "type": "integer", "minimum": 0 }
130
397
  },
131
398
  "required": [
132
399
  "id",
@@ -138,6 +405,19 @@
138
405
  "type"
139
406
  ],
140
407
  "allOf": [
408
+ {
409
+ "if": {
410
+ "properties": { "type": { "const": "req" } }
411
+ },
412
+ "then": {},
413
+ "else": { "not": { "required": ["logic_claims"] } }
414
+ },
415
+ {
416
+ "if": {
417
+ "anyOf": [{ "required": ["claim_key"] }, { "required": ["claim_text"] }]
418
+ },
419
+ "then": { "required": ["claim_key", "claim_text"] }
420
+ },
141
421
  {
142
422
  "if": {
143
423
  "properties": { "type": { "const": "test" } }
@@ -152,6 +432,36 @@
152
432
  }
153
433
  }
154
434
  },
435
+ {
436
+ "if": {
437
+ "properties": {
438
+ "type": { "const": "fact" },
439
+ "fact_kind": { "const": "rule_schema" }
440
+ },
441
+ "required": ["type", "fact_kind"]
442
+ },
443
+ "then": {
444
+ "required": ["rule_name", "argument_names", "argument_types"]
445
+ }
446
+ },
447
+ {
448
+ "if": {
449
+ "properties": {
450
+ "type": { "const": "fact" },
451
+ "fact_kind": { "const": "rule" }
452
+ },
453
+ "required": ["type", "fact_kind"]
454
+ },
455
+ "then": {
456
+ "required": [
457
+ "rule_ir",
458
+ "rule_hash",
459
+ "rule_schema_id",
460
+ "rule_name",
461
+ "semantic_key"
462
+ ]
463
+ }
464
+ },
155
465
  {
156
466
  "if": {
157
467
  "properties": { "type": { "const": "fact" } }
@@ -176,6 +486,8 @@
176
486
  { "required": ["valid_from"] },
177
487
  { "required": ["valid_to"] },
178
488
  { "required": ["canonical_key"] },
489
+ { "required": ["claim_key"] },
490
+ { "required": ["claim_text"] },
179
491
  { "required": ["predicate_name"] },
180
492
  { "required": ["predicate_namespace"] },
181
493
  { "required": ["predicate_arity"] },
@@ -184,11 +496,25 @@
184
496
  { "required": ["argument_descriptions"] },
185
497
  { "required": ["aliases"] },
186
498
  { "required": ["examples"] },
187
- { "required": ["predicate_args"] }
499
+ { "required": ["predicate_args"] },
500
+ { "required": ["rule_ir"] },
501
+ { "required": ["rule_hash"] },
502
+ { "required": ["rule_schema_id"] },
503
+ { "required": ["rule_name"] },
504
+ { "required": ["semantic_key"] },
505
+ { "required": ["claim_span_start"] },
506
+ { "required": ["claim_span_end"] }
188
507
  ]
189
508
  }
190
509
  }
191
510
  },
511
+ {
512
+ "if": {
513
+ "properties": { "type": { "const": "req" } }
514
+ },
515
+ "then": {},
516
+ "else": { "not": { "required": ["semantic_inventory"] } }
517
+ },
192
518
  {
193
519
  "if": {
194
520
  "properties": {
@@ -1,6 +1,6 @@
1
1
  import type { QualityDiagnostic } from "../public/impact/types.js";
2
2
  import { type KibiImpactEvidence } from "./evidence-model.js";
3
- export type KibiImpactDiagnosticId = "kibi_impact_evidence_missing" | "symbols_manifest_stale" | "symbol_granularity_violation" | "symbol_semantic_review_needed" | "multi_requirement_symbol_review" | "duplicate_symbol_coordinate_review" | "component_mixed_purpose_review" | "broad_requirement_review" | "requirement_status_review" | "strict_fact_modeling_review" | "kibi_impact_override_missing_rationale";
3
+ export type KibiImpactDiagnosticId = "kibi_impact_evidence_missing" | "symbols_manifest_stale" | "symbol_granularity_violation" | "symbol_semantic_review_needed" | "multi_requirement_symbol_review" | "duplicate_symbol_coordinate_review" | "component_mixed_purpose_review" | "broad_requirement_review" | "requirement_status_review" | "strict_fact_modeling_review" | "logical_coverage_review" | "kibi_impact_override_missing_rationale";
4
4
  export interface KibiImpactDiagnostic extends QualityDiagnostic {
5
5
  /** Stable staged-enforcement diagnostic identifier. */
6
6
  id: KibiImpactDiagnosticId;
@@ -21,5 +21,5 @@ export interface KibiImpactDiagnostic extends QualityDiagnostic {
21
21
  * files and manifest freshness. It only evaluates explicit predicates recorded in
22
22
  * `KibiImpactEvidence`.
23
23
  */
24
- export declare function collectStagedKibiDiagnostics(evidence: KibiImpactEvidence): KibiImpactDiagnostic[];
24
+ export declare function collectStagedKibiDiagnostics(evidence: KibiImpactEvidence, symbolsManifestPath?: string): KibiImpactDiagnostic[];
25
25
  //# sourceMappingURL=staged-diagnostics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"staged-diagnostics.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAIL,KAAK,kBAAkB,EAIxB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,sBAAsB,GAC9B,8BAA8B,GAC9B,wBAAwB,GACxB,8BAA8B,GAC9B,+BAA+B,GAC/B,iCAAiC,GACjC,oCAAoC,GACpC,gCAAgC,GAChC,0BAA0B,GAC1B,2BAA2B,GAC3B,6BAA6B,GAC7B,wCAAwC,CAAC;AAE7C,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,uDAAuD;IACvD,EAAE,EAAE,sBAAsB,CAAC;IAC3B,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACxC,iEAAiE;IACjE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,gDAAgD;IAChD,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;CACpB;AA4DD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,kBAAkB,GAC3B,oBAAoB,EAAE,CAoCxB"}
1
+ {"version":3,"file":"staged-diagnostics.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-diagnostics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAGL,KAAK,kBAAkB,EAIxB,MAAM,qBAAqB,CAAC;AAQ7B,MAAM,MAAM,sBAAsB,GAC9B,8BAA8B,GAC9B,wBAAwB,GACxB,8BAA8B,GAC9B,+BAA+B,GAC/B,iCAAiC,GACjC,oCAAoC,GACpC,gCAAgC,GAChC,0BAA0B,GAC1B,2BAA2B,GAC3B,6BAA6B,GAC7B,yBAAyB,GACzB,wCAAwC,CAAC;AAE7C,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,uDAAuD;IACvD,EAAE,EAAE,sBAAsB,CAAC;IAC3B,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACxC,iEAAiE;IACjE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,gDAAgD;IAChD,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;CACpB;AAgED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,kBAAkB,EAC5B,mBAAmB,GAAE,MAAmC,GACvD,oBAAoB,EAAE,CA8CxB"}
@@ -1,8 +1,14 @@
1
- import { KIBI_STAGED_IMPACT_EVIDENCE_DOC, KIBI_SYMBOLS_MANIFEST_PATH, KIBI_SYMBOL_COORDINATES_PATH, getBehaviorSourcePaths, getMissingBehaviorSourcePaths, hasOverrideRationale, } from "./evidence-model.js";
1
+ import * as path from "node:path";
2
+ import { KIBI_STAGED_IMPACT_EVIDENCE_DOC, KIBI_SYMBOLS_MANIFEST_PATH, getBehaviorSourcePaths, getMissingBehaviorSourcePaths, hasOverrideRationale, } from "./evidence-model.js";
3
+ function deriveCoordinatesPath(symbolsManifestPath) {
4
+ return path
5
+ .join(path.dirname(symbolsManifestPath), "symbol-coordinates.yaml")
6
+ .replace(/\\/g, "/");
7
+ }
2
8
  function formatFileList(paths) {
3
9
  return paths.join(", ");
4
10
  }
5
- function createMissingEvidenceDiagnostic(paths) {
11
+ function createMissingEvidenceDiagnostic(paths, symbolsManifestPath, coordinatesPath) {
6
12
  return {
7
13
  id: "kibi_impact_evidence_missing",
8
14
  severity: "error",
@@ -11,19 +17,19 @@ function createMissingEvidenceDiagnostic(paths) {
11
17
  files: [...paths],
12
18
  docs: [KIBI_STAGED_IMPACT_EVIDENCE_DOC],
13
19
  message: `Behavior-changing staged files are missing staged Kibi impact evidence (see ${KIBI_STAGED_IMPACT_EVIDENCE_DOC}): ${formatFileList(paths)}`,
14
- suggestion: `Query Kibi via MCP before deciding. MCP writes update KB state but do not stage tracked evidence; also stage requirement/scenario/test/fact/symbol markdown, authored ${KIBI_SYMBOLS_MANIFEST_PATH} metadata, or refreshed ${KIBI_SYMBOL_COORDINATES_PATH}. Re-run kibi check --staged after staging tracked evidence.`,
20
+ suggestion: `Query Kibi via MCP before deciding. MCP writes update KB state but do not stage tracked evidence; also stage requirement/scenario/test/fact/symbol markdown, authored ${symbolsManifestPath} metadata, or refreshed ${coordinatesPath}. Re-run kibi check --staged after staging tracked evidence.`,
15
21
  };
16
22
  }
17
- function createSymbolsManifestStaleDiagnostic(paths) {
23
+ function createSymbolsManifestStaleDiagnostic(paths, symbolsManifestPath, coordinatesPath) {
18
24
  return {
19
25
  id: "symbols_manifest_stale",
20
26
  severity: "error",
21
27
  blocking: true,
22
28
  category: "symbol",
23
- files: [KIBI_SYMBOL_COORDINATES_PATH, ...paths],
29
+ files: [coordinatesPath, ...paths],
24
30
  docs: [KIBI_STAGED_IMPACT_EVIDENCE_DOC],
25
- message: `${KIBI_SYMBOL_COORDINATES_PATH} is stale or missing for staged source files: ${formatFileList(paths)}`,
26
- suggestion: `Run kibi sync --refresh-symbol-coordinates && git add ${KIBI_SYMBOL_COORDINATES_PATH} ${KIBI_SYMBOLS_MANIFEST_PATH}, then re-run kibi check --staged.`,
31
+ message: `${coordinatesPath} is stale or missing for staged source files: ${formatFileList(paths)}`,
32
+ suggestion: `Run kibi sync --refresh-symbol-coordinates && git add ${coordinatesPath} ${symbolsManifestPath}, then re-run kibi check --staged.`,
27
33
  };
28
34
  }
29
35
  function createMissingOverrideRationaleDiagnostic(evidence) {
@@ -49,8 +55,9 @@ function createMissingOverrideRationaleDiagnostic(evidence) {
49
55
  * files and manifest freshness. It only evaluates explicit predicates recorded in
50
56
  * `KibiImpactEvidence`.
51
57
  */
52
- export function collectStagedKibiDiagnostics(evidence) {
58
+ export function collectStagedKibiDiagnostics(evidence, symbolsManifestPath = KIBI_SYMBOLS_MANIFEST_PATH) {
53
59
  const diagnostics = [];
60
+ const coordinatesPath = evidence.symbolsManifest.path || deriveCoordinatesPath(symbolsManifestPath);
54
61
  if (evidence.mode.kind === "no_impact_override" &&
55
62
  !hasOverrideRationale(evidence)) {
56
63
  diagnostics.push(createMissingOverrideRationaleDiagnostic(evidence));
@@ -58,11 +65,11 @@ export function collectStagedKibiDiagnostics(evidence) {
58
65
  if ((evidence.symbolsManifest.state === "stale" ||
59
66
  evidence.symbolsManifest.state === "missing") &&
60
67
  evidence.symbolsManifest.sourcePaths.length > 0) {
61
- diagnostics.push(createSymbolsManifestStaleDiagnostic([...evidence.symbolsManifest.sourcePaths].sort()));
68
+ diagnostics.push(createSymbolsManifestStaleDiagnostic([...evidence.symbolsManifest.sourcePaths].sort(), symbolsManifestPath, coordinatesPath));
62
69
  }
63
70
  const missingBehaviorPaths = getMissingBehaviorSourcePaths(evidence);
64
71
  if (missingBehaviorPaths.length > 0) {
65
- diagnostics.push(createMissingEvidenceDiagnostic(missingBehaviorPaths));
72
+ diagnostics.push(createMissingEvidenceDiagnostic(missingBehaviorPaths, symbolsManifestPath, coordinatesPath));
66
73
  }
67
74
  if (evidence.mode.kind === "no_impact_override" &&
68
75
  evidence.mode.override.sourcePaths.length === 0 &&
@@ -48,7 +48,7 @@ export const KIBI_IMPACT_DIAGNOSTICS = {
48
48
  id: "kibi_impact_evidence_missing",
49
49
  title: "Behavior edit requires staged Kibi impact evidence",
50
50
  resolution: [
51
- "Query Kibi via MCP first: use kb_search for discovery, then kb_query for exact follow-up.",
51
+ "Query Kibi via visible MCP tools or the trusted project-local CLI (peer surfaces): use kb_search for discovery, then kb_query for exact follow-up.",
52
52
  "MCP writes update KB state but do not stage tracked evidence; also stage related KB entity markdown, authored documentation/symbols.yaml metadata, or refreshed documentation/symbol-coordinates.yaml.",
53
53
  "Re-run or let the hook run kibi check --staged.",
54
54
  ],
@@ -10,6 +10,7 @@ export interface StagedAuthoredSymbolsManifestEvidence {
10
10
  sourcePath: string;
11
11
  entityIds: string[];
12
12
  }>;
13
+ changedEntityIds: string[];
13
14
  }
14
15
  export declare function assessStagedSymbolsManifest(options: {
15
16
  symbolsManifestPath: string;
@@ -1 +1 @@
1
- {"version":3,"file":"staged-symbols-manifest.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-symbols-manifest.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA+BlD,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,cAAc,CAAC;IACtD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qCAAqC;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CAC7D;AA+SD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE;IACnD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,GAAG,+BAA+B,CA8ElC;AAoBD,wBAAgB,4CAA4C,CAAC,OAAO,EAAE;IACpE,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,GAAG,qCAAqC,CAgDxC"}
1
+ {"version":3,"file":"staged-symbols-manifest.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-symbols-manifest.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA0ClD,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,cAAc,CAAC;IACtD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qCAAqC;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC5D,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAkTD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE;IACnD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,GAAG,+BAA+B,CAgGlC;AAED,wBAAgB,4CAA4C,CAAC,OAAO,EAAE;IACpE,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,GAAG,qCAAqC,CAmExC"}
@@ -3,7 +3,18 @@ import * as path from "node:path";
3
3
  import { extractManifestSymbolRecordsString, } from "../extractors/manifest.js";
4
4
  import { mergeCoordinatesWithManifest, readCoordinateArtifact, } from "../extractors/symbol-coordinates.js";
5
5
  import { analyzeSourceText } from "../extractors/symbols-coordinator.js";
6
+ import { isCoarseGranularityReason } from "../public/symbol-granularity.js";
6
7
  import { resolveSymbolsManifestPaths } from "../utils/manifest-paths.js";
8
+ /**
9
+ * True when a manifest record documents coarse file/module-level coverage using
10
+ * a canonical granularity reason that legitimately carries no generated
11
+ * per-symbol coordinates. Such records do not participate in coordinate
12
+ * freshness comparison. `legacy-link` records remain coordinate-bearing, and
13
+ * unknown or malformed reasons cannot bypass freshness checks.
14
+ */
15
+ function isDocumentedCoarseRecord(record) {
16
+ return isCoarseGranularityReason(record.granularity_reason);
17
+ }
7
18
  function toRepoRelativePath(absoluteOrRelativePath) {
8
19
  if (!path.isAbsolute(absoluteOrRelativePath)) {
9
20
  return absoluteOrRelativePath.replace(/\\/g, "/");
@@ -100,6 +111,9 @@ function normalizeRelationships(relationships) {
100
111
  function normalizeManifestSymbolsForSourceFile(records, sourceFile) {
101
112
  return records
102
113
  .filter((record) => {
114
+ if (isDocumentedCoarseRecord(record)) {
115
+ return false;
116
+ }
103
117
  const recordSource = typeof record.sourceFile === "string"
104
118
  ? record.sourceFile
105
119
  : typeof record.source === "string"
@@ -226,6 +240,19 @@ export function assessStagedSymbolsManifest(options) {
226
240
  const requiredRefreshPaths = [];
227
241
  const freshPaths = new Set();
228
242
  for (const sourceFile of sourceFiles) {
243
+ const manifestRecordsForFile = (stagedManifestRecords ?? []).filter((record) => {
244
+ const recordSource = typeof record.sourceFile === "string"
245
+ ? record.sourceFile
246
+ : typeof record.source === "string"
247
+ ? record.source
248
+ : null;
249
+ return recordSource === sourceFile.path;
250
+ });
251
+ const coarseCovered = manifestRecordsForFile.length > 0 &&
252
+ manifestRecordsForFile.every(isDocumentedCoarseRecord);
253
+ if (coarseCovered) {
254
+ continue;
255
+ }
229
256
  const expectedSymbols = normalizeExpectedSymbolsForStagedFile(sourceFile);
230
257
  const baselineSymbols = normalizeManifestSymbolsForSourceFile(baselineMergedRecords, sourceFile.path);
231
258
  if (signaturesEqual(expectedSymbols, baselineSymbols)) {
@@ -256,42 +283,44 @@ export function assessStagedSymbolsManifest(options) {
256
283
  }
257
284
  return { state: "stale", sourcePaths, path: paths.coordinatesPath };
258
285
  }
259
- function getEntityIdsForSourceFile(records, sourceFile) {
260
- return records
261
- .filter((record) => {
262
- const recordSource = typeof record.sourceFile === "string"
263
- ? record.sourceFile
264
- : typeof record.source === "string"
265
- ? record.source
266
- : null;
267
- return recordSource === sourceFile && typeof record.id === "string";
268
- })
269
- .map((record) => record.id)
270
- .sort();
271
- }
272
286
  export function collectStagedAuthoredSymbolsManifestEvidence(options) {
273
287
  const { sourceFiles, stagedFiles } = options;
274
288
  const paths = resolveRelativeManifestPaths();
275
289
  const stagedManifestFile = stagedFiles.find((file) => file.path === paths.symbolsPath);
276
290
  if (!stagedManifestFile) {
277
- return { path: paths.symbolsPath, entries: [] };
291
+ return { path: paths.symbolsPath, entries: [], changedEntityIds: [] };
278
292
  }
279
293
  const headManifestRecords = parseManifestRecords(readHeadFileContent(paths.symbolsPath), paths.symbolsPath) ?? [];
280
294
  const stagedManifestRecords = parseManifestRecords(stagedManifestFile.content, paths.symbolsPath);
281
295
  if (stagedManifestRecords === null) {
282
- return { path: paths.symbolsPath, entries: [] };
296
+ return { path: paths.symbolsPath, entries: [], changedEntityIds: [] };
283
297
  }
298
+ const sourcePaths = uniqueSorted([...headManifestRecords, ...stagedManifestRecords].flatMap((record) => {
299
+ const sourceFile = typeof record.sourceFile === "string"
300
+ ? record.sourceFile
301
+ : typeof record.source === "string"
302
+ ? record.source
303
+ : null;
304
+ return sourceFile === null ? [] : [sourceFile];
305
+ }));
306
+ const changedEntityIdsBySourcePath = new Map(sourcePaths.map((sourcePath) => {
307
+ const headSymbols = normalizeAuthoredManifestSymbolsForSourceFile(headManifestRecords, sourcePath);
308
+ const stagedSymbols = normalizeAuthoredManifestSymbolsForSourceFile(stagedManifestRecords, sourcePath);
309
+ return [
310
+ sourcePath,
311
+ getChangedAuthoredEntityIds(headSymbols, stagedSymbols),
312
+ ];
313
+ }));
284
314
  const entries = [];
285
315
  for (const sourceFile of sourceFiles) {
286
- const headSymbols = normalizeAuthoredManifestSymbolsForSourceFile(headManifestRecords, sourceFile.path);
287
- const stagedSymbols = normalizeAuthoredManifestSymbolsForSourceFile(stagedManifestRecords, sourceFile.path);
288
- if (signaturesEqual(headSymbols, stagedSymbols)) {
316
+ const entityIds = changedEntityIdsBySourcePath.get(sourceFile.path) ?? [];
317
+ if (entityIds.length === 0)
289
318
  continue;
290
- }
291
- entries.push({
292
- sourcePath: sourceFile.path,
293
- entityIds: getChangedAuthoredEntityIds(headSymbols, stagedSymbols),
294
- });
319
+ entries.push({ sourcePath: sourceFile.path, entityIds });
295
320
  }
296
- return { path: paths.symbolsPath, entries };
321
+ return {
322
+ path: paths.symbolsPath,
323
+ entries,
324
+ changedEntityIds: uniqueSorted(Array.from(changedEntityIdsBySourcePath.values()).flat()),
325
+ };
297
326
  }
@@ -1 +1 @@
1
- {"version":3,"file":"symbol-extract.d.ts","sourceRoot":"","sources":["../../src/traceability/symbol-extract.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EAEhB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7D,KAAK,wBAAwB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAU7D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC5C;AAED,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAE9D,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAG5E;AAmOD,wBAAgB,4BAA4B,CAE1C,UAAU,EAAE,UAAU,EACtB,cAAc,CAAC,EAAE,cAAc,GAC9B,eAAe,EAAE,CAwSnB"}
1
+ {"version":3,"file":"symbol-extract.d.ts","sourceRoot":"","sources":["../../src/traceability/symbol-extract.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EAEhB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7D,KAAK,wBAAwB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAU7D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC5C;AAED,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAE9D,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAG5E;AAmOD,wBAAgB,4BAA4B,CAE1C,UAAU,EAAE,UAAU,EACtB,cAAc,CAAC,EAAE,cAAc,GAC9B,eAAe,EAAE,CA2SnB"}