kibi-cli 0.14.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/bin/kibi +3 -1
  2. package/dist/cli-command.d.ts +5 -0
  3. package/dist/cli-command.d.ts.map +1 -0
  4. package/dist/cli-command.js +9 -0
  5. package/dist/cli-errors.d.ts +13 -0
  6. package/dist/cli-errors.d.ts.map +1 -0
  7. package/dist/cli-errors.js +26 -0
  8. package/dist/cli-input.d.ts +6 -0
  9. package/dist/cli-input.d.ts.map +1 -0
  10. package/dist/cli-input.js +54 -0
  11. package/dist/cli-json-command.d.ts +14 -0
  12. package/dist/cli-json-command.d.ts.map +1 -0
  13. package/dist/cli-json-command.js +96 -0
  14. package/dist/cli-protocol.d.ts +12 -0
  15. package/dist/cli-protocol.d.ts.map +1 -0
  16. package/dist/cli-protocol.js +37 -0
  17. package/dist/cli-register-foundation.d.ts +3 -0
  18. package/dist/cli-register-foundation.d.ts.map +1 -0
  19. package/dist/cli-register-foundation.js +90 -0
  20. package/dist/cli-register-maintenance.d.ts +3 -0
  21. package/dist/cli-register-maintenance.d.ts.map +1 -0
  22. package/dist/cli-register-maintenance.js +36 -0
  23. package/dist/cli-register-reporting.d.ts +3 -0
  24. package/dist/cli-register-reporting.d.ts.map +1 -0
  25. package/dist/cli-register-reporting.js +101 -0
  26. package/dist/cli-register-skills.d.ts +3 -0
  27. package/dist/cli-register-skills.d.ts.map +1 -0
  28. package/dist/cli-register-skills.js +71 -0
  29. package/dist/cli-validate.d.ts +18 -0
  30. package/dist/cli-validate.d.ts.map +1 -0
  31. package/dist/cli-validate.js +45 -0
  32. package/dist/cli.d.ts +4 -4
  33. package/dist/cli.d.ts.map +1 -1
  34. package/dist/cli.js +48 -211
  35. package/dist/commands/aggregated-checks.d.ts +1 -1
  36. package/dist/commands/aggregated-checks.d.ts.map +1 -1
  37. package/dist/commands/aggregated-checks.js +28 -34
  38. package/dist/commands/check.d.ts +1 -1
  39. package/dist/commands/check.d.ts.map +1 -1
  40. package/dist/commands/check.js +53 -95
  41. package/dist/commands/coverage.d.ts.map +1 -1
  42. package/dist/commands/coverage.js +12 -17
  43. package/dist/commands/discovery-shared.d.ts +2 -1
  44. package/dist/commands/discovery-shared.d.ts.map +1 -1
  45. package/dist/commands/discovery-shared.js +6 -18
  46. package/dist/commands/gaps.d.ts.map +1 -1
  47. package/dist/commands/gaps.js +15 -19
  48. package/dist/commands/graph.d.ts.map +1 -1
  49. package/dist/commands/graph.js +15 -21
  50. package/dist/commands/query.d.ts +7 -7
  51. package/dist/commands/query.d.ts.map +1 -1
  52. package/dist/commands/query.js +98 -204
  53. package/dist/commands/search.d.ts +4 -4
  54. package/dist/commands/search.d.ts.map +1 -1
  55. package/dist/commands/search.js +14 -27
  56. package/dist/commands/status.d.ts +1 -1
  57. package/dist/commands/status.d.ts.map +1 -1
  58. package/dist/commands/status.js +6 -7
  59. package/dist/commands/sync/manifest.d.ts +13 -2
  60. package/dist/commands/sync/manifest.d.ts.map +1 -1
  61. package/dist/commands/sync/manifest.js +31 -22
  62. package/dist/commands/sync/persistence.d.ts.map +1 -1
  63. package/dist/commands/sync/persistence.js +39 -1
  64. package/dist/extractors/markdown.d.ts +22 -2
  65. package/dist/extractors/markdown.d.ts.map +1 -1
  66. package/dist/extractors/markdown.js +50 -1
  67. package/dist/extractors/symbols-ts.d.ts.map +1 -1
  68. package/dist/extractors/symbols-ts.js +11 -1
  69. package/dist/logic/ir.d.ts +112 -0
  70. package/dist/logic/ir.d.ts.map +1 -0
  71. package/dist/logic/ir.js +729 -0
  72. package/dist/operations/autopilot/activation.d.ts +4 -0
  73. package/dist/operations/autopilot/activation.d.ts.map +1 -0
  74. package/dist/operations/autopilot/activation.js +130 -0
  75. package/dist/operations/autopilot/candidate-helpers.d.ts +13 -0
  76. package/dist/operations/autopilot/candidate-helpers.d.ts.map +1 -0
  77. package/dist/operations/autopilot/candidate-helpers.js +55 -0
  78. package/dist/operations/autopilot/candidates.d.ts +4 -0
  79. package/dist/operations/autopilot/candidates.d.ts.map +1 -0
  80. package/dist/operations/autopilot/candidates.js +114 -0
  81. package/dist/operations/autopilot/discovery-evidence.d.ts +10 -0
  82. package/dist/operations/autopilot/discovery-evidence.d.ts.map +1 -0
  83. package/dist/operations/autopilot/discovery-evidence.js +158 -0
  84. package/dist/operations/autopilot/discovery.d.ts +4 -0
  85. package/dist/operations/autopilot/discovery.d.ts.map +1 -0
  86. package/dist/operations/autopilot/discovery.js +100 -0
  87. package/dist/operations/autopilot/generate.d.ts +8 -0
  88. package/dist/operations/autopilot/generate.d.ts.map +1 -0
  89. package/dist/operations/autopilot/generate.js +112 -0
  90. package/dist/operations/autopilot/guidance-actions.d.ts +3 -0
  91. package/dist/operations/autopilot/guidance-actions.d.ts.map +1 -0
  92. package/dist/operations/autopilot/guidance-actions.js +79 -0
  93. package/dist/operations/autopilot/guidance.d.ts +14 -0
  94. package/dist/operations/autopilot/guidance.d.ts.map +1 -0
  95. package/dist/operations/autopilot/guidance.js +124 -0
  96. package/dist/operations/autopilot/markdown-candidates.d.ts +7 -0
  97. package/dist/operations/autopilot/markdown-candidates.d.ts.map +1 -0
  98. package/dist/operations/autopilot/markdown-candidates.js +134 -0
  99. package/dist/operations/autopilot/presentation.d.ts +13 -0
  100. package/dist/operations/autopilot/presentation.d.ts.map +1 -0
  101. package/dist/operations/autopilot/presentation.js +91 -0
  102. package/dist/operations/autopilot/requirement-claims.d.ts +3 -0
  103. package/dist/operations/autopilot/requirement-claims.d.ts.map +1 -0
  104. package/dist/operations/autopilot/requirement-claims.js +48 -0
  105. package/dist/operations/autopilot/types.d.ts +117 -0
  106. package/dist/operations/autopilot/types.d.ts.map +1 -0
  107. package/dist/operations/autopilot/types.js +8 -0
  108. package/dist/operations/modeling/logic-modeling.d.ts +22 -0
  109. package/dist/operations/modeling/logic-modeling.d.ts.map +1 -0
  110. package/dist/operations/modeling/logic-modeling.js +111 -0
  111. package/dist/operations/modeling/model-requirement.d.ts +10 -0
  112. package/dist/operations/modeling/model-requirement.d.ts.map +1 -0
  113. package/dist/operations/modeling/model-requirement.js +164 -0
  114. package/dist/operations/modeling/predicate-applyplan.d.ts +6 -0
  115. package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -0
  116. package/dist/operations/modeling/predicate-applyplan.js +117 -0
  117. package/dist/operations/modeling/predicate-catalog-1.d.ts +3 -0
  118. package/dist/operations/modeling/predicate-catalog-1.d.ts.map +1 -0
  119. package/dist/operations/modeling/predicate-catalog-1.js +200 -0
  120. package/dist/operations/modeling/predicate-catalog-2.d.ts +3 -0
  121. package/dist/operations/modeling/predicate-catalog-2.d.ts.map +1 -0
  122. package/dist/operations/modeling/predicate-catalog-2.js +197 -0
  123. package/dist/operations/modeling/predicate-catalog-3.d.ts +3 -0
  124. package/dist/operations/modeling/predicate-catalog-3.d.ts.map +1 -0
  125. package/dist/operations/modeling/predicate-catalog-3.js +193 -0
  126. package/dist/operations/modeling/predicate-catalog-4.d.ts +3 -0
  127. package/dist/operations/modeling/predicate-catalog-4.d.ts.map +1 -0
  128. package/dist/operations/modeling/predicate-catalog-4.js +149 -0
  129. package/dist/operations/modeling/predicate-catalog.d.ts +5 -0
  130. package/dist/operations/modeling/predicate-catalog.d.ts.map +1 -0
  131. package/dist/operations/modeling/predicate-catalog.js +29 -0
  132. package/dist/operations/modeling/predicate-inference-1.d.ts +16 -0
  133. package/dist/operations/modeling/predicate-inference-1.d.ts.map +1 -0
  134. package/dist/operations/modeling/predicate-inference-1.js +161 -0
  135. package/dist/operations/modeling/predicate-inference-2.d.ts +19 -0
  136. package/dist/operations/modeling/predicate-inference-2.d.ts.map +1 -0
  137. package/dist/operations/modeling/predicate-inference-2.js +169 -0
  138. package/dist/operations/modeling/predicate-inference-3.d.ts +15 -0
  139. package/dist/operations/modeling/predicate-inference-3.d.ts.map +1 -0
  140. package/dist/operations/modeling/predicate-inference-3.js +163 -0
  141. package/dist/operations/modeling/predicate-inference.d.ts +5 -0
  142. package/dist/operations/modeling/predicate-inference.d.ts.map +1 -0
  143. package/dist/operations/modeling/predicate-inference.js +163 -0
  144. package/dist/operations/modeling/predicate-loader.d.ts +10 -0
  145. package/dist/operations/modeling/predicate-loader.d.ts.map +1 -0
  146. package/dist/operations/modeling/predicate-loader.js +94 -0
  147. package/dist/operations/modeling/predicate-ranker.d.ts +3 -0
  148. package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -0
  149. package/dist/operations/modeling/predicate-ranker.js +62 -0
  150. package/dist/operations/modeling/predicate-score-1.d.ts +3 -0
  151. package/dist/operations/modeling/predicate-score-1.d.ts.map +1 -0
  152. package/dist/operations/modeling/predicate-score-1.js +121 -0
  153. package/dist/operations/modeling/predicate-score-2.d.ts +3 -0
  154. package/dist/operations/modeling/predicate-score-2.d.ts.map +1 -0
  155. package/dist/operations/modeling/predicate-score-2.js +122 -0
  156. package/dist/operations/modeling/predicate-score-3.d.ts +3 -0
  157. package/dist/operations/modeling/predicate-score-3.d.ts.map +1 -0
  158. package/dist/operations/modeling/predicate-score-3.js +54 -0
  159. package/dist/operations/modeling/predicate-types.d.ts +64 -0
  160. package/dist/operations/modeling/predicate-types.d.ts.map +1 -0
  161. package/dist/operations/modeling/predicate-types.js +1 -0
  162. package/dist/operations/modeling/predicate-usage-hints-1.d.ts +3 -0
  163. package/dist/operations/modeling/predicate-usage-hints-1.d.ts.map +1 -0
  164. package/dist/operations/modeling/predicate-usage-hints-1.js +211 -0
  165. package/dist/operations/modeling/predicate-usage-hints-2.d.ts +3 -0
  166. package/dist/operations/modeling/predicate-usage-hints-2.d.ts.map +1 -0
  167. package/dist/operations/modeling/predicate-usage-hints-2.js +209 -0
  168. package/dist/operations/modeling/predicate-usage-hints-3.d.ts +3 -0
  169. package/dist/operations/modeling/predicate-usage-hints-3.d.ts.map +1 -0
  170. package/dist/operations/modeling/predicate-usage-hints-3.js +45 -0
  171. package/dist/operations/modeling/predicate-utils.d.ts +23 -0
  172. package/dist/operations/modeling/predicate-utils.d.ts.map +1 -0
  173. package/dist/operations/modeling/predicate-utils.js +187 -0
  174. package/dist/operations/modeling/requirement-applyplan.d.ts +4 -0
  175. package/dist/operations/modeling/requirement-applyplan.d.ts.map +1 -0
  176. package/dist/operations/modeling/requirement-applyplan.js +44 -0
  177. package/dist/operations/modeling/requirement-heuristics.d.ts +4 -0
  178. package/dist/operations/modeling/requirement-heuristics.d.ts.map +1 -0
  179. package/dist/operations/modeling/requirement-heuristics.js +114 -0
  180. package/dist/operations/modeling/requirement-modeler.d.ts +8 -0
  181. package/dist/operations/modeling/requirement-modeler.d.ts.map +1 -0
  182. package/dist/operations/modeling/requirement-modeler.js +70 -0
  183. package/dist/operations/modeling/requirement-types.d.ts +61 -0
  184. package/dist/operations/modeling/requirement-types.d.ts.map +1 -0
  185. package/dist/operations/modeling/requirement-types.js +1 -0
  186. package/dist/operations/modeling/requirement-utils.d.ts +10 -0
  187. package/dist/operations/modeling/requirement-utils.d.ts.map +1 -0
  188. package/dist/operations/modeling/requirement-utils.js +65 -0
  189. package/dist/operations/modeling/suggest-predicates.d.ts +6 -0
  190. package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -0
  191. package/dist/operations/modeling/suggest-predicates.js +64 -0
  192. package/dist/operations/mutation/audit.d.ts +6 -0
  193. package/dist/operations/mutation/audit.d.ts.map +1 -0
  194. package/dist/operations/mutation/audit.js +22 -0
  195. package/dist/operations/mutation/contradictions.d.ts +10 -0
  196. package/dist/operations/mutation/contradictions.d.ts.map +1 -0
  197. package/dist/operations/mutation/contradictions.js +40 -0
  198. package/dist/operations/mutation/delete.d.ts +5 -0
  199. package/dist/operations/mutation/delete.d.ts.map +1 -0
  200. package/dist/operations/mutation/delete.js +67 -0
  201. package/dist/operations/mutation/relationships.d.ts +17 -0
  202. package/dist/operations/mutation/relationships.d.ts.map +1 -0
  203. package/dist/operations/mutation/relationships.js +142 -0
  204. package/dist/operations/mutation/save.d.ts +4 -0
  205. package/dist/operations/mutation/save.d.ts.map +1 -0
  206. package/dist/operations/mutation/save.js +14 -0
  207. package/dist/operations/mutation/serialization.d.ts +5 -0
  208. package/dist/operations/mutation/serialization.d.ts.map +1 -0
  209. package/dist/operations/mutation/serialization.js +88 -0
  210. package/dist/operations/mutation/strict-fact.d.ts +4 -0
  211. package/dist/operations/mutation/strict-fact.d.ts.map +1 -0
  212. package/dist/operations/mutation/strict-fact.js +132 -0
  213. package/dist/operations/mutation/symbol-granularity.d.ts +4 -0
  214. package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -0
  215. package/dist/operations/mutation/symbol-granularity.js +109 -0
  216. package/dist/operations/mutation/symbol-refresh.d.ts +10 -0
  217. package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -0
  218. package/dist/operations/mutation/symbol-refresh.js +105 -0
  219. package/dist/operations/mutation/types.d.ts +43 -0
  220. package/dist/operations/mutation/types.d.ts.map +1 -0
  221. package/dist/operations/mutation/types.js +1 -0
  222. package/dist/operations/mutation/upsert.d.ts +5 -0
  223. package/dist/operations/mutation/upsert.d.ts.map +1 -0
  224. package/dist/operations/mutation/upsert.js +103 -0
  225. package/dist/operations/mutation/validate-upsert.d.ts +5 -0
  226. package/dist/operations/mutation/validate-upsert.d.ts.map +1 -0
  227. package/dist/operations/mutation/validate-upsert.js +50 -0
  228. package/dist/operations/mutation/validation.d.ts +5 -0
  229. package/dist/operations/mutation/validation.d.ts.map +1 -0
  230. package/dist/operations/mutation/validation.js +107 -0
  231. package/dist/operations/mutation/warnings.d.ts +4 -0
  232. package/dist/operations/mutation/warnings.d.ts.map +1 -0
  233. package/dist/operations/mutation/warnings.js +17 -0
  234. package/dist/operations/semantic-advisor/analysis-receipt.d.ts +5 -0
  235. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -0
  236. package/dist/operations/semantic-advisor/analysis-receipt.js +120 -0
  237. package/dist/operations/semantic-advisor/analyze-prose.d.ts +5 -0
  238. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -0
  239. package/dist/operations/semantic-advisor/analyze-prose.js +693 -0
  240. package/dist/operations/semantic-advisor/clauses.d.ts +10 -0
  241. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -0
  242. package/dist/operations/semantic-advisor/clauses.js +43 -0
  243. package/dist/operations/semantic-advisor/observation-plan.d.ts +3 -0
  244. package/dist/operations/semantic-advisor/observation-plan.d.ts.map +1 -0
  245. package/dist/operations/semantic-advisor/observation-plan.js +31 -0
  246. package/dist/operations/semantic-advisor/predicate-rule.d.ts +14 -0
  247. package/dist/operations/semantic-advisor/predicate-rule.d.ts.map +1 -0
  248. package/dist/operations/semantic-advisor/predicate-rule.js +22 -0
  249. package/dist/operations/semantic-advisor/predicate-rules-core.d.ts +79 -0
  250. package/dist/operations/semantic-advisor/predicate-rules-core.d.ts.map +1 -0
  251. package/dist/operations/semantic-advisor/predicate-rules-core.js +140 -0
  252. package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts +83 -0
  253. package/dist/operations/semantic-advisor/predicate-rules-policy.d.ts.map +1 -0
  254. package/dist/operations/semantic-advisor/predicate-rules-policy.js +150 -0
  255. package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts +48 -0
  256. package/dist/operations/semantic-advisor/predicate-rules-product-tail.d.ts.map +1 -0
  257. package/dist/operations/semantic-advisor/predicate-rules-product-tail.js +102 -0
  258. package/dist/operations/semantic-advisor/predicate-rules-product.d.ts +71 -0
  259. package/dist/operations/semantic-advisor/predicate-rules-product.d.ts.map +1 -0
  260. package/dist/operations/semantic-advisor/predicate-rules-product.js +133 -0
  261. package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts +29 -0
  262. package/dist/operations/semantic-advisor/prose-coverage-evaluator.d.ts.map +1 -0
  263. package/dist/operations/semantic-advisor/prose-coverage-evaluator.js +54 -0
  264. package/dist/operations/semantic-advisor/shared.d.ts +19 -0
  265. package/dist/operations/semantic-advisor/shared.d.ts.map +1 -0
  266. package/dist/operations/semantic-advisor/shared.js +209 -0
  267. package/dist/operations/semantic-advisor/strict-count-rules.d.ts +4 -0
  268. package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -0
  269. package/dist/operations/semantic-advisor/strict-count-rules.js +62 -0
  270. package/dist/operations/semantic-advisor/strict-rules.d.ts +4 -0
  271. package/dist/operations/semantic-advisor/strict-rules.d.ts.map +1 -0
  272. package/dist/operations/semantic-advisor/strict-rules.js +106 -0
  273. package/dist/operations/semantic-advisor/types.d.ts +195 -0
  274. package/dist/operations/semantic-advisor/types.d.ts.map +1 -0
  275. package/dist/operations/semantic-advisor/types.js +1 -0
  276. package/dist/prolog/codec.d.ts.map +1 -1
  277. package/dist/prolog/codec.js +20 -3
  278. package/dist/prolog.d.ts +5 -0
  279. package/dist/prolog.d.ts.map +1 -1
  280. package/dist/prolog.js +89 -32
  281. package/dist/public/impact/diagnostics.d.ts.map +1 -1
  282. package/dist/public/impact/diagnostics.js +8 -4
  283. package/dist/public/impact/full-kb-quality.d.ts +1 -1
  284. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  285. package/dist/public/impact/full-kb-quality.js +34 -1
  286. package/dist/public/impact/requirement-quality.d.ts.map +1 -1
  287. package/dist/public/impact/requirement-quality.js +6 -23
  288. package/dist/public/operations/catalog.d.ts +986 -0
  289. package/dist/public/operations/catalog.d.ts.map +1 -0
  290. package/dist/public/operations/catalog.js +42 -0
  291. package/dist/public/operations/check-executor.d.ts +21 -0
  292. package/dist/public/operations/check-executor.d.ts.map +1 -0
  293. package/dist/public/operations/check-executor.js +111 -0
  294. package/dist/public/operations/check-format-shared.d.ts +36 -0
  295. package/dist/public/operations/check-format-shared.d.ts.map +1 -0
  296. package/dist/public/operations/check-format-shared.js +107 -0
  297. package/dist/public/operations/check-helpers.d.ts +10 -0
  298. package/dist/public/operations/check-helpers.d.ts.map +1 -0
  299. package/dist/public/operations/check-helpers.js +107 -0
  300. package/dist/public/operations/discovery-entities.d.ts +14 -0
  301. package/dist/public/operations/discovery-entities.d.ts.map +1 -0
  302. package/dist/public/operations/discovery-entities.js +91 -0
  303. package/dist/public/operations/discovery-executors.d.ts +39 -0
  304. package/dist/public/operations/discovery-executors.d.ts.map +1 -0
  305. package/dist/public/operations/discovery-executors.js +101 -0
  306. package/dist/public/operations/index.d.ts +21 -0
  307. package/dist/public/operations/index.d.ts.map +1 -0
  308. package/dist/public/operations/index.js +19 -0
  309. package/dist/public/operations/node-ports.d.ts +15 -0
  310. package/dist/public/operations/node-ports.d.ts.map +1 -0
  311. package/dist/public/operations/node-ports.js +57 -0
  312. package/dist/public/operations/prolog-json.d.ts +5 -0
  313. package/dist/public/operations/prolog-json.d.ts.map +1 -0
  314. package/dist/public/operations/prolog-json.js +44 -0
  315. package/dist/public/operations/runtime-types.d.ts +69 -0
  316. package/dist/public/operations/runtime-types.d.ts.map +1 -0
  317. package/dist/public/operations/runtime-types.js +17 -0
  318. package/dist/public/operations/specs/autopilot.d.ts +82 -0
  319. package/dist/public/operations/specs/autopilot.d.ts.map +1 -0
  320. package/dist/public/operations/specs/autopilot.js +72 -0
  321. package/dist/public/operations/specs/check.d.ts +51 -0
  322. package/dist/public/operations/specs/check.d.ts.map +1 -0
  323. package/dist/public/operations/specs/check.js +65 -0
  324. package/dist/public/operations/specs/discovery.d.ts +94 -0
  325. package/dist/public/operations/specs/discovery.d.ts.map +1 -0
  326. package/dist/public/operations/specs/discovery.js +98 -0
  327. package/dist/public/operations/specs/modeling.d.ts +142 -0
  328. package/dist/public/operations/specs/modeling.d.ts.map +1 -0
  329. package/dist/public/operations/specs/modeling.js +133 -0
  330. package/dist/public/operations/specs/mutation-schemas.d.ts +268 -0
  331. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -0
  332. package/dist/public/operations/specs/mutation-schemas.js +294 -0
  333. package/dist/public/operations/specs/mutation.d.ts +56 -0
  334. package/dist/public/operations/specs/mutation.d.ts.map +1 -0
  335. package/dist/public/operations/specs/mutation.js +44 -0
  336. package/dist/public/operations/specs/reporting.d.ts +185 -0
  337. package/dist/public/operations/specs/reporting.d.ts.map +1 -0
  338. package/dist/public/operations/specs/reporting.js +158 -0
  339. package/dist/public/operations/specs/semantic.d.ts +81 -0
  340. package/dist/public/operations/specs/semantic.d.ts.map +1 -0
  341. package/dist/public/operations/specs/semantic.js +137 -0
  342. package/dist/public/operations/specs/skills.d.ts +70 -0
  343. package/dist/public/operations/specs/skills.d.ts.map +1 -0
  344. package/dist/public/operations/specs/skills.js +107 -0
  345. package/dist/public/operations/specs/sparql.d.ts +39 -0
  346. package/dist/public/operations/specs/sparql.d.ts.map +1 -0
  347. package/dist/public/operations/specs/sparql.js +121 -0
  348. package/dist/public/operations/specs/upsert.d.ts +291 -0
  349. package/dist/public/operations/specs/upsert.d.ts.map +1 -0
  350. package/dist/public/operations/specs/upsert.js +27 -0
  351. package/dist/public/operations/types.d.ts +24 -0
  352. package/dist/public/operations/types.d.ts.map +1 -0
  353. package/dist/public/operations/types.js +1 -0
  354. package/dist/public/schemas/entity.d.ts.map +1 -1
  355. package/dist/public/schemas/entity.js +317 -0
  356. package/dist/public/schemas/relationship.d.ts.map +1 -1
  357. package/dist/public/schemas/relationship.js +1 -0
  358. package/dist/public/skill-system/errors.d.ts +19 -0
  359. package/dist/public/skill-system/errors.d.ts.map +1 -0
  360. package/dist/public/skill-system/errors.js +36 -0
  361. package/dist/public/skill-system/loader.d.ts +9 -0
  362. package/dist/public/skill-system/loader.d.ts.map +1 -0
  363. package/dist/public/skill-system/loader.js +76 -0
  364. package/dist/public/skill-system/paths.d.ts +6 -0
  365. package/dist/public/skill-system/paths.d.ts.map +1 -0
  366. package/dist/public/skill-system/paths.js +25 -0
  367. package/dist/public/skill-system/types.d.ts +15 -0
  368. package/dist/public/skill-system/types.d.ts.map +1 -0
  369. package/dist/public/skill-system/types.js +1 -0
  370. package/dist/public/skill-system/validation.d.ts +10 -0
  371. package/dist/public/skill-system/validation.d.ts.map +1 -0
  372. package/dist/public/skill-system/validation.js +119 -0
  373. package/dist/public/skills/init-kibi/SKILL.md +62 -0
  374. package/dist/public/skills/kibi-freshness/SKILL.md +44 -0
  375. package/dist/public/skills/kibi-traceability/SKILL.md +54 -0
  376. package/dist/public/skills/kibi-usage/SKILL.md +145 -99
  377. package/dist/public/skills/kibi-usage/resources/fact-lanes.md +112 -0
  378. package/dist/public/skills/kibi-usage/resources/logic-ir.md +43 -0
  379. package/dist/public/skills/kibi-usage/resources/operation-access.md +44 -0
  380. package/dist/public/skills/kibi-usage/resources/ui-requirements.md +96 -0
  381. package/dist/public/skills/kibi-usage/resources/workflows.md +41 -3
  382. package/dist/public/skills.d.ts +4 -41
  383. package/dist/public/skills.d.ts.map +1 -1
  384. package/dist/public/skills.js +3 -270
  385. package/dist/public/symbol-granularity.d.ts +9 -0
  386. package/dist/public/symbol-granularity.d.ts.map +1 -1
  387. package/dist/public/symbol-granularity.js +16 -0
  388. package/dist/runtime/cli-runtime.d.ts +3 -0
  389. package/dist/runtime/cli-runtime.d.ts.map +1 -0
  390. package/dist/runtime/cli-runtime.js +96 -0
  391. package/dist/schemas/entity.schema.json +329 -3
  392. package/dist/traceability/staged-diagnostics.d.ts +2 -2
  393. package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
  394. package/dist/traceability/staged-diagnostics.js +17 -10
  395. package/dist/traceability/staged-impact-contract.js +1 -1
  396. package/dist/traceability/staged-symbols-manifest.d.ts +1 -0
  397. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  398. package/dist/traceability/staged-symbols-manifest.js +53 -24
  399. package/dist/traceability/symbol-extract.d.ts.map +1 -1
  400. package/dist/traceability/symbol-extract.js +17 -1
  401. package/dist/traceability/temp-kb.d.ts.map +1 -1
  402. package/dist/traceability/temp-kb.js +47 -1
  403. package/dist/types/entities.d.ts +3 -0
  404. package/dist/types/entities.d.ts.map +1 -1
  405. package/dist/types/relationships.d.ts +1 -1
  406. package/dist/types/relationships.d.ts.map +1 -1
  407. package/dist/utils/rule-registry.d.ts.map +1 -1
  408. package/dist/utils/rule-registry.js +24 -0
  409. package/dist/utils/schema-version.d.ts +1 -1
  410. package/dist/utils/schema-version.js +1 -1
  411. package/package.json +60 -2
  412. package/src/public/impact/diagnostics.ts +18 -11
  413. package/src/public/impact/full-kb-quality.ts +30 -3
  414. package/src/public/impact/requirement-quality.ts +6 -26
  415. package/src/public/operations/catalog.ts +60 -0
  416. package/src/public/operations/check-executor.ts +185 -0
  417. package/src/public/operations/check-format-shared.ts +178 -0
  418. package/src/public/operations/check-helpers.ts +141 -0
  419. package/src/public/operations/discovery-entities.ts +122 -0
  420. package/src/public/operations/discovery-executors.ts +176 -0
  421. package/src/public/operations/index.ts +20 -0
  422. package/src/public/operations/node-ports.ts +78 -0
  423. package/src/public/operations/prolog-json.ts +71 -0
  424. package/src/public/operations/runtime-types.ts +106 -0
  425. package/src/public/operations/specs/autopilot.ts +98 -0
  426. package/src/public/operations/specs/check.ts +75 -0
  427. package/src/public/operations/specs/discovery.ts +126 -0
  428. package/src/public/operations/specs/modeling.ts +174 -0
  429. package/src/public/operations/specs/mutation-schemas.ts +326 -0
  430. package/src/public/operations/specs/mutation.ts +58 -0
  431. package/src/public/operations/specs/reporting.ts +249 -0
  432. package/src/public/operations/specs/semantic.ts +174 -0
  433. package/src/public/operations/specs/skills.ts +142 -0
  434. package/src/public/operations/specs/sparql.ts +149 -0
  435. package/src/public/operations/specs/upsert.ts +40 -0
  436. package/src/public/operations/types.ts +57 -0
  437. package/src/public/schemas/entity.ts +324 -1
  438. package/src/public/schemas/relationship.ts +1 -0
  439. package/src/public/skill-system/errors.ts +38 -0
  440. package/src/public/skill-system/loader.ts +108 -0
  441. package/src/public/skill-system/paths.ts +27 -0
  442. package/src/public/skill-system/types.ts +14 -0
  443. package/src/public/skill-system/validation.ts +175 -0
  444. package/src/public/skills/init-kibi/SKILL.md +62 -0
  445. package/src/public/skills/kibi-freshness/SKILL.md +44 -0
  446. package/src/public/skills/kibi-traceability/SKILL.md +54 -0
  447. package/src/public/skills/kibi-usage/SKILL.md +145 -99
  448. package/src/public/skills/kibi-usage/resources/fact-lanes.md +112 -0
  449. package/src/public/skills/kibi-usage/resources/logic-ir.md +43 -0
  450. package/src/public/skills/kibi-usage/resources/operation-access.md +44 -0
  451. package/src/public/skills/kibi-usage/resources/ui-requirements.md +96 -0
  452. package/src/public/skills/kibi-usage/resources/workflows.md +41 -3
  453. package/src/public/skills.ts +18 -427
  454. package/src/public/symbol-granularity.ts +25 -0
  455. package/src/schemas/entity.schema.json +329 -3
  456. package/src/schemas/relationship.schema.json +1 -0
