kibi-cli 0.18.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (539) hide show
  1. package/dist/cli-json-command.d.ts +1 -2
  2. package/dist/cli-json-command.d.ts.map +1 -1
  3. package/dist/cli-json-command.js +2 -34
  4. package/dist/cli-operation-loader.d.ts +3 -0
  5. package/dist/cli-operation-loader.d.ts.map +1 -0
  6. package/dist/cli-operation-loader.js +91 -0
  7. package/dist/cli-operation-metadata.d.ts +94 -0
  8. package/dist/cli-operation-metadata.d.ts.map +1 -0
  9. package/dist/cli-operation-metadata.js +121 -0
  10. package/dist/cli-protocol.d.ts +1 -1
  11. package/dist/cli-protocol.d.ts.map +1 -1
  12. package/dist/cli-protocol.js +42 -11
  13. package/dist/cli-register-foundation.d.ts.map +1 -1
  14. package/dist/cli-register-foundation.js +28 -19
  15. package/dist/cli-register-json.d.ts +3 -0
  16. package/dist/cli-register-json.d.ts.map +1 -0
  17. package/dist/cli-register-json.js +35 -0
  18. package/dist/cli-register-maintenance.d.ts.map +1 -1
  19. package/dist/cli-register-maintenance.js +60 -13
  20. package/dist/cli-register-reporting.d.ts.map +1 -1
  21. package/dist/cli-register-reporting.js +23 -14
  22. package/dist/cli-register-skills.d.ts.map +1 -1
  23. package/dist/cli-register-skills.js +8 -6
  24. package/dist/cli-register-verification.d.ts +3 -0
  25. package/dist/cli-register-verification.d.ts.map +1 -0
  26. package/dist/cli-register-verification.js +16 -0
  27. package/dist/cli.d.ts.map +1 -1
  28. package/dist/cli.js +3 -1
  29. package/dist/commands/aggregated-checks.d.ts +1 -2
  30. package/dist/commands/aggregated-checks.d.ts.map +1 -1
  31. package/dist/commands/aggregated-checks.js +14 -9
  32. package/dist/commands/branch.d.ts +36 -0
  33. package/dist/commands/branch.d.ts.map +1 -1
  34. package/dist/commands/branch.js +371 -40
  35. package/dist/commands/check.d.ts.map +1 -1
  36. package/dist/commands/check.js +48 -77
  37. package/dist/commands/coverage.js +1 -1
  38. package/dist/commands/discovery-shared.d.ts +2 -1
  39. package/dist/commands/discovery-shared.d.ts.map +1 -1
  40. package/dist/commands/discovery-shared.js +38 -25
  41. package/dist/commands/doctor.d.ts +4 -1
  42. package/dist/commands/doctor.d.ts.map +1 -1
  43. package/dist/commands/doctor.js +259 -24
  44. package/dist/commands/engine.d.ts +8 -0
  45. package/dist/commands/engine.d.ts.map +1 -0
  46. package/dist/commands/engine.js +103 -0
  47. package/dist/commands/gaps.js +1 -1
  48. package/dist/commands/gc.d.ts +5 -2
  49. package/dist/commands/gc.d.ts.map +1 -1
  50. package/dist/commands/gc.js +140 -71
  51. package/dist/commands/github-init.d.ts +56 -0
  52. package/dist/commands/github-init.d.ts.map +1 -0
  53. package/dist/commands/github-init.js +310 -0
  54. package/dist/commands/graph.js +1 -1
  55. package/dist/commands/init-helpers.d.ts +1 -1
  56. package/dist/commands/init-helpers.d.ts.map +1 -1
  57. package/dist/commands/init-helpers.js +73 -25
  58. package/dist/commands/init.d.ts +2 -0
  59. package/dist/commands/init.d.ts.map +1 -1
  60. package/dist/commands/init.js +79 -24
  61. package/dist/commands/legacy-storage-migration.d.ts +54 -0
  62. package/dist/commands/legacy-storage-migration.d.ts.map +1 -0
  63. package/dist/commands/legacy-storage-migration.js +277 -0
  64. package/dist/commands/migrate.d.ts +7 -0
  65. package/dist/commands/migrate.d.ts.map +1 -1
  66. package/dist/commands/migrate.js +244 -91
  67. package/dist/commands/query.d.ts.map +1 -1
  68. package/dist/commands/query.js +3 -1
  69. package/dist/commands/report.d.ts +24 -0
  70. package/dist/commands/report.d.ts.map +1 -0
  71. package/dist/commands/report.js +191 -0
  72. package/dist/commands/search.d.ts.map +1 -1
  73. package/dist/commands/search.js +3 -1
  74. package/dist/commands/status.d.ts.map +1 -1
  75. package/dist/commands/status.js +2 -1
  76. package/dist/commands/sync/cache.d.ts +26 -3
  77. package/dist/commands/sync/cache.d.ts.map +1 -1
  78. package/dist/commands/sync/cache.js +141 -5
  79. package/dist/commands/sync/discovery.d.ts +23 -2
  80. package/dist/commands/sync/discovery.d.ts.map +1 -1
  81. package/dist/commands/sync/discovery.js +196 -15
  82. package/dist/commands/sync/extraction.d.ts +8 -1
  83. package/dist/commands/sync/extraction.d.ts.map +1 -1
  84. package/dist/commands/sync/extraction.js +38 -4
  85. package/dist/commands/sync/manifest.d.ts +8 -5
  86. package/dist/commands/sync/manifest.d.ts.map +1 -1
  87. package/dist/commands/sync/manifest.js +142 -39
  88. package/dist/commands/sync/persistence.d.ts +10 -1
  89. package/dist/commands/sync/persistence.d.ts.map +1 -1
  90. package/dist/commands/sync/persistence.js +223 -44
  91. package/dist/commands/sync/staging.d.ts +10 -1
  92. package/dist/commands/sync/staging.d.ts.map +1 -1
  93. package/dist/commands/sync/staging.js +84 -1
  94. package/dist/commands/sync.d.ts +6 -0
  95. package/dist/commands/sync.d.ts.map +1 -1
  96. package/dist/commands/sync.js +710 -48
  97. package/dist/commands/verify.d.ts +10 -0
  98. package/dist/commands/verify.d.ts.map +1 -0
  99. package/dist/commands/verify.js +126 -0
  100. package/dist/diagnostics.d.ts +1 -1
  101. package/dist/diagnostics.d.ts.map +1 -1
  102. package/dist/engine-daemon.d.ts +3 -0
  103. package/dist/engine-daemon.d.ts.map +1 -0
  104. package/dist/engine-daemon.js +34 -0
  105. package/dist/engine.d.ts +156 -0
  106. package/dist/engine.d.ts.map +1 -0
  107. package/dist/engine.js +1625 -0
  108. package/dist/env.d.ts.map +1 -1
  109. package/dist/env.js +5 -6
  110. package/dist/extractors/manifest.d.ts +8 -1
  111. package/dist/extractors/manifest.d.ts.map +1 -1
  112. package/dist/extractors/manifest.js +51 -9
  113. package/dist/extractors/markdown.d.ts +2 -1
  114. package/dist/extractors/markdown.d.ts.map +1 -1
  115. package/dist/extractors/markdown.js +21 -3
  116. package/dist/extractors/playwright-cases.d.ts +24 -0
  117. package/dist/extractors/playwright-cases.d.ts.map +1 -0
  118. package/dist/extractors/playwright-cases.js +126 -0
  119. package/dist/extractors/relationships.d.ts +2 -0
  120. package/dist/extractors/relationships.d.ts.map +1 -1
  121. package/dist/extractors/relationships.js +16 -17
  122. package/dist/extractors/symbol-coordinates.d.ts +81 -3
  123. package/dist/extractors/symbol-coordinates.d.ts.map +1 -1
  124. package/dist/extractors/symbol-coordinates.js +389 -51
  125. package/dist/extractors/symbols-coordinator.js +11 -1
  126. package/dist/intent-search.d.ts +60 -0
  127. package/dist/intent-search.d.ts.map +1 -0
  128. package/dist/intent-search.js +433 -0
  129. package/dist/operations/bootstrap/activation.d.ts.map +1 -0
  130. package/dist/operations/{autopilot → bootstrap}/activation.js +48 -31
  131. package/dist/operations/{autopilot → bootstrap}/candidate-helpers.d.ts.map +1 -1
  132. package/dist/operations/bootstrap/candidates.d.ts +4 -0
  133. package/dist/operations/{autopilot → bootstrap}/candidates.d.ts.map +1 -1
  134. package/dist/operations/{autopilot → bootstrap}/candidates.js +22 -8
  135. package/dist/operations/{autopilot → bootstrap}/discovery-evidence.d.ts +2 -2
  136. package/dist/operations/{autopilot → bootstrap}/discovery-evidence.d.ts.map +1 -1
  137. package/dist/operations/{autopilot → bootstrap}/discovery-evidence.js +46 -6
  138. package/dist/operations/{autopilot → bootstrap}/discovery.d.ts +1 -1
  139. package/dist/operations/bootstrap/discovery.d.ts.map +1 -0
  140. package/dist/operations/{autopilot → bootstrap}/discovery.js +21 -14
  141. package/dist/operations/bootstrap/generate.d.ts +8 -0
  142. package/dist/operations/bootstrap/generate.d.ts.map +1 -0
  143. package/dist/operations/bootstrap/generate.js +204 -0
  144. package/dist/operations/{autopilot → bootstrap}/guidance-actions.d.ts +2 -2
  145. package/dist/operations/{autopilot → bootstrap}/guidance-actions.d.ts.map +1 -1
  146. package/dist/operations/{autopilot → bootstrap}/guidance-actions.js +4 -4
  147. package/dist/operations/{autopilot → bootstrap}/guidance.d.ts +2 -2
  148. package/dist/operations/{autopilot → bootstrap}/guidance.d.ts.map +1 -1
  149. package/dist/operations/{autopilot → bootstrap}/guidance.js +2 -0
  150. package/dist/operations/{autopilot → bootstrap}/markdown-candidates.d.ts +2 -2
  151. package/dist/operations/{autopilot → bootstrap}/markdown-candidates.d.ts.map +1 -1
  152. package/dist/operations/{autopilot → bootstrap}/markdown-candidates.js +4 -3
  153. package/dist/operations/bootstrap/presentation.d.ts +15 -0
  154. package/dist/operations/bootstrap/presentation.d.ts.map +1 -0
  155. package/dist/operations/bootstrap/presentation.js +177 -0
  156. package/dist/operations/{autopilot → bootstrap}/requirement-claims.d.ts.map +1 -1
  157. package/dist/operations/{autopilot → bootstrap}/types.d.ts +63 -21
  158. package/dist/operations/bootstrap/types.d.ts.map +1 -0
  159. package/dist/operations/bootstrap/types.js +25 -0
  160. package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
  161. package/dist/operations/modeling/model-requirement.js +4 -17
  162. package/dist/operations/modeling/predicate-applicability.d.ts +16 -0
  163. package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -0
  164. package/dist/operations/modeling/predicate-applicability.js +276 -0
  165. package/dist/operations/modeling/predicate-applyplan.d.ts +13 -2
  166. package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
  167. package/dist/operations/modeling/predicate-applyplan.js +100 -3
  168. package/dist/operations/modeling/predicate-bindings.d.ts +6 -0
  169. package/dist/operations/modeling/predicate-bindings.d.ts.map +1 -0
  170. package/dist/operations/modeling/predicate-bindings.js +122 -0
  171. package/dist/operations/modeling/predicate-catalog-4.d.ts.map +1 -1
  172. package/dist/operations/modeling/predicate-catalog-4.js +155 -0
  173. package/dist/operations/modeling/predicate-inference-1.d.ts.map +1 -1
  174. package/dist/operations/modeling/predicate-inference-1.js +8 -0
  175. package/dist/operations/modeling/predicate-inference-launcher.d.ts +10 -0
  176. package/dist/operations/modeling/predicate-inference-launcher.d.ts.map +1 -0
  177. package/dist/operations/modeling/predicate-inference-launcher.js +13 -0
  178. package/dist/operations/modeling/predicate-inference.d.ts.map +1 -1
  179. package/dist/operations/modeling/predicate-inference.js +4 -0
  180. package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
  181. package/dist/operations/modeling/predicate-loader.js +7 -0
  182. package/dist/operations/modeling/predicate-ranker.d.ts +8 -1
  183. package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -1
  184. package/dist/operations/modeling/predicate-ranker.js +156 -24
  185. package/dist/operations/modeling/predicate-score-3.d.ts.map +1 -1
  186. package/dist/operations/modeling/predicate-score-3.js +6 -0
  187. package/dist/operations/modeling/predicate-types.d.ts +34 -0
  188. package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
  189. package/dist/operations/modeling/predicate-usage-hints-3.d.ts.map +1 -1
  190. package/dist/operations/modeling/predicate-usage-hints-3.js +40 -0
  191. package/dist/operations/modeling/predicate-utils.d.ts.map +1 -1
  192. package/dist/operations/modeling/predicate-utils.js +2 -0
  193. package/dist/operations/modeling/suggest-predicates.d.ts +1 -1
  194. package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
  195. package/dist/operations/modeling/suggest-predicates.js +170 -32
  196. package/dist/operations/mutation/delete.d.ts.map +1 -1
  197. package/dist/operations/mutation/delete.js +415 -19
  198. package/dist/operations/mutation/entity-projection.d.ts +11 -0
  199. package/dist/operations/mutation/entity-projection.d.ts.map +1 -0
  200. package/dist/operations/mutation/entity-projection.js +14 -0
  201. package/dist/operations/mutation/relationships.d.ts +10 -0
  202. package/dist/operations/mutation/relationships.d.ts.map +1 -1
  203. package/dist/operations/mutation/relationships.js +71 -1
  204. package/dist/operations/mutation/serialization.d.ts.map +1 -1
  205. package/dist/operations/mutation/serialization.js +1 -0
  206. package/dist/operations/mutation/source-authoring.d.ts +61 -0
  207. package/dist/operations/mutation/source-authoring.d.ts.map +1 -0
  208. package/dist/operations/mutation/source-authoring.js +543 -0
  209. package/dist/operations/mutation/symbol-compiler-lock.d.ts +51 -0
  210. package/dist/operations/mutation/symbol-compiler-lock.d.ts.map +1 -0
  211. package/dist/operations/mutation/symbol-compiler-lock.js +274 -0
  212. package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
  213. package/dist/operations/mutation/symbol-granularity.js +34 -3
  214. package/dist/operations/mutation/symbol-refresh.d.ts +18 -1
  215. package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
  216. package/dist/operations/mutation/symbol-refresh.js +225 -63
  217. package/dist/operations/mutation/types.d.ts +57 -1
  218. package/dist/operations/mutation/types.d.ts.map +1 -1
  219. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  220. package/dist/operations/mutation/upsert.js +363 -24
  221. package/dist/operations/mutation/validation.d.ts.map +1 -1
  222. package/dist/operations/mutation/validation.js +1 -0
  223. package/dist/operations/planning/apply-plan.d.ts +117 -0
  224. package/dist/operations/planning/apply-plan.d.ts.map +1 -0
  225. package/dist/operations/planning/apply-plan.js +1437 -0
  226. package/dist/operations/planning/compile-intent.d.ts +106 -0
  227. package/dist/operations/planning/compile-intent.d.ts.map +1 -0
  228. package/dist/operations/planning/compile-intent.js +562 -0
  229. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  230. package/dist/operations/semantic-advisor/analyze-prose.js +6 -2
  231. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
  232. package/dist/operations/semantic-advisor/clauses.js +15 -2
  233. package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
  234. package/dist/operations/semantic-advisor/ingestion-boundary.js +7 -3
  235. package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts +51 -0
  236. package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts.map +1 -0
  237. package/dist/operations/semantic-advisor/predicate-rules-launcher.js +96 -0
  238. package/dist/operations/semantic-advisor/types.d.ts +13 -5
  239. package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
  240. package/dist/operations/verification/ingest-verification.d.ts +29 -0
  241. package/dist/operations/verification/ingest-verification.d.ts.map +1 -0
  242. package/dist/operations/verification/ingest-verification.js +192 -0
  243. package/dist/prolog/codec.d.ts.map +1 -1
  244. package/dist/prolog/codec.js +2 -1
  245. package/dist/prolog.d.ts +8 -0
  246. package/dist/prolog.d.ts.map +1 -1
  247. package/dist/prolog.js +66 -16
  248. package/dist/public/branch-resolver.d.ts +1 -0
  249. package/dist/public/branch-resolver.d.ts.map +1 -1
  250. package/dist/public/branch-resolver.js +1 -0
  251. package/dist/public/check-types.d.ts +2 -2
  252. package/dist/public/check-types.d.ts.map +1 -1
  253. package/dist/public/check-types.js +16 -16
  254. package/dist/public/diagnostic-usage.d.ts.map +1 -1
  255. package/dist/public/diagnostic-usage.js +69 -1
  256. package/dist/public/distribution-parity.d.ts +1 -1
  257. package/dist/public/distribution-parity.d.ts.map +1 -1
  258. package/dist/public/distribution-parity.js +1 -0
  259. package/dist/public/ignore-policy.d.ts.map +1 -1
  260. package/dist/public/ignore-policy.js +16 -4
  261. package/dist/public/impact/coverage-depth-quality.d.ts +6 -1
  262. package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
  263. package/dist/public/impact/coverage-depth-quality.js +21 -3
  264. package/dist/public/impact/full-kb-quality.d.ts +4 -2
  265. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  266. package/dist/public/impact/full-kb-quality.js +61 -1
  267. package/dist/public/impact/manifest.d.ts.map +1 -1
  268. package/dist/public/impact/manifest.js +2 -5
  269. package/dist/public/operational-artifacts.d.ts.map +1 -1
  270. package/dist/public/operational-artifacts.js +7 -1
  271. package/dist/public/operations/catalog.d.ts +682 -67
  272. package/dist/public/operations/catalog.d.ts.map +1 -1
  273. package/dist/public/operations/catalog.js +126 -4
  274. package/dist/public/operations/check-executor.d.ts +2 -2
  275. package/dist/public/operations/check-executor.d.ts.map +1 -1
  276. package/dist/public/operations/check-executor.js +72 -13
  277. package/dist/public/operations/check-format-shared.d.ts +3 -0
  278. package/dist/public/operations/check-format-shared.d.ts.map +1 -1
  279. package/dist/public/operations/check-format-shared.js +3 -0
  280. package/dist/public/operations/check-helpers.d.ts +27 -2
  281. package/dist/public/operations/check-helpers.d.ts.map +1 -1
  282. package/dist/public/operations/check-helpers.js +62 -26
  283. package/dist/public/operations/contracts.d.ts +11 -0
  284. package/dist/public/operations/contracts.d.ts.map +1 -0
  285. package/dist/public/operations/contracts.js +325 -0
  286. package/dist/public/operations/discovery-entities.d.ts.map +1 -1
  287. package/dist/public/operations/discovery-entities.js +3 -2
  288. package/dist/public/operations/discovery-executors.d.ts +37 -1
  289. package/dist/public/operations/discovery-executors.d.ts.map +1 -1
  290. package/dist/public/operations/discovery-executors.js +246 -9
  291. package/dist/public/operations/index.d.ts +9 -4
  292. package/dist/public/operations/index.d.ts.map +1 -1
  293. package/dist/public/operations/index.js +8 -3
  294. package/dist/public/operations/migration-plan.d.ts +101 -0
  295. package/dist/public/operations/migration-plan.d.ts.map +1 -0
  296. package/dist/public/operations/migration-plan.js +537 -0
  297. package/dist/public/operations/node-ports.d.ts.map +1 -1
  298. package/dist/public/operations/node-ports.js +68 -8
  299. package/dist/public/operations/prolog-json.d.ts +14 -0
  300. package/dist/public/operations/prolog-json.d.ts.map +1 -1
  301. package/dist/public/operations/prolog-json.js +55 -6
  302. package/dist/public/operations/repair-plan.d.ts.map +1 -1
  303. package/dist/public/operations/repair-plan.js +1 -0
  304. package/dist/public/operations/result-envelope.d.ts +13 -0
  305. package/dist/public/operations/result-envelope.d.ts.map +1 -0
  306. package/dist/public/operations/result-envelope.js +104 -0
  307. package/dist/public/operations/runtime-types.d.ts +126 -5
  308. package/dist/public/operations/runtime-types.d.ts.map +1 -1
  309. package/dist/public/operations/source-relationship-parity.d.ts +13 -0
  310. package/dist/public/operations/source-relationship-parity.d.ts.map +1 -0
  311. package/dist/public/operations/source-relationship-parity.js +162 -0
  312. package/dist/public/operations/specs/{autopilot.d.ts → bootstrap.d.ts} +9 -9
  313. package/dist/public/operations/specs/bootstrap.d.ts.map +1 -0
  314. package/dist/public/operations/specs/{autopilot.js → bootstrap.js} +8 -7
  315. package/dist/public/operations/specs/check.d.ts +4 -4
  316. package/dist/public/operations/specs/check.d.ts.map +1 -1
  317. package/dist/public/operations/specs/check.js +4 -3
  318. package/dist/public/operations/specs/discovery.d.ts +87 -3
  319. package/dist/public/operations/specs/discovery.d.ts.map +1 -1
  320. package/dist/public/operations/specs/discovery.js +53 -3
  321. package/dist/public/operations/specs/modeling.d.ts +3 -3
  322. package/dist/public/operations/specs/modeling.js +3 -3
  323. package/dist/public/operations/specs/mutation-schemas.d.ts +190 -47
  324. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  325. package/dist/public/operations/specs/mutation-schemas.js +3 -1
  326. package/dist/public/operations/specs/mutation.d.ts +42 -2
  327. package/dist/public/operations/specs/mutation.d.ts.map +1 -1
  328. package/dist/public/operations/specs/mutation.js +26 -2
  329. package/dist/public/operations/specs/planning.d.ts +270 -0
  330. package/dist/public/operations/specs/planning.d.ts.map +1 -0
  331. package/dist/public/operations/specs/planning.js +191 -0
  332. package/dist/public/operations/specs/reporting.d.ts +4 -1
  333. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  334. package/dist/public/operations/specs/reporting.js +46 -1
  335. package/dist/public/operations/specs/upsert.d.ts +204 -47
  336. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  337. package/dist/public/operations/specs/upsert.js +9 -0
  338. package/dist/public/operations/specs/verification.d.ts +78 -0
  339. package/dist/public/operations/specs/verification.d.ts.map +1 -0
  340. package/dist/public/operations/specs/verification.js +62 -0
  341. package/dist/public/operations/symbol-repair-plan.d.ts +11 -0
  342. package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -0
  343. package/dist/public/operations/symbol-repair-plan.js +123 -0
  344. package/dist/public/operations/types.d.ts +52 -1
  345. package/dist/public/operations/types.d.ts.map +1 -1
  346. package/dist/public/playwright-case-id.d.ts +8 -0
  347. package/dist/public/playwright-case-id.d.ts.map +1 -0
  348. package/dist/public/playwright-case-id.js +25 -0
  349. package/dist/public/schemas/entity.d.ts.map +1 -1
  350. package/dist/public/schemas/entity.js +4 -2
  351. package/dist/public/skills/kibi-bootstrap/SKILL.md +58 -0
  352. package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
  353. package/dist/public/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
  354. package/dist/public/skills/kibi-bootstrap/resources/operation-access.md +5 -0
  355. package/dist/public/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
  356. package/dist/public/skills/kibi-freshness/SKILL.md +40 -10
  357. package/dist/public/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
  358. package/dist/public/skills/kibi-freshness/resources/operation-access.md +6 -0
  359. package/dist/public/skills/kibi-freshness/resources/source-authoring.md +7 -0
  360. package/dist/public/skills/kibi-traceability/SKILL.md +47 -47
  361. package/dist/public/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
  362. package/dist/public/skills/kibi-traceability/resources/operation-access.md +5 -0
  363. package/dist/public/skills/kibi-traceability/resources/source-authoring.md +6 -0
  364. package/dist/public/skills/kibi-traceability/resources/traceability.md +8 -0
  365. package/dist/public/skills/kibi-usage/SKILL.md +115 -239
  366. package/dist/public/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
  367. package/dist/public/skills/kibi-usage/resources/kb-improvement.md +38 -0
  368. package/dist/public/skills/kibi-usage/resources/operation-access.md +36 -38
  369. package/dist/public/skills/kibi-usage/resources/relationship-directions.md +3 -3
  370. package/dist/public/skills/kibi-usage/resources/source-authoring.md +31 -0
  371. package/dist/public/skills/kibi-usage/resources/workflows.md +56 -3
  372. package/dist/public/symbol-granularity.d.ts +1 -1
  373. package/dist/public/symbol-granularity.d.ts.map +1 -1
  374. package/dist/public/symbol-granularity.js +1 -0
  375. package/dist/public/telemetry-acceptance.d.ts +7 -0
  376. package/dist/public/telemetry-acceptance.d.ts.map +1 -1
  377. package/dist/public/telemetry-acceptance.js +8 -1
  378. package/dist/public/telemetry-remediation.js +1 -1
  379. package/dist/public/verification-receipt.d.ts +206 -39
  380. package/dist/public/verification-receipt.d.ts.map +1 -1
  381. package/dist/public/verification-receipt.js +171 -4
  382. package/dist/relationships/shards.d.ts +16 -0
  383. package/dist/relationships/shards.d.ts.map +1 -1
  384. package/dist/relationships/shards.js +87 -2
  385. package/dist/report/brand.d.ts +19 -0
  386. package/dist/report/brand.d.ts.map +1 -0
  387. package/dist/report/brand.js +112 -0
  388. package/dist/report/html-report.d.ts +19 -0
  389. package/dist/report/html-report.d.ts.map +1 -0
  390. package/dist/report/html-report.js +963 -0
  391. package/dist/report/relative-time.d.ts +4 -0
  392. package/dist/report/relative-time.d.ts.map +1 -0
  393. package/dist/report/relative-time.js +46 -0
  394. package/dist/report/report-view.d.ts +17 -0
  395. package/dist/report/report-view.d.ts.map +1 -0
  396. package/dist/report/report-view.js +33 -0
  397. package/dist/report/repository.d.ts +35 -0
  398. package/dist/report/repository.d.ts.map +1 -0
  399. package/dist/report/repository.js +151 -0
  400. package/dist/runtime/cli-runtime.d.ts.map +1 -1
  401. package/dist/runtime/cli-runtime.js +98 -42
  402. package/dist/schemas/entity.schema.json +1148 -273
  403. package/dist/traceability/evidence-model.d.ts +2 -2
  404. package/dist/traceability/evidence-model.d.ts.map +1 -1
  405. package/dist/traceability/evidence-model.js +2 -2
  406. package/dist/traceability/git-staged.d.ts.map +1 -1
  407. package/dist/traceability/git-staged.js +15 -40
  408. package/dist/traceability/markdown-validate.d.ts.map +1 -1
  409. package/dist/traceability/markdown-validate.js +12 -7
  410. package/dist/traceability/staged-impact-contract.d.ts +3 -3
  411. package/dist/traceability/staged-impact-contract.d.ts.map +1 -1
  412. package/dist/traceability/staged-impact-contract.js +10 -38
  413. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  414. package/dist/traceability/staged-symbols-manifest.js +8 -3
  415. package/dist/traceability/temp-kb.d.ts.map +1 -1
  416. package/dist/traceability/temp-kb.js +3 -0
  417. package/dist/types/entities.d.ts +3 -0
  418. package/dist/types/entities.d.ts.map +1 -1
  419. package/dist/utils/branch-resolver.d.ts +24 -10
  420. package/dist/utils/branch-resolver.d.ts.map +1 -1
  421. package/dist/utils/branch-resolver.js +121 -38
  422. package/dist/utils/branch-store-locator.d.ts +23 -0
  423. package/dist/utils/branch-store-locator.d.ts.map +1 -0
  424. package/dist/utils/branch-store-locator.js +90 -0
  425. package/dist/utils/branch-store.d.ts +15 -0
  426. package/dist/utils/branch-store.d.ts.map +1 -0
  427. package/dist/utils/branch-store.js +130 -0
  428. package/dist/utils/config.d.ts +39 -37
  429. package/dist/utils/config.d.ts.map +1 -1
  430. package/dist/utils/config.js +107 -119
  431. package/dist/utils/kb-manifest.d.ts +35 -0
  432. package/dist/utils/kb-manifest.d.ts.map +1 -0
  433. package/dist/utils/kb-manifest.js +154 -0
  434. package/dist/utils/kb-paths.d.ts +54 -0
  435. package/dist/utils/kb-paths.d.ts.map +1 -0
  436. package/dist/utils/kb-paths.js +125 -0
  437. package/dist/utils/manifest-paths.d.ts +4 -4
  438. package/dist/utils/manifest-paths.d.ts.map +1 -1
  439. package/dist/utils/manifest-paths.js +8 -56
  440. package/dist/utils/rule-registry.d.ts +48 -20
  441. package/dist/utils/rule-registry.d.ts.map +1 -1
  442. package/dist/utils/rule-registry.js +82 -77
  443. package/dist/utils/schema-version.d.ts +5 -5
  444. package/dist/utils/schema-version.d.ts.map +1 -1
  445. package/dist/utils/schema-version.js +26 -6
  446. package/dist/utils/strict-modeling.d.ts +0 -4
  447. package/dist/utils/strict-modeling.d.ts.map +1 -1
  448. package/dist/utils/strict-modeling.js +7 -8
  449. package/dist/verification/playwright-reporter.d.ts +21 -0
  450. package/dist/verification/playwright-reporter.d.ts.map +1 -0
  451. package/dist/verification/playwright-reporter.js +114 -0
  452. package/package.json +51 -8
  453. package/schema/config.json +2 -2
  454. package/schema/manifest.json +26 -0
  455. package/src/public/branch-resolver.ts +1 -0
  456. package/src/public/check-types.ts +22 -19
  457. package/src/public/diagnostic-usage.ts +79 -1
  458. package/src/public/distribution-parity.ts +1 -0
  459. package/src/public/ignore-policy.ts +16 -10
  460. package/src/public/impact/coverage-depth-quality.ts +36 -0
  461. package/src/public/impact/full-kb-quality.ts +118 -5
  462. package/src/public/impact/manifest.ts +2 -4
  463. package/src/public/operational-artifacts.ts +9 -1
  464. package/src/public/operations/catalog.ts +146 -9
  465. package/src/public/operations/check-executor.ts +102 -15
  466. package/src/public/operations/check-format-shared.ts +6 -0
  467. package/src/public/operations/check-helpers.ts +74 -35
  468. package/src/public/operations/contracts.ts +366 -0
  469. package/src/public/operations/discovery-entities.ts +3 -2
  470. package/src/public/operations/discovery-executors.ts +343 -15
  471. package/src/public/operations/index.ts +9 -4
  472. package/src/public/operations/migration-plan.ts +740 -0
  473. package/src/public/operations/node-ports.ts +84 -10
  474. package/src/public/operations/prolog-json.ts +73 -6
  475. package/src/public/operations/repair-plan.ts +1 -0
  476. package/src/public/operations/result-envelope.ts +136 -0
  477. package/src/public/operations/runtime-types.ts +130 -5
  478. package/src/public/operations/source-relationship-parity.ts +226 -0
  479. package/src/public/operations/specs/{autopilot.ts → bootstrap.ts} +17 -16
  480. package/src/public/operations/specs/check.ts +4 -3
  481. package/src/public/operations/specs/discovery.ts +57 -3
  482. package/src/public/operations/specs/modeling.ts +3 -3
  483. package/src/public/operations/specs/mutation-schemas.ts +6 -1
  484. package/src/public/operations/specs/mutation.ts +27 -2
  485. package/src/public/operations/specs/planning.ts +234 -0
  486. package/src/public/operations/specs/reporting.ts +55 -1
  487. package/src/public/operations/specs/upsert.ts +10 -0
  488. package/src/public/operations/specs/verification.ts +78 -0
  489. package/src/public/operations/symbol-repair-plan.ts +164 -0
  490. package/src/public/operations/types.ts +62 -1
  491. package/src/public/playwright-case-id.ts +35 -0
  492. package/src/public/schemas/entity.ts +7 -2
  493. package/src/public/skills/kibi-bootstrap/SKILL.md +58 -0
  494. package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
  495. package/src/public/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
  496. package/src/public/skills/kibi-bootstrap/resources/operation-access.md +5 -0
  497. package/src/public/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
  498. package/src/public/skills/kibi-freshness/SKILL.md +40 -10
  499. package/src/public/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
  500. package/src/public/skills/kibi-freshness/resources/operation-access.md +6 -0
  501. package/src/public/skills/kibi-freshness/resources/source-authoring.md +7 -0
  502. package/src/public/skills/kibi-traceability/SKILL.md +47 -47
  503. package/src/public/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
  504. package/src/public/skills/kibi-traceability/resources/operation-access.md +5 -0
  505. package/src/public/skills/kibi-traceability/resources/source-authoring.md +6 -0
  506. package/src/public/skills/kibi-traceability/resources/traceability.md +8 -0
  507. package/src/public/skills/kibi-usage/SKILL.md +115 -239
  508. package/src/public/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
  509. package/src/public/skills/kibi-usage/resources/kb-improvement.md +38 -0
  510. package/src/public/skills/kibi-usage/resources/operation-access.md +36 -38
  511. package/src/public/skills/kibi-usage/resources/relationship-directions.md +3 -3
  512. package/src/public/skills/kibi-usage/resources/source-authoring.md +31 -0
  513. package/src/public/skills/kibi-usage/resources/workflows.md +56 -3
  514. package/src/public/symbol-granularity.ts +1 -0
  515. package/src/public/telemetry-acceptance.ts +16 -1
  516. package/src/public/telemetry-remediation.ts +1 -1
  517. package/src/public/verification-receipt.ts +248 -6
  518. package/src/schemas/entity.schema.json +1148 -273
  519. package/templates/github/kibi-badge.yml +86 -0
  520. package/templates/github/kibi-report.yml +84 -0
  521. package/dist/operations/autopilot/activation.d.ts.map +0 -1
  522. package/dist/operations/autopilot/candidates.d.ts +0 -4
  523. package/dist/operations/autopilot/discovery.d.ts.map +0 -1
  524. package/dist/operations/autopilot/generate.d.ts +0 -8
  525. package/dist/operations/autopilot/generate.d.ts.map +0 -1
  526. package/dist/operations/autopilot/generate.js +0 -112
  527. package/dist/operations/autopilot/presentation.d.ts +0 -13
  528. package/dist/operations/autopilot/presentation.d.ts.map +0 -1
  529. package/dist/operations/autopilot/presentation.js +0 -91
  530. package/dist/operations/autopilot/types.d.ts.map +0 -1
  531. package/dist/operations/autopilot/types.js +0 -8
  532. package/dist/public/operations/specs/autopilot.d.ts.map +0 -1
  533. package/dist/public/skills/init-kibi/SKILL.md +0 -62
  534. package/src/public/skills/init-kibi/SKILL.md +0 -62
  535. /package/dist/operations/{autopilot → bootstrap}/activation.d.ts +0 -0
  536. /package/dist/operations/{autopilot → bootstrap}/candidate-helpers.d.ts +0 -0
  537. /package/dist/operations/{autopilot → bootstrap}/candidate-helpers.js +0 -0
  538. /package/dist/operations/{autopilot → bootstrap}/requirement-claims.d.ts +0 -0
  539. /package/dist/operations/{autopilot → bootstrap}/requirement-claims.js +0 -0
