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
@@ -0,0 +1,107 @@
1
+ import { createHash } from "node:crypto";
2
+ import { listBundledSkills, loadBundledSkill, readBundledSkillResource, } from "../../skills.js";
3
+ function assertNonEmptyString(value, field) {
4
+ if (typeof value !== "string" || value.trim() === "") {
5
+ throw new Error(`${field} must be a non-empty string`);
6
+ }
7
+ }
8
+ async function executeSkillsList(_input, _context) {
9
+ const skills = listBundledSkills();
10
+ const ids = skills.map((skill) => skill.id).join(", ") || "none";
11
+ return {
12
+ content: [
13
+ { type: "text", text: `Found ${skills.length} bundled skills: ${ids}` },
14
+ ],
15
+ structuredContent: { skills },
16
+ };
17
+ }
18
+ async function executeSkillsLoad(input, _context) {
19
+ const id = typeof input.id === "string" ? input.id : "";
20
+ assertNonEmptyString(id, "id");
21
+ const bundle = loadBundledSkill(id);
22
+ const resources = bundle.manifest.resources ?? [];
23
+ const contentHash = createHash("sha256")
24
+ .update(bundle.body, "utf8")
25
+ .digest("hex");
26
+ const resourceList = resources.length === 0 ? "none" : resources.join(", ");
27
+ return {
28
+ content: [
29
+ {
30
+ type: "text",
31
+ text: `Loaded bundled skill ${bundle.manifest.id} with ${resources.length} resources: ${resourceList}`,
32
+ },
33
+ ],
34
+ structuredContent: {
35
+ metadata: bundle.manifest,
36
+ body: bundle.body,
37
+ resources,
38
+ contentHash,
39
+ sourceType: "bundled",
40
+ },
41
+ };
42
+ }
43
+ async function executeSkillsRead(input, _context) {
44
+ const id = typeof input.id === "string" ? input.id : "";
45
+ const resource = typeof input.resource === "string" ? input.resource : "";
46
+ assertNonEmptyString(id, "id");
47
+ assertNonEmptyString(resource, "resource");
48
+ const resourceContent = readBundledSkillResource(id, resource);
49
+ return {
50
+ content: [
51
+ {
52
+ type: "text",
53
+ text: `Read bundled skill resource ${id}/${resource}`,
54
+ },
55
+ ],
56
+ structuredContent: { content: resourceContent },
57
+ };
58
+ }
59
+ export const skillsListSpec = {
60
+ name: "kb_skills_list",
61
+ cliName: "skills list",
62
+ description: "List bundled Kibi agent skills available for progressive disclosure. Read-only; does not mutate the KB or require Prolog.",
63
+ businessInputSchema: { type: "object", properties: {} },
64
+ requiresProlog: false,
65
+ effects: ["local-read"],
66
+ execute: executeSkillsList,
67
+ };
68
+ export const skillsLoadSpec = {
69
+ name: "kb_skills_load",
70
+ cliName: "skills load",
71
+ description: "Load a bundled Kibi agent skill by ID, returning its manifest metadata, Markdown body, declared resources, content hash, and source type. Read-only; does not execute scripts or require Prolog.",
72
+ businessInputSchema: {
73
+ type: "object",
74
+ required: ["id"],
75
+ properties: {
76
+ id: {
77
+ type: "string",
78
+ description: "Bundled skill ID to load. Example: 'kibi-usage'.",
79
+ },
80
+ },
81
+ },
82
+ requiresProlog: false,
83
+ effects: ["local-read"],
84
+ execute: executeSkillsLoad,
85
+ };
86
+ export const skillsReadSpec = {
87
+ name: "kb_skills_read",
88
+ cliName: "skills read",
89
+ description: "Read a declared resource from a bundled Kibi agent skill. Resource paths are restricted to the skill manifest; arbitrary file paths are not exposed. Read-only; does not require Prolog.",
90
+ businessInputSchema: {
91
+ type: "object",
92
+ required: ["id", "resource"],
93
+ properties: {
94
+ id: {
95
+ type: "string",
96
+ description: "Bundled skill ID. Example: 'kibi-usage'.",
97
+ },
98
+ resource: {
99
+ type: "string",
100
+ description: "Manifest-declared resource path to read. Example: 'resources/workflows.md'.",
101
+ },
102
+ },
103
+ },
104
+ requiresProlog: false,
105
+ effects: ["local-read"],
106
+ execute: executeSkillsRead,
107
+ };
@@ -0,0 +1,39 @@
1
+ import type { OperationContext } from "../runtime-types.js";
2
+ import type { OperationResult } from "../types.js";
3
+ export type SparqlRemoteInput = {
4
+ readonly endpoint: string;
5
+ readonly query: string;
6
+ readonly timeoutMs?: number;
7
+ };
8
+ export type SparqlRemoteOutput = {
9
+ readonly rows: readonly Readonly<Record<string, unknown>>[];
10
+ };
11
+ declare function executeSparqlRemote(input: SparqlRemoteInput, context: OperationContext): Promise<OperationResult<SparqlRemoteOutput>>;
12
+ export declare const sparqlRemoteSpec: {
13
+ readonly name: "kb_sparql_remote";
14
+ readonly cliName: "sparql-remote";
15
+ readonly description: "Opt-in remote SPARQL query tool for external HTTP(S) RDF endpoints. This does not query Kibi's local RDF store directly, stores no credentials, and depends on network availability.";
16
+ readonly businessInputSchema: {
17
+ readonly type: "object";
18
+ readonly required: readonly ["endpoint", "query"];
19
+ readonly properties: {
20
+ readonly endpoint: {
21
+ readonly type: "string";
22
+ readonly description: "Remote SPARQL endpoint URL. Must start with http:// or https://.";
23
+ };
24
+ readonly query: {
25
+ readonly type: "string";
26
+ readonly description: "SPARQL SELECT query to send to the remote endpoint.";
27
+ };
28
+ readonly timeoutMs: {
29
+ readonly type: "number";
30
+ readonly description: "Optional positive timeout in milliseconds for the remote query.";
31
+ };
32
+ };
33
+ };
34
+ readonly requiresProlog: false;
35
+ readonly effects: readonly ["network-read"];
36
+ readonly execute: typeof executeSparqlRemote;
37
+ };
38
+ export {};
39
+ //# sourceMappingURL=sparql.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sparql.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/sparql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,aAAa,CAAC;AAGlE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,IAAI,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC7D,CAAC;AA2DF,iBAAe,mBAAmB,CAChC,KAAK,EAAE,iBAAiB,EACxB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,CA2C9C;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;CA4B4C,CAAC"}
@@ -0,0 +1,121 @@
1
+ function validateInput(input) {
2
+ if (typeof input.endpoint !== "string" || input.endpoint.trim() === "") {
3
+ throw new Error("SPARQL endpoint is required");
4
+ }
5
+ if (typeof input.query !== "string" || input.query.trim() === "") {
6
+ throw new Error("SPARQL query is required");
7
+ }
8
+ let endpoint;
9
+ try {
10
+ endpoint = new URL(input.endpoint);
11
+ }
12
+ catch {
13
+ throw new Error("SPARQL endpoint must be an http:// or https:// URL");
14
+ }
15
+ if (endpoint.protocol !== "http:" && endpoint.protocol !== "https:") {
16
+ throw new Error("SPARQL endpoint must be an http:// or https:// URL");
17
+ }
18
+ if (!/^\s*select\b/i.test(input.query)) {
19
+ throw new Error("SPARQL query must be a SELECT query");
20
+ }
21
+ if (input.timeoutMs !== undefined &&
22
+ (!Number.isFinite(input.timeoutMs) || input.timeoutMs <= 0)) {
23
+ throw new Error("SPARQL timeoutMs must be a positive number when provided");
24
+ }
25
+ return endpoint;
26
+ }
27
+ function isRecord(value) {
28
+ return value !== null && typeof value === "object" && !Array.isArray(value);
29
+ }
30
+ function decodeRows(payload) {
31
+ if (!isRecord(payload) || !isRecord(payload.results)) {
32
+ throw new Error("SPARQL endpoint returned an invalid result document");
33
+ }
34
+ const bindings = payload.results.bindings;
35
+ if (!Array.isArray(bindings)) {
36
+ throw new Error("SPARQL endpoint returned an invalid bindings array");
37
+ }
38
+ const rows = bindings.map((binding) => {
39
+ if (!isRecord(binding)) {
40
+ throw new Error("SPARQL endpoint returned an invalid binding");
41
+ }
42
+ const row = {};
43
+ for (const [variable, term] of Object.entries(binding)) {
44
+ if (!isRecord(term) || typeof term.value !== "string") {
45
+ throw new Error(`SPARQL endpoint returned an invalid ${variable} term`);
46
+ }
47
+ row[variable] = term.value;
48
+ }
49
+ return row;
50
+ });
51
+ return { rows };
52
+ }
53
+ // implements REQ-kibi-operation-interface-parity, REQ-002, REQ-013
54
+ async function executeSparqlRemote(input, context) {
55
+ const endpoint = validateInput(input);
56
+ if (context.net === undefined) {
57
+ throw new Error("SPARQL remote query requires a network port");
58
+ }
59
+ const signal = input.timeoutMs === undefined
60
+ ? context.signal
61
+ : AbortSignal.any([
62
+ context.signal,
63
+ AbortSignal.timeout(Math.max(1, Math.ceil(input.timeoutMs / 1_000)) * 1_000),
64
+ ]);
65
+ try {
66
+ const response = await context.net.fetch(endpoint, {
67
+ method: "POST",
68
+ headers: {
69
+ accept: "application/sparql-results+json",
70
+ "content-type": "application/x-www-form-urlencoded;charset=UTF-8",
71
+ },
72
+ body: new URLSearchParams({ query: input.query }),
73
+ signal,
74
+ });
75
+ if (!response.ok) {
76
+ throw new Error(`SPARQL endpoint returned HTTP ${response.status}`);
77
+ }
78
+ const payload = await response.json();
79
+ const structuredContent = decodeRows(payload);
80
+ const rowCount = structuredContent.rows.length;
81
+ return {
82
+ content: [
83
+ {
84
+ type: "text",
85
+ text: `Remote SPARQL query returned ${rowCount} row${rowCount === 1 ? "" : "s"}.`,
86
+ },
87
+ ],
88
+ structuredContent,
89
+ };
90
+ }
91
+ catch (error) {
92
+ const message = error instanceof Error ? error.message : String(error);
93
+ throw new Error(`SPARQL remote query failed: ${message}`);
94
+ }
95
+ }
96
+ export const sparqlRemoteSpec = {
97
+ name: "kb_sparql_remote",
98
+ cliName: "sparql-remote",
99
+ description: "Opt-in remote SPARQL query tool for external HTTP(S) RDF endpoints. This does not query Kibi's local RDF store directly, stores no credentials, and depends on network availability.",
100
+ businessInputSchema: {
101
+ type: "object",
102
+ required: ["endpoint", "query"],
103
+ properties: {
104
+ endpoint: {
105
+ type: "string",
106
+ description: "Remote SPARQL endpoint URL. Must start with http:// or https://.",
107
+ },
108
+ query: {
109
+ type: "string",
110
+ description: "SPARQL SELECT query to send to the remote endpoint.",
111
+ },
112
+ timeoutMs: {
113
+ type: "number",
114
+ description: "Optional positive timeout in milliseconds for the remote query.",
115
+ },
116
+ },
117
+ },
118
+ requiresProlog: false,
119
+ effects: ["network-read"],
120
+ execute: executeSparqlRemote,
121
+ };
@@ -0,0 +1,291 @@
1
+ import { executeUpsert } from "../../../operations/mutation/upsert.js";
2
+ export declare const upsertSpec: {
3
+ readonly name: "kb_upsert";
4
+ readonly cliName: "upsert";
5
+ readonly description: "Create or update one entity and optional relationships. Use for KB mutations after validating intent; prefer kb_validate_upsert first because it returns semantic advisor receipts for prose-heavy requirements. Use kb_model_requirement before hand-writing strict property facts from prose, and kb_suggest_predicates before hand-writing ontology predicate facts. Use the `relationships` array for batch creation of multiple links in a single call (e.g., linking a requirement to multiple tests or facts). Prefer modeling requirements as reusable fact links (`constrains`, `requires_property`, or `requires_predicate`) so consistency and contradiction checks remain queryable. Relationship endpoints must already exist in KB. For requirements, the write will be rejected if it contradicts existing current requirements that constrain the same subject with incompatible properties. To replace a conflicting requirement, include a `supersedes` relationship from the new requirement to the old one in the same request. Successful writes may return non-blocking semantic advisor warnings; inspect and repair those warnings before treating prose as contradiction-checkable. Do not use for read-only inspection. Side effects: writes KB, may refresh symbol coordinates.";
6
+ readonly businessInputSchema: {
7
+ readonly type: "object";
8
+ readonly required: readonly ["type", "id", "properties"];
9
+ readonly properties: {
10
+ readonly type: {
11
+ readonly type: "string";
12
+ readonly enum: readonly ["req", "scenario", "test", "adr", "flag", "event", "symbol", "fact"];
13
+ readonly description: "Entity type to create/update. Allowed: req, scenario, test, adr, flag, event, symbol, fact. Example: 'req'.";
14
+ };
15
+ readonly id: {
16
+ readonly type: "string";
17
+ readonly description: "Unique entity ID (string). Example: 'REQ-123'. Existing ID updates the entity; new ID creates it.";
18
+ };
19
+ readonly properties: {
20
+ readonly type: "object";
21
+ readonly description: "Entity fields to persist. Must include title and status. If created_at, updated_at, or source are omitted, server fills defaults.";
22
+ readonly properties: {
23
+ readonly title: {
24
+ readonly type: "string";
25
+ readonly description: "Required short title. Example: 'Protect account settings endpoint'.";
26
+ };
27
+ readonly status: {
28
+ readonly type: "string";
29
+ readonly description: "Required lifecycle state. Allowed values depend on entity type; backward-compatible legacy statuses are also accepted. Examples: 'open', 'passing', 'accepted', 'active'.";
30
+ };
31
+ readonly source: {
32
+ readonly type: "string";
33
+ readonly description: "Optional provenance string. Example: 'docs/requirements/REQ-123.md'. Defaults to 'mcp://kibi/upsert'.";
34
+ };
35
+ readonly tags: {
36
+ readonly type: "array";
37
+ readonly items: {
38
+ readonly type: "string";
39
+ };
40
+ readonly description: "Optional categorization tags. Example: ['security','api'].";
41
+ };
42
+ readonly owner: {
43
+ readonly type: "string";
44
+ readonly description: "Optional owner name/team. Example: 'platform-team'.";
45
+ };
46
+ readonly priority: {
47
+ readonly type: "string";
48
+ readonly description: "Optional priority label. Example: 'high'.";
49
+ };
50
+ readonly severity: {
51
+ readonly type: "string";
52
+ readonly description: "Optional severity label. Example: 'critical'.";
53
+ };
54
+ readonly links: {
55
+ readonly type: "array";
56
+ readonly items: {
57
+ readonly type: "string";
58
+ };
59
+ readonly description: "Optional references. Example: ['REQ-010','https://example.com/spec'].";
60
+ };
61
+ readonly text_ref: {
62
+ readonly type: "string";
63
+ readonly description: "Optional text anchor/reference. Example: 'requirements.md#L40'.";
64
+ };
65
+ readonly logic_claims: {
66
+ readonly type: "array";
67
+ readonly minItems: 1;
68
+ readonly uniqueItems: true;
69
+ readonly items: {
70
+ readonly type: "string";
71
+ readonly pattern: "^CLAIM-[A-F0-9]{16}$";
72
+ };
73
+ readonly description: "Requirement-only manifest of every atomic normative claim key returned by kb_semantic_advisor. A requirement is logic-complete only when every key is grounded by a linked property_value or predicate fact with the same claim_key.";
74
+ };
75
+ readonly sourceFile: {
76
+ readonly type: "string";
77
+ readonly description: "Optional code source file for symbol entities. Example: 'src/auth/login.ts'.";
78
+ };
79
+ readonly granularity_reason: {
80
+ readonly type: "string";
81
+ readonly enum: readonly ["config-artifact", "module-level-behavior", "extractor-miss", "legacy-link"];
82
+ readonly description: "Optional justification for a coarse file/module-level symbol traceability relationship when narrower function/class/type symbols exist.";
83
+ };
84
+ readonly symbol_role: {
85
+ readonly type: "string";
86
+ readonly enum: readonly ["behavioral", "structural", "type-shape", "config", "module", "unknown"];
87
+ readonly description: "Optional role classification for symbol entities. Example: 'behavioral'.";
88
+ };
89
+ readonly verification_scope: {
90
+ readonly type: "string";
91
+ readonly enum: readonly ["unit", "integration", "end_to_end"];
92
+ readonly description: "Optional typed verification scope for test entities. Example: 'end_to_end'.";
93
+ };
94
+ readonly verification_perspective: {
95
+ readonly type: "string";
96
+ readonly enum: readonly ["internal", "consumer"];
97
+ readonly description: "Optional typed verification perspective for test entities. Example: 'consumer'.";
98
+ };
99
+ readonly fact_kind: {
100
+ readonly type: "string";
101
+ readonly enum: readonly ["subject", "property_value", "observation", "meta", "predicate_schema", "predicate", "rule_schema", "rule"];
102
+ readonly description: "Optional fact lane kind for fact entities. Strict lane uses 'subject' and 'property_value'; context lane uses 'observation' or 'meta'; ontology lane uses 'predicate_schema' or 'predicate'. Use kb_model_requirement or kb_suggest_predicates when starting from prose.";
103
+ };
104
+ readonly subject_key: {
105
+ readonly type: "string";
106
+ readonly description: "Snake_case only. Optional canonical subject key for strict fact entities. Example: 'user.session'. Do not use subjectKey in kb_upsert.properties.";
107
+ };
108
+ readonly property_key: {
109
+ readonly type: "string";
110
+ readonly description: "Snake_case only. Optional canonical property key for property_value facts. Example: 'session.timeout_minutes'. Do not use propertyKey in kb_upsert.properties.";
111
+ };
112
+ readonly operator: {
113
+ readonly type: "string";
114
+ readonly enum: readonly ["eq", "neq", "lt", "lte", "gt", "gte"];
115
+ readonly description: "Optional comparison operator for property_value facts. Example: 'eq'.";
116
+ };
117
+ readonly value_type: {
118
+ readonly type: "string";
119
+ readonly enum: readonly ["string", "int", "number", "bool"];
120
+ readonly description: "Optional typed value discriminator for property_value facts. Pair with exactly one value_string, value_int, value_number, or value_bool; do not use generic value.";
121
+ };
122
+ readonly value_string: {
123
+ readonly type: "string";
124
+ readonly description: "Optional string value for property_value facts.";
125
+ };
126
+ readonly value_int: {
127
+ readonly type: "integer";
128
+ readonly description: "Optional integer value for property_value facts.";
129
+ };
130
+ readonly value_number: {
131
+ readonly type: "number";
132
+ readonly description: "Optional number value for property_value facts.";
133
+ };
134
+ readonly value_bool: {
135
+ readonly type: "boolean";
136
+ readonly description: "Optional boolean value for property_value facts.";
137
+ };
138
+ readonly unit: {
139
+ readonly type: "string";
140
+ readonly description: "Optional unit for numeric property_value facts.";
141
+ };
142
+ readonly scope: {
143
+ readonly type: "string";
144
+ readonly description: "Optional scope qualifier for fact entities.";
145
+ };
146
+ readonly polarity: {
147
+ readonly type: "string";
148
+ readonly enum: readonly ["require", "forbid", "assert", "deny"];
149
+ readonly description: "Optional polarity for property_value or predicate facts.";
150
+ };
151
+ readonly closed_world: {
152
+ readonly type: "boolean";
153
+ readonly description: "Optional closed-world marker for strict fact interpretation.";
154
+ };
155
+ readonly canonical_key: {
156
+ readonly type: "string";
157
+ readonly description: "Optional canonical identity key for predicate or strict fact claims.";
158
+ };
159
+ readonly claim_key: {
160
+ readonly type: "string";
161
+ readonly pattern: "^CLAIM-[A-F0-9]{16}$";
162
+ readonly description: "Stable semantic-advisor key for the atomic prose clause grounded by this fact.";
163
+ };
164
+ readonly claim_text: {
165
+ readonly type: "string";
166
+ readonly description: "Exact atomic requirement clause represented by this fact, retained for human audit.";
167
+ };
168
+ readonly predicate_name: {
169
+ readonly type: "string";
170
+ readonly description: "Optional predicate name for ontology predicate facts. Prefer kb_suggest_predicates before hand-writing predicate_name.";
171
+ };
172
+ readonly predicate_args: {
173
+ readonly type: "array";
174
+ readonly items: {
175
+ readonly type: "string";
176
+ };
177
+ readonly description: "Optional ordered predicate arguments for ontology predicate facts. Prefer kb_suggest_predicates before hand-writing predicate_args.";
178
+ };
179
+ readonly predicate_namespace: {
180
+ readonly type: "string";
181
+ readonly description: "Optional namespace for a project-local predicate schema.";
182
+ };
183
+ readonly predicate_arity: {
184
+ readonly type: "integer";
185
+ readonly minimum: 1;
186
+ readonly description: "Required arity for predicate_schema facts.";
187
+ };
188
+ readonly argument_names: {
189
+ readonly type: "array";
190
+ readonly items: {
191
+ readonly type: "string";
192
+ };
193
+ readonly description: "Ordered argument role names for predicate_schema facts.";
194
+ };
195
+ readonly argument_types: {
196
+ readonly type: "array";
197
+ readonly items: {
198
+ readonly type: "string";
199
+ };
200
+ readonly description: "Ordered argument types for predicate_schema facts.";
201
+ };
202
+ readonly argument_descriptions: {
203
+ readonly type: "array";
204
+ readonly items: {
205
+ readonly type: "string";
206
+ };
207
+ readonly description: "Optional ordered argument explanations.";
208
+ };
209
+ readonly aliases: {
210
+ readonly type: "array";
211
+ readonly items: {
212
+ readonly type: "string";
213
+ };
214
+ readonly description: "Optional vocabulary aliases for predicate discovery.";
215
+ };
216
+ readonly examples: {
217
+ readonly type: "array";
218
+ readonly items: {
219
+ readonly type: "string";
220
+ };
221
+ readonly description: "Optional ground-term examples for a predicate schema.";
222
+ };
223
+ readonly semantic_inventory: {
224
+ readonly type: "array";
225
+ readonly description: "Requirement proposition ledger returned by kb_semantic_advisor; preserve entries while modeling each assertive span.";
226
+ readonly items: {
227
+ readonly type: "object";
228
+ };
229
+ };
230
+ readonly rule_ir: {
231
+ readonly type: "object";
232
+ readonly description: "Schema-validated kibi.logic.v1 rule IR. It is persisted as data and never executed as caller-supplied Prolog.";
233
+ };
234
+ readonly rule_hash: {
235
+ readonly type: "string";
236
+ readonly description: "Deterministic hash of canonical rule_ir.";
237
+ };
238
+ readonly rule_schema_id: {
239
+ readonly type: "string";
240
+ readonly description: "Rule schema fact ID used to validate this rule.";
241
+ };
242
+ readonly rule_name: {
243
+ readonly type: "string";
244
+ readonly description: "Stable rule schema name.";
245
+ };
246
+ readonly semantic_key: {
247
+ readonly type: "string";
248
+ readonly description: "Canonical semantic identity of the normalized logical model.";
249
+ };
250
+ readonly claim_span_start: {
251
+ readonly type: "integer";
252
+ readonly minimum: 0;
253
+ };
254
+ readonly claim_span_end: {
255
+ readonly type: "integer";
256
+ readonly minimum: 0;
257
+ };
258
+ };
259
+ readonly allOf: readonly [Record<string, unknown>];
260
+ readonly required: readonly ["title", "status"];
261
+ };
262
+ readonly relationships: {
263
+ readonly type: "array";
264
+ readonly description: "Optional relationship rows to create in the same call. For requirement encoding, prefer `constrains` + `requires_property` for strict property facts or `requires_predicate` for ontology predicate facts. Side effect: asserts edges in KB.";
265
+ readonly items: {
266
+ readonly type: "object";
267
+ readonly required: readonly ["type", "from", "to"];
268
+ readonly properties: {
269
+ readonly type: {
270
+ readonly type: "string";
271
+ readonly enum: readonly ["depends_on", "specified_by", "verified_by", "validates", "implements", "covered_by", "executable_for", "constrained_by", "constrains", "requires_property", "requires_predicate", "requires_rule", "guards", "publishes", "consumes", "supersedes", "relates_to"];
272
+ readonly description: "Relationship type enum. Use only supported values. Direction semantics follow KB model (e.g., implements symbol->req, verified_by req/scenario->test, executable_for symbol->test).";
273
+ };
274
+ readonly from: {
275
+ readonly type: "string";
276
+ readonly description: "Source entity ID (must exist). Example: 'SYM-login-handler'.";
277
+ };
278
+ readonly to: {
279
+ readonly type: "string";
280
+ readonly description: "Target entity ID (must exist). Example: 'REQ-001'.";
281
+ };
282
+ };
283
+ };
284
+ };
285
+ };
286
+ };
287
+ readonly requiresProlog: true;
288
+ readonly effects: readonly ["kb-write", "workspace-write"];
289
+ readonly execute: typeof executeUpsert;
290
+ };
291
+ //# sourceMappingURL=upsert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../../src/public/operations/specs/upsert.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAQvE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BuC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { executeUpsert } from "../../../operations/mutation/upsert.js";
2
+ import { ENTITY_PROPERTIES_SCHEMA, ENTITY_TYPES, RELATIONSHIPS_SCHEMA, } from "./mutation-schemas.js";
3
+ export const upsertSpec = {
4
+ name: "kb_upsert",
5
+ cliName: "upsert",
6
+ description: "Create or update one entity and optional relationships. Use for KB mutations after validating intent; prefer kb_validate_upsert first because it returns semantic advisor receipts for prose-heavy requirements. Use kb_model_requirement before hand-writing strict property facts from prose, and kb_suggest_predicates before hand-writing ontology predicate facts. Use the `relationships` array for batch creation of multiple links in a single call (e.g., linking a requirement to multiple tests or facts). Prefer modeling requirements as reusable fact links (`constrains`, `requires_property`, or `requires_predicate`) so consistency and contradiction checks remain queryable. Relationship endpoints must already exist in KB. For requirements, the write will be rejected if it contradicts existing current requirements that constrain the same subject with incompatible properties. To replace a conflicting requirement, include a `supersedes` relationship from the new requirement to the old one in the same request. Successful writes may return non-blocking semantic advisor warnings; inspect and repair those warnings before treating prose as contradiction-checkable. Do not use for read-only inspection. Side effects: writes KB, may refresh symbol coordinates.",
7
+ businessInputSchema: {
8
+ type: "object",
9
+ required: ["type", "id", "properties"],
10
+ properties: {
11
+ type: {
12
+ type: "string",
13
+ enum: ENTITY_TYPES,
14
+ description: "Entity type to create/update. Allowed: req, scenario, test, adr, flag, event, symbol, fact. Example: 'req'.",
15
+ },
16
+ id: {
17
+ type: "string",
18
+ description: "Unique entity ID (string). Example: 'REQ-123'. Existing ID updates the entity; new ID creates it.",
19
+ },
20
+ properties: ENTITY_PROPERTIES_SCHEMA,
21
+ relationships: RELATIONSHIPS_SCHEMA,
22
+ },
23
+ },
24
+ requiresProlog: true,
25
+ effects: ["kb-write", "workspace-write"],
26
+ execute: executeUpsert,
27
+ };
@@ -0,0 +1,24 @@
1
+ import type { OperationContext } from "./runtime-types.js";
2
+ export type { OperationContext };
3
+ export type OperationName = "kb_query" | "kb_search" | "kb_status" | "kb_skills_list" | "kb_skills_load" | "kb_skills_read" | "kb_find_gaps" | "kb_coverage" | "kb_graph" | "kb_sparql_remote" | "kb_semantic_advisor" | "kb_upsert" | "kb_validate_upsert" | "kb_delete" | "kb_check" | "kb_model_requirement" | "kb_suggest_predicates" | "kb_autopilot_generate";
4
+ export type OperationEffect = "local-read" | "kb-read" | "workspace-read" | "network-read" | "kb-write" | "workspace-write";
5
+ export interface OperationContent {
6
+ readonly type: string;
7
+ readonly text?: string;
8
+ }
9
+ export interface OperationResult<O = unknown> {
10
+ readonly content: readonly OperationContent[];
11
+ readonly structuredContent?: O;
12
+ }
13
+ export interface OperationSpec<I = Readonly<Record<string, unknown>>, O = unknown> {
14
+ readonly name: OperationName;
15
+ readonly cliName: string;
16
+ readonly description: string;
17
+ readonly businessInputSchema: Readonly<Record<string, unknown>>;
18
+ readonly requiresProlog: boolean;
19
+ readonly effects: readonly OperationEffect[];
20
+ readonly execute: {
21
+ bivarianceHack(input: I, context: OperationContext): Promise<OperationResult<O>>;
22
+ }["bivarianceHack"];
23
+ }
24
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/public/operations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,gBAAgB,EAAE,CAAC;AACjC,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,WAAW,GACX,WAAW,GACX,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,aAAa,GACb,UAAU,GACV,kBAAkB,GAClB,qBAAqB,GACrB,WAAW,GACX,oBAAoB,GACpB,WAAW,GACX,UAAU,GACV,sBAAsB,GACtB,uBAAuB,GACvB,uBAAuB,CAAC;AAE5B,MAAM,MAAM,eAAe,GACvB,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,cAAc,GACd,UAAU,GACV,iBAAiB,CAAC;AAEtB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC9C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,aAAa,CAC5B,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACrC,CAAC,GAAG,OAAO;IAEX,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAChE,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE;QAChB,cAAc,CACZ,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;KAChC,CAAC,gBAAgB,CAAC,CAAC;CACrB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/entity.ts"],"names":[],"mappings":"AAmFA,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAoLzC,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/entity.ts"],"names":[],"mappings":"AAuTA,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAmRzC,CAAC;AAEF,eAAe,YAAY,CAAC"}