kibi-cli 0.14.0 → 0.16.1

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 (432) 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 +52 -94
  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 +1 -1
  60. package/dist/commands/sync/manifest.d.ts.map +1 -1
  61. package/dist/commands/sync/manifest.js +9 -17
  62. package/dist/commands/sync/persistence.d.ts.map +1 -1
  63. package/dist/commands/sync/persistence.js +22 -1
  64. package/dist/extractors/markdown.d.ts +14 -2
  65. package/dist/extractors/markdown.d.ts.map +1 -1
  66. package/dist/extractors/markdown.js +38 -1
  67. package/dist/extractors/symbols-ts.d.ts.map +1 -1
  68. package/dist/extractors/symbols-ts.js +11 -1
  69. package/dist/operations/autopilot/activation.d.ts +4 -0
  70. package/dist/operations/autopilot/activation.d.ts.map +1 -0
  71. package/dist/operations/autopilot/activation.js +130 -0
  72. package/dist/operations/autopilot/candidate-helpers.d.ts +13 -0
  73. package/dist/operations/autopilot/candidate-helpers.d.ts.map +1 -0
  74. package/dist/operations/autopilot/candidate-helpers.js +55 -0
  75. package/dist/operations/autopilot/candidates.d.ts +4 -0
  76. package/dist/operations/autopilot/candidates.d.ts.map +1 -0
  77. package/dist/operations/autopilot/candidates.js +114 -0
  78. package/dist/operations/autopilot/discovery-evidence.d.ts +10 -0
  79. package/dist/operations/autopilot/discovery-evidence.d.ts.map +1 -0
  80. package/dist/operations/autopilot/discovery-evidence.js +158 -0
  81. package/dist/operations/autopilot/discovery.d.ts +4 -0
  82. package/dist/operations/autopilot/discovery.d.ts.map +1 -0
  83. package/dist/operations/autopilot/discovery.js +100 -0
  84. package/dist/operations/autopilot/generate.d.ts +8 -0
  85. package/dist/operations/autopilot/generate.d.ts.map +1 -0
  86. package/dist/operations/autopilot/generate.js +112 -0
  87. package/dist/operations/autopilot/guidance-actions.d.ts +3 -0
  88. package/dist/operations/autopilot/guidance-actions.d.ts.map +1 -0
  89. package/dist/operations/autopilot/guidance-actions.js +79 -0
  90. package/dist/operations/autopilot/guidance.d.ts +14 -0
  91. package/dist/operations/autopilot/guidance.d.ts.map +1 -0
  92. package/dist/operations/autopilot/guidance.js +124 -0
  93. package/dist/operations/autopilot/markdown-candidates.d.ts +7 -0
  94. package/dist/operations/autopilot/markdown-candidates.d.ts.map +1 -0
  95. package/dist/operations/autopilot/markdown-candidates.js +134 -0
  96. package/dist/operations/autopilot/presentation.d.ts +13 -0
  97. package/dist/operations/autopilot/presentation.d.ts.map +1 -0
  98. package/dist/operations/autopilot/presentation.js +91 -0
  99. package/dist/operations/autopilot/requirement-claims.d.ts +3 -0
  100. package/dist/operations/autopilot/requirement-claims.d.ts.map +1 -0
  101. package/dist/operations/autopilot/requirement-claims.js +48 -0
  102. package/dist/operations/autopilot/types.d.ts +117 -0
  103. package/dist/operations/autopilot/types.d.ts.map +1 -0
  104. package/dist/operations/autopilot/types.js +8 -0
  105. package/dist/operations/modeling/model-requirement.d.ts +10 -0
  106. package/dist/operations/modeling/model-requirement.d.ts.map +1 -0
  107. package/dist/operations/modeling/model-requirement.js +108 -0
  108. package/dist/operations/modeling/predicate-applyplan.d.ts +6 -0
  109. package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -0
  110. package/dist/operations/modeling/predicate-applyplan.js +104 -0
  111. package/dist/operations/modeling/predicate-catalog-1.d.ts +3 -0
  112. package/dist/operations/modeling/predicate-catalog-1.d.ts.map +1 -0
  113. package/dist/operations/modeling/predicate-catalog-1.js +200 -0
  114. package/dist/operations/modeling/predicate-catalog-2.d.ts +3 -0
  115. package/dist/operations/modeling/predicate-catalog-2.d.ts.map +1 -0
  116. package/dist/operations/modeling/predicate-catalog-2.js +197 -0
  117. package/dist/operations/modeling/predicate-catalog-3.d.ts +3 -0
  118. package/dist/operations/modeling/predicate-catalog-3.d.ts.map +1 -0
  119. package/dist/operations/modeling/predicate-catalog-3.js +193 -0
  120. package/dist/operations/modeling/predicate-catalog-4.d.ts +3 -0
  121. package/dist/operations/modeling/predicate-catalog-4.d.ts.map +1 -0
  122. package/dist/operations/modeling/predicate-catalog-4.js +149 -0
  123. package/dist/operations/modeling/predicate-catalog.d.ts +5 -0
  124. package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -0
  125. package/dist/operations/modeling/predicate-catalog.js +29 -0
  126. package/dist/operations/modeling/predicate-inference-1.d.ts +16 -0
  127. package/dist/operations/modeling/predicate-inference-1.d.ts.map +1 -0
  128. package/dist/operations/modeling/predicate-inference-1.js +161 -0
  129. package/dist/operations/modeling/predicate-inference-2.d.ts +19 -0
  130. package/dist/operations/modeling/predicate-inference-2.d.ts.map +1 -0
  131. package/dist/operations/modeling/predicate-inference-2.js +169 -0
  132. package/dist/operations/modeling/predicate-inference-3.d.ts +15 -0
  133. package/dist/operations/modeling/predicate-inference-3.d.ts.map +1 -0
  134. package/dist/operations/modeling/predicate-inference-3.js +163 -0
  135. package/dist/operations/modeling/predicate-inference.d.ts +5 -0
  136. package/dist/operations/modeling/predicate-inference.d.ts.map +1 -0
  137. package/dist/operations/modeling/predicate-inference.js +148 -0
  138. package/dist/operations/modeling/predicate-loader.d.ts +10 -0
  139. package/dist/operations/modeling/predicate-loader.d.ts.map +1 -0
  140. package/dist/operations/modeling/predicate-loader.js +88 -0
  141. package/dist/operations/modeling/predicate-ranker.d.ts +3 -0
  142. package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -0
  143. package/dist/operations/modeling/predicate-ranker.js +24 -0
  144. package/dist/operations/modeling/predicate-score-1.d.ts +3 -0
  145. package/dist/operations/modeling/predicate-score-1.d.ts.map +1 -0
  146. package/dist/operations/modeling/predicate-score-1.js +121 -0
  147. package/dist/operations/modeling/predicate-score-2.d.ts +3 -0
  148. package/dist/operations/modeling/predicate-score-2.d.ts.map +1 -0
  149. package/dist/operations/modeling/predicate-score-2.js +122 -0
  150. package/dist/operations/modeling/predicate-score-3.d.ts +3 -0
  151. package/dist/operations/modeling/predicate-score-3.d.ts.map +1 -0
  152. package/dist/operations/modeling/predicate-score-3.js +54 -0
  153. package/dist/operations/modeling/predicate-types.d.ts +61 -0
  154. package/dist/operations/modeling/predicate-types.d.ts.map +1 -0
  155. package/dist/operations/modeling/predicate-types.js +1 -0
  156. package/dist/operations/modeling/predicate-usage-hints-1.d.ts +3 -0
  157. package/dist/operations/modeling/predicate-usage-hints-1.d.ts.map +1 -0
  158. package/dist/operations/modeling/predicate-usage-hints-1.js +211 -0
  159. package/dist/operations/modeling/predicate-usage-hints-2.d.ts +3 -0
  160. package/dist/operations/modeling/predicate-usage-hints-2.d.ts.map +1 -0
  161. package/dist/operations/modeling/predicate-usage-hints-2.js +209 -0
  162. package/dist/operations/modeling/predicate-usage-hints-3.d.ts +3 -0
  163. package/dist/operations/modeling/predicate-usage-hints-3.d.ts.map +1 -0
  164. package/dist/operations/modeling/predicate-usage-hints-3.js +45 -0
  165. package/dist/operations/modeling/predicate-utils.d.ts +23 -0
  166. package/dist/operations/modeling/predicate-utils.d.ts.map +1 -0
  167. package/dist/operations/modeling/predicate-utils.js +187 -0
  168. package/dist/operations/modeling/requirement-applyplan.d.ts +4 -0
  169. package/dist/operations/modeling/requirement-applyplan.d.ts.map +1 -0
  170. package/dist/operations/modeling/requirement-applyplan.js +44 -0
  171. package/dist/operations/modeling/requirement-heuristics.d.ts +4 -0
  172. package/dist/operations/modeling/requirement-heuristics.d.ts.map +1 -0
  173. package/dist/operations/modeling/requirement-heuristics.js +114 -0
  174. package/dist/operations/modeling/requirement-modeler.d.ts +8 -0
  175. package/dist/operations/modeling/requirement-modeler.d.ts.map +1 -0
  176. package/dist/operations/modeling/requirement-modeler.js +70 -0
  177. package/dist/operations/modeling/requirement-types.d.ts +49 -0
  178. package/dist/operations/modeling/requirement-types.d.ts.map +1 -0
  179. package/dist/operations/modeling/requirement-types.js +1 -0
  180. package/dist/operations/modeling/requirement-utils.d.ts +10 -0
  181. package/dist/operations/modeling/requirement-utils.d.ts.map +1 -0
  182. package/dist/operations/modeling/requirement-utils.js +65 -0
  183. package/dist/operations/modeling/suggest-predicates.d.ts +6 -0
  184. package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -0
  185. package/dist/operations/modeling/suggest-predicates.js +64 -0
  186. package/dist/operations/mutation/audit.d.ts +6 -0
  187. package/dist/operations/mutation/audit.d.ts.map +1 -0
  188. package/dist/operations/mutation/audit.js +22 -0
  189. package/dist/operations/mutation/contradictions.d.ts +10 -0
  190. package/dist/operations/mutation/contradictions.d.ts.map +1 -0
  191. package/dist/operations/mutation/contradictions.js +40 -0
  192. package/dist/operations/mutation/delete.d.ts +5 -0
  193. package/dist/operations/mutation/delete.d.ts.map +1 -0
  194. package/dist/operations/mutation/delete.js +67 -0
  195. package/dist/operations/mutation/relationships.d.ts +17 -0
  196. package/dist/operations/mutation/relationships.d.ts.map +1 -0
  197. package/dist/operations/mutation/relationships.js +134 -0
  198. package/dist/operations/mutation/save.d.ts +4 -0
  199. package/dist/operations/mutation/save.d.ts.map +1 -0
  200. package/dist/operations/mutation/save.js +14 -0
  201. package/dist/operations/mutation/serialization.d.ts +5 -0
  202. package/dist/operations/mutation/serialization.d.ts.map +1 -0
  203. package/dist/operations/mutation/serialization.js +85 -0
  204. package/dist/operations/mutation/strict-fact.d.ts +4 -0
  205. package/dist/operations/mutation/strict-fact.d.ts.map +1 -0
  206. package/dist/operations/mutation/strict-fact.js +67 -0
  207. package/dist/operations/mutation/symbol-granularity.d.ts +4 -0
  208. package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -0
  209. package/dist/operations/mutation/symbol-granularity.js +109 -0
  210. package/dist/operations/mutation/symbol-refresh.d.ts +10 -0
  211. package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -0
  212. package/dist/operations/mutation/symbol-refresh.js +105 -0
  213. package/dist/operations/mutation/types.d.ts +43 -0
  214. package/dist/operations/mutation/types.d.ts.map +1 -0
  215. package/dist/operations/mutation/types.js +1 -0
  216. package/dist/operations/mutation/upsert.d.ts +5 -0
  217. package/dist/operations/mutation/upsert.d.ts.map +1 -0
  218. package/dist/operations/mutation/upsert.js +103 -0
  219. package/dist/operations/mutation/validate-upsert.d.ts +5 -0
  220. package/dist/operations/mutation/validate-upsert.d.ts.map +1 -0
  221. package/dist/operations/mutation/validate-upsert.js +50 -0
  222. package/dist/operations/mutation/validation.d.ts +5 -0
  223. package/dist/operations/mutation/validation.d.ts.map +1 -0
  224. package/dist/operations/mutation/validation.js +107 -0
  225. package/dist/operations/mutation/warnings.d.ts +4 -0
  226. package/dist/operations/mutation/warnings.d.ts.map +1 -0
  227. package/dist/operations/mutation/warnings.js +17 -0
  228. package/dist/operations/semantic-advisor/analysis-receipt.d.ts +5 -0
  229. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -0
  230. package/dist/operations/semantic-advisor/analysis-receipt.js +112 -0
  231. package/dist/operations/semantic-advisor/analyze-prose.d.ts +5 -0
  232. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -0
  233. package/dist/operations/semantic-advisor/analyze-prose.js +271 -0
  234. package/dist/operations/semantic-advisor/clauses.d.ts +10 -0
  235. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -0
  236. package/dist/operations/semantic-advisor/clauses.js +43 -0
  237. package/dist/operations/semantic-advisor/observation-plan.d.ts +3 -0
  238. package/dist/operations/semantic-advisor/observation-plan.d.ts.map +1 -0
  239. package/dist/operations/semantic-advisor/observation-plan.js +19 -0
  240. package/dist/operations/semantic-advisor/predicate-rule.d.ts +14 -0
  241. package/dist/operations/semantic-advisor/predicate-rule.d.ts.map +1 -0
  242. package/dist/operations/semantic-advisor/predicate-rule.js +22 -0
  243. package/dist/operations/semantic-advisor/predicate-rules-core.d.ts +79 -0
  244. package/dist/operations/semantic-advisor/predicate-rules-core.d.ts.map +1 -0
  245. package/dist/operations/semantic-advisor/predicate-rules-core.js +140 -0
  246. package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts +83 -0
  247. package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts.map +1 -0
  248. package/dist/operations/semantic-advisor/predicate-rules-policy.js +150 -0
  249. package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts +48 -0
  250. package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts.map +1 -0
  251. package/dist/operations/semantic-advisor/predicate-rules-product-tail.js +102 -0
  252. package/dist/operations/semantic-advisor/predicate-rules-product.d.ts +71 -0
  253. package/dist/operations/semantic-advisor/predicate-rules-product.d.ts.map +1 -0
  254. package/dist/operations/semantic-advisor/predicate-rules-product.js +133 -0
  255. package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts +29 -0
  256. package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts.map +1 -0
  257. package/dist/operations/semantic-advisor/prose-coverage-evaluator.js +54 -0
  258. package/dist/operations/semantic-advisor/shared.d.ts +18 -0
  259. package/dist/operations/semantic-advisor/shared.d.ts.map +1 -0
  260. package/dist/operations/semantic-advisor/shared.js +209 -0
  261. package/dist/operations/semantic-advisor/strict-count-rules.d.ts +4 -0
  262. package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -0
  263. package/dist/operations/semantic-advisor/strict-count-rules.js +62 -0
  264. package/dist/operations/semantic-advisor/strict-rules.d.ts +4 -0
  265. package/dist/operations/semantic-advisor/strict-rules.d.ts.map +1 -0
  266. package/dist/operations/semantic-advisor/strict-rules.js +106 -0
  267. package/dist/operations/semantic-advisor/types.d.ts +135 -0
  268. package/dist/operations/semantic-advisor/types.d.ts.map +1 -0
  269. package/dist/operations/semantic-advisor/types.js +1 -0
  270. package/dist/prolog/codec.d.ts.map +1 -1
  271. package/dist/prolog/codec.js +9 -2
  272. package/dist/prolog.d.ts +5 -0
  273. package/dist/prolog.d.ts.map +1 -1
  274. package/dist/prolog.js +82 -30
  275. package/dist/public/impact/diagnostics.d.ts.map +1 -1
  276. package/dist/public/impact/diagnostics.js +8 -4
  277. package/dist/public/impact/full-kb-quality.d.ts +1 -1
  278. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  279. package/dist/public/impact/full-kb-quality.js +34 -1
  280. package/dist/public/impact/requirement-quality.d.ts.map +1 -1
  281. package/dist/public/impact/requirement-quality.js +6 -23
  282. package/dist/public/operations/catalog.d.ts +907 -0
  283. package/dist/public/operations/catalog.d.ts.map +1 -0
  284. package/dist/public/operations/catalog.js +42 -0
  285. package/dist/public/operations/check-executor.d.ts +21 -0
  286. package/dist/public/operations/check-executor.d.ts.map +1 -0
  287. package/dist/public/operations/check-executor.js +111 -0
  288. package/dist/public/operations/check-format-shared.d.ts +36 -0
  289. package/dist/public/operations/check-format-shared.d.ts.map +1 -0
  290. package/dist/public/operations/check-format-shared.js +107 -0
  291. package/dist/public/operations/check-helpers.d.ts +10 -0
  292. package/dist/public/operations/check-helpers.d.ts.map +1 -0
  293. package/dist/public/operations/check-helpers.js +107 -0
  294. package/dist/public/operations/discovery-entities.d.ts +14 -0
  295. package/dist/public/operations/discovery-entities.d.ts.map +1 -0
  296. package/dist/public/operations/discovery-entities.js +91 -0
  297. package/dist/public/operations/discovery-executors.d.ts +39 -0
  298. package/dist/public/operations/discovery-executors.d.ts.map +1 -0
  299. package/dist/public/operations/discovery-executors.js +101 -0
  300. package/dist/public/operations/index.d.ts +20 -0
  301. package/dist/public/operations/index.d.ts.map +1 -0
  302. package/dist/public/operations/index.js +18 -0
  303. package/dist/public/operations/node-ports.d.ts +15 -0
  304. package/dist/public/operations/node-ports.d.ts.map +1 -0
  305. package/dist/public/operations/node-ports.js +57 -0
  306. package/dist/public/operations/prolog-json.d.ts +5 -0
  307. package/dist/public/operations/prolog-json.d.ts.map +1 -0
  308. package/dist/public/operations/prolog-json.js +44 -0
  309. package/dist/public/operations/runtime-types.d.ts +69 -0
  310. package/dist/public/operations/runtime-types.d.ts.map +1 -0
  311. package/dist/public/operations/runtime-types.js +17 -0
  312. package/dist/public/operations/specs/autopilot.d.ts +82 -0
  313. package/dist/public/operations/specs/autopilot.d.ts.map +1 -0
  314. package/dist/public/operations/specs/autopilot.js +72 -0
  315. package/dist/public/operations/specs/check.d.ts +51 -0
  316. package/dist/public/operations/specs/check.d.ts.map +1 -0
  317. package/dist/public/operations/specs/check.js +62 -0
  318. package/dist/public/operations/specs/discovery.d.ts +94 -0
  319. package/dist/public/operations/specs/discovery.d.ts.map +1 -0
  320. package/dist/public/operations/specs/discovery.js +98 -0
  321. package/dist/public/operations/specs/modeling.d.ts +126 -0
  322. package/dist/public/operations/specs/modeling.d.ts.map +1 -0
  323. package/dist/public/operations/specs/modeling.js +117 -0
  324. package/dist/public/operations/specs/mutation-schemas.d.ts +233 -0
  325. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -0
  326. package/dist/public/operations/specs/mutation-schemas.js +267 -0
  327. package/dist/public/operations/specs/mutation.d.ts +56 -0
  328. package/dist/public/operations/specs/mutation.d.ts.map +1 -0
  329. package/dist/public/operations/specs/mutation.js +44 -0
  330. package/dist/public/operations/specs/reporting.d.ts +185 -0
  331. package/dist/public/operations/specs/reporting.d.ts.map +1 -0
  332. package/dist/public/operations/specs/reporting.js +158 -0
  333. package/dist/public/operations/specs/semantic.d.ts +53 -0
  334. package/dist/public/operations/specs/semantic.d.ts.map +1 -0
  335. package/dist/public/operations/specs/semantic.js +105 -0
  336. package/dist/public/operations/specs/skills.d.ts +70 -0
  337. package/dist/public/operations/specs/skills.d.ts.map +1 -0
  338. package/dist/public/operations/specs/skills.js +107 -0
  339. package/dist/public/operations/specs/sparql.d.ts +39 -0
  340. package/dist/public/operations/specs/sparql.d.ts.map +1 -0
  341. package/dist/public/operations/specs/sparql.js +121 -0
  342. package/dist/public/operations/specs/upsert.d.ts +256 -0
  343. package/dist/public/operations/specs/upsert.d.ts.map +1 -0
  344. package/dist/public/operations/specs/upsert.js +27 -0
  345. package/dist/public/operations/types.d.ts +24 -0
  346. package/dist/public/operations/types.d.ts.map +1 -0
  347. package/dist/public/operations/types.js +1 -0
  348. package/dist/public/schemas/entity.d.ts.map +1 -1
  349. package/dist/public/schemas/entity.js +27 -0
  350. package/dist/public/skill-system/errors.d.ts +19 -0
  351. package/dist/public/skill-system/errors.d.ts.map +1 -0
  352. package/dist/public/skill-system/errors.js +36 -0
  353. package/dist/public/skill-system/loader.d.ts +9 -0
  354. package/dist/public/skill-system/loader.d.ts.map +1 -0
  355. package/dist/public/skill-system/loader.js +76 -0
  356. package/dist/public/skill-system/paths.d.ts +6 -0
  357. package/dist/public/skill-system/paths.d.ts.map +1 -0
  358. package/dist/public/skill-system/paths.js +25 -0
  359. package/dist/public/skill-system/types.d.ts +15 -0
  360. package/dist/public/skill-system/types.d.ts.map +1 -0
  361. package/dist/public/skill-system/types.js +1 -0
  362. package/dist/public/skill-system/validation.d.ts +10 -0
  363. package/dist/public/skill-system/validation.d.ts.map +1 -0
  364. package/dist/public/skill-system/validation.js +119 -0
  365. package/dist/public/skills/init-kibi/SKILL.md +62 -0
  366. package/dist/public/skills/kibi-freshness/SKILL.md +44 -0
  367. package/dist/public/skills/kibi-traceability/SKILL.md +54 -0
  368. package/dist/public/skills/kibi-usage/SKILL.md +119 -99
  369. package/dist/public/skills/kibi-usage/resources/fact-lanes.md +102 -0
  370. package/dist/public/skills/kibi-usage/resources/operation-access.md +44 -0
  371. package/dist/public/skills/kibi-usage/resources/workflows.md +26 -3
  372. package/dist/public/skills.d.ts +4 -41
  373. package/dist/public/skills.d.ts.map +1 -1
  374. package/dist/public/skills.js +3 -270
  375. package/dist/runtime/cli-runtime.d.ts +3 -0
  376. package/dist/runtime/cli-runtime.d.ts.map +1 -0
  377. package/dist/runtime/cli-runtime.js +96 -0
  378. package/dist/schemas/entity.schema.json +23 -0
  379. package/dist/traceability/staged-diagnostics.d.ts +1 -1
  380. package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
  381. package/dist/traceability/staged-symbols-manifest.d.ts +1 -0
  382. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  383. package/dist/traceability/staged-symbols-manifest.js +38 -27
  384. package/dist/traceability/symbol-extract.d.ts.map +1 -1
  385. package/dist/traceability/symbol-extract.js +17 -1
  386. package/dist/traceability/temp-kb.d.ts.map +1 -1
  387. package/dist/traceability/temp-kb.js +34 -1
  388. package/dist/types/entities.d.ts +3 -0
  389. package/dist/types/entities.d.ts.map +1 -1
  390. package/dist/utils/rule-registry.d.ts.map +1 -1
  391. package/dist/utils/rule-registry.js +6 -0
  392. package/package.json +56 -2
  393. package/src/public/impact/diagnostics.ts +18 -11
  394. package/src/public/impact/full-kb-quality.ts +30 -3
  395. package/src/public/impact/requirement-quality.ts +6 -26
  396. package/src/public/operations/catalog.ts +60 -0
  397. package/src/public/operations/check-executor.ts +185 -0
  398. package/src/public/operations/check-format-shared.ts +178 -0
  399. package/src/public/operations/check-helpers.ts +141 -0
  400. package/src/public/operations/discovery-entities.ts +122 -0
  401. package/src/public/operations/discovery-executors.ts +176 -0
  402. package/src/public/operations/index.ts +19 -0
  403. package/src/public/operations/node-ports.ts +78 -0
  404. package/src/public/operations/prolog-json.ts +71 -0
  405. package/src/public/operations/runtime-types.ts +106 -0
  406. package/src/public/operations/specs/autopilot.ts +98 -0
  407. package/src/public/operations/specs/check.ts +72 -0
  408. package/src/public/operations/specs/discovery.ts +126 -0
  409. package/src/public/operations/specs/modeling.ts +154 -0
  410. package/src/public/operations/specs/mutation-schemas.ts +296 -0
  411. package/src/public/operations/specs/mutation.ts +58 -0
  412. package/src/public/operations/specs/reporting.ts +249 -0
  413. package/src/public/operations/specs/semantic.ts +135 -0
  414. package/src/public/operations/specs/skills.ts +142 -0
  415. package/src/public/operations/specs/sparql.ts +149 -0
  416. package/src/public/operations/specs/upsert.ts +40 -0
  417. package/src/public/operations/types.ts +57 -0
  418. package/src/public/schemas/entity.ts +27 -0
  419. package/src/public/skill-system/errors.ts +38 -0
  420. package/src/public/skill-system/loader.ts +108 -0
  421. package/src/public/skill-system/paths.ts +27 -0
  422. package/src/public/skill-system/types.ts +14 -0
  423. package/src/public/skill-system/validation.ts +175 -0
  424. package/src/public/skills/init-kibi/SKILL.md +62 -0
  425. package/src/public/skills/kibi-freshness/SKILL.md +44 -0
  426. package/src/public/skills/kibi-traceability/SKILL.md +54 -0
  427. package/src/public/skills/kibi-usage/SKILL.md +119 -99
  428. package/src/public/skills/kibi-usage/resources/fact-lanes.md +102 -0
  429. package/src/public/skills/kibi-usage/resources/operation-access.md +44 -0
  430. package/src/public/skills/kibi-usage/resources/workflows.md +26 -3
  431. package/src/public/skills.ts +18 -427
  432. package/src/schemas/entity.schema.json +23 -0
