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,71 @@
1
+ export declare const PRODUCT_PREDICATE_RULES: readonly [{
2
+ readonly pattern: RegExp;
3
+ readonly name: "release_gate_rule";
4
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
5
+ readonly rationale: "Release-gate prose defines required gates before distribution or deployment and should be queryable as a predicate.";
6
+ readonly accepts: (statement: string) => boolean;
7
+ }, {
8
+ readonly pattern: RegExp;
9
+ readonly name: "platform_consistency_rule";
10
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
11
+ readonly rationale: "Platform consistency prose defines synchronization across platforms and should be queryable as a predicate.";
12
+ }, {
13
+ readonly pattern: RegExp;
14
+ readonly name: "preservation_rule";
15
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
16
+ readonly rationale: "Preservation prose defines data preserved across deletion/removal boundaries and should be queryable as a predicate.";
17
+ }, {
18
+ readonly pattern: RegExp;
19
+ readonly name: "abstraction_boundary_rule";
20
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
21
+ readonly rationale: "Abstraction-boundary prose defines renderer/vendor-neutral persistence or contract constraints and should be queryable as a predicate.";
22
+ readonly accepts: (statement: string) => boolean;
23
+ }, {
24
+ readonly pattern: RegExp;
25
+ readonly name: "security_configuration_rule";
26
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
27
+ readonly rationale: "Security-configuration prose defines explicit infrastructure or database settings and should be queryable as a predicate.";
28
+ readonly accepts: (statement: string) => boolean;
29
+ }, {
30
+ readonly pattern: RegExp;
31
+ readonly name: "ordered_strategy_rule";
32
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
33
+ readonly rationale: "Ordered-strategy prose defines a required priority order and should be queryable as a predicate.";
34
+ }, {
35
+ readonly pattern: RegExp;
36
+ readonly name: "refresh_policy_rule";
37
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
38
+ readonly rationale: "Refresh-policy prose defines automatic refresh behavior and should be queryable as a predicate.";
39
+ }, {
40
+ readonly pattern: RegExp;
41
+ readonly name: "scoped_authorization_rule";
42
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
43
+ readonly rationale: "Scoped-authorization prose defines assignment/ownership-qualified authorization and should be queryable as a predicate.";
44
+ readonly accepts: (statement: string) => boolean;
45
+ }, {
46
+ readonly pattern: RegExp;
47
+ readonly name: "documentation_standard_rule";
48
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
49
+ readonly rationale: "Documentation-standard prose defines required documentation artifacts and should be queryable as a predicate.";
50
+ }, {
51
+ readonly pattern: RegExp;
52
+ readonly name: "warmup_policy_rule";
53
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
54
+ readonly rationale: "Warmup-policy prose defines a required warmup trigger and should be queryable as a predicate.";
55
+ }, {
56
+ readonly pattern: RegExp;
57
+ readonly name: "visual_layout_rule";
58
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
59
+ readonly rationale: "Visual-layout prose defines UI alignment requirements and should be queryable as a predicate.";
60
+ }, {
61
+ readonly pattern: RegExp;
62
+ readonly name: "enforcement_location_rule";
63
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
64
+ readonly rationale: "Enforcement-location prose defines the layer where a constraint is enforced and should be queryable as a predicate.";
65
+ }, {
66
+ readonly pattern: RegExp;
67
+ readonly name: "reconciliation_rule";
68
+ readonly args: (g: Readonly<Record<string, string | undefined>>) => string[];
69
+ readonly rationale: "Reconciliation prose defines trigger-based cleanup of stale records and should be queryable as a predicate.";
70
+ }];
71
+ //# sourceMappingURL=predicate-rules-product.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate-rules-product.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/predicate-rules-product.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqKS,CAAC"}
@@ -0,0 +1,133 @@
1
+ import { commaList, normalizeKey, normalizePredicateToken, } from "./predicate-rule.js";
2
+ export const PRODUCT_PREDICATE_RULES = [
3
+ {
4
+ pattern: /^(?<subject>.+?)\s+(?:must|shall|should)\s+pass\s+(?<gate>.+?)\s+before\s+(?<target>.+?)\.?$/i,
5
+ name: "release_gate_rule",
6
+ args: (g) => [
7
+ normalizeKey(g.subject ?? ""),
8
+ normalizePredicateToken(g.gate ?? "gate"),
9
+ normalizeKey(g.target ?? ""),
10
+ ],
11
+ rationale: "Release-gate prose defines required gates before distribution or deployment and should be queryable as a predicate.",
12
+ accepts: (statement) => /\b(?:app store|build|deployment|distribution|release|testflight)\b/i.test(statement),
13
+ },
14
+ {
15
+ pattern: /^(?<subject>.+?)\s+(?:must|shall|should)\s+synchronize\s+across\s+(?<platforms>.+?)\.?$/i,
16
+ name: "platform_consistency_rule",
17
+ args: (g) => [normalizeKey(g.subject ?? ""), commaList(g.platforms ?? "")],
18
+ rationale: "Platform consistency prose defines synchronization across platforms and should be queryable as a predicate.",
19
+ },
20
+ {
21
+ pattern: /^(?<subject>.+?)\s+(?:must|shall|should)\s+preserve\s+(?<preserved>.+?)\s+when\s+(?:the\s+)?(?<condition>.+?)\.?$/i,
22
+ name: "preservation_rule",
23
+ args: (g) => [
24
+ normalizeKey(g.subject ?? ""),
25
+ normalizeKey(g.preserved ?? "preserved"),
26
+ normalizePredicateToken(g.condition ?? ""),
27
+ ],
28
+ rationale: "Preservation prose defines data preserved across deletion/removal boundaries and should be queryable as a predicate.",
29
+ },
30
+ {
31
+ pattern: /^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+persisted\s+as\s+(?<contract>.+?)\.?$/i,
32
+ name: "abstraction_boundary_rule",
33
+ args: (g) => [
34
+ normalizeKey(g.subject ?? ""),
35
+ "persisted_as",
36
+ normalizePredicateToken(g.contract ?? ""),
37
+ ],
38
+ rationale: "Abstraction-boundary prose defines renderer/vendor-neutral persistence or contract constraints and should be queryable as a predicate.",
39
+ accepts: (statement) => /\b(?:neutral|contract|renderer|runtime|vendor)\b/i.test(statement),
40
+ },
41
+ {
42
+ pattern: /^(?<subject>.+?)\s+(?:must|shall|should)\s+have\s+explicit\s+(?<setting>[A-Za-z0-9_.-]+)\s+(?<value>[A-Za-z0-9_.-]+)\.?$/i,
43
+ name: "security_configuration_rule",
44
+ args: (g) => [
45
+ normalizeKey(g.subject ?? ""),
46
+ normalizeKey(g.setting ?? ""),
47
+ normalizeKey(g.value ?? ""),
48
+ ],
49
+ rationale: "Security-configuration prose defines explicit infrastructure or database settings and should be queryable as a predicate.",
50
+ accepts: (statement) => /\b(?:database|deployment|function|rpc|search_path|security|trigger)\b/i.test(statement),
51
+ },
52
+ {
53
+ pattern: /^(?<subject>.+?)\s+(?:must|shall|should)\s+use\s+(?<kind>.+?)\s+in\s+priority\s+order\s+(?<values>.+?)\.?$/i,
54
+ name: "ordered_strategy_rule",
55
+ args: (g) => [
56
+ normalizeKey(g.subject ?? ""),
57
+ normalizeKey(g.kind ?? "strategy"),
58
+ (g.values ?? "")
59
+ .split(/,|>/)
60
+ .map(normalizePredicateToken)
61
+ .filter(Boolean)
62
+ .join(","),
63
+ ],
64
+ rationale: "Ordered-strategy prose defines a required priority order and should be queryable as a predicate.",
65
+ },
66
+ {
67
+ pattern: /^(?<subject>.+?)\s+(?:must|shall|should)\s+automatically\s+refresh\s+(?<target>.+?)\s+without\s+requiring\s+manual\s+page\s+reload\.?$/i,
68
+ name: "refresh_policy_rule",
69
+ args: (g) => [
70
+ normalizeKey(g.subject ?? ""),
71
+ normalizeKey(g.target ?? ""),
72
+ "automatic",
73
+ ],
74
+ rationale: "Refresh-policy prose defines automatic refresh behavior and should be queryable as a predicate.",
75
+ },
76
+ {
77
+ pattern: /^(?<actor>.+?)\s+(?:must|shall|should)\s+be\s+denied\s+(?<action>.+?)\.?$/i,
78
+ name: "scoped_authorization_rule",
79
+ args: (g) => [
80
+ normalizeKey(g.actor ?? ""),
81
+ normalizeKey(g.action ?? ""),
82
+ "deny",
83
+ ],
84
+ rationale: "Scoped-authorization prose defines assignment/ownership-qualified authorization and should be queryable as a predicate.",
85
+ accepts: (statement) => /\b(?:assigned|unassigned|owner|member|scoped)\b/i.test(statement),
86
+ },
87
+ {
88
+ pattern: /^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+documented\s+in\s+(?<artifact>.+?)\.?$/i,
89
+ name: "documentation_standard_rule",
90
+ args: (g) => [
91
+ normalizeKey(g.subject ?? ""),
92
+ "documented_in",
93
+ normalizeKey(g.artifact ?? ""),
94
+ ],
95
+ rationale: "Documentation-standard prose defines required documentation artifacts and should be queryable as a predicate.",
96
+ },
97
+ {
98
+ pattern: /^(?:the\s+)?(?<subject>.+?)\s+(?:must|shall|should)\s+warm\s+up\s+on\s+(?<trigger>.+?)\.?$/i,
99
+ name: "warmup_policy_rule",
100
+ args: (g) => [normalizeKey(g.subject ?? ""), normalizeKey(g.trigger ?? "")],
101
+ rationale: "Warmup-policy prose defines a required warmup trigger and should be queryable as a predicate.",
102
+ },
103
+ {
104
+ pattern: /^(?<subject>.+?)\s+(?:must|shall|should)\s+remain\s+visually\s+aligned\s+with\s+(?<target>.+?)\.?$/i,
105
+ name: "visual_layout_rule",
106
+ args: (g) => [
107
+ normalizeKey(g.subject ?? ""),
108
+ "aligned_with",
109
+ normalizeKey(g.target ?? ""),
110
+ ],
111
+ rationale: "Visual-layout prose defines UI alignment requirements and should be queryable as a predicate.",
112
+ },
113
+ {
114
+ pattern: /^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+enforced\s+at\s+(?<location>.+?)\.?$/i,
115
+ name: "enforcement_location_rule",
116
+ args: (g) => [
117
+ normalizeKey(g.subject ?? ""),
118
+ normalizeKey(g.location ?? ""),
119
+ ],
120
+ rationale: "Enforcement-location prose defines the layer where a constraint is enforced and should be queryable as a predicate.",
121
+ },
122
+ {
123
+ pattern: /^on\s+(?<trigger>.+?),\s*(?<subject>.+?)\s+(?:must|shall|should)\s+reconcile\s+(?<target>.+?)\s+and\s+(?<action>clear\s+stale\s+.+?)\.?$/i,
124
+ name: "reconciliation_rule",
125
+ args: (g) => [
126
+ normalizeKey(g.subject ?? ""),
127
+ normalizeKey(g.trigger ?? "trigger"),
128
+ normalizeKey(g.target ?? ""),
129
+ normalizeKey(g.action ?? "action"),
130
+ ],
131
+ rationale: "Reconciliation prose defines trigger-based cleanup of stale records and should be queryable as a predicate.",
132
+ },
133
+ ];
@@ -0,0 +1,29 @@
1
+ import type { SemanticModelingSuggestion } from "./types.js";
2
+ export interface ProseCoverageExpectation {
3
+ readonly kind: SemanticModelingSuggestion["kind"];
4
+ readonly predicate_name?: string;
5
+ readonly property_key?: string;
6
+ readonly operator?: string;
7
+ }
8
+ export interface ProseCoverageCase {
9
+ readonly id: string;
10
+ readonly source?: string;
11
+ readonly text: string;
12
+ readonly expected: ProseCoverageExpectation;
13
+ }
14
+ export interface ProseCoverageFailure {
15
+ readonly id: string;
16
+ readonly text: string;
17
+ readonly reason: string;
18
+ }
19
+ export interface ProseCoverageResult {
20
+ readonly coverage: number;
21
+ readonly summary: {
22
+ readonly total: number;
23
+ readonly passed: number;
24
+ readonly failed: number;
25
+ };
26
+ readonly failures: readonly ProseCoverageFailure[];
27
+ }
28
+ export declare function evaluateProseCoverageCorpus(cases: readonly ProseCoverageCase[]): ProseCoverageResult;
29
+ //# sourceMappingURL=prose-coverage-evaluator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prose-coverage-evaluator.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/prose-coverage-evaluator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAClD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;CAC7C;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACpD;AAuED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAClC,mBAAmB,CAQrB"}
@@ -0,0 +1,54 @@
1
+ import { analyzeSemanticAdvisorInput } from "./analyze-prose.js";
2
+ function failure(testCase, reason) {
3
+ return { id: testCase.id, text: testCase.text, reason };
4
+ }
5
+ function evaluateCase(testCase) {
6
+ const result = analyzeSemanticAdvisorInput({
7
+ payload: {
8
+ type: "req",
9
+ id: `REQ-CORPUS-${testCase.id}`,
10
+ properties: {
11
+ title: testCase.id,
12
+ status: "open",
13
+ source: "mcp://kibi/prose-coverage-corpus",
14
+ text_ref: testCase.text,
15
+ },
16
+ },
17
+ });
18
+ const suggestion = result.receipt.suggestions[0];
19
+ if (!suggestion)
20
+ return [failure(testCase, "No semantic advisor suggestion was produced")];
21
+ if (suggestion.kind !== testCase.expected.kind)
22
+ return [
23
+ failure(testCase, `Expected ${testCase.expected.kind} but received ${suggestion.kind}`),
24
+ ];
25
+ if (suggestion.kind === "predicate" &&
26
+ testCase.expected.predicate_name &&
27
+ suggestion.predicate.predicate_name !== testCase.expected.predicate_name) {
28
+ return [
29
+ failure(testCase, `Expected predicate ${testCase.expected.predicate_name} but received ${suggestion.predicate.predicate_name}`),
30
+ ];
31
+ }
32
+ if (suggestion.kind === "strict_property") {
33
+ if (testCase.expected.property_key &&
34
+ suggestion.claim.property_key !== testCase.expected.property_key)
35
+ return [
36
+ failure(testCase, `Expected property ${testCase.expected.property_key} but received ${suggestion.claim.property_key}`),
37
+ ];
38
+ if (testCase.expected.operator &&
39
+ suggestion.claim.operator !== testCase.expected.operator)
40
+ return [
41
+ failure(testCase, `Expected operator ${testCase.expected.operator} but received ${suggestion.claim.operator}`),
42
+ ];
43
+ }
44
+ return [];
45
+ }
46
+ export function evaluateProseCoverageCorpus(cases) {
47
+ const failures = cases.flatMap(evaluateCase);
48
+ const passed = cases.length - failures.length;
49
+ return {
50
+ coverage: cases.length === 0 ? 1 : passed / cases.length,
51
+ summary: { total: cases.length, passed, failed: failures.length },
52
+ failures,
53
+ };
54
+ }
@@ -0,0 +1,18 @@
1
+ import type { SemanticModelingSuggestion, SemanticStrictPropertyClaim } from "./types.js";
2
+ export type Payload = Readonly<Record<string, unknown>>;
3
+ export type MatchGroups = Readonly<Record<string, string | undefined>>;
4
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
5
+ export declare function stringValue(value: unknown): string;
6
+ export declare function canonicalize(value: unknown): string;
7
+ export declare function payloadHash(payload: Payload): string;
8
+ export declare function shortHash(value: string): string;
9
+ export declare function propertiesOf(payload: Payload): Record<string, unknown>;
10
+ export declare function statementOf(payload: Payload): string;
11
+ export declare function sourceOf(payload: Payload): string;
12
+ export declare function normalizeKey(value: string): string;
13
+ export declare function normalizePredicateToken(value: string): string;
14
+ export declare function singularize(value: string): string;
15
+ export declare function normalizeSubjectKey(value: string): string;
16
+ export declare function strictSuggestion(payload: Payload, evidence: string, claim: SemanticStrictPropertyClaim, rationale: string, confidence?: number): SemanticModelingSuggestion;
17
+ export declare function predicateSuggestion(payload: Payload, evidence: string, name: string, args: readonly string[], rationale: string, polarity?: "assert" | "deny"): SemanticModelingSuggestion;
18
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/shared.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,0BAA0B,EAE1B,2BAA2B,EAC5B,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACxD,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAGvE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAElD;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CASnD;AAGD,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAKpD;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAGD,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEtE;AAGD,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAGpD;AAGD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAIjD;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD;AAGD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ7D;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGjD;AAGD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAWD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,2BAA2B,EAClC,SAAS,EAAE,MAAM,EACjB,UAAU,SAAM,GACf,0BAA0B,CAqF5B;AAGD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,QAAQ,GAAG,MAAiB,GACrC,0BAA0B,CA+C5B"}
@@ -0,0 +1,209 @@
1
+ import { createHash } from "node:crypto";
2
+ import { semanticClaimKey } from "./clauses.js";
3
+ // implements REQ-mcp-semantic-advisor-preflight
4
+ export function isRecord(value) {
5
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6
+ }
7
+ // implements REQ-mcp-semantic-advisor-preflight
8
+ export function stringValue(value) {
9
+ return typeof value === "string" ? value.trim() : "";
10
+ }
11
+ // implements REQ-mcp-semantic-advisor-preflight
12
+ export function canonicalize(value) {
13
+ if (Array.isArray(value))
14
+ return `[${value.map(canonicalize).join(",")}]`;
15
+ if (isRecord(value)) {
16
+ return `{${Object.keys(value)
17
+ .sort()
18
+ .map((key) => `${JSON.stringify(key)}:${canonicalize(value[key])}`)
19
+ .join(",")}}`;
20
+ }
21
+ return JSON.stringify(value);
22
+ }
23
+ // implements REQ-mcp-semantic-advisor-preflight
24
+ export function payloadHash(payload) {
25
+ const stable = Object.fromEntries(Object.entries(payload).filter(([key]) => !key.startsWith("_")));
26
+ return createHash("sha256").update(canonicalize(stable)).digest("hex");
27
+ }
28
+ // implements REQ-mcp-semantic-advisor-preflight
29
+ export function shortHash(value) {
30
+ return createHash("sha256").update(value).digest("hex").slice(0, 12);
31
+ }
32
+ // implements REQ-mcp-semantic-advisor-preflight
33
+ export function propertiesOf(payload) {
34
+ return isRecord(payload.properties) ? payload.properties : {};
35
+ }
36
+ // implements REQ-mcp-semantic-advisor-preflight
37
+ export function statementOf(payload) {
38
+ const properties = propertiesOf(payload);
39
+ return stringValue(properties.text_ref) || stringValue(properties.title);
40
+ }
41
+ // implements REQ-mcp-semantic-advisor-preflight
42
+ export function sourceOf(payload) {
43
+ return (stringValue(propertiesOf(payload).source) || "mcp://kibi/semantic-advisor");
44
+ }
45
+ // implements REQ-mcp-semantic-advisor-preflight
46
+ export function normalizeKey(value) {
47
+ return value
48
+ .trim()
49
+ .toLowerCase()
50
+ .replace(/['’]/g, "")
51
+ .replace(/[^a-z0-9]+/g, "_")
52
+ .replace(/^_+|_+$/g, "");
53
+ }
54
+ // implements REQ-mcp-semantic-advisor-preflight
55
+ export function normalizePredicateToken(value) {
56
+ return value
57
+ .trim()
58
+ .replace(/\b(?:a|an|the)\b\s*/gi, "")
59
+ .replace(/['’]/g, "")
60
+ .replace(/\s+/g, "_")
61
+ .replace(/[^A-Za-z0-9_-]+/g, "_")
62
+ .replace(/^_+|_+$/g, "");
63
+ }
64
+ // implements REQ-mcp-semantic-advisor-preflight
65
+ export function singularize(value) {
66
+ if (["status", "results"].includes(value))
67
+ return value;
68
+ return value.endsWith("s") && value.length > 3 ? value.slice(0, -1) : value;
69
+ }
70
+ // implements REQ-mcp-semantic-advisor-preflight
71
+ export function normalizeSubjectKey(value) {
72
+ return normalizeKey(value).split("_").map(singularize).join(".");
73
+ }
74
+ function relationship(from, to, type) {
75
+ return { type, from, to };
76
+ }
77
+ // implements REQ-mcp-semantic-advisor-preflight
78
+ export function strictSuggestion(payload, evidence, claim, rationale, confidence = 0.9) {
79
+ const claimText = statementOf(payload);
80
+ const reqId = stringValue(payload.id) || `REQ-SEMANTIC-${shortHash(claim.subject_key)}`;
81
+ const subjectId = `FACT-SUBJECT-${shortHash(claim.subject_key)}`;
82
+ const propertyId = `FACT-PROP-${shortHash(`${claim.subject_key}.${claim.property_key}.${claim.operator}.${canonicalize(claim)}`)}`;
83
+ const source = sourceOf(payload);
84
+ const value = claim.value_string ??
85
+ claim.value_int ??
86
+ claim.value_number ??
87
+ claim.value_bool;
88
+ const propertyFields = {
89
+ ...(claim.value_string !== undefined
90
+ ? { value_string: claim.value_string }
91
+ : {}),
92
+ ...(claim.value_int !== undefined ? { value_int: claim.value_int } : {}),
93
+ ...(claim.value_number !== undefined
94
+ ? { value_number: claim.value_number }
95
+ : {}),
96
+ ...(claim.value_bool !== undefined ? { value_bool: claim.value_bool } : {}),
97
+ ...(claim.unit ? { unit: claim.unit } : {}),
98
+ };
99
+ return {
100
+ kind: "strict_property",
101
+ claim_key: semanticClaimKey(claimText),
102
+ claim_text: claimText,
103
+ confidence,
104
+ evidence,
105
+ rationale,
106
+ suggested_next_tool: "kb_model_requirement",
107
+ claim,
108
+ rejected_alternatives: ["predicate", "observation_review"],
109
+ applyPlan: [
110
+ {
111
+ type: "fact",
112
+ id: subjectId,
113
+ properties: {
114
+ title: `${claim.subject_key} subject`,
115
+ status: "active",
116
+ source,
117
+ fact_kind: "subject",
118
+ subject_key: claim.subject_key,
119
+ canonical_key: claim.subject_key,
120
+ tags: ["lane:strict", "semantic-advisor-suggestion"],
121
+ },
122
+ relationships: [],
123
+ },
124
+ {
125
+ type: "fact",
126
+ id: propertyId,
127
+ properties: {
128
+ title: `${claim.subject_key} ${claim.property_key}`,
129
+ status: "active",
130
+ source,
131
+ fact_kind: "property_value",
132
+ subject_key: claim.subject_key,
133
+ property_key: claim.property_key,
134
+ operator: claim.operator,
135
+ value_type: claim.value_type,
136
+ ...propertyFields,
137
+ canonical_key: `${claim.subject_key}.${claim.property_key}.${claim.operator}.${value}`,
138
+ tags: ["lane:strict", "semantic-advisor-suggestion"],
139
+ },
140
+ relationships: [],
141
+ },
142
+ {
143
+ type: "req",
144
+ id: reqId,
145
+ properties: {
146
+ title: stringValue(propertiesOf(payload).title) ||
147
+ "Semantic advisor requirement suggestion",
148
+ status: "open",
149
+ source,
150
+ text_ref: statementOf(payload),
151
+ tags: ["semantic-advisor-suggestion"],
152
+ },
153
+ relationships: [
154
+ relationship(reqId, subjectId, "constrains"),
155
+ relationship(reqId, propertyId, "requires_property"),
156
+ ],
157
+ },
158
+ ],
159
+ };
160
+ }
161
+ // implements REQ-mcp-semantic-advisor-preflight
162
+ export function predicateSuggestion(payload, evidence, name, args, rationale, polarity = "assert") {
163
+ const claimText = statementOf(payload);
164
+ const canonicalKey = `${name}(${args.join(",")})`;
165
+ const predicate = {
166
+ predicate_name: name,
167
+ predicate_args: args,
168
+ canonical_key: canonicalKey,
169
+ polarity,
170
+ };
171
+ const factId = `FACT-PRED-${shortHash(canonicalKey)}`;
172
+ const reqId = stringValue(payload.id);
173
+ return {
174
+ kind: "predicate",
175
+ claim_key: semanticClaimKey(claimText),
176
+ claim_text: claimText,
177
+ confidence: 0.84,
178
+ evidence,
179
+ rationale,
180
+ suggested_next_tool: "kb_suggest_predicates",
181
+ predicate,
182
+ rejected_alternatives: ["strict_property"],
183
+ applyPlan: [
184
+ {
185
+ type: "fact",
186
+ id: factId,
187
+ properties: {
188
+ title: `${name} suggestion`,
189
+ status: "active",
190
+ source: sourceOf(payload),
191
+ fact_kind: "predicate",
192
+ predicate_name: name,
193
+ predicate_args: args,
194
+ canonical_key: canonicalKey,
195
+ polarity,
196
+ tags: ["lane:ontology", "semantic-advisor-suggestion"],
197
+ },
198
+ relationships: [],
199
+ },
200
+ ],
201
+ relationshipPlan: reqId
202
+ ? {
203
+ applyAfter: factId,
204
+ requiresExistingReq: reqId,
205
+ relationship: relationship(reqId, factId, "requires_predicate"),
206
+ }
207
+ : null,
208
+ };
209
+ }
@@ -0,0 +1,4 @@
1
+ import { type Payload } from "./shared.js";
2
+ import type { SemanticModelingSuggestion } from "./types.js";
3
+ export declare function detectCountStrictSuggestion(payload: Payload, statement: string): SemanticModelingSuggestion | null;
4
+ //# sourceMappingURL=strict-count-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strict-count-rules.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/strict-count-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAKb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAuB7D,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,GAChB,0BAA0B,GAAG,IAAI,CA4DnC"}
@@ -0,0 +1,62 @@
1
+ import { normalizeKey, normalizeSubjectKey, singularize, strictSuggestion, } from "./shared.js";
2
+ const NUMBER_WORDS = new Map([
3
+ ["zero", 0],
4
+ ["one", 1],
5
+ ["two", 2],
6
+ ["three", 3],
7
+ ["four", 4],
8
+ ["five", 5],
9
+ ["six", 6],
10
+ ["seven", 7],
11
+ ["eight", 8],
12
+ ["nine", 9],
13
+ ["ten", 10],
14
+ ]);
15
+ function numberToken(value) {
16
+ return /^\d+$/.test(value)
17
+ ? Number(value)
18
+ : (NUMBER_WORDS.get(value.toLowerCase()) ?? null);
19
+ }
20
+ // implements REQ-mcp-semantic-advisor-preflight
21
+ export function detectCountStrictSuggestion(payload, statement) {
22
+ const cardinality = statement.match(/\b(?<operator>at\s+most|at\s+least|exactly|no\s+more\s+than|up\s+to)\s+(?<value>\d+|zero|one|two|three|four|five|six|seven|eight|nine|ten)\s+(?<resource>[a-z][a-z\s_-]*?)\.?$/i);
23
+ if (cardinality?.groups?.operator &&
24
+ cardinality.groups.value &&
25
+ cardinality.groups.resource) {
26
+ const value = numberToken(cardinality.groups.value);
27
+ if (value !== null) {
28
+ const normalized = normalizeKey(cardinality.groups.resource);
29
+ const tail = singularize(normalized.split("_").at(-1) ?? normalized);
30
+ const operator = /at\s+least/i.test(cardinality.groups.operator)
31
+ ? "gte"
32
+ : /exactly/i.test(cardinality.groups.operator)
33
+ ? "eq"
34
+ : "lte";
35
+ return strictSuggestion(payload, `${cardinality.groups.operator} ${cardinality.groups.value}`, {
36
+ subject_key: tail === "session" ? "user.session" : normalized.replace(/_/g, "."),
37
+ property_key: normalized.includes("active_session")
38
+ ? "active_count"
39
+ : "count",
40
+ operator,
41
+ value_type: "int",
42
+ value_int: value,
43
+ }, "Bounded cardinality is a strict numeric property and should be modeled explicitly.", 0.9);
44
+ }
45
+ }
46
+ const capped = statement.match(/^(?<subject>.+?)\s+cap(?:s|ped)?\s+at\s+(?:(?<property>[a-z][a-z\s_-]*?)\s+)?(?<value>\d+|zero|one|two|three|four|five|six|seven|eight|nine|ten)\.?$/i);
47
+ if (capped?.groups?.subject && capped.groups.value) {
48
+ const value = numberToken(capped.groups.value);
49
+ if (value !== null) {
50
+ return strictSuggestion(payload, `cap at ${capped.groups.value}`, {
51
+ subject_key: normalizeSubjectKey(capped.groups.subject),
52
+ property_key: capped.groups.property
53
+ ? `${normalizeKey(capped.groups.property)}_cap`
54
+ : "count",
55
+ operator: "lte",
56
+ value_type: "int",
57
+ value_int: value,
58
+ }, "Cap-at prose is an upper-bound strict property and should be modeled explicitly.", 0.9);
59
+ }
60
+ }
61
+ return null;
62
+ }
@@ -0,0 +1,4 @@
1
+ import { type Payload } from "./shared.js";
2
+ import type { SemanticModelingSuggestion } from "./types.js";
3
+ export declare function detectStrictSuggestion(payload: Payload, statement: string): SemanticModelingSuggestion | null;
4
+ //# sourceMappingURL=strict-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strict-rules.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/strict-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAGb,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EACV,0BAA0B,EAE3B,MAAM,YAAY,CAAC;AAcpB,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,GAChB,0BAA0B,GAAG,IAAI,CA8KnC"}