kibi-cli 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (352) hide show
  1. package/dist/cli-json-command.d.ts +6 -0
  2. package/dist/cli-json-command.d.ts.map +1 -1
  3. package/dist/cli-json-command.js +37 -9
  4. package/dist/cli-operation-loader.d.ts.map +1 -1
  5. package/dist/cli-operation-loader.js +7 -0
  6. package/dist/cli-operation-metadata.d.ts +12 -4
  7. package/dist/cli-operation-metadata.d.ts.map +1 -1
  8. package/dist/cli-operation-metadata.js +14 -4
  9. package/dist/cli-protocol.d.ts +14 -0
  10. package/dist/cli-protocol.d.ts.map +1 -1
  11. package/dist/cli-protocol.js +31 -2
  12. package/dist/cli-register-proof.d.ts.map +1 -1
  13. package/dist/cli-register-proof.js +13 -0
  14. package/dist/commands/check.d.ts.map +1 -1
  15. package/dist/commands/check.js +11 -2
  16. package/dist/commands/discovery-shared.d.ts.map +1 -1
  17. package/dist/commands/discovery-shared.js +8 -2
  18. package/dist/commands/engine.d.ts.map +1 -1
  19. package/dist/commands/engine.js +4 -2
  20. package/dist/commands/gc.d.ts.map +1 -1
  21. package/dist/commands/gc.js +7 -0
  22. package/dist/commands/init-helpers.d.ts.map +1 -1
  23. package/dist/commands/init-helpers.js +0 -1
  24. package/dist/commands/migrate.d.ts.map +1 -1
  25. package/dist/commands/migrate.js +281 -14
  26. package/dist/commands/proof-compact.d.ts +9 -0
  27. package/dist/commands/proof-compact.d.ts.map +1 -0
  28. package/dist/commands/proof-compact.js +58 -0
  29. package/dist/commands/prove.d.ts +38 -0
  30. package/dist/commands/prove.d.ts.map +1 -1
  31. package/dist/commands/prove.js +222 -47
  32. package/dist/commands/sync/persistence.d.ts.map +1 -1
  33. package/dist/commands/sync/persistence.js +61 -16
  34. package/dist/commands/sync.d.ts +8 -0
  35. package/dist/commands/sync.d.ts.map +1 -1
  36. package/dist/commands/sync.js +42 -16
  37. package/dist/diagnostics.js +1 -1
  38. package/dist/engine-limits.d.ts +74 -0
  39. package/dist/engine-limits.d.ts.map +1 -0
  40. package/dist/engine-limits.js +201 -0
  41. package/dist/engine.d.ts +10 -0
  42. package/dist/engine.d.ts.map +1 -1
  43. package/dist/engine.js +57 -9
  44. package/dist/extractors/manifest.d.ts +8 -0
  45. package/dist/extractors/manifest.d.ts.map +1 -1
  46. package/dist/extractors/manifest.js +34 -5
  47. package/dist/extractors/markdown.d.ts +8 -0
  48. package/dist/extractors/markdown.d.ts.map +1 -1
  49. package/dist/extractors/markdown.js +57 -0
  50. package/dist/extractors/relationships.d.ts.map +1 -1
  51. package/dist/extractors/relationships.js +2 -0
  52. package/dist/intent-search.d.ts +4 -1
  53. package/dist/intent-search.d.ts.map +1 -1
  54. package/dist/intent-search.js +186 -33
  55. package/dist/operations/bootstrap/candidate-helpers.d.ts.map +1 -1
  56. package/dist/operations/bootstrap/candidate-helpers.js +8 -1
  57. package/dist/operations/bootstrap/candidates.d.ts.map +1 -1
  58. package/dist/operations/bootstrap/candidates.js +54 -38
  59. package/dist/operations/bootstrap/generate.d.ts +2 -0
  60. package/dist/operations/bootstrap/generate.d.ts.map +1 -1
  61. package/dist/operations/bootstrap/generate.js +87 -33
  62. package/dist/operations/bootstrap/intent-claims.d.ts.map +1 -1
  63. package/dist/operations/bootstrap/intent-claims.js +12 -4
  64. package/dist/operations/bootstrap/markdown-candidates.d.ts +2 -0
  65. package/dist/operations/bootstrap/markdown-candidates.d.ts.map +1 -1
  66. package/dist/operations/bootstrap/markdown-candidates.js +32 -10
  67. package/dist/operations/bootstrap/presentation.d.ts.map +1 -1
  68. package/dist/operations/bootstrap/presentation.js +6 -2
  69. package/dist/operations/bootstrap/requirement-claims.d.ts +1 -0
  70. package/dist/operations/bootstrap/requirement-claims.d.ts.map +1 -1
  71. package/dist/operations/bootstrap/requirement-claims.js +13 -1
  72. package/dist/operations/bootstrap/validation.d.ts +4 -0
  73. package/dist/operations/bootstrap/validation.d.ts.map +1 -0
  74. package/dist/operations/bootstrap/validation.js +20 -0
  75. package/dist/operations/migration/inventory-rederive.d.ts +81 -0
  76. package/dist/operations/migration/inventory-rederive.d.ts.map +1 -0
  77. package/dist/operations/migration/inventory-rederive.js +484 -0
  78. package/dist/operations/migration/kb-sources.d.ts +53 -0
  79. package/dist/operations/migration/kb-sources.d.ts.map +1 -0
  80. package/dist/operations/migration/kb-sources.js +233 -0
  81. package/dist/operations/migration/origin-backfill.d.ts +39 -0
  82. package/dist/operations/migration/origin-backfill.d.ts.map +1 -0
  83. package/dist/operations/migration/origin-backfill.js +164 -0
  84. package/dist/operations/migration/polarity-values.d.ts +10 -0
  85. package/dist/operations/migration/polarity-values.d.ts.map +1 -0
  86. package/dist/operations/migration/polarity-values.js +60 -0
  87. package/dist/operations/migration/schema6.d.ts +59 -0
  88. package/dist/operations/migration/schema6.d.ts.map +1 -0
  89. package/dist/operations/migration/schema6.js +379 -0
  90. package/dist/operations/migration/source-paths.d.ts +131 -0
  91. package/dist/operations/migration/source-paths.d.ts.map +1 -0
  92. package/dist/operations/migration/source-paths.js +308 -0
  93. package/dist/operations/migration/superseded-closure.d.ts +54 -0
  94. package/dist/operations/migration/superseded-closure.d.ts.map +1 -0
  95. package/dist/operations/migration/superseded-closure.js +187 -0
  96. package/dist/operations/modeling/logic-modeling.d.ts.map +1 -1
  97. package/dist/operations/modeling/logic-modeling.js +3 -5
  98. package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
  99. package/dist/operations/modeling/model-requirement.js +225 -67
  100. package/dist/operations/mutation/contradictions.d.ts +16 -0
  101. package/dist/operations/mutation/contradictions.d.ts.map +1 -1
  102. package/dist/operations/mutation/contradictions.js +32 -0
  103. package/dist/operations/mutation/delete.d.ts.map +1 -1
  104. package/dist/operations/mutation/delete.js +15 -7
  105. package/dist/operations/mutation/origin.d.ts +21 -0
  106. package/dist/operations/mutation/origin.d.ts.map +1 -0
  107. package/dist/operations/mutation/origin.js +78 -0
  108. package/dist/operations/mutation/plan-apply-journal.d.ts +182 -0
  109. package/dist/operations/mutation/plan-apply-journal.d.ts.map +1 -0
  110. package/dist/operations/mutation/plan-apply-journal.js +613 -0
  111. package/dist/operations/mutation/predicate-vocabulary-guard.d.ts +3 -1
  112. package/dist/operations/mutation/predicate-vocabulary-guard.d.ts.map +1 -1
  113. package/dist/operations/mutation/predicate-vocabulary-guard.js +13 -2
  114. package/dist/operations/mutation/relationships.d.ts +5 -5
  115. package/dist/operations/mutation/relationships.d.ts.map +1 -1
  116. package/dist/operations/mutation/relationships.js +31 -11
  117. package/dist/operations/mutation/serialization.d.ts.map +1 -1
  118. package/dist/operations/mutation/serialization.js +3 -1
  119. package/dist/operations/mutation/source-authoring.d.ts +6 -0
  120. package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
  121. package/dist/operations/mutation/source-authoring.js +7 -1
  122. package/dist/operations/mutation/types.d.ts +14 -0
  123. package/dist/operations/mutation/types.d.ts.map +1 -1
  124. package/dist/operations/mutation/upsert.d.ts +30 -3
  125. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  126. package/dist/operations/mutation/upsert.js +105 -35
  127. package/dist/operations/mutation/validate-upsert.d.ts +6 -0
  128. package/dist/operations/mutation/validate-upsert.d.ts.map +1 -1
  129. package/dist/operations/mutation/validate-upsert.js +34 -30
  130. package/dist/operations/planning/apply-plan.d.ts.map +1 -1
  131. package/dist/operations/planning/apply-plan.js +751 -144
  132. package/dist/operations/planning/compile-intent.d.ts +34 -1
  133. package/dist/operations/planning/compile-intent.d.ts.map +1 -1
  134. package/dist/operations/planning/compile-intent.js +314 -98
  135. package/dist/operations/proof/code-scope.d.ts +28 -0
  136. package/dist/operations/proof/code-scope.d.ts.map +1 -1
  137. package/dist/operations/proof/code-scope.js +72 -0
  138. package/dist/operations/proof/compact-receipts.d.ts +49 -0
  139. package/dist/operations/proof/compact-receipts.d.ts.map +1 -0
  140. package/dist/operations/proof/compact-receipts.js +160 -0
  141. package/dist/operations/proof/ingest-proof.d.ts +2 -0
  142. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  143. package/dist/operations/proof/ingest-proof.js +44 -23
  144. package/dist/operations/proof/prune-receipts.d.ts.map +1 -1
  145. package/dist/operations/proof/prune-receipts.js +5 -9
  146. package/dist/operations/proof/receipt-compaction.d.ts +48 -0
  147. package/dist/operations/proof/receipt-compaction.d.ts.map +1 -0
  148. package/dist/operations/proof/receipt-compaction.js +121 -0
  149. package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
  150. package/dist/operations/semantic-advisor/analysis-receipt.js +12 -1
  151. package/dist/operations/semantic-advisor/analyze-prose.d.ts +2 -1
  152. package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
  153. package/dist/operations/semantic-advisor/analyze-prose.js +51 -5
  154. package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
  155. package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
  156. package/dist/operations/semantic-advisor/clauses.js +11 -1
  157. package/dist/operations/semantic-advisor/conditional-rules.d.ts +33 -0
  158. package/dist/operations/semantic-advisor/conditional-rules.d.ts.map +1 -0
  159. package/dist/operations/semantic-advisor/conditional-rules.js +262 -0
  160. package/dist/operations/semantic-advisor/ingestion-boundary.d.ts +3 -1
  161. package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
  162. package/dist/operations/semantic-advisor/ingestion-boundary.js +14 -6
  163. package/dist/operations/semantic-advisor/plugin-orchestration.js +1 -1
  164. package/dist/prolog/codec.d.ts.map +1 -1
  165. package/dist/prolog/codec.js +2 -1
  166. package/dist/prolog.d.ts +9 -0
  167. package/dist/prolog.d.ts.map +1 -1
  168. package/dist/prolog.js +56 -10
  169. package/dist/proof/command-test-report.d.ts +74 -0
  170. package/dist/proof/command-test-report.d.ts.map +1 -0
  171. package/dist/proof/command-test-report.js +206 -0
  172. package/dist/public/branch-resolver.d.ts +1 -0
  173. package/dist/public/branch-resolver.d.ts.map +1 -1
  174. package/dist/public/branch-resolver.js +1 -0
  175. package/dist/public/entity-origin.d.ts +69 -0
  176. package/dist/public/entity-origin.d.ts.map +1 -0
  177. package/dist/public/entity-origin.js +142 -0
  178. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  179. package/dist/public/impact/full-kb-quality.js +1 -0
  180. package/dist/public/impact/requirement-quality.js +1 -1
  181. package/dist/public/operations/catalog.d.ts +130 -19
  182. package/dist/public/operations/catalog.d.ts.map +1 -1
  183. package/dist/public/operations/catalog.js +3 -0
  184. package/dist/public/operations/check-executor.d.ts.map +1 -1
  185. package/dist/public/operations/check-executor.js +8 -0
  186. package/dist/public/operations/contracts.d.ts +0 -5
  187. package/dist/public/operations/contracts.d.ts.map +1 -1
  188. package/dist/public/operations/contracts.js +63 -14
  189. package/dist/public/operations/discovery-entities.d.ts +15 -0
  190. package/dist/public/operations/discovery-entities.d.ts.map +1 -1
  191. package/dist/public/operations/discovery-entities.js +59 -0
  192. package/dist/public/operations/discovery-executors.d.ts +6 -1
  193. package/dist/public/operations/discovery-executors.d.ts.map +1 -1
  194. package/dist/public/operations/discovery-executors.js +65 -6
  195. package/dist/public/operations/index.d.ts +1 -0
  196. package/dist/public/operations/index.d.ts.map +1 -1
  197. package/dist/public/operations/index.js +1 -0
  198. package/dist/public/operations/migration-plan.d.ts +5 -0
  199. package/dist/public/operations/migration-plan.d.ts.map +1 -1
  200. package/dist/public/operations/migration-plan.js +26 -1
  201. package/dist/public/operations/node-ports.d.ts.map +1 -1
  202. package/dist/public/operations/node-ports.js +24 -3
  203. package/dist/public/operations/origin-review.d.ts +51 -0
  204. package/dist/public/operations/origin-review.d.ts.map +1 -0
  205. package/dist/public/operations/origin-review.js +307 -0
  206. package/dist/public/operations/predicate-schema-conformance.js +1 -1
  207. package/dist/public/operations/repair-plan.d.ts.map +1 -1
  208. package/dist/public/operations/repair-plan.js +4 -0
  209. package/dist/public/operations/result-envelope.d.ts.map +1 -1
  210. package/dist/public/operations/result-envelope.js +17 -5
  211. package/dist/public/operations/runtime-types.d.ts +9 -0
  212. package/dist/public/operations/runtime-types.d.ts.map +1 -1
  213. package/dist/public/operations/schema6-check-actions.d.ts +127 -0
  214. package/dist/public/operations/schema6-check-actions.d.ts.map +1 -0
  215. package/dist/public/operations/schema6-check-actions.js +575 -0
  216. package/dist/public/operations/source-path-dangling.d.ts +17 -0
  217. package/dist/public/operations/source-path-dangling.d.ts.map +1 -0
  218. package/dist/public/operations/source-path-dangling.js +66 -0
  219. package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
  220. package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
  221. package/dist/public/operations/specs/check-rules.generated.js +15 -1
  222. package/dist/public/operations/specs/check.d.ts +2 -2
  223. package/dist/public/operations/specs/check.js +1 -1
  224. package/dist/public/operations/specs/composite.d.ts +351 -0
  225. package/dist/public/operations/specs/composite.d.ts.map +1 -0
  226. package/dist/public/operations/specs/composite.js +96 -0
  227. package/dist/public/operations/specs/discovery.d.ts +8 -3
  228. package/dist/public/operations/specs/discovery.d.ts.map +1 -1
  229. package/dist/public/operations/specs/discovery.js +8 -3
  230. package/dist/public/operations/specs/modeling.d.ts +2 -2
  231. package/dist/public/operations/specs/modeling.js +2 -2
  232. package/dist/public/operations/specs/mutation-schemas.d.ts +73 -8
  233. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  234. package/dist/public/operations/specs/mutation-schemas.js +43 -7
  235. package/dist/public/operations/specs/mutation.d.ts +1 -1
  236. package/dist/public/operations/specs/mutation.js +1 -1
  237. package/dist/public/operations/specs/planning.d.ts +2 -2
  238. package/dist/public/operations/specs/planning.js +4 -4
  239. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  240. package/dist/public/operations/specs/reporting.js +13 -26
  241. package/dist/public/operations/specs/upsert.d.ts +79 -9
  242. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  243. package/dist/public/operations/specs/upsert.js +6 -1
  244. package/dist/public/operations/types.d.ts +1 -1
  245. package/dist/public/operations/types.d.ts.map +1 -1
  246. package/dist/public/proof-receipt.d.ts +1 -0
  247. package/dist/public/proof-receipt.d.ts.map +1 -1
  248. package/dist/public/schemas/entity.d.ts.map +1 -1
  249. package/dist/public/schemas/entity.js +52 -0
  250. package/dist/public/schemas/relationship.d.ts.map +1 -1
  251. package/dist/public/schemas/relationship.js +2 -0
  252. package/dist/public/skills/kibi-bootstrap/SKILL.md +6 -1
  253. package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +6 -0
  254. package/dist/public/skills/kibi-usage/SKILL.md +68 -18
  255. package/dist/public/skills/kibi-usage/resources/fact-lanes.md +5 -5
  256. package/dist/public/skills/kibi-usage/resources/kb-improvement.md +1 -1
  257. package/dist/public/skills/kibi-usage/resources/logic-ir.md +2 -2
  258. package/dist/public/skills/kibi-usage/resources/operation-access.md +25 -1
  259. package/dist/public/skills/kibi-usage/resources/ui-requirements.md +4 -4
  260. package/dist/public/skills/kibi-usage/resources/workflows.md +42 -25
  261. package/dist/public/telemetry-acceptance.d.ts +58 -2
  262. package/dist/public/telemetry-acceptance.d.ts.map +1 -1
  263. package/dist/public/telemetry-acceptance.js +136 -10
  264. package/dist/public/telemetry-remediation.d.ts.map +1 -1
  265. package/dist/public/telemetry-remediation.js +26 -10
  266. package/dist/relationships/shards.d.ts +13 -0
  267. package/dist/relationships/shards.d.ts.map +1 -1
  268. package/dist/relationships/shards.js +54 -28
  269. package/dist/runtime/cli-runtime.d.ts.map +1 -1
  270. package/dist/runtime/cli-runtime.js +44 -3
  271. package/dist/runtime/detached-snapshot.d.ts +38 -0
  272. package/dist/runtime/detached-snapshot.d.ts.map +1 -0
  273. package/dist/runtime/detached-snapshot.js +92 -0
  274. package/dist/schemas/entity.schema.json +122 -0
  275. package/dist/search-answer.d.ts +157 -0
  276. package/dist/search-answer.d.ts.map +1 -0
  277. package/dist/search-answer.js +846 -0
  278. package/dist/traceability/impact-knowledge.d.ts.map +1 -1
  279. package/dist/traceability/impact-knowledge.js +7 -0
  280. package/dist/traceability/symbol-extract.js +3 -3
  281. package/dist/traceability/temp-kb.d.ts.map +1 -1
  282. package/dist/traceability/temp-kb.js +12 -0
  283. package/dist/types/entities.d.ts +13 -0
  284. package/dist/types/entities.d.ts.map +1 -1
  285. package/dist/types/relationships.d.ts +1 -1
  286. package/dist/types/relationships.d.ts.map +1 -1
  287. package/dist/utils/branch-resolver.d.ts +37 -1
  288. package/dist/utils/branch-resolver.d.ts.map +1 -1
  289. package/dist/utils/branch-resolver.js +130 -3
  290. package/dist/utils/repo-relative-path.d.ts +18 -0
  291. package/dist/utils/repo-relative-path.d.ts.map +1 -0
  292. package/dist/utils/repo-relative-path.js +58 -0
  293. package/dist/utils/rule-registry.generated.d.ts +75 -3
  294. package/dist/utils/rule-registry.generated.d.ts.map +1 -1
  295. package/dist/utils/rule-registry.generated.js +89 -3
  296. package/dist/utils/schema-version.d.ts +1 -1
  297. package/dist/utils/schema-version.d.ts.map +1 -1
  298. package/dist/utils/schema-version.js +4 -3
  299. package/dist/utils/strict-modeling.d.ts +1 -1
  300. package/dist/utils/strict-modeling.d.ts.map +1 -1
  301. package/dist/utils/strict-modeling.js +23 -3
  302. package/package.json +3 -3
  303. package/schema/entities.pl +22 -0
  304. package/schema/relationships.pl +14 -0
  305. package/schema/validation.pl +45 -1
  306. package/src/public/branch-resolver.ts +1 -0
  307. package/src/public/entity-origin.ts +175 -0
  308. package/src/public/impact/full-kb-quality.ts +1 -0
  309. package/src/public/impact/requirement-quality.ts +1 -1
  310. package/src/public/operations/catalog.ts +3 -0
  311. package/src/public/operations/check-executor.ts +15 -0
  312. package/src/public/operations/contracts.ts +75 -15
  313. package/src/public/operations/discovery-entities.ts +74 -0
  314. package/src/public/operations/discovery-executors.ts +88 -10
  315. package/src/public/operations/index.ts +1 -0
  316. package/src/public/operations/migration-plan.ts +30 -1
  317. package/src/public/operations/node-ports.ts +24 -3
  318. package/src/public/operations/origin-review.ts +375 -0
  319. package/src/public/operations/predicate-schema-conformance.ts +1 -1
  320. package/src/public/operations/repair-plan.ts +4 -0
  321. package/src/public/operations/result-envelope.ts +18 -6
  322. package/src/public/operations/runtime-types.ts +9 -0
  323. package/src/public/operations/schema6-check-actions.ts +699 -0
  324. package/src/public/operations/source-path-dangling.ts +81 -0
  325. package/src/public/operations/specs/check-rules.generated.ts +15 -1
  326. package/src/public/operations/specs/check.ts +1 -1
  327. package/src/public/operations/specs/composite.ts +141 -0
  328. package/src/public/operations/specs/discovery.ts +9 -3
  329. package/src/public/operations/specs/modeling.ts +2 -2
  330. package/src/public/operations/specs/mutation-schemas.ts +49 -7
  331. package/src/public/operations/specs/mutation.ts +1 -1
  332. package/src/public/operations/specs/planning.ts +4 -4
  333. package/src/public/operations/specs/reporting.ts +13 -38
  334. package/src/public/operations/specs/upsert.ts +7 -1
  335. package/src/public/operations/types.ts +2 -0
  336. package/src/public/proof-receipt.ts +1 -0
  337. package/src/public/schemas/entity.ts +57 -0
  338. package/src/public/schemas/relationship.ts +2 -0
  339. package/src/public/skills/kibi-bootstrap/SKILL.md +6 -1
  340. package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +6 -0
  341. package/src/public/skills/kibi-usage/SKILL.md +68 -18
  342. package/src/public/skills/kibi-usage/resources/fact-lanes.md +5 -5
  343. package/src/public/skills/kibi-usage/resources/kb-improvement.md +1 -1
  344. package/src/public/skills/kibi-usage/resources/logic-ir.md +2 -2
  345. package/src/public/skills/kibi-usage/resources/operation-access.md +25 -1
  346. package/src/public/skills/kibi-usage/resources/ui-requirements.md +4 -4
  347. package/src/public/skills/kibi-usage/resources/workflows.md +42 -25
  348. package/src/public/telemetry-acceptance-types.d.ts +4 -1
  349. package/src/public/telemetry-acceptance.ts +204 -10
  350. package/src/public/telemetry-remediation.ts +39 -10
  351. package/src/schemas/entity.schema.json +122 -0
  352. package/src/schemas/relationship.schema.json +2 -0