@@ -0,0 +1,123 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { analyzeSourceText } from "../../extractors/symbols-coordinator.js";
4
+ import { loadEntities } from "./discovery-entities.js";
5
+ export const SYMBOL_REPAIR_PLAN_VERSION = "kibi.symbol-repair-plan.v1";
6
+ function sourceFileOf(entity) {
7
+ const value = entity.sourceFile ?? entity.source;
8
+ return typeof value === "string" && value.trim() ? value.trim() : null;
9
+ }
10
+ function coordinatesPresent(entity) {
11
+ return [
12
+ entity.sourceLine,
13
+ entity.sourceColumn,
14
+ entity.sourceEndLine,
15
+ entity.sourceEndColumn,
16
+ ].every((value) => Number.isInteger(value) && Number(value) >= 0);
17
+ }
18
+ function currentCandidates(entity, symbols, extractedByPath) {
19
+ const title = typeof entity.title === "string" ? entity.title : "";
20
+ const kind = typeof entity.symbol_kind === "string" ? entity.symbol_kind : "";
21
+ const source = sourceFileOf(entity);
22
+ const extracted = source ? (extractedByPath.get(source) ?? []) : [];
23
+ const names = new Set(extracted
24
+ .filter((candidate) => !kind || candidate.kind === kind)
25
+ .map((candidate) => candidate.name));
26
+ return symbols
27
+ .filter((candidate) => candidate.id !== entity.id)
28
+ .filter((candidate) => {
29
+ const candidateTitle = typeof candidate.title === "string" ? candidate.title : "";
30
+ const candidateKind = typeof candidate.symbol_kind === "string" ? candidate.symbol_kind : "";
31
+ return ((title !== "" && candidateTitle === title) ||
32
+ (kind !== "" && candidateKind === kind && names.has(candidateTitle)));
33
+ })
34
+ .map((candidate) => ({
35
+ symbolId: String(candidate.id),
36
+ title: candidate.title,
37
+ symbolKind: candidate.symbol_kind,
38
+ sourceFile: sourceFileOf(candidate),
39
+ evidence: "current extraction/title/kind match",
40
+ }));
41
+ }
42
+ /** Build review-only, evidence-backed symbol recovery suggestions. */
43
+ export async function buildSymbolRepairPlan(rows, context) {
44
+ if (!context.prolog || rows.length === 0)
45
+ return undefined;
46
+ const symbols = await loadEntities(context.prolog, { type: "symbol" });
47
+ const extractedByPath = new Map();
48
+ for (const symbol of symbols) {
49
+ const source = sourceFileOf(symbol);
50
+ if (!source || extractedByPath.has(source))
51
+ continue;
52
+ const absolute = path.isAbsolute(source)
53
+ ? source
54
+ : path.resolve(context.workspaceRoot, source);
55
+ if (!existsSync(absolute))
56
+ continue;
57
+ try {
58
+ const analysis = analyzeSourceText(absolute, readFileSync(absolute, "utf8"));
59
+ extractedByPath.set(source, analysis.symbols.map((candidate) => ({
60
+ name: candidate.name,
61
+ kind: candidate.kind,
62
+ })));
63
+ }
64
+ catch {
65
+ extractedByPath.set(source, []);
66
+ }
67
+ }
68
+ const repairs = rows.flatMap((row) => {
69
+ if (row.type !== "symbol")
70
+ return [];
71
+ const entity = symbols.find((candidate) => candidate.id === row.id);
72
+ if (!entity)
73
+ return [];
74
+ const source = sourceFileOf(entity);
75
+ const absolute = source
76
+ ? path.isAbsolute(source)
77
+ ? source
78
+ : path.resolve(context.workspaceRoot, source)
79
+ : null;
80
+ const exists = absolute !== null && existsSync(absolute);
81
+ const candidates = currentCandidates(entity, symbols, extractedByPath);
82
+ const extraction = source ? extractedByPath.get(source) : undefined;
83
+ const extractionProvesAbsent = exists &&
84
+ extraction !== undefined &&
85
+ !extraction.some((candidate) => candidate.name === entity.title &&
86
+ (!entity.symbol_kind || candidate.kind === entity.symbol_kind));
87
+ const gaps = Array.isArray(row.gaps) ? row.gaps.map(String) : [];
88
+ const action = !exists
89
+ ? entity.symbol_origin === "extracted"
90
+ ? "delete_obsolete_symbol"
91
+ : "review"
92
+ : extractionProvesAbsent && entity.symbol_origin === "extracted"
93
+ ? "delete_obsolete_symbol"
94
+ : !coordinatesPresent(entity)
95
+ ? "refresh_coordinates"
96
+ : candidates.length > 0
97
+ ? "remap"
98
+ : "review";
99
+ return [
100
+ {
101
+ symbolId: String(entity.id),
102
+ action,
103
+ candidates,
104
+ evidence: {
105
+ sourceFile: source,
106
+ sourceExists: exists,
107
+ extractionProvesAbsent,
108
+ gaps,
109
+ currentExtractionAvailable: source
110
+ ? extractedByPath.has(source)
111
+ : false,
112
+ autoApply: false,
113
+ },
114
+ },
115
+ ];
116
+ });
117
+ return {
118
+ version: SYMBOL_REPAIR_PLAN_VERSION,
119
+ readOnly: true,
120
+ autoApplicable: false,
121
+ repairs,
122
+ };
123
+ }
@@ -1,7 +1,14 @@
1
1
  import type { OperationContext } from "./runtime-types.js";
