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,163 @@
1
+ import { inferTrigger, normalizePredicateToken, normalizeSubjectKey, singularize, slug, } from "./predicate-utils.js";
2
+ // implements REQ-mcp-suggest-predicates
3
+ export function inferScopedAuthorizationRuleArgs(text) {
4
+ const scoped = text.match(/^(?<actor>.+?)\s+(?:must|shall|should)\s+be\s+denied\s+(?<action>.+?)\.?$/i);
5
+ return [
6
+ slug(scoped?.groups?.actor ?? "actor"),
7
+ slug(scoped?.groups?.action ?? "action"),
8
+ "deny",
9
+ ];
10
+ }
11
+ // implements REQ-mcp-suggest-predicates
12
+ export function inferDocumentationStandardRuleArgs(text) {
13
+ const docs = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+documented\s+in\s+(?<artifact>.+?)\.?$/i);
14
+ return [
15
+ slug(docs?.groups?.subject ?? "subject"),
16
+ "documented_in",
17
+ slug(docs?.groups?.artifact ?? "documentation"),
18
+ ];
19
+ }
20
+ // implements REQ-mcp-suggest-predicates
21
+ export function inferWarmupPolicyRuleArgs(text) {
22
+ const warmup = text.match(/^(?:the\s+)?(?<subject>.+?)\s+(?:must|shall|should)\s+warm\s+up\s+on\s+(?<trigger>.+?)\.?$/i);
23
+ return [
24
+ slug(warmup?.groups?.subject ?? "subject"),
25
+ slug(warmup?.groups?.trigger ?? "trigger"),
26
+ ];
27
+ }
28
+ // implements REQ-mcp-suggest-predicates
29
+ export function inferVisualLayoutRuleArgs(text) {
30
+ const layout = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+remain\s+visually\s+aligned\s+with\s+(?<target>.+?)\.?$/i);
31
+ return [
32
+ slug(layout?.groups?.subject ?? "subject"),
33
+ "aligned_with",
34
+ slug(layout?.groups?.target ?? "target"),
35
+ ];
36
+ }
37
+ // implements REQ-mcp-suggest-predicates
38
+ export function inferEnforcementLocationRuleArgs(text) {
39
+ const enforcement = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+enforced\s+at\s+(?<location>.+?)\.?$/i);
40
+ return [
41
+ slug(enforcement?.groups?.subject ?? "subject"),
42
+ slug(enforcement?.groups?.location ?? "location"),
43
+ ];
44
+ }
45
+ // implements REQ-mcp-suggest-predicates
46
+ export function inferReconciliationRuleArgs(text) {
47
+ const reconciliation = text.match(/^on\s+(?<trigger>.+?),\s*(?<subject>.+?)\s+(?:must|shall|should)\s+reconcile\s+(?<target>.+?)\s+and\s+(?<action>clear\s+stale\s+.+?)\.?$/i);
48
+ return [
49
+ slug(reconciliation?.groups?.subject ?? "subject"),
50
+ slug(reconciliation?.groups?.trigger ?? "trigger"),
51
+ slug(reconciliation?.groups?.target ?? "target"),
52
+ slug(reconciliation?.groups?.action ?? "action"),
53
+ ];
54
+ }
55
+ // implements REQ-mcp-suggest-predicates
56
+ export function inferThrottlePolicyRuleArgs(text) {
57
+ const throttle = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+throttled\s+for\s+(?<condition>.+?)\.?$/i);
58
+ return [
59
+ slug(throttle?.groups?.subject ?? "subject"),
60
+ normalizePredicateToken(throttle?.groups?.condition ?? "condition"),
61
+ ];
62
+ }
63
+ // implements REQ-mcp-suggest-predicates
64
+ export function inferDefaultValueArgs(text, subject) {
65
+ const defaultValue = text.match(/^(?:the\s+)?(?<subject>[a-z][a-z\s_-]*?)\s+defaults?\s+to\s+(?<value>[a-z][a-z0-9\s_-]*?)(?:\s+(?<property>mode|state|status))?\.?$/i);
66
+ return [
67
+ defaultValue?.groups?.subject
68
+ ? normalizeSubjectKey(defaultValue.groups.subject)
69
+ : subject,
70
+ slug(defaultValue?.groups?.property ?? "value"),
71
+ slug(defaultValue?.groups?.value ?? "value"),
72
+ ];
73
+ }
74
+ // implements REQ-mcp-suggest-predicates
75
+ export function inferUniquenessArgs(text) {
76
+ const uniqueness = text.match(/^(?:there\s+)?(?:must|shall|should)\s+be\s+at\s+most\s+one\s+(?<subject>[a-z][a-z\s_-]*?)\s+per\s+(?<scope>.+?)\.?$/i);
77
+ const scope = (uniqueness?.groups?.scope ?? "scope")
78
+ .split(/\s+per\s+/i)
79
+ .map((part) => part.trim())
80
+ .filter((part) => part.length > 0)
81
+ .map(normalizePredicateToken)
82
+ .join(",");
83
+ return [slug(uniqueness?.groups?.subject ?? "subject"), scope];
84
+ }
85
+ // implements REQ-mcp-suggest-predicates
86
+ export function inferStateMembershipArgs(text, subject) {
87
+ const stateMembership = text.match(/^(?<subject>.+?)\s+(?:terminal\s+)?states\s+are\s+(?<states>.+?)\.?$/i);
88
+ const states = (stateMembership?.groups?.states ?? "state")
89
+ .split(/,|\band\b|\bor\b/i)
90
+ .map((state) => state.trim())
91
+ .filter((state) => state.length > 0)
92
+ .map(normalizePredicateToken)
93
+ .join(",");
94
+ return [
95
+ stateMembership?.groups?.subject
96
+ ? normalizeSubjectKey(stateMembership.groups.subject)
97
+ : subject,
98
+ states,
99
+ ];
100
+ }
101
+ // implements REQ-mcp-suggest-predicates
102
+ export function inferTemporalOrderArgs(text, subject) {
103
+ const initializesAfter = text.match(/^(?:the\s+)?(?<subject>.+?)\s+initializes\s+after\s+(?:the\s+)?(?<ready>.+?)\s+is\s+ready\.?$/i);
104
+ if (initializesAfter?.groups?.subject && initializesAfter.groups.ready) {
105
+ return [
106
+ slug(initializesAfter.groups.subject),
107
+ `${slug(initializesAfter.groups.ready)}_ready`,
108
+ "initializes",
109
+ ];
110
+ }
111
+ const temporal = text.match(/^(?<subject>.+?)\s+(?:must|shall|should)\s+be\s+(?<before>[a-z][a-z\s_-]*?)\s+before\s+(?<after>.+?)\.?$/i);
112
+ return [
113
+ temporal?.groups?.subject
114
+ ? slug(temporal.groups.subject).replace(/_/g, ".")
115
+ : subject,
116
+ normalizePredicateToken(temporal?.groups?.before ?? "before_event"),
117
+ normalizePredicateToken(temporal?.groups?.after ?? "after_event"),
118
+ ];
119
+ }
120
+ // implements REQ-mcp-suggest-predicates
121
+ export function inferConditionalBehaviorArgs(text, subject) {
122
+ const whenMust = text.match(/^when\s+(?<condition>.+?),\s*(?:the\s+)?(?<subject>.+?)\s+(?:must|shall|should)\s+(?<behavior>.+?)\.?$/i);
123
+ if (whenMust?.groups?.condition && whenMust.groups.subject) {
124
+ return [
125
+ slug(whenMust.groups.subject),
126
+ normalizePredicateToken(whenMust.groups.condition),
127
+ normalizePredicateToken(whenMust.groups.behavior ?? "behavior"),
128
+ ];
129
+ }
130
+ const conditional = text.match(/^if\s+(?:(?:a|an|the)\s+)?(?<conditionSubject>[a-z][a-z_-]*)\s+(?<condition>.+?),\s*(?:it|they|the\s+[a-z][a-z\s_-]*?)\s+(?<behavior>.+?)\.?$/i);
131
+ return [
132
+ conditional?.groups?.conditionSubject
133
+ ? singularize(slug(conditional.groups.conditionSubject))
134
+ : subject,
135
+ normalizePredicateToken(conditional?.groups?.condition ?? "condition"),
136
+ normalizePredicateToken(conditional?.groups?.behavior ?? "behavior"),
137
+ ];
138
+ }
139
+ // implements REQ-mcp-suggest-predicates
140
+ export function inferStateTransitionArgs(text, subject) {
141
+ const transition = text.match(/^when\s+(?<trigger>.+?),\s*(?:the\s+)?(?<subject>[a-z][a-z\s_-]*?)\s+transitions?\s+from\s+(?<from>[a-z][a-z0-9_-]*)\s+to\s+(?<to>[a-z][a-z0-9_-]*)\.?$/i);
142
+ return [
143
+ transition?.groups?.subject
144
+ ? normalizeSubjectKey(transition.groups.subject)
145
+ : subject,
146
+ normalizePredicateToken(transition?.groups?.from ?? "from_state"),
147
+ normalizePredicateToken(transition?.groups?.to ?? "to_state"),
148
+ normalizePredicateToken(transition?.groups?.trigger ?? inferTrigger(text)),
149
+ ];
150
+ }
151
+ // implements REQ-mcp-suggest-predicates
152
+ export function inferRateLimitArgs(text) {
153
+ const rateLimit = text.match(/^(?<subject>.+?)\s+must\s+be\s+rate\s+limited\s+to\s+(?<count>\d+)\s+(?<action>[a-z][a-z\s_-]*?)\s+per\s+(?<window>[a-z]+)\.?$/i);
154
+ const subject = rateLimit?.groups?.subject
155
+ ? slug(rateLimit.groups.subject).replace(/_requests?$/, ".request")
156
+ : "requirement.subject";
157
+ return [
158
+ subject,
159
+ normalizePredicateToken(rateLimit?.groups?.action ?? "action"),
160
+ normalizePredicateToken(rateLimit?.groups?.window ?? "window"),
161
+ rateLimit?.groups?.count ?? "0",
162
+ ];
163
+ }
@@ -0,0 +1,5 @@
1
+ import type { PredicateSchemaCandidate } from "./predicate-types.js";
2
+ import { inferSubject } from "./predicate-utils.js";
3
+ export declare function inferArgs(schema: PredicateSchemaCandidate, text: string, subject: string): string[];
4
+ export { inferSubject };
5
+ //# sourceMappingURL=predicate-inference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate-inference.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-inference.ts"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EASL,YAAY,EAKb,MAAM,sBAAsB,CAAC;AAG9B,wBAAgB,SAAS,CACvB,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CA0JV;AAGD,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,163 @@
1
+ import { inferAuditEventRuleArgs, inferAvailabilitySlaArgs, inferConsentRuleArgs, inferDataResidencyRuleArgs, inferDependencyRuleArgs, inferEscalationRuleArgs, inferExceptionRuleArgs, inferGuardArgs, inferIdempotencyRuleArgs, inferLifecycleRuleArgs, inferMutualExclusionArgs, inferNotificationRouteArgs, inferOwnershipRuleArgs, inferPermissionRuleArgs, inferRetryPolicyArgs, } from "./predicate-inference-1.js";
2
+ import { inferAbsenceRequirementArgs, inferAbstractionBoundaryRuleArgs, inferBatchOperationRuleArgs, inferBuildConstraintArgs, inferCodingStandardRuleArgs, inferConflictResolutionRuleArgs, inferConsistencyRuleArgs, inferEnvironmentSafetyRuleArgs, inferFallbackRuleArgs, inferMigrationBoundaryRuleArgs, inferOfflineBehaviorRuleArgs, inferOrderedStrategyRuleArgs, inferPlatformConsistencyRuleArgs, inferPreservationRuleArgs, inferRefreshPolicyRuleArgs, inferReleaseGateRuleArgs, inferSchemaInvariantRuleArgs, inferSecurityConfigurationRuleArgs, } from "./predicate-inference-2.js";
3
+ import { inferConditionalBehaviorArgs, inferDefaultValueArgs, inferDocumentationStandardRuleArgs, inferEnforcementLocationRuleArgs, inferRateLimitArgs, inferReconciliationRuleArgs, inferScopedAuthorizationRuleArgs, inferStateMembershipArgs, inferStateTransitionArgs, inferTemporalOrderArgs, inferThrottlePolicyRuleArgs, inferUniquenessArgs, inferVisualLayoutRuleArgs, inferWarmupPolicyRuleArgs, } from "./predicate-inference-3.js";
4
+ import { inferDuration, inferDurationUnit, inferEvent, inferGate, inferNumber, inferOperator, inferResource, inferScope, inferSubject, inferTrigger, inferUnit, normalizePredicateToken, slug, } from "./predicate-utils.js";
5
+ // implements REQ-mcp-suggest-predicates
6
+ export function inferArgs(schema, text, subject) {
7
+ const lower = text.toLowerCase();
8
+ switch (schema.predicate_name) {
9
+ case "state":
10
+ return [subject, lower.includes("idle") ? "idle" : "active"];
11
+ case "transition":
12
+ return [
13
+ subject,
14
+ lower.includes("edit") ? "edit" : "draft",
15
+ lower.includes("idle") ? "idle" : "active",
16
+ inferTrigger(text),
17
+ ];
18
+ case "guard":
19
+ return inferGuardArgs(text, subject);
20
+ case "exception_rule":
21
+ return inferExceptionRuleArgs(text, subject);
22
+ case "mutual_exclusion":
23
+ return inferMutualExclusionArgs(text);
24
+ case "dependency_rule":
25
+ return inferDependencyRuleArgs(text);
26
+ case "ownership_rule":
27
+ return inferOwnershipRuleArgs(text);
28
+ case "retry_policy":
29
+ return inferRetryPolicyArgs(text);
30
+ case "escalation_rule":
31
+ return inferEscalationRuleArgs(text);
32
+ case "availability_sla":
33
+ return inferAvailabilitySlaArgs(text);
34
+ case "notification_route":
35
+ return inferNotificationRouteArgs(text);
36
+ case "idempotency_rule":
37
+ return inferIdempotencyRuleArgs(text);
38
+ case "data_residency_rule":
39
+ return inferDataResidencyRuleArgs(text);
40
+ case "audit_event_rule":
41
+ return inferAuditEventRuleArgs(text);
42
+ case "consent_rule":
43
+ return inferConsentRuleArgs(text);
44
+ case "lifecycle_rule":
45
+ return inferLifecycleRuleArgs(text);
46
+ case "conflict_resolution_rule":
47
+ return inferConflictResolutionRuleArgs(text);
48
+ case "fallback_rule":
49
+ return inferFallbackRuleArgs(text);
50
+ case "batch_operation_rule":
51
+ return inferBatchOperationRuleArgs(text);
52
+ case "consistency_rule":
53
+ return inferConsistencyRuleArgs(text);
54
+ case "build_constraint":
55
+ return inferBuildConstraintArgs(text);
56
+ case "environment_safety_rule":
57
+ return inferEnvironmentSafetyRuleArgs(text);
58
+ case "schema_invariant_rule":
59
+ return inferSchemaInvariantRuleArgs(text);
60
+ case "coding_standard_rule":
61
+ return inferCodingStandardRuleArgs(text);
62
+ case "migration_boundary_rule":
63
+ return inferMigrationBoundaryRuleArgs(text);
64
+ case "absence_requirement":
65
+ return inferAbsenceRequirementArgs(text);
66
+ case "offline_behavior_rule":
67
+ return inferOfflineBehaviorRuleArgs(text);
68
+ case "release_gate_rule":
69
+ return inferReleaseGateRuleArgs(text);
70
+ case "platform_consistency_rule":
71
+ return inferPlatformConsistencyRuleArgs(text);
72
+ case "preservation_rule":
73
+ return inferPreservationRuleArgs(text);
74
+ case "abstraction_boundary_rule":
75
+ return inferAbstractionBoundaryRuleArgs(text);
76
+ case "security_configuration_rule":
77
+ return inferSecurityConfigurationRuleArgs(text);
78
+ case "ordered_strategy_rule":
79
+ return inferOrderedStrategyRuleArgs(text);
80
+ case "refresh_policy_rule":
81
+ return inferRefreshPolicyRuleArgs(text);
82
+ case "scoped_authorization_rule":
83
+ return inferScopedAuthorizationRuleArgs(text);
84
+ case "documentation_standard_rule":
85
+ return inferDocumentationStandardRuleArgs(text);
86
+ case "warmup_policy_rule":
87
+ return inferWarmupPolicyRuleArgs(text);
88
+ case "visual_layout_rule":
89
+ return inferVisualLayoutRuleArgs(text);
90
+ case "enforcement_location_rule":
91
+ return inferEnforcementLocationRuleArgs(text);
92
+ case "reconciliation_rule":
93
+ return inferReconciliationRuleArgs(text);
94
+ case "throttle_policy_rule":
95
+ return inferThrottlePolicyRuleArgs(text);
96
+ case "has_unsaved_changes":
97
+ return [subject, lower.includes("no unsaved") ? "false" : "true"];
98
+ case "commit_action":
99
+ case "discard_action":
100
+ return [subject, inferTrigger(text), inferScope(text)];
101
+ case "accessibility_requirement":
102
+ return [
103
+ subject,
104
+ lower.includes("wcag") ? "WCAG" : "accessibility",
105
+ "required",
106
+ ];
107
+ case "retention_policy":
108
+ return [subject, inferDuration(text), inferDurationUnit(text)];
109
+ case "resource_constraint":
110
+ return [
111
+ subject,
112
+ inferResource(text),
113
+ inferOperator(text),
114
+ inferNumber(text),
115
+ inferUnit(text),
116
+ ];
117
+ case "feature_gate":
118
+ return [
119
+ subject,
120
+ inferGate(text),
121
+ lower.includes("disabled") ? "false" : "true",
122
+ ];
123
+ case "publishes_event":
124
+ return [subject, inferEvent(text)];
125
+ case "acceptance_rule":
126
+ return [subject, slug(text).slice(0, 64) || "observable_outcome"];
127
+ case "permission_rule":
128
+ return inferPermissionRuleArgs(text);
129
+ case "default_value":
130
+ return inferDefaultValueArgs(text, subject);
131
+ case "uniqueness_constraint":
132
+ return inferUniquenessArgs(text);
133
+ case "state_membership":
134
+ return inferStateMembershipArgs(text, subject);
135
+ case "temporal_order":
136
+ return inferTemporalOrderArgs(text, subject);
137
+ case "conditional_behavior":
138
+ return inferConditionalBehaviorArgs(text, subject);
139
+ case "state_transition":
140
+ return inferStateTransitionArgs(text, subject);
141
+ case "rate_limit":
142
+ return inferRateLimitArgs(text);
143
+ default:
144
+ return schema.argument_names.map((name) => {
145
+ if (name === "subject")
146
+ return subject;
147
+ const normalized = normalizePredicateToken(name);
148
+ const words = normalized.split("_").filter((word) => word.length > 2);
149
+ // Project-local schemas often use the exact domain vocabulary in
150
+ // their ordered argument names. Reuse that declared value when the
151
+ // complete name (or all meaningful words) occurs in the claim; keep
152
+ // genuinely unbound arguments explicit instead of guessing.
153
+ const phrase = words.join(" ");
154
+ return phrase.length > 0 &&
155
+ (lower.includes(phrase) ||
156
+ words.every((word) => lower.includes(word)))
157
+ ? normalized
158
+ : "unknown";
159
+ });
160
+ }
161
+ }
162
+ // implements REQ-mcp-suggest-predicates
163
+ export { inferSubject };
@@ -0,0 +1,10 @@
1
+ import type { PrologPort } from "../../public/operations/runtime-types.js";
2
+ import type { PredicateSchemaCandidate, PredicateUsageHints } from "./predicate-types.js";
3
+ export declare function schemaForCandidate(schema: PredicateSchemaCandidate): Omit<PredicateSchemaCandidate, "keywords"> & {
4
+ usage_hints: PredicateUsageHints;
5
+ };
6
+ export declare function loadExistingPredicateSchemas(prolog: PrologPort | null, includeExistingSchemas: boolean, warnings: string[]): Promise<PredicateSchemaCandidate[]>;
7
+ export declare function predicateSchemaFromEntity(entity: Record<string, unknown>): PredicateSchemaCandidate[];
8
+ export declare function usageHintsFromEntity(entity: Record<string, unknown>): PredicateUsageHints | undefined;
9
+ export declare function stringArray(value: unknown): string[];
10
+ //# sourceMappingURL=predicate-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate-loader.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAK3E,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAI9B,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CACxE,wBAAwB,EACxB,UAAU,CACX,GAAG;IACF,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAmBA;AAGD,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,sBAAsB,EAAE,OAAO,EAC/B,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAwBrC;AAGD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,wBAAwB,EAAE,CAiC5B;AAGD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,mBAAmB,GAAG,SAAS,CAOjC;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAQpD"}
@@ -0,0 +1,94 @@
1
+ import { parseEntityFromList, parseListOfLists } from "../../prolog/codec.js";
2
+ import { DEFAULT_USAGE_HINTS, USAGE_HINTS_BY_PREDICATE, } from "./predicate-catalog.js";
3
+ import { hashId, normalizeOptionalString } from "./predicate-utils.js";
4
+ // implements REQ-mcp-suggest-predicates
5
+ export function schemaForCandidate(schema) {
6
+ return {
7
+ id: schema.id,
8
+ predicate_name: schema.predicate_name,
9
+ title: schema.title,
10
+ description: schema.description,
11
+ argument_names: schema.argument_names,
12
+ argument_types: schema.argument_types,
13
+ ...(schema.aliases ? { aliases: schema.aliases } : {}),
14
+ ...(schema.paraphrase_templates
15
+ ? { paraphrase_templates: schema.paraphrase_templates }
16
+ : {}),
17
+ examples: schema.examples,
18
+ tags: schema.tags,
19
+ usage_hints: schema.usage_hints ??
20
+ USAGE_HINTS_BY_PREDICATE[schema.predicate_name] ??
21
+ DEFAULT_USAGE_HINTS,
22
+ };
23
+ }
24
+ // implements REQ-mcp-suggest-predicates
25
+ export async function loadExistingPredicateSchemas(prolog, includeExistingSchemas, warnings) {
26
+ if (!includeExistingSchemas || prolog === null) {
27
+ return [];
28
+ }
29
+ try {
30
+ const queryResult = await prolog.query("findall([Id,'fact',Props], (kb_entity(Id, 'fact', Props), member(fact_kind=predicate_schema, Props)), Results)");
31
+ if (!queryResult.success) {
32
+ throw new Error(queryResult.error || "Query failed with unknown error");
33
+ }
34
+ const facts = queryResult.bindings.Results
35
+ ? parseListOfLists(queryResult.bindings.Results).map(parseEntityFromList)
36
+ : [];
37
+ return facts.flatMap((fact) => predicateSchemaFromEntity(fact));
38
+ }
39
+ catch (error) {
40
+ const message = error instanceof Error ? error.message : String(error);
41
+ warnings.push(`Existing predicate_schema facts could not be loaded: ${message}`);
42
+ return [];
43
+ }
44
+ }
45
+ // implements REQ-mcp-suggest-predicates
46
+ export function predicateSchemaFromEntity(entity) {
47
+ if (entity.fact_kind !== "predicate_schema")
48
+ return [];
49
+ const predicateName = normalizeOptionalString(typeof entity.predicate_name === "string"
50
+ ? entity.predicate_name
51
+ : undefined);
52
+ if (!predicateName)
53
+ return [];
54
+ const usageHints = usageHintsFromEntity(entity);
55
+ return [
56
+ {
57
+ id: String(entity.id ?? hashId("FACT-SCHEMA", [predicateName])),
58
+ predicate_name: predicateName,
59
+ title: String(entity.title ?? predicateName),
60
+ description: String(entity.description ??
61
+ `Project-local ${predicateName} predicate schema.`),
62
+ argument_names: stringArray(entity.argument_names),
63
+ argument_types: stringArray(entity.argument_types),
64
+ keywords: [
65
+ predicateName,
66
+ ...stringArray(entity.aliases),
67
+ ...stringArray(entity.tags),
68
+ ],
69
+ aliases: stringArray(entity.aliases),
70
+ paraphrase_templates: stringArray(entity.paraphrase_templates),
71
+ examples: stringArray(entity.examples),
72
+ tags: stringArray(entity.tags),
73
+ ...(usageHints ? { usage_hints: usageHints } : {}),
74
+ },
75
+ ];
76
+ }
77
+ // implements REQ-mcp-suggest-predicates
78
+ export function usageHintsFromEntity(entity) {
79
+ const useWhen = stringArray(entity.use_when);
80
+ const doNotUseWhen = stringArray(entity.do_not_use_when);
81
+ if (useWhen.length === 0 || doNotUseWhen.length === 0) {
82
+ return undefined;
83
+ }
84
+ return { use_when: useWhen, do_not_use_when: doNotUseWhen };
85
+ }
86
+ // implements REQ-mcp-suggest-predicates
87
+ export function stringArray(value) {
88
+ if (!Array.isArray(value))
89
+ return [];
90
+ return value.flatMap((item) => {
91
+ const normalized = normalizeOptionalString(typeof item === "string" ? item : undefined);
92
+ return normalized ? [normalized] : [];
93
+ });
94
+ }
@@ -0,0 +1,3 @@
1
+ import type { PredicateSchemaCandidate } from "./predicate-types.js";
2
+ export declare function scoreSchema(schema: PredicateSchemaCandidate, text: string): number;
3
+ //# sourceMappingURL=predicate-ranker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate-ranker.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-ranker.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA6BrE,wBAAgB,WAAW,CACzB,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,MAAM,GACX,MAAM,CAuDR"}
@@ -0,0 +1,62 @@
1
+ import { scoreExactPredicates1 } from "./predicate-score-1.js";
2
+ import { scoreExactPredicates2 } from "./predicate-score-2.js";
3
+ import { scoreExactPredicates3 } from "./predicate-score-3.js";
4
+ import { matchesKeyword } from "./predicate-utils.js";
5
+ function tokens(value) {
6
+ return value.toLowerCase().match(/[a-z0-9]+/g) ?? [];
7
+ }
8
+ function stem(value) {
9
+ if (value.length > 5 && value.endsWith("ies"))
10
+ return `${value.slice(0, -3)}y`;
11
+ if (value.length > 4 && value.endsWith("ing"))
12
+ return value.slice(0, -3);
13
+ if (value.length > 4 && value.endsWith("ed"))
14
+ return value.slice(0, -2);
15
+ if (value.length > 4 && value.endsWith("s"))
16
+ return value.slice(0, -1);
17
+ return value;
18
+ }
19
+ function overlap(left, right) {
20
+ const target = new Set(right.map(stem));
21
+ const matches = new Set(left.map(stem).filter((token) => target.has(token)));
22
+ return target.size === 0 ? 0 : matches.size / target.size;
23
+ }
24
+ const EXACT_SCORERS = [
25
+ scoreExactPredicates1,
26
+ scoreExactPredicates2,
27
+ scoreExactPredicates3,
28
+ ];
29
+ // implements REQ-mcp-suggest-predicates
30
+ export function scoreSchema(schema, text) {
31
+ for (const scorer of EXACT_SCORERS) {
32
+ const score = scorer(schema, text);
33
+ if (score !== null)
34
+ return score;
35
+ }
36
+ const lower = text.toLowerCase();
37
+ const keywordHits = schema.keywords.filter((keyword) => matchesKeyword(text, lower, keyword)).length;
38
+ const textTokens = tokens(text);
39
+ const descriptors = [
40
+ schema.predicate_name,
41
+ schema.title,
42
+ schema.description,
43
+ ...(schema.aliases ?? []),
44
+ ...(schema.paraphrase_templates ?? []),
45
+ ...schema.examples,
46
+ ];
47
+ const descriptorOverlap = Math.max(...descriptors.map((descriptor) => overlap(textTokens, tokens(descriptor))), 0);
48
+ const useWhenOverlap = Math.max(...(schema.usage_hints?.use_when ?? []).map((descriptor) => overlap(textTokens, tokens(descriptor))), 0);
49
+ const doNotUseWhenOverlap = Math.max(...(schema.usage_hints?.do_not_use_when ?? []).map((descriptor) => overlap(textTokens, tokens(descriptor))), 0);
50
+ const morphologyHits = schema.keywords.filter((keyword) => textTokens.map(stem).includes(stem(keyword.toLowerCase()))).length;
51
+ if (keywordHits === 0 && morphologyHits === 0 && descriptorOverlap < 0.25)
52
+ return 0;
53
+ const normalized = keywordHits / Math.max(3, schema.keywords.length / 2);
54
+ const score = Math.min(0.98, Math.max(0, 0.2 +
55
+ normalized * 0.4 +
56
+ keywordHits * 0.05 +
57
+ morphologyHits * 0.04 +
58
+ descriptorOverlap * 0.3 +
59
+ useWhenOverlap * 0.08 -
60
+ doNotUseWhenOverlap * 0.18));
61
+ return Math.round(score * 100) / 100;
62
+ }
@@ -0,0 +1,3 @@
1
+ import type { PredicateSchemaCandidate } from "./predicate-types.js";
2
+ export declare function scoreExactPredicates1(schema: PredicateSchemaCandidate, text: string): number | null;
3
+ //# sourceMappingURL=predicate-score-1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate-score-1.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-score-1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGrE,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,IAAI,CA6Lf"}
@@ -0,0 +1,121 @@
1
+ // implements REQ-mcp-suggest-predicates
2
+ export function scoreExactPredicates1(schema, text) {
3
+ if (schema.predicate_name === "guard") {
4
+ if (/^.+?\s+(?:must|shall|should)?\s*(?:stay|remain)?\s*disabled\s+until\s+.+?\.?$/i.test(text)) {
5
+ return 0.98;
6
+ }
7
+ }
8
+ if (schema.predicate_name === "conditional_behavior") {
9
+ if (/^if\s+(?:(?:a|an|the)\s+)?[a-z][a-z_-]*\s+.+?,\s*(?:it|they|the\s+[a-z][a-z\s_-]*?)\s+.+?\.?$/i.test(text)) {
10
+ return 0.98;
11
+ }
12
+ if (/^when\s+.+?,\s*(?:the\s+)?.+?\s+(?:must|shall|should)\s+.+?\.?$/i.test(text)) {
13
+ return 0.36;
14
+ }
15
+ return 0;
16
+ }
17
+ if (schema.predicate_name === "exception_rule") {
18
+ if (!/^(?:the\s+)?[a-z][a-z\s_-]*?\s+(?:must|shall|should)\s+.+?\s+unless\s+(?:the\s+)?.+?\.?$/i.test(text)) {
19
+ return 0;
20
+ }
21
+ return 0.98;
22
+ }
23
+ if (schema.predicate_name === "mutual_exclusion") {
24
+ if (!/^.+?\s+and\s+.+?\s+(?:must|shall|should)\s+be\s+mutually\s+exclusive\.?$/i.test(text)) {
25
+ return 0;
26
+ }
27
+ return 0.98;
28
+ }
29
+ if (schema.predicate_name === "dependency_rule") {
30
+ if (!/^.+?\s+requires\s+.+?\s+before\s+.+?\.?$/i.test(text)) {
31
+ return 0;
32
+ }
33
+ return 0.98;
34
+ }
35
+ if (schema.predicate_name === "ownership_rule") {
36
+ if (!/^.+?\s+(?:is|are)\s+owned\s+by\s+(?:the\s+)?.+?\.?$/i.test(text)) {
37
+ return 0;
38
+ }
39
+ return 0.98;
40
+ }
41
+ if (schema.predicate_name === "retry_policy") {
42
+ if (!/^.+?\s+(?:must|shall|should)\s+retry\s+up\s+to\s+\d+\s+(?:times|attempts?)\.?$/i.test(text)) {
43
+ return 0;
44
+ }
45
+ return 0.98;
46
+ }
47
+ if (schema.predicate_name === "escalation_rule") {
48
+ if (!/^.+?\s+(?:must|shall|should)\s+escalate\s+to\s+.+?\s+after\s+\d+\s+[a-z]+\.?$/i.test(text)) {
49
+ return 0;
50
+ }
51
+ return 0.98;
52
+ }
53
+ if (schema.predicate_name === "availability_sla") {
54
+ if (!/^.+?\s+availability\s+(?:must|shall|should)\s+be\s+at\s+least\s+\d+(?:\.\d+)?\s+(?:percent|%)\s+[a-z]+\.?$/i.test(text)) {
55
+ return 0;
56
+ }
57
+ return 0.98;
58
+ }
59
+ if (schema.predicate_name === "notification_route") {
60
+ if (!/^.+?\s+(?:must|shall|should)\s+notify\s+.+?\s+by\s+[a-z]+\.?$/i.test(text)) {
61
+ return 0;
62
+ }
63
+ return 0.98;
64
+ }
65
+ if (schema.predicate_name === "idempotency_rule") {
66
+ if (!/^.+?\s+(?:must|shall|should)\s+be\s+idempotent\s+by\s+.+?\.?$/i.test(text) &&
67
+ !/^.+?\s+(?:must|shall|should)\s+be\s+deduplicated\s+to\s+prevent\s+redundant\s+requests\s+during\s+.+?\.?$/i.test(text)) {
68
+ return 0;
69
+ }
70
+ return 0.98;
71
+ }
72
+ if (schema.predicate_name === "data_residency_rule") {
73
+ if (!/^.+?\s+(?:must|shall|should)\s+be\s+(?:stored|processed|kept)\s+in\s+(?:the\s+)?.+?\b(?:region|jurisdiction|country|zone|area)\.?$/i.test(text)) {
74
+ return 0;
75
+ }
76
+ return 0.98;
77
+ }
78
+ if (schema.predicate_name === "audit_event_rule") {
79
+ if (!/^.+?\s+(?:must|shall|should)\s+be\s+(?:recorded|logged|audited)\s+in\s+(?:the\s+)?audit\s+(?:log|trail)\.?$/i.test(text)) {
80
+ return 0;
81
+ }
82
+ return 0.98;
83
+ }
84
+ if (schema.predicate_name === "consent_rule") {
85
+ if (!/^.+?\s+(?:must|shall|should)\s+require\s+.+?consent\s+before\s+.+?\.?$/i.test(text)) {
86
+ return 0;
87
+ }
88
+ return 0.98;
89
+ }
90
+ if (schema.predicate_name === "lifecycle_rule") {
91
+ if (!/^.+?\s+(?:must|shall|should)\s+be\s+(?:archived|deleted|expired)\s+after\s+\d+\s+[a-z]+\.?$/i.test(text)) {
92
+ return 0;
93
+ }
94
+ return 0.98;
95
+ }
96
+ if (schema.predicate_name === "conflict_resolution_rule") {
97
+ if (!/^when\s+.+?\s+conflicts?,\s+(?:the\s+)?.+?\.?$/i.test(text)) {
98
+ return 0;
99
+ }
100
+ return 0.98;
101
+ }
102
+ if (schema.predicate_name === "fallback_rule") {
103
+ if (!/^if\s+.+?,\s+.+?\s+(?:must|shall|should)\s+fall\s+back\s+to\s+.+?\.?$/i.test(text)) {
104
+ return 0;
105
+ }
106
+ return 0.98;
107
+ }
108
+ if (schema.predicate_name === "batch_operation_rule") {
109
+ if (!/^.+?\s+(?:must|shall|should)\s+process\s+.+?\s+in\s+batches\s+of\s+\d+\.?$/i.test(text)) {
110
+ return 0;
111
+ }
112
+ return 0.98;
113
+ }
114
+ if (schema.predicate_name === "consistency_rule") {
115
+ if (!/^.+?\s+(?:must|shall|should)\s+reference\s+an?\s+existing\s+.+?\.?$/i.test(text)) {
116
+ return 0;
117
+ }
118
+ return 0.98;
119
+ }
120
+ return null;
121
+ }
@@ -0,0 +1,3 @@
1
+ import type { PredicateSchemaCandidate } from "./predicate-types.js";
2
+ export declare function scoreExactPredicates2(schema: PredicateSchemaCandidate, text: string): number | null;
3
+ //# sourceMappingURL=predicate-score-2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predicate-score-2.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/predicate-score-2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGrE,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,wBAAwB,EAChC,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,IAAI,CAgMf"}