@@ -35,21 +35,22 @@ edits dependency configuration.
35
35
 
36
36
  ## Choosing a discovery mode
37
37
 
38
- `kb_search` is not one behavior. It selects deterministic intent ranking when
39
- you pass `rankingMode: "intent-v1"`, `semanticFacets`, or `sourceLocations`,
40
- and legacy lexical ranking otherwise. Naming the tool is not enough; the inputs
41
- decide the path.
38
+ `kb_search` defaults to deterministic intent ranking (`rankingMode:
39
+ "intent-v1"`), so a natural-language question is a valid query. Pass
40
+ `rankingMode: "legacy"` for the older lexical ranking. The inputs, not the tool
41
+ name, decide how results are ranked.
42
42
 
43
43
  - **Exact identity** — you already know the ID. Use `kb_query`, not search.
44
44
  - **Literal token** — a symbol, file, or error string that appears verbatim.
45
- Use lexical `kb_search` and keep the query close to the literal text.
46
- - **Conceptual or behavioral** — "how does checkout handle a declined card".
47
- Use intent mode and ground it in what you actually know:
45
+ Keep the query close to the literal text; `rankingMode: "legacy"` ranks it
46
+ lexically.
47
+ - **Question or behavior** — "what governs how checkout handles a declined
48
+ card?". Ask it directly, and ground it with facets from what you actually
49
+ know:
48
50
 
