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,40 @@
1
+ import type {
2
+ UpsertInput,
3
+ UpsertPayload,
4
+ } from "../../../operations/mutation/types.js";
5
+ import { executeUpsert } from "../../../operations/mutation/upsert.js";
6
+ import type { OperationSpec } from "../types.js";
7
+ import {
8
+ ENTITY_PROPERTIES_SCHEMA,
9
+ ENTITY_TYPES,
10
+ RELATIONSHIPS_SCHEMA,
11
+ } from "./mutation-schemas.js";
12
+
13
+ export const upsertSpec = {
14
+ name: "kb_upsert",
15
+ cliName: "upsert",
16
+ description:
17
+ "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.",
18
+ businessInputSchema: {
19
+ type: "object",
20
+ required: ["type", "id", "properties"],
21
+ properties: {
22
+ type: {
23
+ type: "string",
24
+ enum: ENTITY_TYPES,
25
+ description:
26
+ "Entity type to create/update. Allowed: req, scenario, test, adr, flag, event, symbol, fact. Example: 'req'.",
27
+ },
28
+ id: {
29
+ type: "string",
30
+ description:
31
+ "Unique entity ID (string). Example: 'REQ-123'. Existing ID updates the entity; new ID creates it.",
32
+ },
33
+ properties: ENTITY_PROPERTIES_SCHEMA,
34
+ relationships: RELATIONSHIPS_SCHEMA,
35
+ },
36
+ },
37
+ requiresProlog: true,
38
+ effects: ["kb-write", "workspace-write"],
39
+ execute: executeUpsert,
40
+ } as const satisfies OperationSpec<UpsertInput, UpsertPayload>;
@@ -0,0 +1,57 @@
1
+ import type { OperationContext } from "./runtime-types.js";
2
+ export type { OperationContext };
3
+ export type OperationName =
4
+ | "kb_query"
5
+ | "kb_search"
6
+ | "kb_status"
7
+ | "kb_skills_list"
8
+ | "kb_skills_load"
9
+ | "kb_skills_read"
10
+ | "kb_find_gaps"
11
+ | "kb_coverage"
12
+ | "kb_graph"
13
+ | "kb_sparql_remote"
14
+ | "kb_semantic_advisor"
15
+ | "kb_upsert"
16
+ | "kb_validate_upsert"
17
+ | "kb_delete"
18
+ | "kb_check"
19
+ | "kb_model_requirement"
20
+ | "kb_suggest_predicates"
21
+ | "kb_autopilot_generate";
22
+
23
+ export type OperationEffect =
24
+ | "local-read"
25
+ | "kb-read"
26
+ | "workspace-read"
27
+ | "network-read"
28
+ | "kb-write"
29
+ | "workspace-write";
30
+
31
+ export interface OperationContent {
32
+ readonly type: string;
33
+ readonly text?: string;
34
+ }
35
+
36
+ export interface OperationResult<O = unknown> {
37
+ readonly content: readonly OperationContent[];
38
+ readonly structuredContent?: O;
39
+ }
40
+
41
+ export interface OperationSpec<
42
+ I = Readonly<Record<string, unknown>>,
43
+ O = unknown,
44
+ > {
45
+ readonly name: OperationName;
46
+ readonly cliName: string;
47
+ readonly description: string;
48
+ readonly businessInputSchema: Readonly<Record<string, unknown>>;
49
+ readonly requiresProlog: boolean;
50
+ readonly effects: readonly OperationEffect[];
51
+ readonly execute: {
52
+ bivarianceHack(
53
+ input: I,
54
+ context: OperationContext,
55
+ ): Promise<OperationResult<O>>;
56
+ }["bivarianceHack"];
57
+ }
@@ -33,6 +33,15 @@ type VerificationScope = "unit" | "integration" | "end_to_end";
33
33
  type VerificationPerspective = "internal" | "consumer";
34
34
 