@@ -0,0 +1,91 @@
1
+ import { buildGuidance } from "./guidance.js";
2
+ function strings(values) {
3
+ return [
4
+ ...new Set((values ?? []).map((value) => value.trim()).filter(Boolean)),
5
+ ];
6
+ }
7
+ export function normalizeBootstrapContext(input) {
8
+ const projectSummary = input?.projectSummary?.trim();
9
+ return {
10
+ ...(projectSummary ? { projectSummary } : {}),
11
+ sourceOfTruthPaths: strings(input?.sourceOfTruthPaths),
12
+ sourceOfTruthNotes: strings(input?.sourceOfTruthNotes),
13
+ priorityRoots: strings(input?.priorityRoots),
14
+ verificationAnchors: strings(input?.verificationAnchors),
15
+ };
16
+ }
17
+ function payoff(candidates) {
18
+ const projectedIfAllApplied = {};
19
+ for (const candidate of candidates)
20
+ projectedIfAllApplied[candidate.entityType] =
21
+ (projectedIfAllApplied[candidate.entityType] ?? 0) + 1;
22
+ return {
23
+ current: {},
24
+ projectedIfAllApplied,
25
+ delta: { ...projectedIfAllApplied },
26
+ };
27
+ }
28
+ export function presentAutopilot(input) {
29
+ const declaredContext = normalizeBootstrapContext(input.bootstrapContext);
30
+ const guidance = buildGuidance({
31
+ root: input.root,
32
+ activation: input.activation,
33
+ declared: declaredContext,
34
+ candidates: input.candidates,
35
+ signals: input.sourceOnlySignals,
36
+ warnings: input.discoverySummary.scanWarnings,
37
+ });
38
+ const confidenceLevel = String(guidance.confidence.level);
39
+ const applyBlocked = input.activation.applyBlocked ||
40
+ confidenceLevel === "medium" ||
41
+ confidenceLevel === "low";
42
+ const blockedFallback = input.activation.activationMode === "vendored_blocked"
43
+ ? `Autopilot bootstrap blocked: ${input.activation.reason}`
44
+ : input.activation.activationMode === "attached_thin_handoff" ||
45
+ input.activation.activationMode === "attached_seeded_handoff"
46
+ ? `Autopilot handoff: ${input.activation.reason}`
47
+ : "Bootstrap output found no safe candidates; follow the recommended actions to continue.";
48
+ const baseTldr = input.candidates.length + input.sourceOnlySignals.length > 0
49
+ ? `Bootstrap output is ready with ${input.candidates.length} safe candidate(s) and ${input.sourceOnlySignals.length} source-only authoring follow-up(s).`
50
+ : (input.activation.handoffMessage ?? blockedFallback);
51
+ const tldr = confidenceLevel === "low" && !input.activation.applyBlocked
52
+ ? `Low-confidence bootstrap (${String(guidance.confidence.score)}): review diagnostics before proceeding. ${baseTldr}`
53
+ : baseTldr;
54
+ const applyPlan = input.candidates.flatMap((candidate) => [
55
+ ...candidate.applyPlan,
56
+ ]);
57
+ const payoffSummary = payoff(input.candidates);
58
+ const structuredContent = {
59
+ activationState: input.activation.activationState,
60
+ activationMode: input.activation.activationMode,
61
+ bootstrapMode: input.activation.activationMode,
62
+ activationReason: input.activation.reason,
63
+ applyBlocked,
64
+ migrationWarning: input.migrationWarning,
65
+ ...(input.activation.handoffMessage
66
+ ? { handoffMessage: input.activation.handoffMessage }
67
+ : {}),
68
+ confidence: guidance.confidence,
69
+ tldr,
70
+ promptBlock: guidance.promptBlock,
71
+ recommendedActions: guidance.actions,
72
+ declaredContext,
73
+ discoverySummary: input.discoverySummary,
74
+ candidates: input.candidates,
75
+ applyPlan,
76
+ suppressedCandidates: input.suppressedCandidates,
77
+ payoffSummary,
78
+ };
79
+ const text = applyPlan.length > 0
80
+ ? `${tldr} Review structuredContent.applyPlan for exact sequential kb_upsert payloads before requesting approval.`
81
+ : tldr;
82
+ return {
83
+ content: [{ type: "text", text }],
84
+ structuredContent,
85
+ migrationWarning: input.migrationWarning,
86
+ candidates: input.candidates,
87
+ applyPlan,
88
+ suppressedCandidates: input.suppressedCandidates,
89
+ payoffSummary,
90
+ };
91
+ }
@@ -0,0 +1,3 @@
1
+ import type { SemanticClaim } from "../../utils/strict-modeling.js";
2
+ export declare function claimFor(statement: string, source: string, confidence: number, provenance: string): SemanticClaim | null;
3
+ //# sourceMappingURL=requirement-claims.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requirement-claims.d.ts","sourceRoot":"","sources":["../../../src/operations/autopilot/requirement-claims.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEpE,wBAAgB,QAAQ,CACtB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,aAAa,GAAG,IAAI,CAsDtB"}
@@ -0,0 +1,48 @@
1
+ export function claimFor(statement, source, confidence, provenance) {
2
+ const normalized = statement.replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "").trim();
3
+ const retention = normalized.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+retained\s+for\s+(?<value>\d+)\s+(?<unit>day|days|month|months|year|years)\.?$/i);
4
+ if (retention?.groups?.subject &&
5
+ retention.groups.value &&
6
+ retention.groups.unit) {
7
+ const unit = retention.groups.unit.toLowerCase().startsWith("day")
8
+ ? "Days"
9
+ : retention.groups.unit.toLowerCase().startsWith("month")
10
+ ? "Months"
11
+ : "Years";
12
+ return {
13
+ source,
14
+ subjectKey: retention.groups.subject
15
+ .replace(/^(the|a|an)\s+/i, "")
16
+ .trim(),
17
+ propertyKey: `Retention ${unit}`,
18
+ operator: "eq",
19
+ value: Number(retention.groups.value),
20
+ confidence,
21
+ provenance,
22
+ };
23
+ }
24
+ const state = normalized.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+(?<value>enabled|disabled)\.?$/i);
25
+ if (state?.groups?.subject && state.groups.value) {
26
+ return {
27
+ source,
28
+ subjectKey: state.groups.subject.trim(),
29
+ propertyKey: "enabled",
30
+ operator: "bool",
31
+ value: state.groups.value.toLowerCase() === "enabled",
32
+ confidence,
33
+ provenance,
34
+ };
35
+ }
36
+ const polarity = normalized.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+(?<negative>not\s+)?(?<predicate>.+?)\.?$/i);
37
+ if (!polarity?.groups?.subject || !polarity.groups.predicate)
38
+ return null;
39
+ return {
40
+ source,
41
+ subjectKey: polarity.groups.subject.trim(),
42
+ propertyKey: polarity.groups.predicate.trim(),
43
+ operator: "polarity",
44
+ value: polarity.groups.negative ? "forbid" : "require",
45
+ confidence,
46
+ provenance,
47
+ };
48
+ }
@@ -0,0 +1,117 @@
1
+ import type { OperationResult } from "../../public/operations/types.js";
2
+ export type AutopilotBootstrapContext = {
3
+ readonly projectSummary?: string;
4
+ readonly sourceOfTruthPaths?: readonly string[];
5
+ readonly sourceOfTruthNotes?: readonly string[];
6
+ readonly priorityRoots?: readonly string[];
7
+ readonly verificationAnchors?: readonly string[];
8
+ };
9
+ export type AutopilotGenerateArgs = {
10
+ readonly includeGenericMarkdown?: boolean;
11
+ readonly minConfidence?: number;
12
+ readonly maxCandidates?: number;
13
+ readonly entityTypes?: readonly ("req" | "scenario" | "test" | "adr" | "fact" | "symbol")[];
14
+ readonly bootstrapContext?: AutopilotBootstrapContext;
15
+ };
16
+ export type AutopilotConfidence = {
17
+ readonly score: number;
18
+ readonly level: "high" | "medium" | "low";
19
+ readonly reasons: readonly string[];
20
+ readonly policy: "full_actions" | "review_required" | "handoff_only";
21
+ };
22
+ export type AutopilotRecommendedAction = {
23
+ readonly order: number;
24
+ readonly kind: "query" | "upsert" | "check" | "handoff";
25
+ readonly description: string;
26
+ readonly candidateIds?: readonly string[];
27
+ };
28
+ export type AutopilotDeclaredContext = {
29
+ readonly projectSummary?: string;
30
+ readonly sourceOfTruthPaths: readonly string[];
31
+ readonly sourceOfTruthNotes: readonly string[];
32
+ readonly priorityRoots: readonly string[];
33
+ readonly verificationAnchors: readonly string[];
34
+ };
35
+ export type ActivationState = "root_uninitialized" | "root_partial" | "vendored_only" | "root_active_thin" | "root_active_seeded";
36
+ export type ActivationMode = "cold_start_bootstrap" | "repair_bootstrap" | "attached_thin_handoff" | "attached_seeded_handoff" | "vendored_blocked";
37
+ export declare const AUTOPILOT_PROVIDER_ORDER: readonly ["typed_kibi_docs", "generic_repo_docs", "repo_metadata", "repo_layout", "test_topology", "source_symbols"];
38
+ export type EvidenceProviderName = (typeof AUTOPILOT_PROVIDER_ORDER)[number];
39
+ export type EvidenceKind = "typed_markdown" | "symbol_manifest" | "generic_markdown" | "repo_metadata" | "repo_layout" | "test_topology" | "source_symbols";
40
+ export type ActivationPolicy = {
41
+ readonly activationState: ActivationState;
42
+ readonly activationMode: ActivationMode;
43
+ readonly applyBlocked: boolean;
44
+ readonly allowCandidateGeneration: boolean;
45
+ readonly reason: string;
46
+ readonly handoffMessage?: string;
47
+ };
48
+ export type AutopilotEvidence = {
49
+ readonly provider: EvidenceProviderName;
50
+ readonly kind: EvidenceKind;
51
+ readonly label: string;
52
+ readonly relativePath?: string;
53
+ readonly absolutePath?: string;
54
+ readonly content?: string;
55
+ readonly data: Readonly<Record<string, unknown>>;
56
+ };
57
+ export type DiscoverySummary = {
58
+ readonly activationState: ActivationState;
59
+ readonly activationMode: ActivationMode;
60
+ readonly applyBlocked: boolean;
61
+ readonly reason: string;
62
+ readonly handoffMessage?: string;
63
+ readonly vendored?: readonly string[];
64
+ readonly providersRun: readonly EvidenceProviderName[];
65
+ readonly providerCounts: Readonly<Record<string, number>>;
66
+ readonly detectedLanguages: readonly string[];
67
+ readonly detectedTestFrameworks: readonly string[];
68
+ readonly excludedRoots: readonly string[];
69
+ readonly truncated: boolean;
70
+ readonly scanWarnings: readonly string[];
71
+ };
72
+ export type DiscoveryResult = {
73
+ readonly activation: ActivationPolicy;
74
+ readonly evidence: readonly AutopilotEvidence[];
75
+ readonly ignoredSources: readonly string[];
76
+ readonly summary: DiscoverySummary;
77
+ readonly migrationWarning: string | null;
78
+ };
79
+ export type Candidate = {
80
+ readonly candidateId: string;
81
+ readonly entityType: string;
82
+ readonly title: string;
83
+ readonly sourceKind: string;
84
+ readonly sourcePath: string;
85
+ readonly confidence: number;
86
+ readonly confidenceBand: string;
87
+ readonly evidence: readonly string[];
88
+ readonly relationships: readonly {
89
+ readonly type: string;
90
+ readonly from: string;
91
+ readonly to: string;
92
+ }[];
93
+ readonly applyPlan: readonly Readonly<Record<string, unknown>>[];
94
+ };
95
+ export type SourceOnlySignal = {
96
+ readonly kind: "req" | "scenario" | "test";
97
+ readonly title: string;
98
+ readonly sourcePath: string;
99
+ readonly confidence: number;
100
+ readonly evidence: readonly string[];
101
+ };
102
+ export type AutopilotStructuredContent = Readonly<Record<string, unknown>> & {
103
+ readonly tldr: string;
104
+ readonly activationReason: string;
105
+ readonly candidates: readonly Readonly<Record<string, unknown>>[];
106
+ readonly applyPlan: readonly Readonly<Record<string, unknown>>[];
107
+ readonly suppressedCandidates: readonly Readonly<Record<string, unknown>>[];
108
+ };
109
+ export type AutopilotGenerateResult = OperationResult<AutopilotStructuredContent> & {
110
+ readonly structuredContent: AutopilotStructuredContent;
111
+ readonly migrationWarning: string | null;
112
+ readonly candidates: readonly Readonly<Record<string, unknown>>[];
113
+ readonly applyPlan: readonly Readonly<Record<string, unknown>>[];
114
+ readonly suppressedCandidates: readonly Readonly<Record<string, unknown>>[];
115
+ readonly payoffSummary: Readonly<Record<string, unknown>>;
116
+ };
117
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/operations/autopilot/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAC1C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAC5B,KAAK,GACL,UAAU,GACV,MAAM,GACN,KAAK,GACL,MAAM,GACN,QAAQ,CACX,EAAE,CAAC;IACJ,QAAQ,CAAC,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,i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AE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC3D,CAAC"}
@@ -0,0 +1,8 @@
1
+ export const AUTOPILOT_PROVIDER_ORDER = [
2
+ "typed_kibi_docs",
3
+ "generic_repo_docs",
4
+ "repo_metadata",
5
+ "repo_layout",
6
+ "test_topology",
7
+ "source_symbols",
8
+ ];
@@ -0,0 +1,10 @@
1
+ import type { OperationContext } from "../../public/operations/runtime-types.js";
2
+ import { strictWriteSetToApplyPlan, writeSetPrimaryEntityId } from "./requirement-applyplan.js";
3
+ import { estimateNormativeSignalConfidence, extractRequirementClaim } from "./requirement-modeler.js";
4
+ import type { ModelRequirementArgs, ModelRequirementResult } from "./requirement-types.js";
5
+ export type { ModelRequirementArgs, ModelRequirementResult, } from "./requirement-types.js";
6
+ export { estimateNormativeSignalConfidence, extractRequirementClaim, strictWriteSetToApplyPlan, writeSetPrimaryEntityId, };
7
+ export declare function getWorkspaceMigrationWarning(workspaceRoot: string): Promise<string | null>;
8
+ export declare function handleKbModelRequirement(_prolog: unknown, args: ModelRequirementArgs, workspaceRoot: string): Promise<ModelRequirementResult>;
9
+ export declare function executeModelRequirement(args: ModelRequirementArgs, context: OperationContext): Promise<ModelRequirementResult>;
10
+ //# sourceMappingURL=model-requirement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-requirement.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/model-requirement.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAGjF,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAMhC,YAAY,EACV,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,GACxB,CAAC;AAEF,wBAAsB,4BAA4B,CAChD,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgBxB;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,oBAAoB,EAC1B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,CAAC,CAmFjC;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC,CAEjC"}
@@ -0,0 +1,108 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { buildStrictWriteSet } from "../../public/check-types.js";
4
+ import { getSchemaVersionStatus } from "../../public/schema-version.js";
5
+ import { semanticClaimKey } from "../semantic-advisor/clauses.js";
6
+ import { strictWriteSetToApplyPlan, writeSetPrimaryEntityId, } from "./requirement-applyplan.js";
7
+ import { estimateNormativeSignalConfidence, extractRequirementClaim, } from "./requirement-modeler.js";
8
+ import { normalizeOptionalString, normalizeSourceFiles, } from "./requirement-utils.js";
9
+ export { estimateNormativeSignalConfidence, extractRequirementClaim, strictWriteSetToApplyPlan, writeSetPrimaryEntityId, };
10
+ export async function getWorkspaceMigrationWarning(workspaceRoot) {
11
+ const configPath = path.join(workspaceRoot, ".kb", "config.json");
12
+ let rawConfig;
13
+ try {
14
+ rawConfig = await readFile(configPath, "utf8");
15
+ }
16
+ catch {
17
+ return null;
18
+ }
19
+ try {
20
+ const parsed = JSON.parse(rawConfig);
21
+ return getSchemaVersionStatus(parsed ?? undefined).warning;
22
+ }
23
+ catch {
24
+ return "KB config schemaVersion could not be read and should be checked before applying automated modeling.";
25
+ }
26
+ }
27
+ export async function handleKbModelRequirement(_prolog, args, workspaceRoot) {
28
+ const extracted = extractRequirementClaim({
29
+ ...args,
30
+ source: normalizeOptionalString(args.source) ??
31
+ normalizeSourceFiles(args.sourceFiles)[0] ??
32
+ "mcp://kibi/model-requirement",
33
+ });
34
+ const writeSet = buildStrictWriteSet({
35
+ claim: extracted.claim,
36
+ statement: extracted.statement,
37
+ });
38
+ const claimKey = semanticClaimKey(extracted.statement);
39
+ const logicClaims = Array.from(new Set([...(args.existingLogicClaims ?? []), claimKey]));
40
+ const applyPlan = strictWriteSetToApplyPlan(writeSet).map((step) => {
41
+ const properties = step.properties !== null && typeof step.properties === "object"
42
+ ? step.properties
43
+ : {};
44
+ if (step.type === "fact") {
45
+ return {
46
+ ...step,
47
+ properties: {
48
+ ...properties,
49
+ claim_key: claimKey,
50
+ claim_text: extracted.statement,
51
+ },
52
+ };
53
+ }
54
+ if (step.type === "req") {
55
+ return {
56
+ ...step,
57
+ properties: { ...properties, logic_claims: logicClaims },
58
+ };
59
+ }
60
+ return step;
61
+ });
62
+ const migrationWarning = await getWorkspaceMigrationWarning(workspaceRoot);
63
+ const warnings = writeSet.isStrict
64
+ ? []
65
+ : [
66
+ {
67
+ kind: "low_confidence_observation_downgrade",
68
+ message: `Claim confidence ${writeSet.confidence.toFixed(2)} is below the strict threshold 0.70, so Kibi emitted an observation fact instead of strict subject/property facts.`,
69
+ nextAction: "If this is normative, provide subjectKey, propertyKey, operator, and value explicitly, then apply the returned strict write-set sequentially.",
70
+ },
71
+ ];
72
+ const strictSummary = writeSet.isStrict
73
+ ? `Modeled strict requirement into ${applyPlan.length} sequential applyPlan step(s).`
74
+ : "Modeled a non-blocking observation review artifact; deterministic claim extraction stayed below the strict threshold.";
75
+ const structuredContent = {
76
+ statement: extracted.statement,
77
+ claimKey,
78
+ logicClaims,
79
+ source: extracted.source,
80
+ sourceFiles: extracted.sourceFiles,
81
+ claim: extracted.claim,
82
+ writeSet,
83
+ applyPlan,
84
+ isStrict: writeSet.isStrict,
85
+ confidence: writeSet.confidence,
86
+ extractionMode: extracted.extractionMode,
87
+ extractionWarnings: extracted.extractionWarnings,
88
+ warnings,
89
+ migrationWarning,
90
+ };
91
+ return {
92
+ content: [
93
+ {
94
+ type: "text",
95
+ text: migrationWarning
96
+ ? `${strictSummary} Migration warning included.`
97
+ : strictSummary,
98
+ },
99
+ ],
100
+ structuredContent,
101
+ applyPlan,
102
+ writeSet,
103
+ migrationWarning,
104
+ };
105
+ }
106
+ export async function executeModelRequirement(args, context) {
107
+ return handleKbModelRequirement(context.prolog, args, context.workspaceRoot);
108
+ }
@@ -0,0 +1,6 @@
1
+ import type { PredicateSchemaCandidate, PredicateSuggestion, SuggestPredicatesArgs } from "./predicate-types.js";
2
+ export declare function buildSuggestion(schema: PredicateSchemaCandidate, text: string, subject: string, score: number): PredicateSuggestion;
3
+ export declare function buildPredicateApplyPlan(suggestion: PredicateSuggestion, args: SuggestPredicatesArgs): Array<Record<string, unknown>>;
4
+ export declare function buildRelationshipPlan(factId: string | undefined, requirementId: string | undefined, claimText?: string, existingLogicClaims?: readonly string[]): Record<string, unknown> | null;
5
+ export declare function buildGapApplyPlan(text: string, args: SuggestPredicatesArgs): Array<Record<string, unknown>>;
6
+ //# sourceMappingURL=predicate-applyplan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate-applyplan.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-applyplan.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAI9B,wBAAgB,eAAe,CAC7B,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,mBAAmB,CAarB;AAGD,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,mBAAmB,EAC/B,IAAI,EAAE,qBAAqB,GAC1B,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAgChC;AAGD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,SAAS,CAAC,EAAE,MAAM,EAClB,mBAAmB,GAAE,SAAS,MAAM,EAAO,GAC1C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAwBhC;AAGD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,qBAAqB,GAC1B,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAyBhC"}
@@ -0,0 +1,104 @@
1
+ import { semanticClaimKey } from "../semantic-advisor/clauses.js";
2
+ import { inferArgs } from "./predicate-inference.js";
3
+ import { schemaForCandidate } from "./predicate-loader.js";
4
+ import { hashId } from "./predicate-utils.js";
5
+ // implements REQ-mcp-suggest-predicates
6
+ export function buildSuggestion(schema, text, subject, score) {
7
+ const predicateArgs = inferArgs(schema, text, subject);
8
+ const canonicalKey = `${schema.predicate_name}(${predicateArgs.join(",")})`;
9
+ return {
10
+ id: hashId("SUGGEST", [schema.id, canonicalKey, text]),
11
+ predicate_name: schema.predicate_name,
12
+ predicate_args: predicateArgs,
13
+ canonical_key: canonicalKey,
14
+ polarity: "assert",
15
+ score,
16
+ rationale: `Matched ${schema.predicate_name} because the prose overlaps with ${schema.tags.join(", ")} cues.`,
17
+ schema: schemaForCandidate(schema),
18
+ };
19
+ }
20
+ // implements REQ-mcp-suggest-predicates
21
+ export function buildPredicateApplyPlan(suggestion, args) {
22
+ const claimKey = semanticClaimKey(args.text);
23
+ const factId = hashId("FACT-PRED", [
24
+ args.requirementId ?? "",
25
+ args.source ?? "",
26
+ suggestion.canonical_key,
27
+ ]);
28
+ return [
29
+ {
30
+ type: "fact",
31
+ id: factId,
32
+ properties: {
33
+ title: `Predicate: ${suggestion.canonical_key}`,
34
+ status: "active",
35
+ source: args.source ?? "mcp://kibi/suggest-predicates",
36
+ text_ref: args.source,
37
+ tags: [
38
+ "lane:ontology",
39
+ "predicate-suggestion",
40
+ ...suggestion.schema.tags.map((tag) => `predicate:${tag}`),
41
+ ],
42
+ fact_kind: "predicate",
43
+ predicate_name: suggestion.predicate_name,
44
+ predicate_args: suggestion.predicate_args,
45
+ canonical_key: suggestion.canonical_key,
46
+ polarity: suggestion.polarity,
47
+ claim_key: claimKey,
48
+ claim_text: args.text.trim(),
49
+ },
50
+ relationships: [],
51
+ },
52
+ ];
53
+ }
54
+ // implements REQ-mcp-suggest-predicates
55
+ export function buildRelationshipPlan(factId, requirementId, claimText, existingLogicClaims = []) {
56
+ if (!factId || !requirementId)
57
+ return null;
58
+ const claimKey = claimText ? semanticClaimKey(claimText) : null;
59
+ const logicClaims = Array.from(new Set([...existingLogicClaims, ...(claimKey === null ? [] : [claimKey])]));
60
+ return {
61
+ applyAfter: factId,
62
+ requiresExistingReq: requirementId,
63
+ relationship: {
64
+ type: "requires_predicate",
65
+ from: requirementId,
66
+ to: factId,
67
+ },
68
+ ...(claimText
69
+ ? {
70
+ claimKey,
71
+ claimText: claimText.trim(),
72
+ logicClaims,
73
+ }
74
+ : {}),
75
+ instructions: "Apply the predicate fact first, update the requirement with the returned merged logicClaims manifest, then attach this relationship without overwriting other requirement metadata.",
76
+ };
77
+ }
78
+ // implements REQ-mcp-suggest-predicates
79
+ export function buildGapApplyPlan(text, args) {
80
+ const claimKey = semanticClaimKey(text);
81
+ const factId = hashId("FACT-ONTOLOGY-GAP", [
82
+ args.requirementId ?? "",
83
+ args.source ?? "",
84
+ text,
85
+ ]);
86
+ return [
87
+ {
88
+ type: "fact",
89
+ id: factId,
90
+ properties: {
91
+ title: "Ontology gap: predicate schema needed",
92
+ status: "active",
93
+ source: args.source ?? "mcp://kibi/suggest-predicates",
94
+ text_ref: args.source,
95
+ tags: ["review:ontology-gap", "needs_schema_extension"],
96
+ fact_kind: "observation",
97
+ value_string: text,
98
+ claim_key: claimKey,
99
+ claim_text: text,
100
+ },
101
+ relationships: [],
102
+ },
103
+ ];
104
+ }
@@ -0,0 +1,3 @@
1
+ import type { PredicateSchemaCandidate } from "./predicate-types.js";
2
+ export declare const PREDICATE_CATALOG_1: PredicateSchemaCandidate[];
3
+ //# sourceMappingURL=predicate-catalog-1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate-catalog-1.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-catalog-1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGrE,eAAO,MAAM,mBAAmB,EAAE,wBAAwB,EAmNzD,CAAC"}