49
51
  ```json
50
52
  {
51
- "query": "declined card during checkout",
52
- "rankingMode": "intent-v1",
53
+ "query": "what governs a declined card during checkout?",
53
54
  "semanticFacets": {
54
55
  "actors": ["shopper"],
55
56
  "actions": ["pay"],
@@ -66,7 +67,6 @@ decide the path.
66
67
  ```json
67
68
  {
68
69
  "query": "checkout total rounding",
69
- "rankingMode": "intent-v1",
70
70
  "sourceLocations": [{ "path": "src/checkout.ts", "symbol": "computeTotal" }]
71
71
  }
72
72
  ```
@@ -75,8 +75,25 @@ Supply facets only from the request, the code, or prior results. Inventing
75
75
  facets fabricates evidence and biases ranking. Intent mode abstains below
76
76
  `minScore` instead of returning weak matches; an abstention is an explicit
77
77
  no-answer, so widen the query or drop to lexical search rather than treating it
78
- as "nothing exists". There is no target percentage of intent-mode calls — a
79
- literal identifier lookup is still best served lexically.
78
+ as "nothing exists". A literal identifier lookup is still best served
79
+ lexically.
80
+
81
+ On the first page, intent mode also returns an answer layer in `data.answer`
82
+ (`kibi.search-answer.v1`; turn it off with `answer: false`):
83
+
84
+ - `governing` — current requirements matched by the query or linked to a
85
+ matched entity, each with `via` (how it was reached) and its linked `facts`,
86
+ `scenarios`, `tests`, and `adrs`.
87
+ - `rationale` — ADRs that explain the decisions.
88
+ - `notGoverning` — superseded or deprecated requirements, with `supersededBy`
89
+ when known. Never read these as current policy; superseded entities are also
90
+ demoted in the ranked results.
91
+ - `observations` — observation/meta facts, which are notes, not rules.
92
+ - `truncated` and `note` — the layer is size-bounded; an empty `governing`
93
+ list is not evidence that nothing governs the change.
94
+
95
+ The answer layer is graph traversal: discovery, not proof. Use `kb_check` and
96
+ `kb_coverage` for consistency and proof status.
80
97
 
81
98
  Results are summaries by default: identifying metadata, score, reasons, and a
82
99
  snippet. Read them to pick candidates, then `kb_query` those IDs for full
@@ -88,12 +105,12 @@ planning a behavior change; a search receipt is not comprehension.
88
105
 
89
106
  The canonical workflow for any KB operation follows this pattern:
90
107
 
91
- 1. **Discover**: `kb_search` with focused probes; pick the mode above
108
+ 1. **Discover**: `kb_search` with focused probes or a direct question; read `data.answer`, and pick the mode above
92
109
  2. **Confirm**: `kb_query` for exact IDs and state
93
110
  3. **Inspect**: `kb_status` when freshness matters
94
- 4. **Decompose**: `kb_semantic_advisor` on the complete normative prose; verify or supply every atomic clause
95
- 5. **Choose per-clause lanes**: strict facts for scalar claims; `kb_suggest_predicates` for approved ground ontology relations; `kb_model_requirement` with `kibi.logic.v1` for conditions, exceptions, modalities, quantifiers, cardinality, and bounded temporal rules; observation review for ambiguity, nonlogical prose, and ontology gaps
96
- 6. **Preflight**: `kb_validate_upsert` for every intended entity or relationship payload
111
+ 4. **Decompose**: `kb_model` (`mode: "analyze"`) on the complete normative prose; verify or supply every atomic clause
112
+ 5. **Choose per-clause lanes**: strict facts for scalar claims; `kb_model` `mode: "predicates"` for approved ground ontology relations; `kb_model` `mode: "requirement"` with `kibi.logic.v1` for conditions, exceptions, modalities, quantifiers, cardinality, and bounded temporal rules; observation review for ambiguity, nonlogical prose, and ontology gaps
113
+ 6. **Preflight**: `kb_upsert` with `dryRun: true` for every intended entity or relationship payload
97
114
  7. **Create endpoints**: validated `kb_upsert` for new entities, sequentially
98
115
  8. **Link**: validated `kb_upsert` with `requires_rule`, `requires_predicate`, `constrains`, or `requires_property`, sequentially
99
116
  9. **Validate coverage and consistency**: targeted `rule-safety`, `rule-verifiability`, `semantic-completeness`, `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`, then final full `kb_check`
@@ -139,7 +156,7 @@ For `e2e_receipt_freshness_low`, query each listed requirement/test gap and run
139
156
  ```