@@ -0,0 +1,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
+ export 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"}
@@ -0,0 +1,106 @@
1
+ import { normalizeSubjectKey, strictSuggestion, } from "./shared.js";
2
+ import { detectCountStrictSuggestion } from "./strict-count-rules.js";
3
+ function suggestion(payload, match, claim, rationale, confidence, evidence = match[0]) {
4
+ return strictSuggestion(payload, evidence, claim, rationale, confidence);
5
+ }
6
+ // implements REQ-mcp-semantic-advisor-preflight
7
+ export function detectStrictSuggestion(payload, statement) {
8
+ const expiry = statement.match(/^(?<subject>.+?)\s+expir(?:e|es)\s+after\s+(?<value>\d+)\s+(?<unit>days?|months?|years?|hours?|minutes?)\.?$/i);
9
+ if (expiry?.groups?.subject && expiry.groups.value && expiry.groups.unit) {
10
+ const unit = expiry.groups.unit.toLowerCase().replace(/s?$/, "s");
11
+ return suggestion(payload, expiry, {
12
+ subject_key: normalizeSubjectKey(expiry.groups.subject),
13
+ property_key: `expiry_${unit}`,
14
+ operator: "eq",
15
+ value_type: "int",
16
+ value_int: Number(expiry.groups.value),
17
+ unit,
18
+ }, "Expiry duration is a scalar strict property and should be explicit.", 0.88, `expire after ${expiry.groups.value} ${expiry.groups.unit}`);
19
+ }
20
+ const comparative = statement.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+(?<operator>less\s+than|greater\s+than|below|above|minimum|maximum|at\s+least|at\s+most)\s+(?<value>\d+)\.?$/i);
21
+ if (comparative?.groups?.subject &&
22
+ comparative.groups.operator &&
23
+ comparative.groups.value) {
24
+ const operatorText = comparative.groups.operator.toLowerCase();
25
+ const operator = /less|below/.test(operatorText)
26
+ ? "lt"
27
+ : /greater|above/.test(operatorText)
28
+ ? "gt"
29
+ : /minimum|least/.test(operatorText)
30
+ ? "gte"
31
+ : "lte";
32
+ return suggestion(payload, comparative, {
33
+ subject_key: normalizeSubjectKey(comparative.groups.subject),
34
+ property_key: "value",
35
+ operator,
36
+ value_type: "int",
37
+ value_int: Number(comparative.groups.value),
38
+ }, "Comparative numeric prose is a strict property constraint.", 0.86, `${comparative.groups.operator} ${comparative.groups.value}`);
39
+ }
40
+ const precision = statement.match(/^.+?\s+(?:must|shall|should)\s+normalize\s+into\s+canonical\s+integer\s+decisecond\s+(?<subject>[a-z][a-z0-9_-]*)\s+values?\.?$/i);
41
+ if (precision?.groups?.subject) {
42
+ return suggestion(payload, precision, {
43
+ subject_key: normalizeSubjectKey(precision.groups.subject),
44
+ property_key: "slot_precision",
45
+ operator: "eq",
46
+ value_type: "string",
47
+ value_string: "decisecond",
48
+ }, "Canonical decisecond slot prose is a strict precision property.", 0.9);
49
+ }
50
+ const threshold = statement.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+return\s+within\s+(?<value>\d+)\s+(?<unit>ms|milliseconds?|s|sec|secs|seconds?)\.?$/i);
51
+ if (threshold?.groups?.subject &&
52
+ threshold.groups.value &&
53
+ threshold.groups.unit) {
54
+ const unit = threshold.groups.unit.toLowerCase().startsWith("m")
55
+ ? "ms"
56
+ : "seconds";
57
+ return suggestion(payload, threshold, {
58
+ subject_key: normalizeSubjectKey(threshold.groups.subject),
59
+ property_key: unit === "ms" ? "latency_ms" : "latency_seconds",
60
+ operator: "lte",
61
+ value_type: "int",
62
+ value_int: Number(threshold.groups.value),
63
+ unit,
64
+ }, "Response-time thresholds are bounded numeric properties and should be modeled explicitly.", 0.88, `within ${threshold.groups.value} ${threshold.groups.unit}`);
65
+ }
66
+ const booleanState = statement.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+(?<state>enabled|disabled)\.?$/i);
67
+ if (booleanState?.groups?.subject && booleanState.groups.state) {
68
+ return suggestion(payload, booleanState, {
69
+ subject_key: normalizeSubjectKey(booleanState.groups.subject),
70
+ property_key: "enabled",
71
+ operator: "eq",
72
+ value_type: "bool",
73
+ value_bool: booleanState.groups.state.toLowerCase() === "enabled",
74
+ }, "Enabled/disabled requirements are boolean properties and can participate in strict checks.", 0.88, `be ${booleanState.groups.state}`);
75
+ }
76
+ const retention = statement.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+retained\s+for\s+(?<value>\d+)\s+(?<unit>days?|months?|years?)\.?$/i);
77
+ if (retention?.groups?.subject &&
78
+ retention.groups.value &&
79
+ retention.groups.unit) {
80
+ const unit = retention.groups.unit.toLowerCase().replace(/s$/, "s");
81
+ return suggestion(payload, retention, {
82
+ subject_key: normalizeSubjectKey(retention.groups.subject),
83
+ property_key: `retention_${unit}`,
84
+ operator: "eq",
85
+ value_type: "int",
86
+ value_int: Number(retention.groups.value),
87
+ unit,
88
+ }, "Retention duration is a scalar strict property and can participate in contradiction checks.", 0.92, `retained for ${retention.groups.value} ${retention.groups.unit}`);
89
+ }
90
+ const enumSet = statement.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+one\s+of\s+(?<values>.+?)\.?$/i);
91
+ if (enumSet?.groups?.subject && enumSet.groups.values) {
92
+ const values = enumSet.groups.values
93
+ .split(/,|\bor\b/i)
94
+ .map((value) => value.trim())
95
+ .filter(Boolean);
96
+ if (values.length > 1)
97
+ return suggestion(payload, enumSet, {
98
+ subject_key: normalizeSubjectKey(enumSet.groups.subject),
99
+ property_key: "allowed_values",
100
+ operator: "eq",
101
+ value_type: "string",
102
+ value_string: values.join("|"),
103
+ }, "Allowed enum sets are explicit property values and should not remain prose-only.", 0.86, `one of ${enumSet.groups.values}`);
104
+ }
105
+ return detectCountStrictSuggestion(payload, statement);
106
+ }
@@ -0,0 +1,195 @@
1
+ import type { LogicRuleIR } from "../../logic/ir.js";
2
+ export type SemanticAdvisorLane = "strict_property" | "predicate" | "rule" | "observation_review" | "none";
3
+ export type SemanticAdvisorReadiness = "modeled" | "needs_modeling" | "not_applicable";
4
+ export type SemanticLogicCoverageStatus = "complete" | "partial" | "unverified" | "not_applicable";
5
+ export type SemanticPropositionRole = "normative" | "definition" | "descriptive" | "condition" | "exception" | "rationale" | "example" | "subjective";
6
+ export type SemanticPropositionStatus = "modeled" | "ambiguous" | "ontology_gap" | "nonlogical" | "missing";
7
+ export interface SemanticPropositionSpan {
8
+ readonly start: number;
9
+ readonly end: number;
10
+ }
11
+ export interface SemanticProposition {
12
+ readonly claim_key: string;
13
+ readonly claim_text: string;
14
+ readonly role: SemanticPropositionRole;
15
+ readonly status: SemanticPropositionStatus;
16
+ readonly span: SemanticPropositionSpan;
17
+ readonly payload_hash?: string;
18
+ readonly semantic_key?: string;
19
+ readonly reason?: string;
20
+ }
21
+ export interface SemanticInterpretationInput {
22
+ readonly claim_key: string;
23
+ readonly claim_text: string;
24
+ readonly ir: LogicRuleIR;
25
+ readonly confidence?: number;
26
+ readonly span?: SemanticPropositionSpan;
27
+ }
28
+ export interface SemanticInterpretationResult {
29
+ readonly claim_key: string;
30
+ readonly semantic_key?: string;
31
+ /** Canonical, schema-validated IR for inspection; never executable source. */
32
+ readonly normalized_ir?: LogicRuleIR;
33
+ readonly valid: boolean;
34
+ readonly confidence: number;
35
+ readonly errors: readonly string[];
36
+ readonly warnings: readonly string[];
37
+ readonly rendered_prolog?: string;
38
+ }
39
+ export type SemanticShadowCueKind = "modal" | "polarity" | "passive_voice" | "nominalization" | "conditional" | "causal" | "prerequisite" | "exception" | "temporal" | "quantifier" | "numeric" | "negation_scope" | "directionality";
40
+ export interface SemanticShadowCue {
41
+ readonly kind: SemanticShadowCueKind;
42
+ readonly evidence: string;
43
+ readonly represented: boolean;
44
+ }
45
+ export type SemanticSignalKind = "normative_modal" | "numeric_cardinality" | "numeric_threshold" | "conditional" | "permission" | "state_or_default";
46
+ export interface SemanticSignal {
47
+ readonly kind: SemanticSignalKind;
48
+ readonly evidence: string;
49
+ readonly candidate_lane: SemanticAdvisorLane;
50
+ readonly confidence: number;
51
+ }
52
+ export interface SemanticAmbiguityWitness {
53
+ readonly signal_kind: SemanticSignalKind;
54
+ readonly evidence: string;
55
+ readonly interpretations: readonly string[];
56
+ readonly message: string;
57
+ }
58
+ export interface SemanticStrictPropertyClaim {
59
+ readonly subject_key: string;
60
+ readonly property_key: string;
61
+ readonly operator: "eq" | "neq" | "lt" | "lte" | "gt" | "gte";
62
+ readonly value_type: "string" | "int" | "number" | "bool";
63
+ readonly value_string?: string;
64
+ readonly value_int?: number;
65
+ readonly value_number?: number;
66
+ readonly value_bool?: boolean;
67
+ readonly unit?: string;
68
+ }
69
+ export interface SemanticPredicateClaim {
70
+ readonly predicate_name: string;
71
+ readonly predicate_args: readonly string[];
72
+ readonly canonical_key: string;
73
+ readonly polarity: "assert" | "deny";
74
+ }
75
+ export type SemanticModelingSuggestion = {
76
+ readonly kind: "strict_property";
77
+ readonly claim_key: string;
78
+ readonly claim_text: string;
79
+ readonly confidence: number;
80
+ readonly evidence: string;
81
+ readonly rationale: string;
82
+ readonly suggested_next_tool: "kb_model_requirement";
83
+ readonly claim: SemanticStrictPropertyClaim;
84
+ readonly rejected_alternatives: readonly string[];
85
+ readonly applyPlan: readonly Readonly<Record<string, unknown>>[];
86
+ } | {
87
+ readonly kind: "predicate";
88
+ readonly claim_key: string;
89
+ readonly claim_text: string;
90
+ readonly confidence: number;
91
+ readonly evidence: string;
92
+ readonly rationale: string;
93
+ readonly suggested_next_tool: "kb_suggest_predicates";
94
+ readonly predicate: SemanticPredicateClaim;
95
+ readonly rejected_alternatives: readonly string[];
96
+ readonly applyPlan: readonly Readonly<Record<string, unknown>>[];
97
+ readonly relationshipPlan: Readonly<Record<string, unknown>> | null;
98
+ } | {
99
+ readonly kind: "rule";
100
+ readonly claim_key: string;
101
+ readonly claim_text: string;
102
+ readonly confidence: number;
103
+ readonly evidence: string;
104
+ readonly rationale: string;
105
+ readonly suggested_next_tool: "kb_model_requirement";
106
+ readonly rule: LogicRuleIR;
107
+ readonly semantic_key: string;
108
+ readonly rendered_prolog: string;
109
+ readonly rejected_alternatives: readonly string[];
110
+ readonly applyPlan: readonly Readonly<Record<string, unknown>>[];
111
+ readonly relationshipPlan: Readonly<Record<string, unknown>> | null;
112
+ } | {
113
+ readonly kind: "ambiguity_observation";
114
+ readonly claim_key: string;
115
+ readonly claim_text: string;
116
+ readonly confidence: number;
117
+ readonly evidence: string;
118
+ readonly rationale: string;
119
+ readonly ambiguity: readonly string[];
120
+ readonly suggested_next_tool: "kb_model_requirement" | "kb_suggest_predicates";
121
+ readonly applyPlan: readonly Readonly<Record<string, unknown>>[];
122
+ } | {
123
+ readonly kind: "ontology_gap";
124
+ readonly claim_key: string;
125
+ readonly claim_text: string;
126
+ readonly confidence: number;
127
+ readonly evidence: string;
128
+ readonly rationale: string;
129
+ readonly suggested_next_tool: "kb_suggest_predicates";
130
+ readonly recommendedPredicateSchema: {
131
+ readonly predicate_name: string;
132
+ readonly argument_names: readonly string[];
133
+ readonly argument_types: readonly string[];
134
+ } | null;
135
+ readonly applyPlan: readonly Readonly<Record<string, unknown>>[];
136
+ };
137
+ export interface SemanticAdvisorReceipt {
138
+ readonly version: string;
139
+ readonly payload_hash: string;
140
+ readonly logic_readiness: SemanticAdvisorReadiness;
141
+ readonly candidate_lane: SemanticAdvisorLane;
142
+ readonly signals: readonly SemanticSignal[];
143
+ readonly ambiguity_witnesses: readonly SemanticAmbiguityWitness[];
144
+ readonly propositions: readonly SemanticProposition[];
145
+ readonly interpretations: readonly SemanticInterpretationResult[];
146
+ readonly shadow_analysis: readonly SemanticShadowCue[];
147
+ readonly suggestions: readonly SemanticModelingSuggestion[];
148
+ readonly clauses: readonly {
149
+ readonly claim_key: string;
150
+ readonly text: string;
151
+ readonly index: number;
152
+ readonly normative: boolean;
153
+ readonly source: "detected" | "supplied";
154
+ readonly suggestion_indexes: readonly number[];
155
+ }[];
156
+ readonly logic_coverage: {
157
+ readonly status: SemanticLogicCoverageStatus;
158
+ readonly expected_claim_keys: readonly string[];
159
+ readonly declared_claim_keys: readonly string[];
160
+ readonly missing_claim_keys: readonly string[];
161
+ readonly unresolved_claim_keys: readonly string[];
162
+ };
163
+ readonly suggested_next_tools: readonly string[];
164
+ readonly summary: string;
165
+ }
166
+ export interface SemanticAdvisorInput {
167
+ readonly payload: Readonly<Record<string, unknown>>;
168
+ readonly clauses?: readonly string[];
169
+ readonly interpretations?: readonly SemanticInterpretationInput[];
170
+ }
171
+ export interface SemanticAdvisorAnalysisResult {
172
+ readonly receipt: SemanticAdvisorReceipt;
173
+ readonly warnings: readonly string[];
174
+ }
175
+ export interface SemanticAdvisorArgs {
176
+ readonly text: string;
177
+ readonly clauses?: readonly string[];
178
+ readonly type?: string;
179
+ readonly id?: string;
180
+ readonly title?: string;
181
+ readonly source?: string;
182
+ readonly status?: string;
183
+ readonly interpretations?: readonly SemanticInterpretationInput[];
184
+ }
185
+ export interface SemanticAdvisorOperationResult {
186
+ readonly content: readonly {
187
+ readonly type: "text";
188
+ readonly text: string;
189
+ }[];
190
+ readonly structuredContent: {
191
+ readonly receipt: SemanticAdvisorReceipt;
192
+ readonly warnings: readonly string[];
193
+ };
194
+ }
195
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAC3B,iBAAiB,GACjB,WAAW,GACX,MAAM,GACN,oBAAoB,GACpB,MAAM,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAChC,SAAS,GACT,gBAAgB,GAChB,gBAAgB,CAAC;AACrB,MAAM,MAAM,2BAA2B,GACnC,UAAU,GACV,SAAS,GACT,YAAY,GACZ,gBAAgB,CAAC;AAErB,MAAM,MAAM,uBAAuB,GAC/B,WAAW,GACX,YAAY,GACZ,aAAa,GACb,WAAW,GACX,WAAW,GACX,WAAW,GACX,SAAS,GACT,YAAY,CAAC;AAEjB,MAAM,MAAM,yBAAyB,GACjC,SAAS,GACT,WAAW,GACX,cAAc,GACd,YAAY,GACZ,SAAS,CAAC;AAEd,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IACvC,QAAQ,CAAC,M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,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAoBzE;AAuDD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE,CA6DjE"}
@@ -138,7 +138,7 @@ export function parseEntityFromList(data) {
138
138
  return { ...props, id: normalizeEntityId(stripOuterQuotes(id)), type };
139
139
  }