2
2
  export type { OperationContext };
3
- export type OperationName = "kb_query" | "kb_search" | "kb_status" | "kb_skills_list" | "kb_skills_load" | "kb_skills_read" | "kb_find_gaps" | "kb_coverage" | "kb_graph" | "kb_sparql_remote" | "kb_semantic_advisor" | "kb_upsert" | "kb_validate_upsert" | "kb_delete" | "kb_check" | "kb_model_requirement" | "kb_suggest_predicates" | "kb_autopilot_generate";
3
+ export type OperationName = "kb_query" | "kb_search" | "kb_status" | "kb_skills_list" | "kb_skills_load" | "kb_skills_read" | "kb_find_gaps" | "kb_coverage" | "kb_graph" | "kb_sparql_remote" | "kb_semantic_advisor" | "kb_upsert" | "kb_validate_upsert" | "kb_delete" | "kb_check" | "kb_model_requirement" | "kb_suggest_predicates" | "kb_plan_bootstrap" | "kb_compile_intent" | "kb_apply_plan" | "kb_ingest_verification";
4
4
  export type OperationEffect = "local-read" | "kb-read" | "workspace-read" | "network-read" | "kb-write" | "workspace-write";
5
+ export type OperationEffectDeclaration = Readonly<{
6
+ kind: OperationEffect;
7
+ mutability: "read" | "write";
8
+ destructive: boolean;
9
+ retrySafety: "safe" | "unsafe";
10
+ openWorld: boolean;
11
+ }>;
5
12
  export interface OperationContent {
6
13
  readonly type: string;
7
14
  readonly text?: string;
@@ -10,6 +17,38 @@ export interface OperationResult<O = unknown> {
10
17
  readonly content: readonly OperationContent[];
11
18
  readonly structuredContent?: O;
12
19
  }
20
+ export type KibiResultStatus = "success" | "committed_with_repairs" | "error";
21
+ export type KibiResult<T = unknown> = {
22
+ readonly kibiProtocol: 1;
23
+ readonly operation: OperationName | string;
24
+ readonly resultVersion: string;
25
+ readonly status: KibiResultStatus;
26
+ readonly data: T;
27
+ readonly effects: readonly {
28
+ readonly kind: string;
29
+ readonly status: "completed" | "failed" | "not_applicable";
30
+ readonly detail?: unknown;
31
+ readonly errorCode?: string;
32
+ }[];
33
+ readonly diagnostics: readonly {
34
+ readonly code?: string;
35
+ readonly severity?: "info" | "warning" | "error";
36
+ readonly message: string;
37
+ readonly detail?: unknown;
38
+ }[];
39
+ readonly nextActions: readonly {
40
+ readonly operation: OperationName | string;
41
+ readonly input?: unknown;
42
+ readonly reason: string;
43
+ readonly required: boolean;
44
+ }[];
45
+ readonly error?: {
46
+ readonly code: string;
47
+ readonly message: string;
48
+ readonly retryable: boolean;
49
+ readonly details?: unknown;
50
+ };
51
+ };
13
52
  export interface OperationSpec<I = Readonly<Record<string, unknown>>, O = unknown> {
14
53
  readonly name: OperationName;
15
54
  readonly cliName: string;
@@ -17,8 +56,20 @@ export interface OperationSpec<I = Readonly<Record<string, unknown>>, O = unknow
17
56
  readonly businessInputSchema: Readonly<Record<string, unknown>>;
18
57
  readonly requiresProlog: boolean;
19
58
  readonly effects: readonly OperationEffect[];
59
+ /** Generated effect metadata used by MCP annotations and telemetry. */
60
+ readonly declaredEffects?: readonly OperationEffectDeclaration[];
61
+ /** Version of the machine-readable result data for this operation. */
62
+ readonly resultVersion?: string;
63
+ /** JSON Schema for the machine-readable result data. */
64
+ readonly outputSchema?: Readonly<Record<string, unknown>>;
20
65
  readonly execute: {
21
66
  bivarianceHack(input: I, context: OperationContext): Promise<OperationResult<O>>;
22
67
  }["bivarianceHack"];
23
68
  }
69
+ /** A catalog spec after its generated machine contract has been attached. */
70
+ export type ResolvedOperationSpec<I = Readonly<Record<string, unknown>>, O = unknown> = OperationSpec<I, O> & {
71
+ readonly declaredEffects: readonly OperationEffectDeclaration[];
72
+ readonly resultVersion: string;
73
+ readonly outputSchema: Readonly<Record<string, unknown>>;
74
+ };
24
75
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/public/operations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,gBAAgB,EAAE,CAAC;AACjC,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,WAAW,GACX,WAAW,GACX,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,aAAa,GACb,UAAU,GACV,kBAAkB,GAClB,qBAAqB,GACrB,WAAW,GACX,oBAAoB,GACpB,WAAW,GACX,UAAU,GACV,sBAAsB,GACtB,uBAAuB,GACvB,uBAAuB,CAAC;AAE5B,MAAM,MAAM,eAAe,GACvB,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,cAAc,GACd,UAAU,GACV,iBAAiB,CAAC;AAEtB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC9C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,aAAa,CAC5B,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACrC,CAAC,GAAG,OAAO;IAEX,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAChE,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE;QAChB,cAAc,CACZ,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;KAChC,CAAC,gBAAgB,CAAC,CAAC;CACrB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/public/operations/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Stable identity for a statically named Playwright test case.
3
+ * The path is always repository-relative before hashing so the same case has
4
+ * the same identity in a checkout, packed consumer, and dogfood workspace.
5
+ */
6
+ export declare function playwrightCaseId(sourceFile: string, qualifiedTitle: string): string;
7
+ export declare function normalizePlaywrightSourceFile(sourceFile: string, workspaceRoot?: string): string;
8
+ //# sourceMappingURL=playwright-case-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playwright-case-id.d.ts","sourceRoot":"","sources":["../../src/public/playwright-case-id.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,GACrB,MAAM,CAOR;AAGD,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,MAAM,GACrB,MAAM,CASR"}
@@ -0,0 +1,25 @@
1
+ import { createHash } from "node:crypto";
2
+ import path from "node:path";
3
+ /**
4
+ * Stable identity for a statically named Playwright test case.
5
+ * The path is always repository-relative before hashing so the same case has
6
+ * the same identity in a checkout, packed consumer, and dogfood workspace.
7
+ */
8
+ // implements REQ-kibi-verification-evidence-contract
9
+ export function playwrightCaseId(sourceFile, qualifiedTitle) {
10
+ const normalizedPath = sourceFile
11
+ .replaceAll("\\", "/")
12
+ .replace(/^\.\//, "")
13
+ .replace(/^\/+/, "");
14
+ const key = `${normalizedPath}\0${qualifiedTitle.trim()}`;
15
+ return `SYM-PW-${createHash("sha256").update(key).digest("hex").slice(0, 16).toUpperCase()}`;
16
+ }
17
+ // implements REQ-kibi-verification-evidence-contract
18
+ export function normalizePlaywrightSourceFile(sourceFile, workspaceRoot) {
19
+ const absolute = path.resolve(sourceFile);
20
+ if (!workspaceRoot)
21
+ return sourceFile.replaceAll("\\", "/");
22
+ const root = path.resolve(workspaceRoot);
23
+ const relative = path.relative(root, absolute);
24
+ return (relative.startsWith("..") ? sourceFile : relative).replaceAll("\\", "/");
25
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/entity.ts"],"names":[],"mappings":"AAwTA,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA6TzC,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/public/schemas/entity.ts"],"names":[],"mappings":"AA2TA,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA+TzC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -17,7 +17,7 @@
17
17
  */
18
18
  // Typed fact field enums per proposal
19
19
  import { SYMBOL_ROLES } from "../symbol-granularity.js";
20
- import { VERIFICATION_RECEIPT_SCHEMA } from "../verification-receipt.js";
20
+ import { VERIFICATION_CONTRACT_SCHEMA, VERIFICATION_RECEIPT_SCHEMA, } from "../verification-receipt.js";
21
21
  const factConditionals = JSON.parse(`[
22
22
  {
23
23
  "if": {
@@ -416,6 +416,7 @@ const entitySchema = {
416
416
  "module-level-behavior",
417
417
  "extractor-miss",
418
418
  "legacy-link",
419
+ "test-suite",
419
420
  ],
420
421
  },
421
422
  symbol_role: {
@@ -430,9 +431,9 @@ const entitySchema = {
430
431
  type: "string",
431
432
  enum: ["internal", "consumer"],
432
433
  },
434
+ verification_contract: VERIFICATION_CONTRACT_SCHEMA,
433
435
  verification_receipts: {
434
436
  type: "array",
435
- maxItems: 50,
436
437
  items: VERIFICATION_RECEIPT_SCHEMA,
437
438
  },
438
439
  type: {
@@ -574,6 +575,7 @@ const entitySchema = {
574
575
  anyOf: [
575
576
  { required: ["verification_scope"] },
576
577
  { required: ["verification_perspective"] },
578
+ { required: ["verification_contract"] },
577
579
  { required: ["verification_receipts"] },
578
580
  ],
579
581
  },
@@ -0,0 +1,58 @@
1
+ ---
2
+ id: kibi-bootstrap
3
+ name: kibi-bootstrap
4
+ description: Bootstrap Kibi from the current Git checkout with exact Git attachment, preview approval, source-first writes, and repair-safe completion.
5
+ version: 3.0.0
6
+ kibiCompatibility: ">=1.0.0"
7
+ tags:
8
+ - kibi
9
+ - bootstrap
10
+ - source-first
11
+ - agent-guidance
12
+ resources:
13
+ - resources/bootstrap.md
14
+ - resources/branch-lifecycle.md
15
+ - resources/source-authoring.md
16
+ - resources/operation-access.md
17
+ ---
18
+ ## Goal
19
+
20
+ Seed branch-local Kibi knowledge for an attached but thin repository without
21
+ creating a parallel human-maintained ticket system. Ask at most four bounded
22
+ context questions only when the planner says repository evidence is
23
+ insufficient; agents own deterministic translation and humans resolve genuine
24
+ ambiguity. A seeded repository hands off to the normal Kibi workflow.
25
+
26
+ ## Interface and preview
27
+
28
+ Use the visible approved MCP surface or the trusted project-local CLI as equal
29
+ peer interfaces. If neither is available, stop. Run `kb_plan_bootstrap` (or
30
+ `plan-bootstrap --input`) read-only. If it returns `needs_context`, ask only its
31
+ bounded questions (never more than four), then rerun the planner. Show the
32
+ complete returned `structuredContent.plan`, including its canonical hash, and
33
+ get explicit approval before any write. Pass that plan object unchanged to
34
+ `kb_apply_plan`; do not reconstruct it from preview fields.
35
+
36
+ For CLI JSON, use the trusted route with `--input` (for example
37
+ `printf '%s\n' '{}' | kibi status --input -`); MCP and CLI are semantic peers.
38
+ Read the branch-lifecycle and source-authoring resources before migration,
39
+ source writes, or repair actions.
40
+
41
+ ## Apply and verify
42
+
43
+ Apply the approved `kibi.bootstrap-plan.v1` by calling `kb_apply_plan` with the
44
+ exact plan and approved hash. The operation owns dependency ordering,
45
+ source-first writes, sequential mutation, and recovery journaling. Direct
46
+ `kb_upsert` is forbidden for every kibi-bootstrap task, including after
47
+ approval; never replay plan actions manually. Use `kb_delete` only for an
48
+ approved hash-bound deletion plan; evolve requirements with `supersedes`.
49
+ Finish with `kb_check` and `kb_status`.
50
+
51
+ Consume the versioned `kibiProtocol: 1` result envelope: inspect `status`, `effects`,
52
+ `diagnostics`, and `nextActions`. On `committed_with_repairs`, execute required
53
+ repair actions and never retry the original mutation.
54
+
55
+ Kibi may author tracked Markdown/YAML/manifests and relationship shards
56
+ transactionally, but never Git-stages or commits them. Never read or edit
57
+ `.kb` directly. Missing exact branch stores are compiled from this checkout's
58
+ tracked sources by `kibi sync`; Kibi does not copy another branch's store.
@@ -0,0 +1,11 @@
1
+ # Bootstrap resource
2
+
3
+ `kb_plan_bootstrap` is read-only and returns `kibi.bootstrap-plan.v1`. Review
4
+ candidate evidence, exact actions, dependencies, expected snapshots, source
5
+ hashes, bounded questions, diagnostics, and the canonical `planHash` before
6
+ approving. A preview does not authorize source edits. After approval, pass the
7
+ unchanged returned `structuredContent.plan` to `kb_apply_plan` once with its
8
+ approved hash; inspect its typed result
9
+ and follow `nextActions` if it returns `committed_with_repairs`. Direct
10
+ `kb_upsert` is forbidden for every bootstrap task; never manually replay the
11
+ plan through it.
@@ -0,0 +1,7 @@
1
+ # Branch lifecycle
2
+
3
+ Use the exact `KIBI_BRANCH` value or Git symbolic HEAD. Hashed stores carry a
4
+ matching `branch.json`; missing stores are compiled from tracked sources by
5
+ `kibi sync`. Legacy literal stores require explicit migration. Kibi never
6
+ copies stores between branches or resolves Git conflicts. Read the preview,
7
+ approval hash, quarantine, restore, and purge details before lifecycle work.
@@ -0,0 +1,5 @@
1
+ # Operation access
2
+
3
+ MCP tools and the trusted project-local CLI are peer surfaces for the same
4
+ operation contracts. Use the dedicated JSON route; parse the shared
5
+ `KibiResult` envelope and follow required `nextActions` after partial commits.
@@ -0,0 +1,8 @@
1
+ # Source authoring
2
+
3
+ Tracked documents, manifests, and relationship shards are authoritative.
4
+ Kibi may write them transactionally but does not stage or commit them. Use
5
+ `document.path` for ambiguous new targets, preserve existing bodies when the
6
+ body is omitted, and use hash-bound deletion plans. On
7
+ `committed_with_repairs`, follow typed `nextActions` and never retry the
8
+ original mutation.
@@ -1,14 +1,18 @@
1
1
  ---
2
2
  id: kibi-freshness
3
3
  name: kibi-freshness
4
- description: Check branch freshness and source linkage quality before decisions or risky writes.
5
- version: 1.0.0
6
- kibiCompatibility: "*"
4
+ description: Check exact Git attachment, branch migration/quarantine, compiled-store freshness, source linkage, and repair state before decisions or writes.
5
+ version: 2.0.0
6
+ kibiCompatibility: ">=1.0.0"
7
7
  tags:
8
8
  - kibi
9
9
  - mcp
10
10
  - freshness
11
11
  - agent-guidance
12
+ resources:
13
+ - resources/branch-lifecycle.md
14
+ - resources/source-authoring.md
15
+ - resources/operation-access.md
12
16
  ---
13
17
  ## Goal
14
18
 
@@ -16,10 +20,10 @@ Help agents decide whether Kibi knowledge is current enough to support safe chan
16
20
 
17
21
  ## Interface Selection
18
22
 
19
- 1. If Kibi MCP tools are visible and approved for the workspace, use the MCP surface only.
20
- 2. Otherwise, in a trusted workspace, use the canonical project-local CLI fallback through `npx --no-install kibi ...` or `bunx --no-install kibi ...`.
21
- 3. If the project-local CLI is unavailable or too old, stop and tell the operator to enable or install Kibi.
22
- 4. Never use a global fallback or an installing runner.
23
+ 1. Use whichever approved peer is visible: MCP or the trusted project-local CLI.
24
+ 2. They have the same operation semantics and machine envelope; neither is preferred.
25
+ 3. If neither surface is available, stop and tell the operator which capability must be enabled.
26
+ 4. Never install packages, choose a package manager, or use a global fallback as part of freshness inspection.
23
27
 
24
28
  Use `kibi-usage/resources/operation-access.md` for exact dedicated routes. A project-local CLI freshness check is executable as:
25
29
 
@@ -30,15 +34,41 @@ echo '{}' | npx --no-install kibi status --input -
30
34
  ## Capability Workflow
31
35
 
32
36
  - Use `kb_status`, or `status --input`, first to confirm branch attachment, freshness state, dirty-worktree evidence, and whether the knowledge snapshot is safe to rely on.
37
+ - Treat `branchAttachment.gitBranch`, `branchAttachment.kbBranch`, and
38
+ `branchAttachment.storePath` as exact identities. Hashed stores require a
39
+ matching `branch.json`; a `legacy_compat` attachment is read-only until an
40
+ explicit old/new migration is approved.
41
+ - Inspect bounded `staleReasons` (indexed source missing/newer or documentation
42
+ source newer) and `verificationSnapshotChanges`. Kibi deliberately reports
43
+ editor/config paths such as editor dot-directories; do not silently ignore them.
33
44
  - Use `kb_query`, or `query --input`, with `sourceFile` and text references for source-linked discovery.
34
45
  - Re-run `kb_search`, or `search --input`, after sync gaps or stale context are detected.
35
46
  - If knowledge must change, use the selected interface's `kb_upsert`/`upsert` or `kb_delete`/`delete` operation sequentially, then finish with `kb_check`/`check`.
47
+ - If status returns `migrationPlan.version: kibi.migration-plan.v2`, inspect its
48
+ hash, scope, dependencies, and safety classes. Apply only ready automatic
49
+ actions with explicit hash/action approval through `kb_apply_plan` or
50
+ `kibi migrate --apply-safe`; escalate operator actions and never infer a
51
+ migration from prose suggestions.
52
+ - Parse the outer `kibiProtocol`/`resultVersion` envelope. If a mutation returns
53
+ `committed_with_repairs`, follow required typed `nextActions`; never retry the
54
+ original operation.
36
55
 
37
56
  ## Guidance
38
57
 
39
- - Prefer the public Kibi MCP surface whenever it is available and approved.
40
- - Never proceed with broad changes when freshness is stale and unresolved.
58
+ - Treat MCP and the trusted project-local CLI as equal peer surfaces.
59
+ - Report task outcome separately from KB, verification, proof, and limitation
60
+ state. A maintenance task can be complete with stale KB state or unresolved
61
+ proof only when its scoped objective is complete and the status is named
62
+ accurately; never call the KB clean/fresh in that case.
63
+ - A legacy attachment blocks mutation, and a dirty verification snapshot blocks
64
+ evidence-dependent closeout. Name the exact paths/symbol IDs and whether the
65
+ result is fixed, accepted, or deferred.
41
66
  - If entities look stale, refresh context through an approved Kibi capability and then re-query.
42
67
  - Preserve source-file traceability by carrying `sourceFile`, text references, and validation evidence through discovery, mutation, and completion.
43
68
  - Do not read or edit files inside `.kb` directly; use the selected Kibi interface instead.
44
- - Completion must state one freshness outcome: KB updated, no KB impact with rationale, or deferred/failed.
69
+ - Kibi authors tracked files but never Git-stages or commits them; ordinary Git workflows remain responsible for review and commit.
70
+ - Completion must state one freshness outcome: KB updated, no KB impact with rationale, or deferred/failed.
71
+
72
+ For exact branch lifecycle, quarantine, restore, and source-first writes, read
73
+ the shared `kibi-usage/resources/branch-lifecycle.md` and
74
+ `source-authoring.md` resources.
@@ -0,0 +1,7 @@
1
+ # Branch lifecycle
2
+
3
+ Use the exact `KIBI_BRANCH` value or Git symbolic HEAD. Hashed stores carry a
4
+ matching `branch.json`; missing stores are rebuilt from tracked sources by
5
+ `kibi sync`. Legacy literal stores require explicit migration. Kibi never copies
6
+ stores between branches or resolves Git conflicts.
7
+
@@ -0,0 +1,6 @@
1
+ # Operation access
2
+
3
+ Use visible approved MCP or the trusted project-local CLI. `kb_status`/`status`
4
+ is read-only and returns the shared versioned result envelope with exact branch,
5
+ store, freshness, effects, diagnostics, and typed next actions.
6
+
@@ -0,0 +1,7 @@
1
+ # Source authoring
2
+
3
+ Tracked documents and relationship shards are authoritative. Kibi may write
4
+ them transactionally but does not stage or commit them. Inspect `effects` and
5
+ typed `nextActions`; after `committed_with_repairs`, repair without retrying the
6
+ original mutation.
7
+
@@ -1,60 +1,60 @@
1
1
  ---
2
2
  id: kibi-traceability
3
3
  name: kibi-traceability
4
- description: Maintain requirement, scenario, and test traceability through Kibi MCP tools.
5
- version: 1.0.0
6
- kibiCompatibility: "*"
4
+ description: Maintain source-first requirement, scenario, test, symbol, and proof traceability through Kibi's peer interfaces.
5
+ version: 2.0.0
6
+ kibiCompatibility: ">=1.0.0"
7
7
  tags:
8
8
  - kibi
9
- - mcp
10
9
  - traceability
10
+ - source-first
11
+ - proof
11
12
  - agent-guidance
13
+ resources:
14
+ - resources/traceability.md
15
+ - resources/branch-lifecycle.md
16
+ - resources/source-authoring.md
17
+ - resources/operation-access.md
12
18
  ---
13
19
  ## Goal
14
20
 
15
- Validate and strengthen requirement, scenario, test, behavioral-symbol, and source-file traceability before and after code changes.
21
+ Keep product intent connected to implementation without a parallel ticket
22
+ bureaucracy. Requirements own symbols, requirements have clause-complete
23
+ semantics, scenarios have tests, and proof-bearing tests have fresh evidence.
16
24
 
17
25
  ## Interface Selection
18
26
 
19
- 1. If Kibi MCP tools are visible and approved, use the MCP surface as the primary authority.
20
- 2. Otherwise, in a trusted workspace, use the canonical project-local CLI fallback through `npx --no-install kibi ...` or `bunx --no-install kibi ...`.
21
- 3. If neither approved MCP tools nor the project-local CLI are available, or if the CLI is unavailable or too old, stop and tell the operator to enable or install Kibi.
22
- 4. Never use a global fallback or an installing runner.
23
-
24
- Use MCP routes for modeling, querying, checking, validation, and cleanup. Use the project-local CLI only as the fallback interface, passing JSON input through stdin. Example:
25
-
26
- ```bash
27
- echo '{"sourceFiles":["src/auth/login.ts"],"includeImpactDiagnostics":true,"includeWorkingTreeDiff":true}' | npx --no-install kibi check --input -
28
- ```
29
-
30
- ## Capability Workflow
31
-
32
- - Locate requirements through `kb_search` or `search --input`, then inspect exact records through `kb_query` or `query --input`.
33
- - Before meaningful edits, identify linked requirements, scenarios, tests, facts, source files, and behavioral symbols relevant to the planned change.
34
- - After meaningful source edits, run `kb_check({sourceFiles:[...], includeImpactDiagnostics:true, includeWorkingTreeDiff:true})` or the equivalent `check --input` JSON recipe before deciding whether traceability is current.
35
- - Apply traceability updates sequentially through `kb_upsert` or `upsert --input` for requirements, scenarios, tests, facts, behavioral symbols, and source-linked relationships.
36
- - Validate constraints and consistency through `kb_check` or `check --input` after updates.
37
- - Run `kb_coverage` by requirement after validation. Treat `coverageStatus` as structural compatibility only; use the separate `proofStatus`, `proofStages`, `proofGaps`, and ranked `proofRepairs` to decide whether the complete intent-to-code chain is proven.
38
- - Use `kb_delete` or `delete --input` only for explicit cleanup of obsolete records or relationships.
39
-
40
- ## Guidance
41
-
42
- - Prefer source-linked relationships so requirements, scenarios, tests, symbols, and files can be traced cleanly.
43
- - Preserve source-file traceability whenever adding or changing requirements, scenarios, tests, facts, behavioral symbols, or implementation links.
44
- - Preserve the canonical chain `REQ-* -> SCEN-* -> TEST-*` when adding or changing requirements.
45
- - Production symbols should implement requirements; test symbols should remain executable evidence for tests.
46
- - A proof-bearing test must be reached through the requirement's scenario, declare `verification_scope: end_to_end`, and carry a fresh passed `kibi.verification-receipt.v1` bound to the live `verificationSnapshot`. Link its executable code with `executable_for`; link each production symbol with `implements` and `covered_by` to that qualifying test. Durable `status: passing` is structural metadata, not execution proof.
47
- - Read `kb_status` immediately before a proof-bearing run, execute the exact recorded command, then append—not replace—the receipt history with test ID, scope, runner, command, snapshot, environment hash, timestamps, outcome, and artifact digest. Re-read coverage; wrong-snapshot, stale, failed, malformed, future-dated, or unavailable evidence must remain a gap.
48
- - A green structural count is not proof. Do not report success while a proposition is absent or unresolved, grounding is incomplete or non-bijective, contradiction analysis is incomplete, the E2E path is direct-only, its execution receipt is not fresh for the live snapshot, or proof-bearing symbols lack current generated coordinates.
49
- - Use `kb_coverage.repairPlan` to turn row-local `proofRepairs` into small dependency-ordered batches. Require `scope.complete: true` before treating it as a project-wide inventory, apply only `state: ready` work, and treat every `autoApplicable: false` batch as reviewed guidance rather than an executable mutation payload. Query current endpoints, follow its validation policy, keep upserts sequential, then rerun coverage after each batch; newly visible downstream gaps supersede the older plan. Never reinterpret `no_conflict_found` as universal consistency; it only describes the modeled ground claims Kibi could inspect.
50
- - When `.kb/usage.log` exists, run `kibi usage-metrics --format json --require-acceptance` after the final complete coverage call. A successful graph check does not override failed or insufficient `kibi.telemetry-acceptance.v1` evidence; follow ranked telemetry diagnostics for advisor/preflight bypasses, lookup misses, stalled proof recovery, receipt freshness, or repeated mutation failures.
51
- - Resolve impact at behavioral-symbol granularity when Kibi reports symbol-level diagnostics; avoid treating a whole file as impacted when the report identifies narrower linked behavior.
52
- - Treat `symbol_semantic_review_needed` as a prompt to inspect linked requirements and tests; Kibi reports graph links but does not prove prose semantics.
53
- - Do not read or edit files inside `.kb` directly; all modeling and cleanup goes through the selected Kibi interface.
54
- - Keep approval boundaries intact: only use Kibi MCP tools that are visible and approved, and only use the project-local CLI fallback in a trusted workspace.
55
-
56
- Public training trajectories:
57
- [{"taskId":"kibi-traceability-requirement-discovery-train-1","family":"requirement-discovery","reflection":"Discover the requirement linked to the supplied source symbol. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-requirement-discovery-train-2","family":"requirement-discovery","reflection":"Discover the requirement linked to the supplied source symbol. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-symbol-impact-granularity-train-1","family":"symbol-impact-granularity","reflection":"Resolve impact at behavioral symbol granularity rather than file granularity. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-symbol-impact-granularity-train-2","family":"symbol-impact-granularity","reflection":"Resolve impact at behavioral symbol granularity rather than file granularity. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-relationship-chain-train-1","family":"relationship-chain","reflection":"Trace the requirement, scenario, and test relationship chain. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-relationship-chain-train-2","family":"relationship-chain","reflection":"Trace the requirement, scenario, and test relationship chain. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-executable-coverage-train-1","family":"executable-coverage","reflection":"Establish executable test identity and behavioral coverage links. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-executable-coverage-train-2","family":"executable-coverage","reflection":"Establish executable test identity and behavioral coverage links. This is train case 2; use only the public Kibi MCP surface."}]
58
-
59
- Previous development gate:
60
- {"mean":0,"hardPasses":0,"worstFamilyMean":0}
27
+ Use the visible approved MCP tools or trusted project-local CLI as equal peer
28
+ interfaces. Select the surface by capability; neither is semantically preferred.
29
+ For CLI JSON, use a dedicated route such as
30
+ `printf '%s\n' '{}' | kibi status --input -`.
31
+
32
+ ## Workflow
33
+
34
+ Use the visible approved MCP tools or trusted project-local CLI as equal peer
35
+ interfaces. Discover with `kb_search`, exact-filter with `kb_query`, and inspect
36
+ `kb_status` before branch-sensitive work. Preserve `REQ-* -> SCEN-* -> TEST-*`;
37
+ link production symbols with `implements` and qualifying tests with
38
+ `executable_for`/`covered_by`.
39
+
40
+ After source edits, run targeted `kb_check` with impact diagnostics, update
41
+ tracked Markdown/YAML/manifests and canonical relationship shards through
42
+ sequential `kb_upsert`, then run final check and coverage. Kibi authors tracked
43
+ files transactionally but never Git-stages or commits them. Do not read or edit
44
+ `.kb` directly.
45
+
46
+ Use `kb_delete` only for intentional cleanup. Authored entity deletion returns a
47
+ hash-bound approval plan; requirements normally evolve through a new
48
+ requirement linked with `supersedes`. Relationship deletes patch shards while
49
+ preserving unrelated records.
50
+
51
+ ## Typed recovery and proof
52
+
53
+ Parse `kibiProtocol`, `resultVersion`, `status`, `effects`, diagnostics, and
54
+ typed `nextActions`. On `committed_with_repairs`, execute the required repair
55
+ action and never retry the original mutation. Keep ontology gaps, ambiguity,
56
+ stale snapshots, unavailable receipts, and incomplete grounding explicit.
57
+
58
+ Fresh proof requires a current verification snapshot, the exact contracted E2E
59
+ command, an append-only receipt, and current symbol coordinates. Structural
60
+ coverage and a green check are not proof by themselves.
@@ -0,0 +1,7 @@
1
+ # Branch lifecycle
2
+
3
+ The exact Git ref is the branch identity. Hashed stores are rebuildable
4
+ artifacts, missing stores compile from this checkout, and Git remains the sole
5
+ merge/conflict authority. Explicitly migrate legacy literal stores; do not copy
6
+ another branch's compiled state.
7
+
@@ -0,0 +1,5 @@
1
+ # Operation access
2
+
3
+ Use the shared operation contracts through approved MCP or the trusted project-local
4
+ CLI. Parse `kibiProtocol`, `resultVersion`, `status`, `effects`, diagnostics,
5
+ and typed `nextActions`; do not retry a mutation after authoritative commit.