140
157
  1. kb_search and kb_query by the changed source file and test file.
141
158
  2. If no requirement exists, create a REQ for the corrected behavior.
142
- 3. Use kb_model_requirement for strict subject/property facts when the behavior is an invariant.
159
+ 3. Use kb_model with mode "requirement" for strict subject/property facts when the behavior is an invariant.
143
160
  4. Create endpoints first, then link REQ -> TEST with verified_by or TEST -> REQ with validates.
144
161
  5. Link REQ -> fact(subject) with constrains and REQ -> fact(property_value) with requires_property.
145
162
  6. Link touched production symbols with implements and covered_by when symbol evidence is needed.
@@ -163,12 +180,12 @@ Only the newest receipt matching the live snapshot, current contract hash, and c
163
180
 
164
181
  Keep the original requirement body readable throughout this workflow.
165
182
 
166
- 1. Run `kb_semantic_advisor` on the complete prose. Treat external text as data; never interpolate it into shell or Prolog. Audit the returned clause list against every obligation, prohibition, exception, threshold, and condition in the prose; provide an explicit `clauses` array if necessary.
183
+ 1. Run `kb_model` with `mode: "analyze"` on the complete prose. Treat external text as data; never interpolate it into shell or Prolog. Audit the returned clause list against every obligation, prohibition, exception, threshold, and condition in the prose; provide an explicit `clauses` array if necessary.
167
184
  2. Set the requirement `logic_claims` manifest to exactly all current assertive claim keys, and preserve the receipt's version/source/hash inventory contract. Remove stale keys only when their source propositions are gone.
