kibi-cli 0.19.0 → 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 (506) hide show
  1. package/dist/cli-operation-loader.d.ts.map +1 -1
  2. package/dist/cli-operation-loader.js +53 -20
  3. package/dist/cli-operation-metadata.d.ts +20 -8
  4. package/dist/cli-operation-metadata.d.ts.map +1 -1
  5. package/dist/cli-operation-metadata.js +23 -8
  6. package/dist/cli-protocol.d.ts.map +1 -1
  7. package/dist/cli-protocol.js +38 -8
  8. package/dist/cli-register-foundation.d.ts.map +1 -1
  9. package/dist/cli-register-foundation.js +14 -2
  10. package/dist/cli-register-maintenance.d.ts.map +1 -1
  11. package/dist/cli-register-maintenance.js +26 -4
  12. package/dist/cli-register-reporting.d.ts.map +1 -1
  13. package/dist/cli-register-reporting.js +10 -0
  14. package/dist/cli-register-verification.d.ts +3 -0
  15. package/dist/cli-register-verification.d.ts.map +1 -0
  16. package/dist/cli-register-verification.js +16 -0
  17. package/dist/cli.d.ts.map +1 -1
  18. package/dist/cli.js +2 -0
  19. package/dist/commands/aggregated-checks.d.ts +1 -2
  20. package/dist/commands/aggregated-checks.d.ts.map +1 -1
  21. package/dist/commands/aggregated-checks.js +14 -9
  22. package/dist/commands/branch.d.ts +36 -0
  23. package/dist/commands/branch.d.ts.map +1 -1
  24. package/dist/commands/branch.js +371 -40
  25. package/dist/commands/check.d.ts.map +1 -1
  26. package/dist/commands/check.js +20 -67
  27. package/dist/commands/discovery-shared.d.ts.map +1 -1
  28. package/dist/commands/discovery-shared.js +10 -19
  29. package/dist/commands/doctor.d.ts +4 -1
  30. package/dist/commands/doctor.d.ts.map +1 -1
  31. package/dist/commands/doctor.js +259 -24
  32. package/dist/commands/engine.d.ts.map +1 -1
  33. package/dist/commands/engine.js +10 -7
  34. package/dist/commands/gc.d.ts +5 -2
  35. package/dist/commands/gc.d.ts.map +1 -1
  36. package/dist/commands/gc.js +140 -71
  37. package/dist/commands/github-init.d.ts +56 -0
  38. package/dist/commands/github-init.d.ts.map +1 -0
  39. package/dist/commands/github-init.js +310 -0
  40. package/dist/commands/init-helpers.d.ts +1 -1
  41. package/dist/commands/init-helpers.d.ts.map +1 -1
  42. package/dist/commands/init-helpers.js +73 -25
  43. package/dist/commands/init.d.ts +2 -0
  44. package/dist/commands/init.d.ts.map +1 -1
  45. package/dist/commands/init.js +79 -24
  46. package/dist/commands/legacy-storage-migration.d.ts +54 -0
  47. package/dist/commands/legacy-storage-migration.d.ts.map +1 -0
  48. package/dist/commands/legacy-storage-migration.js +277 -0
  49. package/dist/commands/migrate.d.ts +7 -0
  50. package/dist/commands/migrate.d.ts.map +1 -1
  51. package/dist/commands/migrate.js +244 -91
  52. package/dist/commands/report.d.ts +24 -0
  53. package/dist/commands/report.d.ts.map +1 -0
  54. package/dist/commands/report.js +191 -0
  55. package/dist/commands/sync/cache.d.ts +16 -3
  56. package/dist/commands/sync/cache.d.ts.map +1 -1
  57. package/dist/commands/sync/cache.js +111 -4
  58. package/dist/commands/sync/discovery.d.ts +23 -2
  59. package/dist/commands/sync/discovery.d.ts.map +1 -1
  60. package/dist/commands/sync/discovery.js +196 -15
  61. package/dist/commands/sync/extraction.d.ts +8 -1
  62. package/dist/commands/sync/extraction.d.ts.map +1 -1
  63. package/dist/commands/sync/extraction.js +38 -4
  64. package/dist/commands/sync/manifest.d.ts +8 -5
  65. package/dist/commands/sync/manifest.d.ts.map +1 -1
  66. package/dist/commands/sync/manifest.js +142 -39
  67. package/dist/commands/sync/persistence.d.ts.map +1 -1
  68. package/dist/commands/sync/persistence.js +3 -0
  69. package/dist/commands/sync.d.ts +6 -0
  70. package/dist/commands/sync.d.ts.map +1 -1
  71. package/dist/commands/sync.js +304 -79
  72. package/dist/commands/verify.d.ts +10 -0
  73. package/dist/commands/verify.d.ts.map +1 -0
  74. package/dist/commands/verify.js +126 -0
  75. package/dist/diagnostics.d.ts +1 -1
  76. package/dist/diagnostics.d.ts.map +1 -1
  77. package/dist/engine.d.ts +96 -3
  78. package/dist/engine.d.ts.map +1 -1
  79. package/dist/engine.js +392 -23
  80. package/dist/env.d.ts.map +1 -1
  81. package/dist/env.js +5 -6
  82. package/dist/extractors/manifest.d.ts +8 -1
  83. package/dist/extractors/manifest.d.ts.map +1 -1
  84. package/dist/extractors/manifest.js +51 -9
  85. package/dist/extractors/markdown.d.ts +2 -1
  86. package/dist/extractors/markdown.d.ts.map +1 -1
  87. package/dist/extractors/markdown.js +21 -3
  88. package/dist/extractors/playwright-cases.d.ts +24 -0
  89. package/dist/extractors/playwright-cases.d.ts.map +1 -0
  90. package/dist/extractors/playwright-cases.js +126 -0
  91. package/dist/extractors/relationships.d.ts.map +1 -1
  92. package/dist/extractors/relationships.js +1 -0
  93. package/dist/extractors/symbol-coordinates.d.ts +81 -3
  94. package/dist/extractors/symbol-coordinates.d.ts.map +1 -1
  95. package/dist/extractors/symbol-coordinates.js +389 -51
  96. package/dist/extractors/symbols-coordinator.js +11 -1
  97. package/dist/intent-search.d.ts +60 -0
  98. package/dist/intent-search.d.ts.map +1 -0
  99. package/dist/intent-search.js +433 -0
  100. package/dist/operations/bootstrap/activation.d.ts.map +1 -0
  101. package/dist/operations/{autopilot → bootstrap}/activation.js +48 -31
  102. package/dist/operations/{autopilot → bootstrap}/candidate-helpers.d.ts.map +1 -1
  103. package/dist/operations/bootstrap/candidates.d.ts +4 -0
  104. package/dist/operations/{autopilot → bootstrap}/candidates.d.ts.map +1 -1
  105. package/dist/operations/{autopilot → bootstrap}/candidates.js +22 -8
  106. package/dist/operations/{autopilot → bootstrap}/discovery-evidence.d.ts +2 -2
  107. package/dist/operations/{autopilot → bootstrap}/discovery-evidence.d.ts.map +1 -1
  108. package/dist/operations/{autopilot → bootstrap}/discovery-evidence.js +46 -6
  109. package/dist/operations/{autopilot → bootstrap}/discovery.d.ts +1 -1
  110. package/dist/operations/bootstrap/discovery.d.ts.map +1 -0
  111. package/dist/operations/{autopilot → bootstrap}/discovery.js +21 -14
  112. package/dist/operations/bootstrap/generate.d.ts +8 -0
  113. package/dist/operations/bootstrap/generate.d.ts.map +1 -0
  114. package/dist/operations/bootstrap/generate.js +204 -0
  115. package/dist/operations/{autopilot → bootstrap}/guidance-actions.d.ts +2 -2
  116. package/dist/operations/{autopilot → bootstrap}/guidance-actions.d.ts.map +1 -1
  117. package/dist/operations/{autopilot → bootstrap}/guidance-actions.js +4 -4
  118. package/dist/operations/{autopilot → bootstrap}/guidance.d.ts +2 -2
  119. package/dist/operations/{autopilot → bootstrap}/guidance.d.ts.map +1 -1
  120. package/dist/operations/{autopilot → bootstrap}/guidance.js +2 -0
  121. package/dist/operations/{autopilot → bootstrap}/markdown-candidates.d.ts +2 -2
  122. package/dist/operations/{autopilot → bootstrap}/markdown-candidates.d.ts.map +1 -1
  123. package/dist/operations/{autopilot → bootstrap}/markdown-candidates.js +4 -3
  124. package/dist/operations/bootstrap/presentation.d.ts +15 -0
  125. package/dist/operations/bootstrap/presentation.d.ts.map +1 -0
  126. package/dist/operations/bootstrap/presentation.js +177 -0
  127. package/dist/operations/{autopilot → bootstrap}/requirement-claims.d.ts.map +1 -1
  128. package/dist/operations/{autopilot → bootstrap}/types.d.ts +63 -21
  129. package/dist/operations/bootstrap/types.d.ts.map +1 -0
  130. package/dist/operations/bootstrap/types.js +25 -0
  131. package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
  132. package/dist/operations/modeling/model-requirement.js +4 -17
  133. package/dist/operations/modeling/predicate-applicability.d.ts +16 -0
  134. package/dist/operations/modeling/predicate-applicability.d.ts.map +1 -0
  135. package/dist/operations/modeling/predicate-applicability.js +276 -0
  136. package/dist/operations/modeling/predicate-applyplan.d.ts +13 -2
  137. package/dist/operations/modeling/predicate-applyplan.d.ts.map +1 -1
  138. package/dist/operations/modeling/predicate-applyplan.js +100 -3
  139. package/dist/operations/modeling/predicate-bindings.d.ts +6 -0
  140. package/dist/operations/modeling/predicate-bindings.d.ts.map +1 -0
  141. package/dist/operations/modeling/predicate-bindings.js +122 -0
  142. package/dist/operations/modeling/predicate-catalog-4.d.ts.map +1 -1
  143. package/dist/operations/modeling/predicate-catalog-4.js +155 -0
  144. package/dist/operations/modeling/predicate-inference-1.d.ts.map +1 -1
  145. package/dist/operations/modeling/predicate-inference-1.js +8 -0
  146. package/dist/operations/modeling/predicate-inference-launcher.d.ts +10 -0
  147. package/dist/operations/modeling/predicate-inference-launcher.d.ts.map +1 -0
  148. package/dist/operations/modeling/predicate-inference-launcher.js +13 -0
  149. package/dist/operations/modeling/predicate-inference.d.ts.map +1 -1
  150. package/dist/operations/modeling/predicate-inference.js +4 -0
  151. package/dist/operations/modeling/predicate-loader.d.ts.map +1 -1
  152. package/dist/operations/modeling/predicate-loader.js +7 -0
  153. package/dist/operations/modeling/predicate-ranker.d.ts +8 -1
  154. package/dist/operations/modeling/predicate-ranker.d.ts.map +1 -1
  155. package/dist/operations/modeling/predicate-ranker.js +156 -24
  156. package/dist/operations/modeling/predicate-score-3.d.ts.map +1 -1
  157. package/dist/operations/modeling/predicate-score-3.js +6 -0
  158. package/dist/operations/modeling/predicate-types.d.ts +34 -0
  159. package/dist/operations/modeling/predicate-types.d.ts.map +1 -1
  160. package/dist/operations/modeling/predicate-usage-hints-3.d.ts.map +1 -1
  161. package/dist/operations/modeling/predicate-usage-hints-3.js +40 -0
  162. package/dist/operations/modeling/predicate-utils.d.ts.map +1 -1
  163. package/dist/operations/modeling/predicate-utils.js +2 -0
  164. package/dist/operations/modeling/suggest-predicates.d.ts +1 -1
  165. package/dist/operations/modeling/suggest-predicates.d.ts.map +1 -1
  166. package/dist/operations/modeling/suggest-predicates.js +170 -32
  167. package/dist/operations/mutation/delete.d.ts.map +1 -1
  168. package/dist/operations/mutation/delete.js +415 -19
  169. package/dist/operations/mutation/entity-projection.d.ts +11 -0
  170. package/dist/operations/mutation/entity-projection.d.ts.map +1 -0
  171. package/dist/operations/mutation/entity-projection.js +14 -0
  172. package/dist/operations/mutation/relationships.d.ts +10 -0
  173. package/dist/operations/mutation/relationships.d.ts.map +1 -1
  174. package/dist/operations/mutation/relationships.js +71 -1
  175. package/dist/operations/mutation/serialization.d.ts.map +1 -1
  176. package/dist/operations/mutation/serialization.js +1 -0
  177. package/dist/operations/mutation/source-authoring.d.ts +61 -0
  178. package/dist/operations/mutation/source-authoring.d.ts.map +1 -0
  179. package/dist/operations/mutation/source-authoring.js +543 -0
  180. package/dist/operations/mutation/symbol-compiler-lock.d.ts +51 -0
  181. package/dist/operations/mutation/symbol-compiler-lock.d.ts.map +1 -0
  182. package/dist/operations/mutation/symbol-compiler-lock.js +274 -0
  183. package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
  184. package/dist/operations/mutation/symbol-granularity.js +34 -3
  185. package/dist/operations/mutation/symbol-refresh.d.ts +18 -1
  186. package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
  187. package/dist/operations/mutation/symbol-refresh.js +225 -63
  188. package/dist/operations/mutation/types.d.ts +57 -1
  189. package/dist/operations/mutation/types.d.ts.map +1 -1
  190. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  191. package/dist/operations/mutation/upsert.js +363 -24
  192. package/dist/operations/mutation/validation.d.ts.map +1 -1
  193. package/dist/operations/mutation/validation.js +1 -0
  194. package/dist/operations/planning/apply-plan.d.ts +117 -0
  195. package/dist/operations/planning/apply-plan.d.ts.map +1 -0
  196. package/dist/operations/planning/apply-plan.js +1437 -0
  197. package/dist/operations/planning/compile-intent.d.ts +106 -0
  198. package/dist/operations/planning/compile-intent.d.ts.map +1 -0
  199. package/dist/operations/planning/compile-intent.js +562 -0
  200. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  201. package/dist/operations/semantic-advisor/analyze-prose.js +6 -2
  202. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
  203. package/dist/operations/semantic-advisor/clauses.js +15 -2
  204. package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
  205. package/dist/operations/semantic-advisor/ingestion-boundary.js +7 -3
  206. package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts +51 -0
  207. package/dist/operations/semantic-advisor/predicate-rules-launcher.d.ts.map +1 -0
  208. package/dist/operations/semantic-advisor/predicate-rules-launcher.js +96 -0
  209. package/dist/operations/semantic-advisor/types.d.ts +13 -5
  210. package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
  211. package/dist/operations/verification/ingest-verification.d.ts +29 -0
  212. package/dist/operations/verification/ingest-verification.d.ts.map +1 -0
  213. package/dist/operations/verification/ingest-verification.js +192 -0
  214. package/dist/prolog/codec.d.ts.map +1 -1
  215. package/dist/prolog/codec.js +2 -1
  216. package/dist/prolog.d.ts.map +1 -1
  217. package/dist/prolog.js +27 -8
  218. package/dist/public/branch-resolver.d.ts +1 -0
  219. package/dist/public/branch-resolver.d.ts.map +1 -1
  220. package/dist/public/branch-resolver.js +1 -0
  221. package/dist/public/check-types.d.ts +2 -2
  222. package/dist/public/check-types.d.ts.map +1 -1
  223. package/dist/public/check-types.js +16 -16
  224. package/dist/public/diagnostic-usage.d.ts.map +1 -1
  225. package/dist/public/diagnostic-usage.js +69 -1
  226. package/dist/public/distribution-parity.d.ts +1 -1
  227. package/dist/public/distribution-parity.d.ts.map +1 -1
  228. package/dist/public/distribution-parity.js +1 -0
  229. package/dist/public/ignore-policy.d.ts.map +1 -1
  230. package/dist/public/ignore-policy.js +16 -4
  231. package/dist/public/impact/coverage-depth-quality.d.ts +6 -1
  232. package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
  233. package/dist/public/impact/coverage-depth-quality.js +21 -3
  234. package/dist/public/impact/full-kb-quality.d.ts +4 -2
  235. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  236. package/dist/public/impact/full-kb-quality.js +61 -1
  237. package/dist/public/impact/manifest.d.ts.map +1 -1
  238. package/dist/public/impact/manifest.js +2 -5
  239. package/dist/public/operational-artifacts.d.ts.map +1 -1
  240. package/dist/public/operational-artifacts.js +7 -1
  241. package/dist/public/operations/catalog.d.ts +682 -67
  242. package/dist/public/operations/catalog.d.ts.map +1 -1
  243. package/dist/public/operations/catalog.js +126 -4
  244. package/dist/public/operations/check-executor.d.ts +2 -2
  245. package/dist/public/operations/check-executor.d.ts.map +1 -1
  246. package/dist/public/operations/check-executor.js +72 -13
  247. package/dist/public/operations/check-format-shared.d.ts +3 -0
  248. package/dist/public/operations/check-format-shared.d.ts.map +1 -1
  249. package/dist/public/operations/check-format-shared.js +3 -0
  250. package/dist/public/operations/check-helpers.d.ts +27 -2
  251. package/dist/public/operations/check-helpers.d.ts.map +1 -1
  252. package/dist/public/operations/check-helpers.js +62 -26
  253. package/dist/public/operations/contracts.d.ts +11 -0
  254. package/dist/public/operations/contracts.d.ts.map +1 -0
  255. package/dist/public/operations/contracts.js +325 -0
  256. package/dist/public/operations/discovery-executors.d.ts +37 -1
  257. package/dist/public/operations/discovery-executors.d.ts.map +1 -1
  258. package/dist/public/operations/discovery-executors.js +206 -6
  259. package/dist/public/operations/index.d.ts +9 -4
  260. package/dist/public/operations/index.d.ts.map +1 -1
  261. package/dist/public/operations/index.js +8 -3
  262. package/dist/public/operations/migration-plan.d.ts +101 -0
  263. package/dist/public/operations/migration-plan.d.ts.map +1 -0
  264. package/dist/public/operations/migration-plan.js +537 -0
  265. package/dist/public/operations/node-ports.d.ts.map +1 -1
  266. package/dist/public/operations/node-ports.js +68 -8
  267. package/dist/public/operations/prolog-json.d.ts +14 -0
  268. package/dist/public/operations/prolog-json.d.ts.map +1 -1
  269. package/dist/public/operations/prolog-json.js +44 -5
  270. package/dist/public/operations/repair-plan.d.ts.map +1 -1
  271. package/dist/public/operations/repair-plan.js +1 -0
  272. package/dist/public/operations/result-envelope.d.ts +13 -0
  273. package/dist/public/operations/result-envelope.d.ts.map +1 -0
  274. package/dist/public/operations/result-envelope.js +104 -0
  275. package/dist/public/operations/runtime-types.d.ts +97 -7
  276. package/dist/public/operations/runtime-types.d.ts.map +1 -1
  277. package/dist/public/operations/source-relationship-parity.d.ts +13 -0
  278. package/dist/public/operations/source-relationship-parity.d.ts.map +1 -0
  279. package/dist/public/operations/source-relationship-parity.js +162 -0
  280. package/dist/public/operations/specs/{autopilot.d.ts → bootstrap.d.ts} +9 -9
  281. package/dist/public/operations/specs/bootstrap.d.ts.map +1 -0
  282. package/dist/public/operations/specs/{autopilot.js → bootstrap.js} +8 -7
  283. package/dist/public/operations/specs/check.d.ts +4 -4
  284. package/dist/public/operations/specs/check.d.ts.map +1 -1
  285. package/dist/public/operations/specs/check.js +4 -3
  286. package/dist/public/operations/specs/discovery.d.ts +87 -3
  287. package/dist/public/operations/specs/discovery.d.ts.map +1 -1
  288. package/dist/public/operations/specs/discovery.js +53 -3
  289. package/dist/public/operations/specs/modeling.d.ts +3 -3
  290. package/dist/public/operations/specs/modeling.js +3 -3
  291. package/dist/public/operations/specs/mutation-schemas.d.ts +190 -47
  292. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  293. package/dist/public/operations/specs/mutation-schemas.js +3 -1
  294. package/dist/public/operations/specs/mutation.d.ts +42 -2
  295. package/dist/public/operations/specs/mutation.d.ts.map +1 -1
  296. package/dist/public/operations/specs/mutation.js +26 -2
  297. package/dist/public/operations/specs/planning.d.ts +270 -0
  298. package/dist/public/operations/specs/planning.d.ts.map +1 -0
  299. package/dist/public/operations/specs/planning.js +191 -0
  300. package/dist/public/operations/specs/reporting.d.ts +4 -1
  301. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  302. package/dist/public/operations/specs/reporting.js +46 -1
  303. package/dist/public/operations/specs/upsert.d.ts +204 -47
  304. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  305. package/dist/public/operations/specs/upsert.js +9 -0
  306. package/dist/public/operations/specs/verification.d.ts +78 -0
  307. package/dist/public/operations/specs/verification.d.ts.map +1 -0
  308. package/dist/public/operations/specs/verification.js +62 -0
  309. package/dist/public/operations/symbol-repair-plan.d.ts +11 -0
  310. package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -0
  311. package/dist/public/operations/symbol-repair-plan.js +123 -0
  312. package/dist/public/operations/types.d.ts +52 -1
  313. package/dist/public/operations/types.d.ts.map +1 -1
  314. package/dist/public/playwright-case-id.d.ts +8 -0
  315. package/dist/public/playwright-case-id.d.ts.map +1 -0
  316. package/dist/public/playwright-case-id.js +25 -0
  317. package/dist/public/schemas/entity.d.ts.map +1 -1
  318. package/dist/public/schemas/entity.js +4 -2
  319. package/dist/public/skills/kibi-bootstrap/SKILL.md +58 -0
  320. package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
  321. package/dist/public/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
  322. package/dist/public/skills/kibi-bootstrap/resources/operation-access.md +5 -0
  323. package/dist/public/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
  324. package/dist/public/skills/kibi-freshness/SKILL.md +39 -9
  325. package/dist/public/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
  326. package/dist/public/skills/kibi-freshness/resources/operation-access.md +6 -0
  327. package/dist/public/skills/kibi-freshness/resources/source-authoring.md +7 -0
  328. package/dist/public/skills/kibi-traceability/SKILL.md +47 -47
  329. package/dist/public/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
  330. package/dist/public/skills/kibi-traceability/resources/operation-access.md +5 -0
  331. package/dist/public/skills/kibi-traceability/resources/source-authoring.md +6 -0
  332. package/dist/public/skills/kibi-traceability/resources/traceability.md +8 -0
  333. package/dist/public/skills/kibi-usage/SKILL.md +115 -239
  334. package/dist/public/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
  335. package/dist/public/skills/kibi-usage/resources/kb-improvement.md +38 -0
  336. package/dist/public/skills/kibi-usage/resources/operation-access.md +36 -38
  337. package/dist/public/skills/kibi-usage/resources/relationship-directions.md +3 -3
  338. package/dist/public/skills/kibi-usage/resources/source-authoring.md +31 -0
  339. package/dist/public/skills/kibi-usage/resources/workflows.md +56 -3
  340. package/dist/public/symbol-granularity.d.ts +1 -1
  341. package/dist/public/symbol-granularity.d.ts.map +1 -1
  342. package/dist/public/symbol-granularity.js +1 -0
  343. package/dist/public/telemetry-acceptance.d.ts +7 -0
  344. package/dist/public/telemetry-acceptance.d.ts.map +1 -1
  345. package/dist/public/telemetry-acceptance.js +8 -1
  346. package/dist/public/telemetry-remediation.js +1 -1
  347. package/dist/public/verification-receipt.d.ts +206 -39
  348. package/dist/public/verification-receipt.d.ts.map +1 -1
  349. package/dist/public/verification-receipt.js +171 -4
  350. package/dist/relationships/shards.d.ts +16 -0
  351. package/dist/relationships/shards.d.ts.map +1 -1
  352. package/dist/relationships/shards.js +87 -2
  353. package/dist/report/brand.d.ts +19 -0
  354. package/dist/report/brand.d.ts.map +1 -0
  355. package/dist/report/brand.js +112 -0
  356. package/dist/report/html-report.d.ts +19 -0
  357. package/dist/report/html-report.d.ts.map +1 -0
  358. package/dist/report/html-report.js +963 -0
  359. package/dist/report/relative-time.d.ts +4 -0
  360. package/dist/report/relative-time.d.ts.map +1 -0
  361. package/dist/report/relative-time.js +46 -0
  362. package/dist/report/report-view.d.ts +17 -0
  363. package/dist/report/report-view.d.ts.map +1 -0
  364. package/dist/report/report-view.js +33 -0
  365. package/dist/report/repository.d.ts +35 -0
  366. package/dist/report/repository.d.ts.map +1 -0
  367. package/dist/report/repository.js +151 -0
  368. package/dist/runtime/cli-runtime.d.ts.map +1 -1
  369. package/dist/runtime/cli-runtime.js +82 -22
  370. package/dist/schemas/entity.schema.json +1148 -273
  371. package/dist/traceability/evidence-model.d.ts +2 -2
  372. package/dist/traceability/evidence-model.d.ts.map +1 -1
  373. package/dist/traceability/evidence-model.js +2 -2
  374. package/dist/traceability/git-staged.d.ts.map +1 -1
  375. package/dist/traceability/git-staged.js +15 -40
  376. package/dist/traceability/markdown-validate.d.ts.map +1 -1
  377. package/dist/traceability/markdown-validate.js +12 -7
  378. package/dist/traceability/staged-impact-contract.d.ts +3 -3
  379. package/dist/traceability/staged-impact-contract.d.ts.map +1 -1
  380. package/dist/traceability/staged-impact-contract.js +10 -38
  381. package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
  382. package/dist/traceability/staged-symbols-manifest.js +8 -3
  383. package/dist/traceability/temp-kb.d.ts.map +1 -1
  384. package/dist/traceability/temp-kb.js +3 -0
  385. package/dist/types/entities.d.ts +3 -0
  386. package/dist/types/entities.d.ts.map +1 -1
  387. package/dist/utils/branch-resolver.d.ts +24 -10
  388. package/dist/utils/branch-resolver.d.ts.map +1 -1
  389. package/dist/utils/branch-resolver.js +121 -38
  390. package/dist/utils/branch-store-locator.d.ts +23 -0
  391. package/dist/utils/branch-store-locator.d.ts.map +1 -0
  392. package/dist/utils/branch-store-locator.js +90 -0
  393. package/dist/utils/branch-store.d.ts +15 -0
  394. package/dist/utils/branch-store.d.ts.map +1 -0
  395. package/dist/utils/branch-store.js +130 -0
  396. package/dist/utils/config.d.ts +39 -37
  397. package/dist/utils/config.d.ts.map +1 -1
  398. package/dist/utils/config.js +107 -119
  399. package/dist/utils/kb-manifest.d.ts +35 -0
  400. package/dist/utils/kb-manifest.d.ts.map +1 -0
  401. package/dist/utils/kb-manifest.js +154 -0
  402. package/dist/utils/kb-paths.d.ts +54 -0
  403. package/dist/utils/kb-paths.d.ts.map +1 -0
  404. package/dist/utils/kb-paths.js +125 -0
  405. package/dist/utils/manifest-paths.d.ts +4 -4
  406. package/dist/utils/manifest-paths.d.ts.map +1 -1
  407. package/dist/utils/manifest-paths.js +8 -56
  408. package/dist/utils/rule-registry.d.ts +48 -20
  409. package/dist/utils/rule-registry.d.ts.map +1 -1
  410. package/dist/utils/rule-registry.js +82 -77
  411. package/dist/utils/schema-version.d.ts +5 -5
  412. package/dist/utils/schema-version.d.ts.map +1 -1
  413. package/dist/utils/schema-version.js +26 -6
  414. package/dist/utils/strict-modeling.d.ts +0 -4
  415. package/dist/utils/strict-modeling.d.ts.map +1 -1
  416. package/dist/utils/strict-modeling.js +7 -8
  417. package/dist/verification/playwright-reporter.d.ts +21 -0
  418. package/dist/verification/playwright-reporter.d.ts.map +1 -0
  419. package/dist/verification/playwright-reporter.js +114 -0
  420. package/package.json +46 -7
  421. package/schema/config.json +2 -2
  422. package/schema/manifest.json +26 -0
  423. package/src/public/branch-resolver.ts +1 -0
  424. package/src/public/check-types.ts +22 -19
  425. package/src/public/diagnostic-usage.ts +79 -1
  426. package/src/public/distribution-parity.ts +1 -0
  427. package/src/public/ignore-policy.ts +16 -10
  428. package/src/public/impact/coverage-depth-quality.ts +36 -0
  429. package/src/public/impact/full-kb-quality.ts +118 -5
  430. package/src/public/impact/manifest.ts +2 -4
  431. package/src/public/operational-artifacts.ts +9 -1
  432. package/src/public/operations/catalog.ts +146 -9
  433. package/src/public/operations/check-executor.ts +102 -15
  434. package/src/public/operations/check-format-shared.ts +6 -0
  435. package/src/public/operations/check-helpers.ts +74 -35
  436. package/src/public/operations/contracts.ts +366 -0
  437. package/src/public/operations/discovery-executors.ts +299 -12
  438. package/src/public/operations/index.ts +9 -4
  439. package/src/public/operations/migration-plan.ts +740 -0
  440. package/src/public/operations/node-ports.ts +84 -10
  441. package/src/public/operations/prolog-json.ts +60 -5
  442. package/src/public/operations/repair-plan.ts +1 -0
  443. package/src/public/operations/result-envelope.ts +136 -0
  444. package/src/public/operations/runtime-types.ts +91 -5
  445. package/src/public/operations/source-relationship-parity.ts +226 -0
  446. package/src/public/operations/specs/{autopilot.ts → bootstrap.ts} +17 -16
  447. package/src/public/operations/specs/check.ts +4 -3
  448. package/src/public/operations/specs/discovery.ts +57 -3
  449. package/src/public/operations/specs/modeling.ts +3 -3
  450. package/src/public/operations/specs/mutation-schemas.ts +6 -1
  451. package/src/public/operations/specs/mutation.ts +27 -2
  452. package/src/public/operations/specs/planning.ts +234 -0
  453. package/src/public/operations/specs/reporting.ts +55 -1
  454. package/src/public/operations/specs/upsert.ts +10 -0
  455. package/src/public/operations/specs/verification.ts +78 -0
  456. package/src/public/operations/symbol-repair-plan.ts +164 -0
  457. package/src/public/operations/types.ts +62 -1
  458. package/src/public/playwright-case-id.ts +35 -0
  459. package/src/public/schemas/entity.ts +7 -2
  460. package/src/public/skills/kibi-bootstrap/SKILL.md +58 -0
  461. package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
  462. package/src/public/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
  463. package/src/public/skills/kibi-bootstrap/resources/operation-access.md +5 -0
  464. package/src/public/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
  465. package/src/public/skills/kibi-freshness/SKILL.md +39 -9
  466. package/src/public/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
  467. package/src/public/skills/kibi-freshness/resources/operation-access.md +6 -0
  468. package/src/public/skills/kibi-freshness/resources/source-authoring.md +7 -0
  469. package/src/public/skills/kibi-traceability/SKILL.md +47 -47
  470. package/src/public/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
  471. package/src/public/skills/kibi-traceability/resources/operation-access.md +5 -0
  472. package/src/public/skills/kibi-traceability/resources/source-authoring.md +6 -0
  473. package/src/public/skills/kibi-traceability/resources/traceability.md +8 -0
  474. package/src/public/skills/kibi-usage/SKILL.md +115 -239
  475. package/src/public/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
  476. package/src/public/skills/kibi-usage/resources/kb-improvement.md +38 -0
  477. package/src/public/skills/kibi-usage/resources/operation-access.md +36 -38
  478. package/src/public/skills/kibi-usage/resources/relationship-directions.md +3 -3
  479. package/src/public/skills/kibi-usage/resources/source-authoring.md +31 -0
  480. package/src/public/skills/kibi-usage/resources/workflows.md +56 -3
  481. package/src/public/symbol-granularity.ts +1 -0
  482. package/src/public/telemetry-acceptance.ts +16 -1
  483. package/src/public/telemetry-remediation.ts +1 -1
  484. package/src/public/verification-receipt.ts +248 -6
  485. package/src/schemas/entity.schema.json +1148 -273
  486. package/templates/github/kibi-badge.yml +86 -0
  487. package/templates/github/kibi-report.yml +84 -0
  488. package/dist/operations/autopilot/activation.d.ts.map +0 -1
  489. package/dist/operations/autopilot/candidates.d.ts +0 -4
  490. package/dist/operations/autopilot/discovery.d.ts.map +0 -1
  491. package/dist/operations/autopilot/generate.d.ts +0 -8
  492. package/dist/operations/autopilot/generate.d.ts.map +0 -1
  493. package/dist/operations/autopilot/generate.js +0 -112
  494. package/dist/operations/autopilot/presentation.d.ts +0 -13
  495. package/dist/operations/autopilot/presentation.d.ts.map +0 -1
  496. package/dist/operations/autopilot/presentation.js +0 -91
  497. package/dist/operations/autopilot/types.d.ts.map +0 -1
  498. package/dist/operations/autopilot/types.js +0 -8
  499. package/dist/public/operations/specs/autopilot.d.ts.map +0 -1
  500. package/dist/public/skills/init-kibi/SKILL.md +0 -62
  501. package/src/public/skills/init-kibi/SKILL.md +0 -62
  502. /package/dist/operations/{autopilot → bootstrap}/activation.d.ts +0 -0
  503. /package/dist/operations/{autopilot → bootstrap}/candidate-helpers.d.ts +0 -0
  504. /package/dist/operations/{autopilot → bootstrap}/candidate-helpers.js +0 -0
  505. /package/dist/operations/{autopilot → bootstrap}/requirement-claims.d.ts +0 -0
  506. /package/dist/operations/{autopilot → bootstrap}/requirement-claims.js +0 -0