35
35
  const factConditionals = JSON.parse(`[
36
+ {
37
+ "if": {
38
+ "anyOf": [
39
+ { "required": ["claim_key"] },
40
+ { "required": ["claim_text"] }
41
+ ]
42
+ },
43
+ "then": { "required": ["claim_key", "claim_text"] }
44
+ },
36
45
  {
37
46
  "if": {
38
47
  "properties": {
@@ -121,6 +130,12 @@ const entitySchema: Record<string, unknown> = {
121
130
  severity: { type: "string" },
122
131
  links: { type: "array", items: { type: "string" } },
123
132
  text_ref: { type: "string" },
133
+ logic_claims: {
134
+ type: "array",
135
+ minItems: 1,
136
+ uniqueItems: true,
137
+ items: { type: "string", pattern: "^CLAIM-[A-F0-9]{16}$" },
138
+ },
124
139
  sourceFile: { type: "string" },
125
140
  granularity_reason: {
126
141
  type: "string",
@@ -186,6 +201,8 @@ const entitySchema: Record<string, unknown> = {
186
201
  valid_from: { type: "string" },
187
202
  valid_to: { type: "string" },
188
203
  canonical_key: { type: "string" },
204
+ claim_key: { type: "string", pattern: "^CLAIM-[A-F0-9]{16}$" },
205
+ claim_text: { type: "string" },
189
206
  predicate_name: { type: "string" },
190
207
  predicate_namespace: { type: "string" },
191
208
  predicate_arity: { type: "integer", minimum: 1 },
@@ -206,6 +223,14 @@ const entitySchema: Record<string, unknown> = {
206
223
  "type",
207
224
  ],
208
225
  allOf: [
226
+ {
227
+ if: {
228
+ properties: { type: { const: "req" } },
229
+ },
230
+ else: {
231
+ not: { required: ["logic_claims"] },
232
+ },
233
+ },
209
234
  // Forbid fact-only fields on non-fact entities
210
235
  {
211
236
  if: {
@@ -232,6 +257,8 @@ const entitySchema: Record<string, unknown> = {
232
257
  { required: ["valid_from"] },
233
258
  { required: ["valid_to"] },
234
259
  { required: ["canonical_key"] },
260
+ { required: ["claim_key"] },
261
+ { required: ["claim_text"] },
235
262
  { required: ["predicate_name"] },
236
263
  { required: ["predicate_namespace"] },
237
264
  { required: ["predicate_arity"] },
@@ -0,0 +1,38 @@
1
+ export class SkillNotFoundError extends Error {
2
+ constructor(id: string) {
3
+ super(`Skill not found: ${id}`);
4
+ this.name = "SkillNotFoundError";
5
+ }
6
+ }
7
+ export class SkillResourceNotFoundError extends Error {
8
+ constructor(id: string, resourcePath: string) {
9
+ super(`Skill resource not found: ${id}/${resourcePath}`);
10
+ this.name = "SkillResourceNotFoundError";
11
+ }
12
+ }
13
+ export class SkillResourceOutOfBoundsError extends Error {
14
+ constructor(id: string, resourcePath: string) {
15
+ super(`Skill resource escapes bundle root: ${id}/${resourcePath}`);
16
+ this.name = "SkillResourceOutOfBoundsError";
17
+ }
18
+ }
19
+ export class SkillValidationError extends Error {
20
+ readonly field: string;
21
+ constructor(field: string, message: string) {
22
+ super(message);
23
+ this.name = "SkillValidationError";
24
+ this.field = field;
25
+ }
26
+ }
27
+ export class SkillOversizeError extends Error {
28
+ readonly maxBytes: number;
29
+ readonly actualBytes: number;
30
+ constructor(pathLike: string, maxBytes: number, actualBytes: number) {
31
+ super(
32
+ `Skill file exceeds ${maxBytes} bytes: ${pathLike} (${actualBytes} bytes)`,
33
+ );
34
+ this.name = "SkillOversizeError";
35
+ this.maxBytes = maxBytes;
36
+ this.actualBytes = actualBytes;
37
+ }
38
+ }
@@ -0,0 +1,108 @@
1
+ import { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
2
+ import { dirname, join, resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import {
5
+ SkillNotFoundError,
6
+ SkillResourceNotFoundError,
7
+ SkillResourceOutOfBoundsError,
8
+ } from "./errors.js";
9
+ import {
10
+ SKILL_FILE_NAME,
11
+ isPathOutOfBounds,
12
+ isWithinRoot,
13
+ normalizeResourcePath,
14
+ } from "./paths.js";
15
+ import type { SkillBundle, SkillManifest } from "./types.js";
16
+ import {
17
+ RESOURCE_MAX_BYTES,
18
+ assertMaxBytes,
19
+ parseSkillBundle,
20
+ } from "./validation.js";
21
+ const defaultBundledSkillsDir = resolve(
22
+ dirname(fileURLToPath(import.meta.url)),
23
+ "../skills",
24
+ );
25
+ let bundledSkillsDir = defaultBundledSkillsDir;
26
+ export function setBundledSkillsDir(dir: string): void {
27
+ bundledSkillsDir = dir;
28
+ }
29
+ export function resetBundledSkillsDir(): void {
30
+ bundledSkillsDir = defaultBundledSkillsDir;
31
+ }
32
+ export function listBundledSkills(): SkillManifest[] {
33
+ return listFrom(bundledSkillsDir);
34
+ }
35
+ export function loadBundledSkill(id: string): SkillBundle {
36
+ return loadBundledSkillFrom(bundledSkillsDir, id);
37
+ }
38
+ // implements REQ-reusable-skill-subsystem
39
+ // covered_by TEST-skill-cli-load-validate
40
+ export function loadBundledSkillFrom(
41
+ skillsDir: string,
42
+ id: string,
43
+ ): SkillBundle {
44
+ const root = findRoot(resolve(skillsDir), id);
45
+ if (!root) throw new SkillNotFoundError(id);
46
+ return parseSkillBundle(root);
47
+ }
48
+ export function readBundledSkillResource(
49
+ id: string,
50
+ resourcePath: string,
51
+ ): string {
52
+ return readBundle(loadBundledSkill(id), id, resourcePath);
53
+ }
54
+ // implements REQ-reusable-skill-subsystem
55
+ // covered_by TEST-skill-cli-load-validate
56
+ export function readBundledSkillResourceFrom(
57
+ skillsDir: string,
58
+ id: string,
59
+ resourcePath: string,
60
+ ): string {
61
+ return readBundle(loadBundledSkillFrom(skillsDir, id), id, resourcePath);
62
+ }
63
+ function listFrom(dir: string): SkillManifest[] {
64
+ if (!existsSync(dir)) return [];
65
+ return readdirSync(dir, { withFileTypes: true })
66
+ .filter((entry) => entry.isDirectory())
67
+ .map((entry) => join(dir, entry.name))
68
+ .filter((root) => existsSync(join(root, SKILL_FILE_NAME)))
69
+ .map((root) => parseSkillBundle(root).manifest)
70
+ .sort((a, b) => a.id.localeCompare(b.id));
71
+ }
72
+ function findRoot(dir: string, id: string): string | undefined {
73
+ return listRoots(dir).find(
74
+ (root) => parseSkillBundle(root).manifest.id === id,
75
+ );
76
+ }
77
+ function listRoots(dir: string): string[] {
78
+ if (!existsSync(dir)) return [];
79
+ return readdirSync(dir, { withFileTypes: true })
80
+ .filter((entry) => entry.isDirectory())
81
+ .map((entry) => join(dir, entry.name))
82
+ .filter((root) => existsSync(join(root, SKILL_FILE_NAME)));
83
+ }
84
+ function readBundle(
85
+ bundle: SkillBundle,
86
+ id: string,
87
+ resourcePath: string,
88
+ ): string {
89
+ const resource = normalizeResourcePath(resourcePath);
90
+ if (!resource || isPathOutOfBounds(resourcePath))
91
+ throw new SkillResourceOutOfBoundsError(id, resourcePath);
92
+ if (
93
+ !(bundle.manifest.resources ?? []).some(
94
+ (declared) => normalizeResourcePath(declared) === resource,
95
+ )
96
+ )
97
+ throw new SkillResourceNotFoundError(id, resourcePath);
98
+ const candidate = resolve(bundle.rootDir, resource);
99
+ try {
100
+ if (!isWithinRoot(realpathSync(bundle.rootDir), realpathSync(candidate)))
101
+ throw new SkillResourceOutOfBoundsError(id, resourcePath);
102
+ } catch (error) {
103
+ if (error instanceof SkillResourceOutOfBoundsError) throw error;
104
+ throw new SkillResourceNotFoundError(id, resourcePath);
105
+ }
106
+ assertMaxBytes(candidate, RESOURCE_MAX_BYTES);
107
+ return readFileSync(candidate, "utf8");
108
+ }
@@ -0,0 +1,27 @@
1
+ import { existsSync, statSync } from "node:fs";
2
+ import { isAbsolute, join, normalize, relative, resolve } from "node:path";
3
+ export const SKILL_FILE_NAME = "SKILL.md";
4
+ export function normalizeResourcePath(pathLike: string): string {
5
+ return normalize(pathLike).replaceAll("\\", "/");
6
+ }
7
+ export function isPathOutOfBounds(pathLike: string): boolean {
8
+ const normalized = normalizeResourcePath(pathLike);
9
+ return (
10
+ isAbsolute(pathLike) ||
11
+ normalized === ".." ||
12
+ normalized.startsWith("../") ||
13
+ normalized.includes("/../")
14
+ );
15
+ }
16
+ export function isWithinRoot(rootDir: string, candidatePath: string): boolean {
17
+ const rel = relative(rootDir, candidatePath);
18
+ return rel === "" || (!rel.startsWith("..") && !isAbsolute(rel));
19
+ }
20
+ export function resolveSkillFilePath(pathLike: string): string {
21
+ const resolved = resolve(pathLike);
22
+ if (existsSync(resolved) && statSync(resolved).isDirectory())
23
+ return join(resolved, SKILL_FILE_NAME);
24
+ return resolved.endsWith(SKILL_FILE_NAME)
25
+ ? resolved
26
+ : join(resolved, SKILL_FILE_NAME);
27
+ }
@@ -0,0 +1,14 @@
1
+ export interface SkillManifest {
2
+ id: string;
3
+ name: string;
4
+ description: string;
5
+ version: string;
6
+ kibiCompatibility: string;
7
+ tags?: string[];
8
+ resources?: string[];
9
+ }
10
+ export interface SkillBundle {
11
+ manifest: SkillManifest;
12
+ body: string;
13
+ rootDir: string;
14
+ }
@@ -0,0 +1,175 @@
1
+ import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
2
+ import { dirname, resolve } from "node:path";
3
+ import matter from "gray-matter";
4
+ import { SkillOversizeError, SkillValidationError } from "./errors.js";
5
+ import {
6
+ SKILL_FILE_NAME,
7
+ isPathOutOfBounds,
8
+ isWithinRoot,
9
+ normalizeResourcePath,
10
+ resolveSkillFilePath,
11
+ } from "./paths.js";
12
+ import type { SkillBundle, SkillManifest } from "./types.js";
13
+ const SKILL_MARKDOWN_MAX_BYTES = 256 * 1024;
14
+ export const RESOURCE_MAX_BYTES = 128 * 1024;
15
+ export function assertMaxBytes(pathLike: string, maxBytes: number): void {
16
+ const size = statSync(pathLike).size;
17
+ if (size > maxBytes) throw new SkillOversizeError(pathLike, maxBytes, size);
18
+ }
19
+ export function parseSkillBundle(rootDir: string): SkillBundle {
20
+ const path = resolve(rootDir, SKILL_FILE_NAME);
21
+ assertMaxBytes(path, SKILL_MARKDOWN_MAX_BYTES);
22
+ const parsed = matter(readFileSync(path, "utf8"));
23
+ const [error] = validateManifestData(parsed.data);
24
+ if (error) throw error;
25
+ return {
26
+ manifest: coerceManifest(parsed.data),
27
+ body: parsed.content,
28
+ rootDir: resolve(rootDir),
29
+ };
30
+ }
31
+ export function validateSkillBundle(pathLike: string): {
32
+ valid: boolean;
33
+ errors: SkillValidationError[];
34
+ } {
35
+ const path = resolveSkillFilePath(pathLike);
36
+ const errors: SkillValidationError[] = [];
37
+ if (!existsSync(path))
38
+ return {
39
+ valid: false,
40
+ errors: [
41
+ new SkillValidationError("SKILL.md", `Missing ${SKILL_FILE_NAME}`),
42
+ ],
43
+ };
44
+ const parsed = matter(readFileSync(path, "utf8"));
45
+ errors.push(...validateManifestData(parsed.data));
46
+ if (errors.length === 0)
47
+ validateBundleContents(path, coerceManifest(parsed.data), errors);
48
+ return { valid: errors.length === 0, errors };
49
+ }
50
+ function validateBundleContents(
51
+ path: string,
52
+ manifest: SkillManifest,
53
+ errors: SkillValidationError[],
54
+ ): void {
55
+ try {
56
+ assertMaxBytes(path, SKILL_MARKDOWN_MAX_BYTES);
57
+ } catch (error) {
58
+ errors.push(
59
+ new SkillValidationError(
60
+ "SKILL.md",
61
+ error instanceof Error ? error.message : String(error),
62
+ ),
63
+ );
64
+ }
65
+ let root: string;
66
+ try {
67
+ root = realpathSync(dirname(path));
68
+ } catch (error) {
69
+ errors.push(
70
+ new SkillValidationError(
71
+ "SKILL.md",
72
+ error instanceof Error ? error.message : String(error),
73
+ ),
74
+ );
75
+ return;
76
+ }
77
+ for (const resource of manifest.resources ?? []) {
78
+ const resourcePath = resolve(dirname(path), resource);
79
+ try {
80
+ if (!existsSync(resourcePath)) {
81
+ errors.push(
82
+ new SkillValidationError(
83
+ "resources",
84
+ `Missing skill resource: ${resource}`,
85
+ ),
86
+ );
87
+ continue;
88
+ }
89
+ const real = realpathSync(resourcePath);
90
+ if (!isWithinRoot(root, real)) {
91
+ errors.push(
92
+ new SkillValidationError(
93
+ "resources",
94
+ `Skill resource escapes bundle root: ${resource}`,
95
+ ),
96
+ );
97
+ continue;
98
+ }
99
+ assertMaxBytes(resourcePath, RESOURCE_MAX_BYTES);
100
+ } catch (error) {
101
+ errors.push(
102
+ new SkillValidationError(
103
+ "resources",
104
+ error instanceof Error ? error.message : String(error),
105
+ ),
106
+ );
107
+ }
108
+ }
109
+ }
110
+ function validateManifestData(
111
+ data: Record<string, unknown>,
112
+ ): SkillValidationError[] {
113
+ const errors: SkillValidationError[] = [];
114
+ for (const field of [
115
+ "id",
116
+ "name",
117
+ "description",
118
+ "version",
119
+ "kibiCompatibility",
120
+ ] as const)
121
+ if (typeof data[field] !== "string" || data[field].trim() === "")
122
+ errors.push(
123
+ new SkillValidationError(
124
+ field,
125
+ `Missing required skill field: ${field}`,
126
+ ),
127
+ );
128
+ if (
129
+ typeof data.version === "string" &&
130
+ !/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(data.version)
131
+ )
132
+ errors.push(
133
+ new SkillValidationError(
134
+ "version",
135
+ `Invalid skill version: ${data.version}`,
136
+ ),
137
+ );
138
+ for (const [field, value] of [
139
+ ["tags", data.tags],
140
+ ["resources", data.resources],
141
+ ] as const) {
142
+ if (value !== undefined && !isStringArray(value))
143
+ errors.push(
144
+ new SkillValidationError(field, `Skill ${field} must be strings`),
145
+ );
146
+ }
147
+ if (isStringArray(data.resources))
148
+ for (const resource of data.resources)
149
+ if (!normalizeResourcePath(resource) || isPathOutOfBounds(resource))
150
+ errors.push(
151
+ new SkillValidationError(
152
+ "resources",
153
+ `Invalid skill resource: ${resource}`,
154
+ ),
155
+ );
156
+ return errors;
157
+ }
158
+ function coerceManifest(data: Record<string, unknown>): SkillManifest {
159
+ const manifest: SkillManifest = {
160
+ id: String(data.id),
161
+ name: String(data.name),
162
+ description: String(data.description),
163
+ version: String(data.version),
164
+ kibiCompatibility: String(data.kibiCompatibility),
165
+ };
166
+ if (isStringArray(data.tags)) manifest.tags = data.tags;
167
+ if (isStringArray(data.resources))
168
+ manifest.resources = data.resources.map(normalizeResourcePath);
169
+ return manifest;
170
+ }
171
+ function isStringArray(value: unknown): value is string[] {
172
+ return (
173
+ Array.isArray(value) && value.every((item) => typeof item === "string")
174
+ );
175
+ }
@@ -0,0 +1,62 @@
1
+ ---
2
+ id: init-kibi
3
+ name: init-kibi
4
+ description: Bootstrap and model knowledge safely using approved Kibi MCP initialization and mutation workflow.
5
+ version: 1.0.0
6
+ kibiCompatibility: "*"
7
+ tags:
8
+ - kibi
9
+ - mcp
10
+ - bootstrap
11
+ - agent-guidance
12
+ ---
13
+ ## Goal
14
+
15
+ Set up or refresh Kibi knowledge for the current branch through approved Kibi interfaces only. Maintain source-file traceability for every repository-backed claim, and require explicit operator approval before any mutation.
16
+
17
+ ## Interface Selection
18
+
19
+ 1. If approved Kibi MCP tools are visible, use the MCP route.
20
+ 2. Otherwise, in a trusted workspace, use the canonical project-local CLI fallback: `npx --no-install kibi ...` or `bunx --no-install kibi ...`.
21
+ 3. If neither approved MCP tools nor the project-local CLI are available, stop and tell the operator to enable or install Kibi for this workspace.
22
+ 4. Never use a global fallback, an installing runner, or any route outside the approved Kibi interface.
23
+
24
+ Use `kibi-usage/resources/operation-access.md` for the exact operation-to-route mapping. The CLI preview route accepts the same JSON object as `kb_autopilot_generate`:
25
+
26
+ ```bash
27
+ echo '{"maxCandidates":25,"minConfidence":0.8}' | npx --no-install kibi autopilot-generate --input -
28
+ ```
29
+
30
+ ## Capability Workflow
31
+
32
+ - Generate a read-only bootstrap preview with `kb_autopilot_generate`, or the dedicated CLI route `autopilot-generate --input`.
33
+ - Show the generated preview and obtain explicit approval before writes.
34
+ - Apply reviewed entity creation or updates with `kb_upsert`, or `upsert --input`.
35
+ - If cleanup is needed, use `kb_delete`, or `delete --input`, only after checking dependencies and obtaining approval for the specific removal.
36
+ - Finish with `kb_check`, or `check --input`, to validate the branch snapshot.
37
+
38
+ ## Guidance
39
+
40
+ - Keep mutation requests explicit, small, and sequential.
41
+ - Prefer source-linked entities so future `kb_query` lookups can verify repository context against source files.
42
+ - Preserve traceability by linking facts, claims, scenarios, and tests to concrete project files whenever repository evidence supports it.
43
+ - Do not read or edit files inside `.kb` directly; all changes go through the selected Kibi interface.
44
+ - Ask at most four bounded context questions, and only when repository evidence is insufficient.
45
+ - Stop at the documented operator repair boundary if the setup appears partial, inconsistent, or unsupported by the approved interface.
46
+
47
+ ## Public Training Trajectories
48
+
49
+ - `init-kibi-bootstrap-analysis-train-1`: Analyze the cold-start repository and produce a read-only bootstrap preview using only the public Kibi MCP surface.
50
+ - `init-kibi-bootstrap-analysis-train-2`: Analyze the cold-start repository and produce a read-only bootstrap preview using only the public Kibi MCP surface.
51
+ - `init-kibi-bounded-context-questions-train-1`: Ask only the bounded context questions needed before bootstrap synthesis using only the public Kibi MCP surface.
52
+ - `init-kibi-bounded-context-questions-train-2`: Ask only the bounded context questions needed before bootstrap synthesis using only the public Kibi MCP surface.
53
+ - `init-kibi-approval-sequential-writes-train-1`: Apply the approved bootstrap plan sequentially and finish with validation using only the public Kibi MCP surface.
54
+ - `init-kibi-approval-sequential-writes-train-2`: Apply the approved bootstrap plan sequentially and finish with validation using only the public Kibi MCP surface.
55
+ - `init-kibi-repair-escalation-train-1`: Identify the partial setup and stop at the documented operator repair boundary using only the public Kibi MCP surface.
56
+ - `init-kibi-repair-escalation-train-2`: Identify the partial setup and stop at the documented operator repair boundary using only the public Kibi MCP surface.
57
+
58
+ ## Training Data
59
+
60
+ ```json
61
+ [{"taskId":"init-kibi-bootstrap-analysis-train-1","family":"bootstrap-analysis","reflection":"Analyze the cold-start repository and produce a read-only bootstrap preview. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-bootstrap-analysis-train-2","family":"bootstrap-analysis","reflection":"Analyze the cold-start repository and produce a read-only bootstrap preview. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"init-kibi-bounded-context-questions-train-1","family":"bounded-context-questions","reflection":"Ask only the bounded context questions needed before bootstrap synthesis. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-bounded-context-questions-train-2","family":"bounded-context-questions","reflection":"Ask only the bounded context questions needed before bootstrap synthesis. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"init-kibi-approval-sequential-writes-train-1","family":"approval-sequential-writes","reflection":"Apply the approved bootstrap plan sequentially and finish with validation. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-approval-sequential-writes-train-2","family":"approval-sequential-writes","reflection":"Apply the approved bootstrap plan sequentially and finish with validation. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"init-kibi-repair-escalation-train-1","family":"repair-escalation","reflection":"Identify the partial setup and stop at the documented operator repair boundary. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-repair-escalation-train-2","family":"repair-escalation","reflection":"Identify the partial setup and stop at the documented operator repair boundary. This is train case 2; use only the public Kibi MCP surface."}]
62
+ ```
@@ -0,0 +1,44 @@
1
+ ---
2
+ id: kibi-freshness
3
+ name: kibi-freshness
4
+ description: Check branch freshness and source linkage quality before decisions or risky writes.
5
+ version: 1.0.0
6
+ kibiCompatibility: "*"
7
+ tags:
8
+ - kibi
9
+ - mcp
10
+ - freshness
11
+ - agent-guidance
12
+ ---
13
+ ## Goal
14
+
15
+ Help agents decide whether Kibi knowledge is current enough to support safe changes while preserving source-file traceability and approved interface boundaries.
16
+
17
+ ## Interface Selection
18
+
19
+ 1. If Kibi MCP tools are visible and approved for the workspace, use the MCP surface only.
20
+ 2. Otherwise, in a trusted workspace, use the canonical project-local CLI fallback through `npx --no-install kibi ...` or `bunx --no-install kibi ...`.
21
+ 3. If the project-local CLI is unavailable or too old, stop and tell the operator to enable or install Kibi.
22
+ 4. Never use a global fallback or an installing runner.
23
+
24
+ Use `kibi-usage/resources/operation-access.md` for exact dedicated routes. A project-local CLI freshness check is executable as:
25
+
26
+ ```bash
27
+ echo '{}' | npx --no-install kibi status --input -
28
+ ```
29
+
30
+ ## Capability Workflow
31
+
32
+ - Use `kb_status`, or `status --input`, first to confirm branch attachment, freshness state, dirty-worktree evidence, and whether the knowledge snapshot is safe to rely on.
33
+ - Use `kb_query`, or `query --input`, with `sourceFile` and text references for source-linked discovery.
34
+ - Re-run `kb_search`, or `search --input`, after sync gaps or stale context are detected.
35
+ - If knowledge must change, use the selected interface's `kb_upsert`/`upsert` or `kb_delete`/`delete` operation sequentially, then finish with `kb_check`/`check`.
36
+
37
+ ## Guidance
38
+
39
+ - Prefer the public Kibi MCP surface whenever it is available and approved.
40
+ - Never proceed with broad changes when freshness is stale and unresolved.
41
+ - If entities look stale, refresh context through an approved Kibi capability and then re-query.
42
+ - Preserve source-file traceability by carrying `sourceFile`, text references, and validation evidence through discovery, mutation, and completion.
43
+ - Do not read or edit files inside `.kb` directly; use the selected Kibi interface instead.
44
+ - Completion must state one freshness outcome: KB updated, no KB impact with rationale, or deferred/failed.