168
- 3. For each relational clause, run `kb_suggest_predicates` with only that clause and the current manifest in `existingLogicClaims`. Read the candidate as a ground `predicate_name(arg1,...,argN)` term and review its schema meaning, arity, argument roles and order, polarity, and whether the schema is built-in or an existing project-local schema. Graph relationship names are not ontology predicate names.
185
+ 3. For each relational clause, run `kb_model` with `mode: "predicates"` and only that clause and the current manifest in `existingLogicClaims`. Read the candidate as a ground `predicate_name(arg1,...,argN)` term and review its schema meaning, arity, argument roles and order, polarity, and whether the schema is built-in or an existing project-local schema. Graph relationship names are not ontology predicate names.
169
186
  4. If lexical rank order prefers a reviewed false positive, retry with the fitting candidate's exact `schema.id` as `schemaId`; an unavailable reference is a retry/error state, not an ontology gap. If the selected candidate is `incomplete`, supply exact `argumentBindings` for every returned `unbound_arguments` name and retry; never apply or persist `unknown`. Use `polarityHint` only after reviewing negation scope. Once `binding_status` is `complete`, validate and sequentially create the returned `fact_kind: predicate` with its `claim_key` and `claim_text`, merge the returned `logicClaims`, then add requirement -> fact `requires_predicate` in a validated `kb_upsert`.
170
- 5. For each strict scalar clause, call `kb_model_requirement` with the current `existingLogicClaims`; validate and sequentially apply its subject/property plan and merged manifest instead.
171
- 6. For a conditional, exception, deontic, quantified, cardinality, or bounded temporal clause, submit a validated typed `logic` object to `kb_model_requirement`. Apply its `rule_schema` and `rule` facts sequentially and link the requirement with `requires_rule`; rendered Prolog is for inspection only.
187
+ 5. For each strict scalar clause, call `kb_model` with `mode: "requirement"` and the current `existingLogicClaims`; validate and sequentially apply its subject/property plan and merged manifest instead.
188
+ 6. For a conditional, exception, deontic, quantified, cardinality, or bounded temporal clause, submit a validated typed `logic` object to `kb_model` with `mode: "requirement"`. Apply its `rule_schema` and `rule` facts sequentially and link the requirement with `requires_rule`; rendered Prolog is for inspection only.
172
189
  7. If wording is ambiguous, a candidate is only a lexical false positive, or no schema/IR interpretation fits, create the advised observation review artifact and apply its returned `relates_to` review anchor when present; report that claim key as unresolved. Use `review:ambiguity` for unresolved interpretation, `review:keyword-false-positive` for a vocabulary match that is not a domain assertion, and `review:ontology-gap` only for a true catalog gap. Define a new `predicate_schema` only when the task explicitly authorizes ontology extension and provides a stable signature.
173
190
  8. Read back the requirement, proposition ledger, and all facts. Confirm every manifest key occurs on exactly one intended ground fact/rule, no punctuation variant minted a second claim, and no two claim keys encode the same logical term. Exact query output may represent repeated relationship types as arrays, so inspect every target. Then run `kb_check` with `rule-safety`, `rule-verifiability`, `semantic-completeness`, `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`. Finish with an unfiltered `kb_check`.
174
191
 
@@ -183,12 +200,12 @@ On resume after interruption, repeat `kb_query` for exact endpoints and apply on
183
200
  Optional per-project workflow for recording what the screen should look like. Non-UI projects skip this lane entirely.
184
201
 
185
202
  1. Create a prose `req` holding the full visual description; it is the searchable anchor agents discover before touching a UI file.
186
- 2. Run `kb_semantic_advisor` on the description; audit or supply `clauses`.
187
- 3. For relational layout clauses ("X must remain visually aligned with Y"), call `kb_suggest_predicates`, apply the returned `fact_kind: predicate` plan with `predicate_name: visual_layout_rule` and `requires_predicate`.
188
- 4. For scalar placement, alignment, and ordering clauses, call `kb_model_requirement` and apply strict `fact_kind: subject` / `fact_kind: property_value` facts linked with `constrains` / `requires_property`. Model header order as indexed property keys (`nav_order_1`, `nav_order_2`, ...) against one subject region.
203
+ 2. Run `kb_model` with `mode: "analyze"` on the description; audit or supply `clauses`.
204
+ 3. For relational layout clauses ("X must remain visually aligned with Y"), call `kb_model` with `mode: "predicates"`, apply the returned `fact_kind: predicate` plan with `predicate_name: visual_layout_rule` and `requires_predicate`.
205
+ 4. For scalar placement, alignment, and ordering clauses, call `kb_model` with `mode: "requirement"` and apply strict `fact_kind: subject` / `fact_kind: property_value` facts linked with `constrains` / `requires_property`. Model header order as indexed property keys (`nav_order_1`, `nav_order_2`, ...) against one subject region.
189
206
  5. Preserve `claim_key` / `claim_text` on every ground fact and merge every key into the requirement `logic_claims` manifest.
190
207
  6. Model UI components as `symbol` entities with `sourceFile` and `symbol_role: behavioral`, linked `implements` to the requirement.
191
- 7. `kb_validate_upsert`, create endpoints first, then sequential `kb_upsert`. Run `kb_check` with `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`, then a final unfiltered `kb_check`.
208
+ 7. `kb_upsert` with `dryRun: true`, create endpoints first, then sequential `kb_upsert`. Run `kb_check` with `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`, then a final unfiltered `kb_check`.
192
209
 
193
210
  Incompatible values on the same subject/property from two current requirements are rejected on write; change an intentional value via a replacement requirement linked with `supersedes`. Full payloads are in `resources/ui-requirements.md`.
194
211
 
@@ -10,21 +10,77 @@ export declare const DEFAULT_TELEMETRY_ACCEPTANCE_POLICY: {
10
10
  readonly telemetryCompletenessMinimum: 0.95;
11
11
  readonly validationBeforeUpsertMinimum: 1;
12
12
  readonly advisorBeforeRequirementWriteMinimum: 1;
13
+ readonly lookupBeforeFirstEditMinimum: 1;
13
14
  readonly sourceLookupZeroResultMaximum: 0.2;
14
15
  readonly preflightMaxAgeSeconds: number;
15
16
  readonly advisorMaxAgeSeconds: number;
16
17
  readonly repeatedMutationFailureThreshold: 3;
17
18
  };
19
+ /**
20
+ * A row written by a host plugin hook (`interface: "hook"`). Hooks record
21
+ * agent activity around Kibi calls: which Kibi operation a tool call ran
22
+ * (`hook_action: "kb_usage"`) and which files an edit tool changed, with the
23
+ * requirements those files' symbols implement (`hook_action: "edited"`).
24
+ */
25
+ export interface TelemetryHookEvent extends TelemetryUsageEvent {
26
+ readonly interface?: string;
27
+ readonly host?: string;
28
+ readonly hook_action?: string;
29
+ readonly path?: string | null;
30
+ readonly requirement_ids?: readonly string[];
31
+ readonly kb_operation?: string | null;
32
+ }
33
+ /** A host hook row and where it sits relative to the operation events. */
34
+ export interface TelemetryHookRow {
35
+ readonly event: TelemetryHookEvent;
36
+ /** 1-based `.kb/usage.log` line (array position for in-memory events). */
37
+ readonly logLine: number;
38
+ /** Operation events that precede this row in the log. */
39
+ readonly operationsBefore: number;
40
+ }
41
+ /** Operation events and host hook rows of one usage log, kept apart. */
42
+ export interface TelemetryUsagePartition {
43
+ readonly operations: readonly TelemetryUsageEvent[];
44
+ /** 1-based `.kb/usage.log` line of each operation event. */
45
+ readonly operationLines: readonly number[];
46
+ readonly hookRows: readonly TelemetryHookRow[];
47
+ }
18
48
  /**
19
49
  * Parse Kibi operation events from `.kb/usage.log`.
20
50
  *
21
51
  * Host plugin hooks share the log and tag their rows `interface: "hook"`.
22
52
  * Those rows describe agent activity around Kibi calls, not Kibi operations,
23
- * so they are dropped here: otherwise a busy editing session would push every
24
- * operation out of the bounded acceptance window.
53
+ * so they are left out of the returned array: otherwise a busy editing
54
+ * session would push every operation out of the bounded acceptance window.
55
+ * They stay attached to the array for `partitionTelemetryUsage`, which is how
56
+ * the `lookup_before_first_edit` metric reads them.
25
57
  */