140
140
  export function parsePropertyList(propsStr) {
141
- // implements REQ-009
141
+ // implements REQ-009, REQ-skillopt-logical-evidence-fidelity
142
142
  const props = {};
143
143
  let cleaned = propsStr.trim();
144
144
  if (cleaned.startsWith("[")) {
@@ -157,8 +157,25 @@ export function parsePropertyList(propsStr) {
157
157
  if (key === "..." || value === "..." || value === "...|...") {
158
158
  continue;
159
159
  }
160
- const parsed = parsePrologValue(value);
161
- props[key] = parsed;
160
+ let parsed = parsePrologValue(value);
161
+ if ((key === "rule_ir" || key === "semantic_inventory") &&
162
+ typeof parsed === "string") {
163
+ try {
164
+ parsed = JSON.parse(parsed);
165
+ }
166
+ catch {
167
+ // Keep malformed structured fields as strings so the schema validator
168
+ // can report the precise payload problem instead of losing evidence.
169
+ }
170
+ }
171
+ if (!Object.hasOwn(props, key)) {
172
+ props[key] = parsed;
173
+ continue;
174
+ }
175
+ const existing = props[key];
176
+ props[key] = Array.isArray(existing)
177
+ ? [...existing, parsed]
178
+ : [existing, parsed];
162
179
  }
163
180
  return props;
164
181
  }