@@ -19,7 +19,9 @@ import { chmodSync, copyFileSync, existsSync, mkdirSync, readFileSync, writeFile
19
19
  import * as path from "node:path";
20
20
  import fg from "fast-glob";
21
21
  import { getBranchDiagnostic, resolveActiveBranch, } from "../utils/branch-resolver.js";
22
- import { DEFAULT_CONFIG } from "../utils/config.js";
22
+ import { ensureBranchStoreManifest } from "../utils/branch-store-locator.js";
23
+ import { defaultKbManifest, writeKbManifest } from "../utils/kb-manifest.js";
24
+ import { ENTITY_LANES, KB_PATHS } from "../utils/kb-paths.js";
23
25
  import { SYMBOLS_MANIFEST_COMMENT_BLOCK } from "./sync/manifest.js";
24
26
  const POST_CHECKOUT_HOOK = `#!/bin/sh
25
27
  # post-checkout hook for kibi
@@ -35,15 +37,9 @@ new_ref=$2
35
37
  branch_flag=$3
36
38
 
37
39
  if [ "$branch_flag" = "1" ]; then
38
- # Try to resolve the branch we just left (strip decorations like ^ and ~)
39
- old_branch=$(git name-rev --name-only "$old_ref" 2>/dev/null | sed 's/\\^.*//')
40
-
41
- # Basic validation: non-empty and does not contain ~ or ^
42
- if [ -n "$old_branch" ] && echo "$old_branch" | grep -qv '[~^]'; then
43
- kibi branch ensure --from "$old_branch" && kibi sync
44
- else
45
- kibi branch ensure && kibi sync
46
- fi
40
+ # Branch stores are derived from the checked-out tracked sources. Never copy
41
+ # the old branch's compiled store during checkout.
42
+ kibi sync
47
43
  fi
48
44
  `;
49
45
  const POST_MERGE_HOOK = `#!/bin/sh
@@ -73,10 +69,10 @@ const PRE_COMMIT_HOOK = `#!/bin/sh
73
69
  # Hard enforcement boundary: commits are blocked only here via kibi check.
74
70
  # The OpenCode plugin remains advisory and must not replace this gate.
75
71
  # Behavior-changing source edits require staged Kibi impact evidence
76
- # (KB entity docs, authored symbols metadata, or refreshed symbol
77
- # coordinates). Test-only and docs-only edits are exempt.
72
+ # (KB entity docs under .kb/, authored symbols metadata, or refreshed
73
+ # symbol coordinates). Test-only and docs-only edits are exempt.
78
74
  # Refresh with:
79
- # kibi sync --refresh-symbol-coordinates && git add documentation/symbol-coordinates.yaml documentation/symbols.yaml
75
+ # kibi sync --refresh-symbol-coordinates && git add .kb/symbol-coordinates.yaml .kb/symbols.yaml
80
76
 
81
77
  set -e
82
78
 
@@ -93,37 +89,89 @@ export async function getCurrentBranch(cwd = process.cwd()) {
93
89
  export function createKbDirectoryStructure(kbDir, currentBranch) {
94
90
  mkdirSync(kbDir, { recursive: true });
95
91
  mkdirSync(path.join(kbDir, "schema"), { recursive: true });
96
- mkdirSync(path.join(kbDir, "branches", currentBranch), {
97
- recursive: true,
98
- });
92
+ // Canonical tracked knowledge lanes under .kb/.
93
+ for (const lane of ENTITY_LANES) {
94
+ mkdirSync(path.join(kbDir, lane), { recursive: true });
95
+ }
96
+ ensureBranchStoreManifest(path.dirname(kbDir), currentBranch);
99
97
  console.log("✓ Created .kb/ directory structure");
100
- console.log(`✓ Created branches/${currentBranch}/ directory`);
98
+ console.log(`✓ Created hashed branch store for ${currentBranch}`);
101
99
  }
102
- export function createConfigFile(kbDir) {
103
- writeFileSync(path.join(kbDir, "config.json"), JSON.stringify(DEFAULT_CONFIG, null, 2));
104
- console.log("✓ Created config.json with default paths");
100
+ export function createManifestFile(kbDir) {
101
+ writeKbManifest(path.dirname(kbDir), defaultKbManifest());
102
+ console.log("✓ Created Kibi lifecycle manifest at .kb/manifest.json");
105
103
  }
106
104
  export function updateGitIgnore(cwd) {
107
- // implements REQ-001
105
+ // implements REQ-cli-init-canonical
108
106
  const gitignorePath = path.join(cwd, ".gitignore");
109
107
  const gitignoreContent = existsSync(gitignorePath)
110
108
  ? readFileSync(gitignorePath, "utf8")
111
109
  : "";
112
110
  const ensureEntry = (current, entry) => {
113
- if (current.includes(entry)) {
111
+ const lines = current.split(/\r?\n/).map((line) => line.trim());
112
+ if (lines.includes(entry)) {
114
113
  return current;
115
114
  }
116
115
  return current ? `${current.trimEnd()}\n${entry}\n` : `${entry}\n`;
117
116
  };
118
- const updatedContent = ensureEntry(gitignoreContent, ".kb/");
117
+ // Derived runtime state stays ignored. Authored knowledge lanes, the
118
+ // symbols manifest, relationship shards, schema, and the lifecycle
119
+ // manifest stay committable. `.kb/migrations/` is derived runtime
120
+ // audit state, not tracked project knowledge.
121
+ let updatedContent = stripLegacyKibiGitIgnoreStanza(gitignoreContent);
122
+ for (const entry of CANONICAL_DERIVED_GITIGNORE_ENTRIES) {
123
+ updatedContent = ensureEntry(updatedContent, entry);
124
+ }
119
125
  if (updatedContent !== gitignoreContent) {
120
126
  writeFileSync(gitignorePath, updatedContent);
121
- console.log("✓ Added .kb/ to .gitignore");
127
+ console.log("✓ Configured .gitignore for the canonical .kb/ layout");
128
+ }
129
+ }
130
+ /** Exact derived-runtime entries owned by current Kibi init/migrate. */
131
+ const CANONICAL_DERIVED_GITIGNORE_ENTRIES = [
132
+ ".kb/branches/",
133
+ ".kb/recovery/",
134
+ ".kb/verification/",
135
+ ".kb/briefs/",
136
+ ".kb/migrations/",
137
+ ".kb/usage.log",
138
+ ];
139
+ /**
140
+ * Pre-canonical Kibi init wrote a blanket `.kb/` fence and then
141
+ * re-included only config/schema/relationship artifacts. After the
142
+ * knowledge cutover that fence would keep `.kb/requirements/*` ignored.
143
+ */
144
+ const LEGACY_KIBI_GITIGNORE_FENCE = ".kb/";
145
+ const LEGACY_KIBI_GITIGNORE_REINCLUDES = [
146
+ "!.kb/",
147
+ "!.kb/config.json",
148
+ "!.kb/schema/",
149
+ "!.kb/relationships/",
150
+ "!.kb/relationships/*.yaml",
151
+ ];
152
+ function stripLegacyKibiGitIgnoreStanza(content) {
153
+ if (content.length === 0)
154
+ return content;
155
+ const lines = content.split(/\r?\n/);
156
+ const trimmed = lines.map((line) => line.trim());
157
+ const hasFence = trimmed.includes(LEGACY_KIBI_GITIGNORE_FENCE);
158
+ const hasReinclude = LEGACY_KIBI_GITIGNORE_REINCLUDES.some((entry) => trimmed.includes(entry));
159
+ if (!hasFence || !hasReinclude) {
160
+ return content;
161
+ }
162
+ const drop = new Set([
163
+ LEGACY_KIBI_GITIGNORE_FENCE,
164
+ ...LEGACY_KIBI_GITIGNORE_REINCLUDES,
165
+ ]);
166
+ const kept = lines.filter((line) => !drop.has(line.trim()));
167
+ while (kept.length > 0 && kept[kept.length - 1] === "") {
168
+ kept.pop();
122
169
  }
170
+ return kept.length === 0 ? "" : `${kept.join("\n")}\n`;
123
171
  }
124
172
  // implements REQ-003
125
173
  export function ensureSymbolsManifestFile(cwd) {
126
- const symbolsRelPath = DEFAULT_CONFIG.paths.symbols ?? "documentation/symbols.yaml";
174
+ const symbolsRelPath = KB_PATHS.symbolsManifest;
127
175
  const symbolsPath = path.join(cwd, symbolsRelPath);
128
176
  if (existsSync(symbolsPath)) {
129
177
  return;
@@ -1,5 +1,7 @@
1
1
  interface InitOptions {
2
2
  hooks?: boolean;
3
+ github?: boolean;
4
+ badgeOnly?: boolean;
3
5
  }
4
6
  export declare function initCommand(options: InitOptions): Promise<{
5
7
  exitCode: number;
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAkCA,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAGD,wBAAsB,WAAW,CAC/B,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CA+D/B"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAqCA,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAoDD,wBAAsB,WAAW,CAC/B,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CA2F/B"}
@@ -18,45 +18,91 @@
18
18
  import { existsSync } from "node:fs";
19
19
  import * as path from "node:path";
20
20
  import { fileURLToPath } from "node:url";
21
- import { resolveActiveBranch } from "../utils/branch-resolver.js";
22
- import { copySchemaFiles, createConfigFile, createKbDirectoryStructure, ensureSymbolsManifestFile, installGitHooks, updateGitIgnore, } from "./init-helpers.js";
21
+ import { classifyActivation } from "../operations/bootstrap/activation.js";
22
+ import { nodeFilesystem } from "../public/operations/node-ports.js";
23
+ import { resolveBranchAttachment } from "../utils/branch-resolver.js";
24
+ import { scaffoldGitHubIntegration } from "./github-init.js";
25
+ import { copySchemaFiles, createKbDirectoryStructure, createManifestFile, ensureSymbolsManifestFile, installGitHooks, updateGitIgnore, } from "./init-helpers.js";
23
26
  const __filename = fileURLToPath(import.meta.url);
24
27
  const __dirname = path.dirname(__filename);
25
- // implements REQ-003
28
+ async function initNextAction() {
29
+ const sourceFiles = await nodeFilesystem.glob([
30
+ ".kb/requirements/**/*.md",
31
+ ".kb/scenarios/**/*.md",
32
+ ".kb/tests/**/*.md",
33
+ ".kb/adrs/**/*.md",
34
+ ".kb/adr/**/*.md",
35
+ ".kb/flags/**/*.md",
36
+ ".kb/events/**/*.md",
37
+ ".kb/facts/**/*.md",
38
+ ], { cwd: process.cwd() });
39
+ const activation = await classifyActivation({
40
+ workspaceRoot: process.cwd(),
41
+ signal: new AbortController().signal,
42
+ clock: () => new Date(),
43
+ fs: nodeFilesystem,
44
+ }, sourceFiles);
45
+ switch (activation.activationState) {
46
+ case "root_active_seeded":
47
+ return {
48
+ operation: "continue-kibi-workflow",
49
+ message: " Next: your repository already has seeded Kibi knowledge; continue working with your coding agent.",
50
+ };
51
+ case "root_partial":
52
+ return {
53
+ operation: "kibi doctor",
54
+ message: " Next: run 'kibi doctor' to repair degraded Kibi infrastructure before bootstrapping.",
55
+ };
56
+ default:
57
+ return {
58
+ operation: "kb_plan_bootstrap",
59
+ message: " Next: ask your coding agent “Bootstrap Kibi for this repository.”",
60
+ };
61
+ }
62
+ }
63
+ // implements REQ-cli-init
64
+ // implements REQ-kibi-github-report-integration
26
65
  export async function initCommand(options) {
66
+ if (options.badgeOnly === true && options.github !== true) {
67
+ console.error("Error: --badge-only requires --github. The recommended integration is `kibi init --github` (badge + full report).");
68
+ return { exitCode: 1 };
69
+ }
27
70
  const kbDir = path.join(process.cwd(), ".kb");
28
71
  const kbExists = existsSync(kbDir);
29
- // Resolve branch: allow non-git repos to use default "main" for init
72
+ // Resolve the exact active Git branch. Standalone use must be explicit via
73
+ // KIBI_BRANCH; there is no implicit default branch.
30
74
  let currentBranch;
31
- const result = resolveActiveBranch();
75
+ const result = resolveBranchAttachment();
32
76
  if ("error" in result) {
33
77
  const isNonGitError = result.code === "NOT_A_GIT_REPO" || result.code === "GIT_NOT_AVAILABLE";
34
- if (isNonGitError) {
35
- // For init command, use "main" as default branch when not in a git repo.
36
- // This allows initialization before git init, which is useful for first-time setup.
37
- console.warn("Warning: Not in a git repository");
38
- console.warn("Using 'main' as default branch. Run 'kibi sync' in a git repo for proper branch-aware behavior.");
39
- currentBranch = "main";
40
- }
41
- else {
42
- console.error("Error: Failed to resolve the active git branch.");
43
- console.error(result.error);
44
- return { exitCode: 1 };
45
- }
78
+ console.error("Error: Failed to resolve the active git branch.");
79
+ console.error(isNonGitError
80
+ ? `${result.error} Set KIBI_BRANCH explicitly for a standalone workspace.`
81
+ : result.error);
82
+ return { exitCode: 1 };
46
83
  }
47
- else {
48
- currentBranch = result.branch;
84
+ if (result.migrationRequired) {
85
+ console.error(`Error: KB is attached through legacy branch storage for '${result.gitBranch}'. Run 'kibi branch migrate --from ${result.kbBranch} --to ${result.gitBranch} --apply' first.`);
86
+ return { exitCode: 1 };
49
87
  }
88
+ currentBranch = result.kbBranch;
50
89
  try {
51
90
  if (!kbExists) {
52
91
  createKbDirectoryStructure(kbDir, currentBranch);
53
- createConfigFile(kbDir);
92
+ createManifestFile(kbDir);
54
93
  updateGitIgnore(process.cwd());
55
94
  const schemaSourceDir = path.resolve(__dirname, "..", "..", "schema");
56
95
  await copySchemaFiles(kbDir, schemaSourceDir);
57
96
  }
58
97
  else {
59
98
  console.log("✓ .kb/ directory already exists, skipping creation");
99
+ // An orphan branch can legitimately remove tracked `.kb/manifest.json`
100
+ // while the ignored branch stores remain on disk. Recreate the
101
+ // lifecycle manifest so status/doctor stay coherent; entity paths are
102
+ // canonical and require no per-repository configuration.
103
+ if (!existsSync(path.join(kbDir, "manifest.json"))) {
104
+ createManifestFile(kbDir);
105
+ }
60
106
  }
61
107
  ensureSymbolsManifestFile(process.cwd());
62
108
  if (options.hooks) {
@@ -68,10 +114,19 @@ export async function initCommand(options) {
68
114
  installGitHooks(gitDir);
69
115
  }
70
116
  }
71
- console.log("\nKibi initialized successfully!");
72
- console.log("Next steps:");
73
- console.log(" 1. Run 'kibi doctor' to verify setup");
74
- console.log(" 2. Run 'kibi sync' to extract entities from documents");
117
+ console.log("\n✓ Kibi initialized. Kibi infrastructure is ready for this repository.");
118
+ console.log(" No product knowledge was inferred or changed by kibi init.");
119
+ if (kbExists) {
120
+ console.log(" Existing Kibi source knowledge was preserved.");
121
+ }
122
+ console.log((await initNextAction()).message);
123
+ console.log(" Optional diagnostic: run 'kibi doctor' if setup appears degraded.");
124
+ if (options.github === true) {
125
+ scaffoldGitHubIntegration({
126
+ cwd: process.cwd(),
127
+ badgeOnly: options.badgeOnly === true,
128
+ });
129
+ }
75
130
  return { exitCode: 0 };
76
131
  }
77
132
  catch (error) {
@@ -0,0 +1,54 @@
1
+ import { type SemanticAdvisorBackfill } from "../utils/kb-manifest.js";
2
+ import { type EntityLane } from "../utils/kb-paths.js";
3
+ /**
4
+ * One-way migration from the legacy configurable layout (entity documents
5
+ * under `documentation/` or custom configured paths, `.kb/config.json`)
6
+ * to the canonical `.kb/` knowledge namespace.
7
+ *
8
+ * The migration is deterministic and idempotent:
9
+ * - legacy `.kb/config.json` is read (never trusted blindly);
10
+ * - configured or default legacy paths are discovered on disk;
11
+ * - files move into `.kb/<lane>/` without content changes;
12
+ * - destination conflicts abort before any file moves;
13
+ * - partial migrations resume safely (already-moved files are no-ops);
14
+ * - on success the legacy config is retired.
15
+ */
16
+ export interface StorageMigrationPlan {
17
+ /** Files that would move from a legacy location into `.kb/`. */
18
+ moves: StorageMigrationMove[];
19
+ /** Legacy `.kb/config.json` disposition. */
20
+ legacyConfig: "absent" | "present" | "malformed";
21
+ legacyConfigError?: string;
22
+ /** Lifecycle state preserved into the canonical manifest. */
23
+ schemaVersion: number | null;
24
+ semanticAdvisorBackfill: SemanticAdvisorBackfill | null;
25
+ /** Why the migration cannot proceed automatically, if blocked. */
26
+ blockers: string[];
27
+ }
28
+ export interface StorageMigrationMove {
29
+ from: string;
30
+ to: string;
31
+ lane: EntityLane | "symbols";
32
+ }
33
+ /** Discover the concrete migration moves for a workspace. */
34
+ export declare function planLegacyStorageMigration(cwd: string): StorageMigrationPlan;
35
+ export interface StorageMigrationResult {
36
+ movedFiles: string[];
37
+ retiredLegacyConfig: boolean;
38
+ manifestPath: string;
39
+ schemaVersion: number;
40
+ semanticAdvisorBackfill: SemanticAdvisorBackfill;
41
+ }
42
+ /**
43
+ * Apply the legacy storage migration. Moves every planned file, writes the
44
+ * canonical lifecycle manifest, retires the legacy config, and prunes empty
45
+ * legacy directories. Fails closed on any blocker.
46
+ */
47
+ export declare function applyLegacyStorageMigration(cwd: string, plan: StorageMigrationPlan): StorageMigrationResult;
48
+ /** Rewrite recovery pending-source receipts after a storage cutover. */
49
+ export declare function rewritePendingSourceReceiptPaths(cwd: string, moves: readonly StorageMigrationMove[]): number;
50
+ /** True when the workspace still needs the legacy storage migration. */
51
+ export declare function needsLegacyStorageMigration(cwd: string): boolean;
52
+ /** Entity lanes that must exist for the canonical layout to be complete. */
53
+ export declare function missingCanonicalLanes(cwd: string): EntityLane[];
54
+ //# sourceMappingURL=legacy-storage-migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-storage-migration.d.ts","sourceRoot":"","sources":["../../src/commands/legacy-storage-migration.ts"],"names":[],"mappings":"AAoCA,OAAO,EACL,KAAK,uBAAuB,EAI7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,sBAAsB,CAAC;AAI9B;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B,4CAA4C;IAC5C,YAAY,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;IACjD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6DAA6D;IAC7D,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,uBAAuB,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACxD,kEAAkE;IAClE,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;CAC9B;AA2BD,6DAA6D;AAC7D,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAqH5E;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,EAAE,uBAAuB,CAAC;CAClD;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,oBAAoB,GACzB,sBAAsB,CAqDxB;AA+BD,wEAAwE;AACxE,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,oBAAoB,EAAE,GACrC,MAAM,CAwCR;AAED,wEAAwE;AACxE,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAOhE;AAED,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,EAAE,CAI/D"}
@@ -0,0 +1,277 @@
1
+ /*
2
+ * Kibi — repo-local, per-branch, queryable long-term memory for software projects
3
+ * Copyright (C) 2026 Piotr Franczyk
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU Affero General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+ import { createHash } from "node:crypto";
19
+ import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, writeFileSync, } from "node:fs";
20
+ import * as path from "node:path";
21
+ import fg from "fast-glob";
22
+ import { readLegacyKbConfig, resolveLegacyEntityPaths, } from "../utils/config.js";
23
+ import { defaultKbManifest, readKbManifest, writeKbManifest, } from "../utils/kb-manifest.js";
24
+ import { CANONICAL_ENTITY_PATHS, ENTITY_LANES, KB_PATHS, } from "../utils/kb-paths.js";
25
+ import { LATEST_KB_SCHEMA_VERSION } from "../utils/schema-version.js";
26
+ import { updateGitIgnore } from "./init-helpers.js";
27
+ const LANE_BY_CONFIG_KEY = {
28
+ requirements: "requirements",
29
+ scenarios: "scenarios",
30
+ tests: "tests",
31
+ adr: "adr",
32
+ flags: "flags",
33
+ events: "events",
34
+ facts: "facts",
35
+ };
36
+ function stripGlobToRoot(pattern) {
37
+ const normalized = pattern.replaceAll("\\", "/").replace(/\/+$/, "");
38
+ if (!normalized.includes("*"))
39
+ return normalized;
40
+ const [root] = normalized.split("*");
41
+ return (root ?? "").replace(/\/+$/, "");
42
+ }
43
+ function normalizeLegacySource(raw) {
44
+ const normalized = raw.replaceAll("\\", "/");
45
+ if (normalized.includes("*")) {
46
+ return { root: stripGlobToRoot(normalized), glob: normalized };
47
+ }
48
+ return { root: normalized, glob: `${normalized}/**/*.md` };
49
+ }
50
+ /** Discover the concrete migration moves for a workspace. */
51
+ export function planLegacyStorageMigration(cwd) {
52
+ const legacyConfigResult = readLegacyKbConfig(cwd);
53
+ if (legacyConfigResult.kind === "malformed") {
54
+ return {
55
+ moves: [],
56
+ legacyConfig: "malformed",
57
+ legacyConfigError: legacyConfigResult.error,
58
+ schemaVersion: null,
59
+ semanticAdvisorBackfill: null,
60
+ blockers: [
61
+ `Legacy .kb/config.json is malformed (${legacyConfigResult.error}). Repair the JSON or provide an explicit recovery/migration override; Kibi will not infer default legacy paths.`,
62
+ ],
63
+ };
64
+ }
65
+ const config = legacyConfigResult.kind === "present"
66
+ ? legacyConfigResult.config
67
+ : undefined;
68
+ const legacyPaths = resolveLegacyEntityPaths(config);
69
+ const moves = [];
70
+ const blockers = [];
71
+ for (const [key, lane] of Object.entries(LANE_BY_CONFIG_KEY)) {
72
+ const legacy = legacyPaths[key];
73
+ if (typeof legacy !== "string" || legacy.trim().length === 0)
74
+ continue;
75
+ const { root, glob } = normalizeLegacySource(legacy);
76
+ const legacyRoot = path.resolve(cwd, root);
77
+ // Skip lanes whose legacy root is already the canonical location.
78
+ if (legacyRoot === path.resolve(cwd, KB_PATHS.lanes[lane]))
79
+ continue;
80
+ if (!existsSync(legacyRoot))
81
+ continue;
82
+ const files = fg.sync([glob], {
83
+ cwd,
84
+ absolute: true,
85
+ ignore: ["**/README.md", "**/e2e/**", "**/benchmarks/**"],
86
+ onlyFiles: true,
87
+ });
88
+ for (const file of files.sort()) {
89
+ const relativeUnderRoot = path.relative(legacyRoot, file);
90
+ const destination = path.join(cwd, KB_PATHS.lanes[lane], relativeUnderRoot);
91
+ moves.push({
92
+ from: path.relative(cwd, file).replaceAll(path.sep, "/"),
93
+ to: path.relative(cwd, destination).replaceAll(path.sep, "/"),
94
+ lane,
95
+ });
96
+ }
97
+ }
98
+ // Symbols manifest + coordinates.
99
+ const legacySymbols = legacyPaths.symbols;
100
+ if (typeof legacySymbols === "string" && legacySymbols.trim().length > 0) {
101
+ const legacyManifest = path.resolve(cwd, legacySymbols);
102
+ if (existsSync(legacyManifest) &&
103
+ legacyManifest !== path.resolve(cwd, CANONICAL_ENTITY_PATHS.symbols)) {
104
+ moves.push({
105
+ from: path.relative(cwd, legacyManifest).replaceAll(path.sep, "/"),
106
+ to: CANONICAL_ENTITY_PATHS.symbols,
107
+ lane: "symbols",
108
+ });
109
+ }
110
+ const legacyCoordinates = legacySymbols
111
+ .replace(/\.ya?ml$/, ".yaml")
112
+ .replace(/symbols\.yaml$/, "symbol-coordinates.yaml");
113
+ const legacyCoordinatesPath = path.resolve(cwd, legacyCoordinates);
114
+ if (existsSync(legacyCoordinatesPath) &&
115
+ legacyCoordinatesPath !== path.resolve(cwd, KB_PATHS.symbolCoordinates)) {
116
+ moves.push({
117
+ from: path
118
+ .relative(cwd, legacyCoordinatesPath)
119
+ .replaceAll(path.sep, "/"),
120
+ to: KB_PATHS.symbolCoordinates,
121
+ lane: "symbols",
122
+ });
123
+ }
124
+ }
125
+ // Destination-conflict detection: a move whose destination already exists
126
+ // with different content requires an operator decision.
127
+ for (const move of moves) {
128
+ const destinationAbsolute = path.resolve(cwd, move.to);
129
+ if (!existsSync(destinationAbsolute))
130
+ continue;
131
+ blockers.push(`Destination ${move.to} already exists; resolve the conflict manually before migrating ${move.from}.`);
132
+ }
133
+ // Duplicate destinations (two legacy sources collapsing onto one target).
134
+ const destinations = new Map();
135
+ for (const move of moves) {
136
+ const existing = destinations.get(move.to);
137
+ if (existing !== undefined && existing !== move.from) {
138
+ blockers.push(`Both ${existing} and ${move.from} would migrate to ${move.to}.`);
139
+ continue;
140
+ }
141
+ destinations.set(move.to, move.from);
142
+ }
143
+ return {
144
+ moves,
145
+ legacyConfig: legacyConfigResult.kind === "none" ? "absent" : "present",
146
+ schemaVersion: typeof config?.schemaVersion === "number" ? config.schemaVersion : null,
147
+ semanticAdvisorBackfill: config?.semanticAdvisorBackfill ?? null,
148
+ blockers,
149
+ };
150
+ }
151
+ /**
152
+ * Apply the legacy storage migration. Moves every planned file, writes the
153
+ * canonical lifecycle manifest, retires the legacy config, and prunes empty
154
+ * legacy directories. Fails closed on any blocker.
155
+ */
156
+ export function applyLegacyStorageMigration(cwd, plan) {
157
+ if (plan.blockers.length > 0) {
158
+ throw new Error(`Legacy storage migration is blocked: ${plan.blockers.join(" ")}`);
159
+ }
160
+ const movedFiles = [];
161
+ for (const move of plan.moves) {
162
+ const sourceAbsolute = path.resolve(cwd, move.from);
163
+ const destinationAbsolute = path.resolve(cwd, move.to);
164
+ if (!existsSync(sourceAbsolute)) {
165
+ // Already moved by a previous (possibly interrupted) run.
166
+ continue;
167
+ }
168
+ mkdirSync(path.dirname(destinationAbsolute), { recursive: true });
169
+ renameSync(sourceAbsolute, destinationAbsolute);
170
+ movedFiles.push(move.to);
171
+ }
172
+ // Preserve lifecycle metadata into the canonical manifest.
173
+ const existing = readKbManifest(cwd);
174
+ const backfill = plan.semanticAdvisorBackfill ??
175
+ existing?.semanticAdvisorBackfill ??
176
+ "pending";
177
+ const manifest = {
178
+ ...(existing ?? defaultKbManifest()),
179
+ manifestVersion: defaultKbManifest().manifestVersion,
180
+ schemaVersion: LATEST_KB_SCHEMA_VERSION,
181
+ semanticAdvisorBackfill: backfill,
182
+ };
183
+ const manifestPath = writeKbManifest(cwd, manifest);
184
+ // Retire the legacy configuration only after all moves succeeded.
185
+ let retiredLegacyConfig = false;
186
+ const legacyConfigPath = path.join(cwd, ".kb", "config.json");
187
+ if (existsSync(legacyConfigPath)) {
188
+ rmSync(legacyConfigPath);
189
+ retiredLegacyConfig = true;
190
+ }
191
+ pruneEmptyLegacyDirs(cwd, plan);
192
+ rewritePendingSourceReceiptPaths(cwd, plan.moves);
193
+ updateGitIgnore(cwd);
194
+ return {
195
+ movedFiles,
196
+ retiredLegacyConfig,
197
+ manifestPath: path.relative(cwd, manifestPath).replaceAll(path.sep, "/"),
198
+ schemaVersion: manifest.schemaVersion,
199
+ semanticAdvisorBackfill: backfill,
200
+ };
201
+ }
202
+ function pruneEmptyLegacyDirs(cwd, plan) {
203
+ const roots = new Set();
204
+ for (const move of plan.moves) {
205
+ const absolute = path.resolve(cwd, move.from);
206
+ let dir = path.dirname(absolute);
207
+ while (dir.startsWith(path.resolve(cwd)) &&
208
+ dir !== path.resolve(cwd) &&
209
+ !dir.startsWith(path.resolve(cwd, KB_ROOT))) {
210
+ roots.add(dir);
211
+ dir = path.dirname(dir);
212
+ }
213
+ }
214
+ // Deepest first.
215
+ const ordered = [...roots].sort((a, b) => b.length - a.length);
216
+ for (const dir of ordered) {
217
+ try {
218
+ if (statSync(dir).isDirectory() && readdirSync(dir).length === 0) {
219
+ rmSync(dir, { recursive: true });
220
+ }
221
+ }
222
+ catch {
223
+ // Best-effort pruning; leftover empty dirs are harmless.
224
+ }
225
+ }
226
+ }
227
+ const KB_ROOT = ".kb";
228
+ /** Rewrite recovery pending-source receipts after a storage cutover. */
229
+ export function rewritePendingSourceReceiptPaths(cwd, moves) {
230
+ const pendingRoot = path.join(cwd, ".kb", "recovery", "pending-sources");
231
+ if (!existsSync(pendingRoot))
232
+ return 0;
233
+ const moveByFrom = new Map(moves.map((move) => [move.from, move.to]));
234
+ let rewritten = 0;
235
+ for (const name of readdirSync(pendingRoot)) {
236
+ if (!name.endsWith(".json"))
237
+ continue;
238
+ const receiptPath = path.join(pendingRoot, name);
239
+ try {
240
+ const raw = readFileSync(receiptPath, "utf8");
241
+ const receipt = JSON.parse(raw);
242
+ if (typeof receipt.path !== "string")
243
+ continue;
244
+ const normalized = receipt.path.replaceAll("\\", "/");
245
+ const destination = moveByFrom.get(normalized) ??
246
+ (normalized.startsWith("documentation/")
247
+ ? normalized.replace(/^documentation\//, ".kb/")
248
+ : undefined);
249
+ if (destination === undefined || destination === normalized)
250
+ continue;
251
+ const absolute = path.resolve(cwd, destination);
252
+ if (!existsSync(absolute))
253
+ continue;
254
+ const afterHash = typeof receipt.afterHash === "string" &&
255
+ /^[a-f0-9]{64}$/i.test(receipt.afterHash)
256
+ ? receipt.afterHash
257
+ : createHash("sha256").update(readFileSync(absolute)).digest("hex");
258
+ writeFileSync(receiptPath, `${JSON.stringify({ ...receipt, path: destination, afterHash }, null, 2)}\n`, "utf8");
259
+ rewritten += 1;
260
+ }
261
+ catch {
262
+ // Best-effort; malformed receipts remain for operator repair.
263
+ }
264
+ }
265
+ return rewritten;
266
+ }
267
+ /** True when the workspace still needs the legacy storage migration. */
268
+ export function needsLegacyStorageMigration(cwd) {
269
+ const plan = planLegacyStorageMigration(cwd);
270
+ return (plan.moves.length > 0 ||
271
+ plan.legacyConfig === "present" ||
272
+ plan.legacyConfig === "malformed");
273
+ }
274
+ /** Entity lanes that must exist for the canonical layout to be complete. */
275
+ export function missingCanonicalLanes(cwd) {
276
+ return ENTITY_LANES.filter((lane) => !existsSync(path.resolve(cwd, KB_PATHS.lanes[lane])));
277
+ }
@@ -1,6 +1,13 @@
1
1
  interface MigrateOptions {
2
2
  dryRun?: boolean;
3
3
  yes?: boolean;
4
+ format?: "json" | "table";
5
+ applySafe?: boolean;
6
+ approvedPlanHash?: string;
7
+ approvedActionIds?: string[];
8
+ workspaceRoot?: string;
9
+ /** Internal migration-plan executor: create only the canonical baseline manifest. */
10
+ initializeMissingConfig?: boolean;
4
11
  }
5
12
  export declare function migrateCommand(options?: MigrateOptions): Promise<{
6
13
  exitCode: number;
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAqCA,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AA8WD,wBAAsB,cAAc,CAClC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CA+I/B"}
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAgDA,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AA4WD,wBAAsB,cAAc,CAClC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAuO/B"}