26
58
  export declare function parseTelemetryUsageLog(contents: string): TelemetryUsageEvent[];
59
+ /**
60
+ * Split events into Kibi operations and host hook rows. Arrays from
61
+ * `parseTelemetryUsageLog` carry their hook rows and log lines; any other
62
+ * array is split on `interface: "hook"`, with positions as line numbers.
63
+ */
64
+ export declare function partitionTelemetryUsage(events: readonly TelemetryUsageEvent[]): TelemetryUsagePartition;
27
65
  export declare function thresholdStatus(actual: number | undefined, operator: ">=" | "<=" | "<", expected: number): TelemetryMetricStatus;
66
+ /** Kibi operations that count as looking up requirements before an edit. */
67
+ export declare const LOOKUP_BEFORE_EDIT_OPERATIONS: readonly ["kb_query", "kb_search"];
68
+ /** The first requirement-linked edit of one host session. */
69
+ export interface FirstLinkedEdit {
70
+ /** `<host>:<session_id>` of the session. */
71
+ readonly session: string;
72
+ readonly edit: TelemetryHookRow;
73
+ /** True when kb_search or kb_query ran earlier in the same session. */
74
+ readonly lookedUp: boolean;
75
+ }
76
+ /**
77
+ * For each host session, its first edit of a file whose symbols implement a
78
+ * requirement and whether a Kibi lookup (MCP or CLI) preceded it. Rows
79
+ * without a session id cannot be ordered within a session and are skipped;
80
+ * sessions whose first linked edit predates the evaluated window are left
81
+ * out.
82
+ */
83
+ export declare function firstLinkedEdits(hookRows: readonly TelemetryHookRow[], recentStart: number): FirstLinkedEdit[];
28
84
  export declare function analyzeTelemetryAcceptance(events: readonly TelemetryUsageEvent[], now?: Date, policy?: TelemetryAcceptancePolicy): TelemetryAcceptanceReport;
29
85
  export declare function createTelemetryAcceptanceDiagnostics(report: TelemetryAcceptanceReport): readonly QualityDiagnostic[];
30
86
  //# sourceMappingURL=telemetry-acceptance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry-acceptance.d.ts","sourceRoot":"","sources":["../../src/public/telemetry-acceptance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAEV,yBAAyB,EACzB,yBAAyB,EAGzB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EACV,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AAEzC,eAAO,MAAM,4BAA4B,EACvC,8BAAuC,CAAC;AAE1C,eAAO,MAAM,mCAAmC;;;;;;;;;;;;CAYF,CAAC;AAgB/C;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,GACf,mBAAmB,EAAE,CAuBvB;AA0DD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,GAAG,EAC3B,QAAQ,EAAE,MAAM,GACf,qBAAqB,CAKvB;AA0dD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,SAAS,mBAAmB,EAAE,EACtC,GAAG,GAAE,IAAiB,EACtB,MAAM,GAAE,yBAA+D,GACtE,yBAAyB,CA6D3B;AA+DD,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,yBAAyB,GAChC,SAAS,iBAAiB,EAAE,CA+E9B"}
1
+ {"version":3,"file":"telemetry-acceptance.d.ts","sourceRoot":"","sources":["../../src/public/telemetry-acceptance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM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GASG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,GACf,mBAAmB,EAAE,CAkCvB;AAGD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,mBAAmB,EAAE,GACrC,uBAAuB,CAmBzB;AA0DD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,GAAG,EAC3B,QAAQ,EAAE,MAAM,GACf,qBAAqB,CAKvB;AA+ND,4EAA4E;AAC5E,eAAO,MAAM,6BAA6B,oCAAqC,CAAC;AAGhF,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AASD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EACrC,WAAW,EAAE,MAAM,GAClB,eAAe,EAAE,CA4BnB;AAkSD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,SAAS,mBAAmB,EAAE,EACtC,GAAG,GAAE,IAAiB,EACtB,MAAM,GAAE,yBAA+D,GACtE,yBAAyB,CA+D3B;AAsED,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,yBAAyB,GAChC,SAAS,iBAAiB,EAAE,CA+E9B"}
@@ -7,6 +7,7 @@ export const DEFAULT_TELEMETRY_ACCEPTANCE_POLICY = {
7
7
  telemetryCompletenessMinimum: 0.95,
8
8
  validationBeforeUpsertMinimum: 1,
9
9
  advisorBeforeRequirementWriteMinimum: 1,
10
+ lookupBeforeFirstEditMinimum: 1,
10
11
  sourceLookupZeroResultMaximum: 0.2,
11
12
  preflightMaxAgeSeconds: 60 * 60,
12
13
  advisorMaxAgeSeconds: 24 * 60 * 60,
@@ -15,16 +16,26 @@ export const DEFAULT_TELEMETRY_ACCEPTANCE_POLICY = {
15
16
  function isRecord(value) {
16
17
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
17
18
  }
19
+ /**
20
+ * Hook rows and line numbers of every array `parseTelemetryUsageLog`
21
+ * returned. The array itself keeps its operation-only shape, so callers that
22
+ * pass it straight to the analyzers need no change.
23
+ */
24
+ const parsedUsageLogs = new WeakMap();
18
25
  /**
19
26
  * Parse Kibi operation events from `.kb/usage.log`.
20
27
  *
21
28
  * Host plugin hooks share the log and tag their rows `interface: "hook"`.
22
29
  * Those rows describe agent activity around Kibi calls, not Kibi operations,
23
- * so they are dropped here: otherwise a busy editing session would push every
24
- * operation out of the bounded acceptance window.
30
+ * so they are left out of the returned array: otherwise a busy editing
31
+ * session would push every operation out of the bounded acceptance window.
32
+ * They stay attached to the array for `partitionTelemetryUsage`, which is how
33
+ * the `lookup_before_first_edit` metric reads them.
25
34
  */
26
35
  export function parseTelemetryUsageLog(contents) {
27
36
  const events = [];
37
+ const operationLines = [];
38
+ const hookRows = [];
28
39
  for (const [index, line] of contents.split(/\r?\n/).entries()) {
29
40
  const trimmed = line.trim();
30
41
  if (!trimmed)
@@ -40,12 +51,48 @@ export function parseTelemetryUsageLog(contents) {
40
51
  if (!isRecord(parsed)) {
41
52
  throw new Error(`Failed to parse .kb/usage.log line ${index + 1}: expected object`);
42
53
  }
43
- if (parsed.interface === "hook")
54
+ if (parsed.interface === "hook") {
55
+ hookRows.push({
56
+ event: parsed,
57
+ logLine: index + 1,
58
+ operationsBefore: events.length,
59
+ });
44
60
  continue;
61
+ }
45
62
  events.push(parsed);
63
+ operationLines.push(index + 1);
46
64
  }
65
+ parsedUsageLogs.set(events, { operationLines, hookRows });
47
66
  return events;
48
67
  }
68
+ // implements REQ-kibi-telemetry-acceptance-gate-v2, REQ-claude-hook-usage-telemetry-v2
69
+ /**
70
+ * Split events into Kibi operations and host hook rows. Arrays from
71
+ * `parseTelemetryUsageLog` carry their hook rows and log lines; any other
72
+ * array is split on `interface: "hook"`, with positions as line numbers.
73
+ */
74
+ export function partitionTelemetryUsage(events) {
75
+ const parsed = parsedUsageLogs.get(events);
76
+ if (parsed !== undefined)
77
+ return { operations: events, ...parsed };
78
+ const operations = [];
79
+ const operationLines = [];
80
+ const hookRows = [];
81
+ for (const [index, event] of events.entries()) {
82
+ if (event.interface === "hook") {
83
+ hookRows.push({
84
+ event: event,
85
+ logLine: index + 1,
86
+ operationsBefore: operations.length,
87
+ });
88
+ }
89
+ else {
90
+ operations.push(event);
91
+ operationLines.push(index + 1);
92
+ }
93
+ }
94
+ return { operations, operationLines, hookRows };
95
+ }
49
96
  function eventArgs(event) {
50
97
  return event.business_args ?? event.args ?? {};
51
98
  }
@@ -261,6 +308,77 @@ function advisorBeforeRequirementWriteMetric(all, recentStart, policy) {
261
308
  },
262
309
  };
263
310
  }
311
+ // implements REQ-kibi-telemetry-acceptance-gate-v2
312
+ /** Kibi operations that count as looking up requirements before an edit. */
313
+ export const LOOKUP_BEFORE_EDIT_OPERATIONS = ["kb_query", "kb_search"];
314
+ function hookSession(event) {
315
+ const sessionId = event.session_id;
316
+ if (typeof sessionId !== "string" || sessionId.length === 0)
317
+ return undefined;
318
+ return `${event.host ?? "unknown"}:${sessionId}`;
319
+ }
320
+ // implements REQ-kibi-telemetry-acceptance-gate-v2, REQ-claude-hook-usage-telemetry-v2
321
+ /**
322
+ * For each host session, its first edit of a file whose symbols implement a
323
+ * requirement and whether a Kibi lookup (MCP or CLI) preceded it. Rows
324
+ * without a session id cannot be ordered within a session and are skipped;
325
+ * sessions whose first linked edit predates the evaluated window are left
326
+ * out.
327
+ */
328
+ export function firstLinkedEdits(hookRows, recentStart) {
329
+ const lookedUp = new Set();
330
+ const edited = new Set();
331
+ const firstEdits = [];
332
+ for (const row of hookRows) {
333
+ const session = hookSession(row.event);
334
+ if (session === undefined)
335
+ continue;
336
+ const { hook_action: action, kb_operation: operation } = row.event;
337
+ if (action === "kb_usage" &&
338
+ LOOKUP_BEFORE_EDIT_OPERATIONS.some((candidate) => candidate === operation)) {
339
+ lookedUp.add(session);
340
+ continue;
341
+ }
342
+ if (action !== "edited" ||
343
+ edited.has(session) ||
344
+ !Array.isArray(row.event.requirement_ids) ||
345
+ row.event.requirement_ids.length === 0) {
346
+ continue;
347
+ }
348
+ edited.add(session);
349
+ if (row.operationsBefore < recentStart)
350
+ continue;
351
+ firstEdits.push({ session, edit: row, lookedUp: lookedUp.has(session) });
352
+ }
353
+ return firstEdits;
354
+ }
355
+ function lookupBeforeFirstEditMetric(hookRows, recentStart, policy) {
356
+ const firstEdits = firstLinkedEdits(hookRows, recentStart);
357
+ const attempts = firstEdits.length;
358
+ const guided = firstEdits.filter((entry) => entry.lookedUp).length;
359
+ const unguidedEditPaths = new Set(firstEdits
360
+ .filter((entry) => !entry.lookedUp)
361
+ .map((entry) => entry.edit.event.path ?? "unknown path"));
362
+ const actual = rate(guided, attempts);
363
+ return {
364
+ id: "lookup_before_first_edit",
365
+ status: thresholdStatus(actual, ">=", policy.lookupBeforeFirstEditMinimum),
366
+ numerator: guided,
367
+ denominator: attempts,
368
+ ...(actual !== undefined ? { rate: actual } : {}),
369
+ threshold: {
370
+ operator: ">=",
371
+ value: policy.lookupBeforeFirstEditMinimum,
372
+ },
373
+ message: attempts === 0
374
+ ? "No host hook recorded an edit of a requirement-linked file in the evaluated window."
375
+ : `${guided}/${attempts} sessions ran kb_search or kb_query before their first edit of a requirement-linked file.`,
376
+ evidence: {
377
+ unguidedEditPaths: [...unguidedEditPaths].sort().slice(0, 20),
378
+ lookupOperations: [...LOOKUP_BEFORE_EDIT_OPERATIONS],
379
+ },
380
+ };
381
+ }
264
382
  function sourceLookupMessage(zeroResults, lookups, unobservable) {
265
383
  const unreadable = unobservable > 0
266
384
  ? `${unobservable} source-linked lookups recorded no readable result count.`
@@ -462,7 +580,8 @@ function reportStatus(metrics, fresh) {
462
580
  return "passed";
463
581
  }
464
582
  export function analyzeTelemetryAcceptance(events, now = new Date(), policy = DEFAULT_TELEMETRY_ACCEPTANCE_POLICY) {
465
- const all = events.map((event, index) => ({
583
+ const { operations, hookRows } = partitionTelemetryUsage(events);
584
+ const all = operations.map((event, index) => ({
466
585
  event,
467
586
  index,
468
587
  time: timestampMillis(event.timestamp),
@@ -483,15 +602,16 @@ export function analyzeTelemetryAcceptance(events, now = new Date(), policy = DE
483
602
  telemetryCompletenessMetric(recent, policy),
484
603
  advisorBeforeRequirementWriteMetric(all, recentStart, policy),
485
604
  validationBeforeUpsertMetric(all, recentStart, policy),
605
+ lookupBeforeFirstEditMetric(hookRows, recentStart, policy),
486
606
  sourceLookupMetric(recent, policy),
487
607
  proofGapRecoveryMetric(recent),
488
608
  receiptFreshnessMetric(recent),
489
609
  repeatedMutationFailuresMetric(recent, policy),
490
610
  ];
491
611
  const diagnostics = [];
492
- if (events.length === 0)
612
+ if (operations.length === 0)
493
613
  diagnostics.push("usage_log_empty");
494
- if (lastTime === null && events.length > 0) {
614
+ if (lastTime === null && operations.length > 0) {
495
615
  diagnostics.push("usage_log_timestamps_unavailable");
496
616
  }
497
617
  else if (!fresh) {
@@ -505,9 +625,9 @@ export function analyzeTelemetryAcceptance(events, now = new Date(), policy = DE
505
625
  evaluatedAt: now.toISOString(),
506
626
  policy,
507
627
  scope: {
508
- totalEvents: events.length,
628
+ totalEvents: operations.length,
509
629
  evaluatedEvents: recent.length,
510
- truncated: events.length > recent.length,
630
+ truncated: operations.length > recent.length,
511
631
  firstTimestamp: firstTime === null ? null : new Date(firstTime).toISOString(),
512
632
  lastTimestamp: lastTime === null ? null : new Date(lastTime).toISOString(),
513
633
  evidenceAgeSeconds: ageSeconds,
@@ -528,13 +648,19 @@ const METRIC_DIAGNOSTICS = {
528
648
  id: "semantic_advisor_bypassed",
529
649
  severity: "warning",
530
650
  rank: 30,
531
- suggestion: "Run kb_semantic_advisor on the complete current requirement prose before its next upsert, preserve the returned source hash, and recheck telemetry.",
651
+ suggestion: "Run kb_model with mode analyze (CLI: semantic-advisor) on the complete current requirement prose before its next upsert, preserve the returned source hash, and recheck telemetry.",
532
652
  },
533
653
  validation_before_upsert: {
534
654
  id: "mutation_validation_bypassed",
535
655
  severity: "warning",
536
656
  rank: 20,
537
- suggestion: "Run kb_validate_upsert for the exact payload no more than one hour before each sequential kb_upsert attempt.",
657
+ suggestion: "Run kb_upsert with dryRun true (CLI: validate-upsert) for the exact payload no more than one hour before each sequential kb_upsert attempt.",
658
+ },
659
+ lookup_before_first_edit: {
660
+ id: "lookup_before_first_edit_bypassed",
661
+ severity: "warning",
662
+ rank: 35,
663
+ suggestion: "Before a session's first edit of a requirement-linked file, run kb_search for the change (or kb_query with sourceFile for the file) and read the requirements it names; host hook rows in diagnostic mode record the order.",
538
664
  },
539
665
  source_lookup_zero_result_rate: {
540
666
  id: "source_lookup_zero_result_rate_high",
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry-remediation.d.ts","sourceRoot":"","sources":["../../src/public/telemetry-remediation.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAEzB,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,6BAA6B,EACxC,+BAAwC,CAAC;AAE3C,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;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B"}
@@ -1,10 +1,11 @@
1
1
  import { diagnosticMutationFingerprint } from "./diagnostic-usage.js";
2
- import { DEFAULT_TELEMETRY_ACCEPTANCE_POLICY, analyzeTelemetryAcceptance, } from "./telemetry-acceptance.js";
2
+ import { DEFAULT_TELEMETRY_ACCEPTANCE_POLICY, analyzeTelemetryAcceptance, firstLinkedEdits, partitionTelemetryUsage, } from "./telemetry-acceptance.js";
3
3
  export const TELEMETRY_REMEDIATION_VERSION = "kibi.telemetry-remediation.v1";
4
4
  const RANKS = {
5
5
  repeated_mutation_failures: 10,
6
6
  validation_before_upsert: 20,
7
7
  advisor_before_requirement_write: 30,
8
+ lookup_before_first_edit: 35,
8
9
  e2e_receipt_freshness: 40,
9
10
  proof_gap_recovery: 50,
10
11
  source_lookup_zero_result_rate: 60,
@@ -66,7 +67,7 @@ function target(event) {
66
67
  }
67
68
  function reference(entry) {
68
69
  return {
69
- logLine: entry.index + 1,
70
+ logLine: entry.logLine,
70
71
  requestId: entry.event.request_id ?? null,
71
72
  timestamp: entry.event.timestamp ?? null,
72
73
  tool: entry.event.tool ?? null,
@@ -76,7 +77,7 @@ function reference(entry) {
76
77
  }
77
78
  function eventItem(metric, entry, itemTarget, reason, action) {
78
79
  return {
79
- id: `${metric}:line-${entry.index + 1}:${itemTarget}`,
80
+ id: `${metric}:line-${entry.logLine}:${itemTarget}`,
80
81
  rank: RANKS[metric],
81
82
  metric,
82
83
  scope: "event",
@@ -104,13 +105,16 @@ function isActionable(acceptance, metric) {
104
105
  }
105
106
  export function buildTelemetryRemediationReport(events, now = new Date(), policy = DEFAULT_TELEMETRY_ACCEPTANCE_POLICY) {
106
107
  const acceptance = analyzeTelemetryAcceptance(events, now, policy);
107
- const all = events.map((event, index) => ({
108
+ const { operations, operationLines, hookRows } = partitionTelemetryUsage(events);
109
+ const timeOf = (event) => event.timestamp === undefined ||
110
+ !Number.isFinite(Date.parse(event.timestamp))
111
+ ? null
112
+ : Date.parse(event.timestamp);
113
+ const all = operations.map((event, index) => ({
108
114
  event,
109
115
  index,
110
- time: event.timestamp === undefined ||
111
- !Number.isFinite(Date.parse(event.timestamp))
112
- ? null
113
- : Date.parse(event.timestamp),
116
+ logLine: operationLines[index] ?? index + 1,
117
+ time: timeOf(event),
114
118
  }));
115
119
  const recentStart = Math.max(0, all.length - policy.eventLimit);
116
120
  const recent = all.slice(recentStart);
@@ -142,7 +146,7 @@ export function buildTelemetryRemediationReport(events, now = new Date(), policy
142
146
  const match = (preflights.get(fingerprint(entry.event)) ?? []).findLast((candidate) => compatible(candidate.event, entry.event) &&
143
147
  withinAge(candidate.time, entry.time, policy.preflightMaxAgeSeconds));
144
148
  if (match === undefined) {
145
- items.push(eventItem("validation_before_upsert", entry, target(entry.event), "No recent successful preflight matches this exact payload and correlation context.", "Run kb_validate_upsert for this exact payload in the same session/actor context before retrying once."));
149
+ items.push(eventItem("validation_before_upsert", entry, target(entry.event), "No recent successful preflight matches this exact payload and correlation context.", "Run kb_upsert with dryRun true (CLI: validate-upsert) for this exact payload in the same session/actor context before retrying once."));
146
150
  }
147
151
  }
148
152
  }
@@ -176,10 +180,22 @@ export function buildTelemetryRemediationReport(events, now = new Date(), policy
176
180
  entry.event.semantic_source_hash) &&
177
181
  withinAge(candidate.time, entry.time, policy.advisorMaxAgeSeconds));
178
182
  if (match === undefined) {
179
- items.push(eventItem("advisor_before_requirement_write", entry, requirementId, "No recent semantic-advisor event matches this requirement, source hash, and correlation context.", "Run kb_semantic_advisor on the complete prose in the same session/actor context before the next upsert."));
183
+ items.push(eventItem("advisor_before_requirement_write", entry, requirementId, "No recent semantic-advisor event matches this requirement, source hash, and correlation context.", "Run kb_model with mode analyze (CLI: semantic-advisor) on the complete prose in the same session/actor context before the next upsert."));
180
184
  }
181
185
  }
182
186
  }
187
+ if (isActionable(acceptance, "lookup_before_first_edit")) {
188
+ for (const { edit, lookedUp } of firstLinkedEdits(hookRows, recentStart)) {
189
+ if (lookedUp)
190
+ continue;
191
+ items.push(eventItem("lookup_before_first_edit", {
192
+ event: edit.event,
193
+ index: edit.operationsBefore,
194
+ logLine: edit.logLine,
195
+ time: timeOf(edit.event),
196
+ }, edit.event.path ?? "unknown path", "This session edited a requirement-linked file before any kb_search or kb_query.", "Before the next edit of this file, run kb_search for the change or kb_query with this sourceFile, and read the requirements it names."));
197
+ }
198
+ }
183
199
  if (isActionable(acceptance, "source_lookup_zero_result_rate")) {
184
200
  for (const entry of recent) {
185
201
  const sourceFile = args(entry.event).sourceFile;
@@ -30,6 +30,11 @@ export declare function computeShardPath(kbRoot: string, entityId: string): stri
30
30
  * Throws on parse errors.
31
31
  */
32
32
  export declare function readShard(shardPath: string): RelationshipRecord[];
33
+ /**
34
+ * Parses relationship shard text read from `shardPath`.
35
+ * Returns an empty array for blank text. Throws on parse errors.
36
+ */
37
+ export declare function parseShardText(content: string, shardPath: string): RelationshipRecord[];
33
38
  /**
34
39
  * Writes a relationship shard file.
35
40
  * Creates parent directories if needed.
@@ -65,6 +70,14 @@ export declare function appendRelationship(kbRoot: string, relationship: Omit<Re
65
70
  shardPath: string;
66
71
  recordId: string;
67
72
  };
73
+ /**
74
+ * The shard text appendRelationship would publish for `relationship`, without
75
+ * writing it: `existing` is the current shard text, or null when the shard
76
+ * file does not exist. Returns null when the shard already records the
77
+ * relationship. Callers that must journal exact after-bytes before any write
78
+ * (atomic plan application) render a shard through this function.
79
+ */
80
+ export declare function renderShardWithRelationship(shardPath: string, existing: string | null, relationship: Omit<RelationshipRecord, "id">): string | null;
68
81
  /**
69
82
  * Lists all shard files in the relationships directory.
70
83
  */
@@ -1 +1 @@
1
- {"version":3,"file":"shards.d.ts","sourceRoot":"","sources":["../../src/relationships/shards.ts"],"names":[],"mappings":"AAwBA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,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