kibi-cli 2.31.0 → 2.32.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 (226) hide show
  1. package/dist/cli-register-proof.d.ts.map +1 -1
  2. package/dist/cli-register-proof.js +19 -7
  3. package/dist/cli-register-reporting.d.ts.map +1 -1
  4. package/dist/cli-register-reporting.js +2 -0
  5. package/dist/commands/check.d.ts +1 -0
  6. package/dist/commands/check.d.ts.map +1 -1
  7. package/dist/commands/check.js +14 -5
  8. package/dist/commands/discovery-table.d.ts.map +1 -1
  9. package/dist/commands/discovery-table.js +51 -4
  10. package/dist/commands/doctor.js +19 -4
  11. package/dist/commands/migrate.d.ts.map +1 -1
  12. package/dist/commands/migrate.js +89 -3
  13. package/dist/commands/prove.d.ts +48 -1
  14. package/dist/commands/prove.d.ts.map +1 -1
  15. package/dist/commands/prove.js +293 -8
  16. package/dist/commands/report.d.ts +1 -0
  17. package/dist/commands/report.d.ts.map +1 -1
  18. package/dist/commands/report.js +70 -5
  19. package/dist/commands/signoff.d.ts.map +1 -1
  20. package/dist/commands/signoff.js +21 -2
  21. package/dist/commands/sync/manifest.d.ts.map +1 -1
  22. package/dist/commands/sync/manifest.js +20 -4
  23. package/dist/commands/sync/persistence.d.ts.map +1 -1
  24. package/dist/commands/sync/persistence.js +16 -5
  25. package/dist/diagnostics.js +1 -1
  26. package/dist/engine.js +1 -1
  27. package/dist/extractors/markdown.d.ts +3 -1
  28. package/dist/extractors/markdown.d.ts.map +1 -1
  29. package/dist/extractors/markdown.js +17 -0
  30. package/dist/operations/bootstrap/candidate-helpers.d.ts +3 -0
  31. package/dist/operations/bootstrap/candidate-helpers.d.ts.map +1 -1
  32. package/dist/operations/bootstrap/candidate-helpers.js +4 -0
  33. package/dist/operations/migration/evidence-floor.d.ts +41 -0
  34. package/dist/operations/migration/evidence-floor.d.ts.map +1 -0
  35. package/dist/operations/migration/evidence-floor.js +230 -0
  36. package/dist/operations/migration/proof-contract-claims.d.ts +59 -0
  37. package/dist/operations/migration/proof-contract-claims.d.ts.map +1 -0
  38. package/dist/operations/migration/proof-contract-claims.js +182 -0
  39. package/dist/operations/migration/schema6.d.ts +6 -0
  40. package/dist/operations/migration/schema6.d.ts.map +1 -1
  41. package/dist/operations/migration/schema6.js +94 -0
  42. package/dist/operations/mutation/omitted-properties.d.ts +11 -0
  43. package/dist/operations/mutation/omitted-properties.d.ts.map +1 -0
  44. package/dist/operations/mutation/omitted-properties.js +76 -0
  45. package/dist/operations/mutation/serialization.d.ts.map +1 -1
  46. package/dist/operations/mutation/serialization.js +1 -0
  47. package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
  48. package/dist/operations/mutation/strict-fact.js +6 -2
  49. package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
  50. package/dist/operations/mutation/symbol-granularity.js +5 -3
  51. package/dist/operations/mutation/upsert.d.ts.map +1 -1
  52. package/dist/operations/mutation/upsert.js +7 -1
  53. package/dist/operations/mutation/validation.d.ts +2 -0
  54. package/dist/operations/mutation/validation.d.ts.map +1 -1
  55. package/dist/operations/mutation/validation.js +4 -0
  56. package/dist/operations/proof/claim-bindings.d.ts +23 -0
  57. package/dist/operations/proof/claim-bindings.d.ts.map +1 -0
  58. package/dist/operations/proof/claim-bindings.js +211 -0
  59. package/dist/operations/proof/code-certificates.d.ts +135 -0
  60. package/dist/operations/proof/code-certificates.d.ts.map +1 -0
  61. package/dist/operations/proof/code-certificates.js +785 -0
  62. package/dist/operations/proof/code-scope.d.ts +11 -1
  63. package/dist/operations/proof/code-scope.d.ts.map +1 -1
  64. package/dist/operations/proof/code-scope.js +20 -2
  65. package/dist/operations/proof/compact-receipts.d.ts.map +1 -1
  66. package/dist/operations/proof/compact-receipts.js +4 -3
  67. package/dist/operations/proof/explain.d.ts +32 -0
  68. package/dist/operations/proof/explain.d.ts.map +1 -1
  69. package/dist/operations/proof/explain.js +91 -0
  70. package/dist/operations/proof/ingest-proof.d.ts +9 -1
  71. package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
  72. package/dist/operations/proof/ingest-proof.js +41 -2
  73. package/dist/operations/proof/receipt-compaction.d.ts +2 -0
  74. package/dist/operations/proof/receipt-compaction.d.ts.map +1 -1
  75. package/dist/operations/proof/receipt-compaction.js +6 -2
  76. package/dist/operations/semantic-advisor/shared.d.ts.map +1 -1
  77. package/dist/operations/semantic-advisor/shared.js +4 -0
  78. package/dist/operations/semantic-advisor/strict-rules.js +3 -3
  79. package/dist/operations/semantic-advisor/types.d.ts +2 -1
  80. package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
  81. package/dist/plugins/approved-source-analyzers.generated.d.ts +6 -6
  82. package/dist/plugins/approved-source-analyzers.generated.js +6 -6
  83. package/dist/proof/command-test-report.d.ts +4 -3
  84. package/dist/proof/command-test-report.d.ts.map +1 -1
  85. package/dist/proof/command-test-report.js +4 -10
  86. package/dist/proof/evaluate.d.ts.map +1 -1
  87. package/dist/proof/evaluate.js +18 -2
  88. package/dist/proof/inspect.d.ts.map +1 -1
  89. package/dist/proof/inspect.js +58 -0
  90. package/dist/proof/producers/playwright-reporter.d.ts +3 -0
  91. package/dist/proof/producers/playwright-reporter.d.ts.map +1 -1
  92. package/dist/proof/producers/playwright-reporter.js +25 -2
  93. package/dist/proof/step-runner.d.ts +36 -0
  94. package/dist/proof/step-runner.d.ts.map +1 -0
  95. package/dist/proof/step-runner.js +234 -0
  96. package/dist/public/evidence-levels.d.ts +12 -0
  97. package/dist/public/evidence-levels.d.ts.map +1 -0
  98. package/dist/public/evidence-levels.js +19 -0
  99. package/dist/public/impact/coverage-depth-quality.d.ts +7 -0
  100. package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
  101. package/dist/public/impact/coverage-depth-quality.js +59 -0
  102. package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
  103. package/dist/public/impact/full-kb-quality.js +3 -1
  104. package/dist/public/operations/catalog.d.ts +167 -6
  105. package/dist/public/operations/catalog.d.ts.map +1 -1
  106. package/dist/public/operations/check-executor.d.ts +2 -0
  107. package/dist/public/operations/check-executor.d.ts.map +1 -1
  108. package/dist/public/operations/check-executor.js +6 -0
  109. package/dist/public/operations/evidence-floor.d.ts +48 -0
  110. package/dist/public/operations/evidence-floor.d.ts.map +1 -0
  111. package/dist/public/operations/evidence-floor.js +143 -0
  112. package/dist/public/operations/migration-plan.d.ts +19 -5
  113. package/dist/public/operations/migration-plan.d.ts.map +1 -1
  114. package/dist/public/operations/migration-plan.js +22 -5
  115. package/dist/public/operations/node-ports.d.ts.map +1 -1
  116. package/dist/public/operations/node-ports.js +4 -1
  117. package/dist/public/operations/proof-contract-claims.d.ts +26 -0
  118. package/dist/public/operations/proof-contract-claims.d.ts.map +1 -0
  119. package/dist/public/operations/proof-contract-claims.js +71 -0
  120. package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
  121. package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
  122. package/dist/public/operations/specs/check-rules.generated.js +3 -1
  123. package/dist/public/operations/specs/check.d.ts +1 -1
  124. package/dist/public/operations/specs/mutation-schemas.d.ts +157 -5
  125. package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
  126. package/dist/public/operations/specs/mutation-schemas.js +15 -2
  127. package/dist/public/operations/specs/proof.d.ts +9 -0
  128. package/dist/public/operations/specs/proof.d.ts.map +1 -1
  129. package/dist/public/operations/specs/reporting.d.ts.map +1 -1
  130. package/dist/public/operations/specs/reporting.js +19 -10
  131. package/dist/public/operations/specs/upsert.d.ts +157 -5
  132. package/dist/public/operations/specs/upsert.d.ts.map +1 -1
  133. package/dist/public/proof-certificates.d.ts +89 -0
  134. package/dist/public/proof-certificates.d.ts.map +1 -0
  135. package/dist/public/proof-certificates.js +207 -0
  136. package/dist/public/proof-protocol.d.ts +126 -3
  137. package/dist/public/proof-protocol.d.ts.map +1 -1
  138. package/dist/public/proof-protocol.js +239 -3
  139. package/dist/public/proof-receipt.d.ts +89 -6
  140. package/dist/public/proof-receipt.d.ts.map +1 -1
  141. package/dist/public/proof-receipt.js +83 -7
  142. package/dist/public/schemas/entity.d.ts.map +1 -1
  143. package/dist/public/schemas/entity.js +18 -1
  144. package/dist/public/skills/kibi-bootstrap/SKILL.md +2 -2
  145. package/dist/public/skills/kibi-commit-review/SKILL.md +4 -3
  146. package/dist/public/skills/kibi-commit-review/resources/staged-gate.md +6 -1
  147. package/dist/public/skills/kibi-decisions/SKILL.md +10 -2
  148. package/dist/public/skills/kibi-decisions/resources/decision-records.md +6 -1
  149. package/dist/public/skills/kibi-decisions/resources/signoff-views.md +3 -2
  150. package/dist/public/skills/kibi-freshness/SKILL.md +5 -1
  151. package/dist/public/skills/kibi-traceability/SKILL.md +11 -1
  152. package/dist/public/skills/kibi-usage/SKILL.md +6 -4
  153. package/dist/public/skills/kibi-usage/resources/proof.md +124 -19
  154. package/dist/public/skills/kibi-usage/resources/workflows.md +4 -4
  155. package/dist/report/html-report.css +38 -1
  156. package/dist/report/html-report.d.ts +8 -0
  157. package/dist/report/html-report.d.ts.map +1 -1
  158. package/dist/report/html-report.js +141 -6
  159. package/dist/report/report-view.d.ts +1 -1
  160. package/dist/report/report-view.d.ts.map +1 -1
  161. package/dist/report/report-view.js +7 -0
  162. package/dist/schemas/entity.schema.json +212 -4
  163. package/dist/search-answer.d.ts.map +1 -1
  164. package/dist/search-answer.js +1 -0
  165. package/dist/signoff/html.d.ts.map +1 -1
  166. package/dist/signoff/html.js +3 -0
  167. package/dist/signoff/markdown.d.ts.map +1 -1
  168. package/dist/signoff/markdown.js +3 -0
  169. package/dist/signoff/model.d.ts +20 -0
  170. package/dist/signoff/model.d.ts.map +1 -1
  171. package/dist/signoff/model.js +20 -1
  172. package/dist/traceability/impact-knowledge.d.ts.map +1 -1
  173. package/dist/traceability/impact-knowledge.js +1 -0
  174. package/dist/traceability/temp-kb.d.ts.map +1 -1
  175. package/dist/traceability/temp-kb.js +1 -0
  176. package/dist/types/entities.d.ts +4 -1
  177. package/dist/types/entities.d.ts.map +1 -1
  178. package/dist/utils/merge-driver-setup.d.ts +8 -1
  179. package/dist/utils/merge-driver-setup.d.ts.map +1 -1
  180. package/dist/utils/merge-driver-setup.js +23 -2
  181. package/dist/utils/rule-registry.generated.d.ts +10 -0
  182. package/dist/utils/rule-registry.generated.d.ts.map +1 -1
  183. package/dist/utils/rule-registry.generated.js +12 -0
  184. package/dist/utils/schema-version.d.ts +1 -1
  185. package/dist/utils/schema-version.d.ts.map +1 -1
  186. package/dist/utils/schema-version.js +5 -1
  187. package/package.json +6 -2
  188. package/schema/entities.pl +6 -0
  189. package/schema/validation.pl +4 -1
  190. package/src/public/evidence-levels.ts +23 -0
  191. package/src/public/impact/coverage-depth-quality.ts +73 -0
  192. package/src/public/impact/full-kb-quality.ts +6 -1
  193. package/src/public/operations/check-executor.ts +13 -0
  194. package/src/public/operations/evidence-floor.ts +203 -0
  195. package/src/public/operations/migration-plan.ts +39 -6
  196. package/src/public/operations/node-ports.ts +3 -1
  197. package/src/public/operations/proof-contract-claims.ts +103 -0
  198. package/src/public/operations/specs/check-rules.generated.ts +3 -1
  199. package/src/public/operations/specs/mutation-schemas.ts +17 -2
  200. package/src/public/operations/specs/reporting.ts +20 -10
  201. package/src/public/proof-certificates.ts +271 -0
  202. package/src/public/proof-protocol-types.d.ts +17 -1
  203. package/src/public/proof-protocol.ts +318 -3
  204. package/src/public/proof-receipt.ts +127 -7
  205. package/src/public/schemas/entity.ts +19 -1
  206. package/src/public/skills/kibi-bootstrap/SKILL.md +2 -2
  207. package/src/public/skills/kibi-commit-review/SKILL.md +4 -3
  208. package/src/public/skills/kibi-commit-review/resources/staged-gate.md +6 -1
  209. package/src/public/skills/kibi-decisions/SKILL.md +10 -2
  210. package/src/public/skills/kibi-decisions/resources/decision-records.md +6 -1
  211. package/src/public/skills/kibi-decisions/resources/signoff-views.md +3 -2
  212. package/src/public/skills/kibi-freshness/SKILL.md +5 -1
  213. package/src/public/skills/kibi-traceability/SKILL.md +11 -1
  214. package/src/public/skills/kibi-usage/SKILL.md +6 -4
  215. package/src/public/skills/kibi-usage/resources/proof.md +124 -19
  216. package/src/public/skills/kibi-usage/resources/workflows.md +4 -4
  217. package/src/schemas/entity.schema.json +212 -4
  218. package/dist/commands/proof-impact.d.ts +0 -7
  219. package/dist/commands/proof-impact.d.ts.map +0 -1
  220. package/dist/commands/proof-impact.js +0 -39
  221. package/dist/operations/proof/baseline-diff.d.ts +0 -41
  222. package/dist/operations/proof/baseline-diff.d.ts.map +0 -1
  223. package/dist/operations/proof/baseline-diff.js +0 -153
  224. package/dist/operations/proof/impact.d.ts +0 -51
  225. package/dist/operations/proof/impact.d.ts.map +0 -1
  226. package/dist/operations/proof/impact.js +0 -138
@@ -30,11 +30,16 @@ symbols_manifest_stale: .kb/symbol-coordinates.yaml is stale or missing for stag
30
30
  | `symbol-coverage` | A changed symbol, or a symbol whose staged manifest entry changed, fails the full-check rule on the staged knowledge. | The symbol `implements` the requirement and is `covered_by` a test that verifies it: through the requirement's scenario (`verified_by` scenario -> test) when it has one, else `verified_by` requirement -> test. A direct requirement -> test link does not count while a scenario exists. The finding's suggestion names the missing link (see `kibi-traceability`). |
31
31
  | `kibi_impact_override_missing_rationale` | A `Kibi-Impact: none` declaration has no `Rationale:` line. | Add the rationale, or drop the declaration and stage real evidence. |
32
32
  | `entity-context-missing` (staged entity) | A staged requirement, scenario, test, ADR or observation fact has fewer than 12 words of context. | Upsert a sectioned `document.body` (see `kibi-usage`, Entity body contract). |
33
- | `domain-contradictions`, `scenario-feasibility`, `exception-claim-keys` (staged `.kb/` change) | The staged knowledge introduces a violation the last commit did not have. | Fix the knowledge; a contradiction with a recorded rule goes to the person (`kibi-decisions`). |
33
+ | `domain-contradictions`, `kb-consistency`, `scenario-feasibility`, `exception-claim-keys` (staged `.kb/` change) | The staged knowledge introduces a violation the last commit did not have. `kb-consistency` also catches facts that contradict only together and names their requirements. | Fix the knowledge; a contradiction with a recorded rule goes to the person (`kibi-decisions`). |
34
34
  | Proposition-complete ingestion | A staged requirement's semantic inventory is missing or no longer matches its prose. | Re-derive it (`kb_model` analyze with the complete prose) or run `kibi migrate` for drift. |
35
35
  | `kibi check-generated --staged` drift | The staged `.kb/symbols.yaml` or `.kb/symbol-coordinates.yaml` differs from a refresh computed from the index. | `kibi sync --refresh-symbol-coordinates`, review the diff, stage only the intended hunks (`git add -p`). |
36
36
  | `Staged impact review failed: impact_review_invalid: ...` | The base commit has `.kibi/impact-policy.json` and the staged `.kibi/impact-review.json` is missing, stale or incomplete. The message names the cause (missing review path, stale fingerprint, ...). | Prepare a fresh record (below). Any later staged change makes the fingerprints stale again, so prepare it last. |
37
37
 
38
+ The staged gate does not judge evidence levels: the `evidence-floor` rule
39
+ runs only in a full `kibi check`. A firm requirement staged without an
40
+ end-to-end proof passes the commit and fails that check later (see
41
+ `kibi-decisions` for `required_evidence`).
42
+
38
43
  ## Advisory findings
39
44
 
40
45
  These warn but do not block. Read them; they are often the real review.
@@ -2,7 +2,7 @@
2
2
  id: kibi-decisions
3
3
  name: kibi-decisions
4
4
  description: "Use when the person states a rule or decision (must, never, always, from now on, we decided), when a Kibi hook asks to confirm or warns about an edit to code that implements a firm requirement, when the Stop hook says source files changed but nothing was recorded, when kb_check quotes requirement_statement_unverified, or when a request conflicts with a recorded requirement or ADR. Covers reading firmness and origin, recording a person's rule as firm with origin.ref, superseding with a Why this changed section, the kb_compile_intent unresolved/reviewCandidates/conflictReviews loop, asking before overriding a firm rule, and putting decisions to the person as one numbered kibi signoff --questions view."
5
- version: 1.2.0
5
+ version: 1.3.0
6
6
  kibiCompatibility: ">=1.0.0"
7
7
  tags:
8
8
  - kibi
@@ -74,6 +74,13 @@ name the missing capability. Never read or edit `.kb/` files directly.
74
74
  quoting their words and where they said them, a sectioned `document.body`,
75
75
  a scenario, and an `implements` link from the code that enforces it. Use
76
76
  `kb_compile_intent` first when the rule may touch several requirements.
77
+ A firm rule needs `tested` evidence by default, so `kb_check`'s
78
+ `evidence-floor` rule fails on it until an end-to-end test proves its
79
+ scenario. When the change includes that test, give it a proof contract and
80
+ run `kibi prove`. Otherwise set `required_evidence: asserted`, say in the
81
+ body that no end-to-end test proves the rule yet, and report it as
82
+ asserted, not tested. Kibi's bootstrap and migration give an untested firm
83
+ rule the same floor.
77
84
  - **The person changes a rule:** supersede it (new requirement linked
78
85
  `supersedes` new -> old, `firmness: firm` when the old one was firm, a
79
86
  `## Why this changed` section of at least 12 words naming their instruction
@@ -124,7 +131,8 @@ Validation is not completion. When a request conflicts with a recorded rule and
124
131
 
125
132
  End with `kb_check` (and `kb_status` when freshness matters) and say:
126
133
 
127
- - which rules you followed, asked about, recorded or changed (ids, firmness);
134
+ - which rules you followed, asked about, recorded or changed (ids, firmness,
135
+ evidence level);
128
136
  - under "Decisions I changed", each supersede and its evidence;
129
137
  - the open question, if a conflict is waiting on the person;
130
138
  - or, when the session made no decision, one line saying so.
@@ -43,7 +43,7 @@ says it, link to it instead of restating it. Otherwise write the scenario
43
43
  first, then the requirement (the requirement's write sends `specified_by`):
44
44
 
45
45
  ```json
46
- {"type":"req","id":"REQ-billing-refund-approval","properties":{"title":"Refunds above 500 EUR need a finance approval","status":"open","priority":"must","firmness":"firm","origin":{"kind":"agent","ref":"session request: \"from now on refunds above 500 EUR must be approved by finance\""}},"relationships":[{"type":"specified_by","from":"REQ-billing-refund-approval","to":"SCEN-billing-refund-approval"}],"document":{"body":"Refunds above 500 EUR need a finance approval.\n\n## Context\n\nThe person asked for this rule while changing the refund flow; reason not stated.\n\n## Source\n\n> from now on refunds above 500 EUR must be approved by finance\n\nSession request."}}
46
+ {"type":"req","id":"REQ-billing-refund-approval","properties":{"title":"Refunds above 500 EUR need a finance approval","status":"open","priority":"must","firmness":"firm","required_evidence":"asserted","origin":{"kind":"agent","ref":"session request: \"from now on refunds above 500 EUR must be approved by finance\""}},"relationships":[{"type":"specified_by","from":"REQ-billing-refund-approval","to":"SCEN-billing-refund-approval"}],"document":{"body":"Refunds above 500 EUR need a finance approval.\n\n## Context\n\nThe person asked for this rule while changing the refund flow; reason not stated. No end-to-end test proves it yet.\n\n## Source\n\n> from now on refunds above 500 EUR must be approved by finance\n\nSession request."}}
47
47
  ```
48
48
 
49
49
  Then link the enforcing symbol with `implements` (and its test with
@@ -58,6 +58,11 @@ validation, not the write.
58
58
  `origin.approved_by` to the person.
59
59
  - A rule from a document, test or ticket a person wrote is `firm` too, with
60
60
  `origin.ref` to that source.
61
+ - `required_evidence: asserted` keeps an untested firm rule from failing
62
+ the `evidence-floor` check while it is recorded. Drop it (the floor goes
63
+ back to `tested`) once an end-to-end test with a proof contract and a
64
+ passing `kibi prove` receipt covers the rule's scenario; never set it below
65
+ `asserted` on a firm rule.
61
66
  - Your own choice is `default`; a guess is `exploratory`. Write the value
62
67
  explicitly whenever you record a decision.
63
68
  - For strict modeling (claim keys, predicate facts) follow `kibi-usage`,
@@ -13,7 +13,8 @@ statements and lists that render in any chat or messaging surface. Put it in
13
13
  your reply unchanged: never wrap it in a code block, summarize it or retell a
14
14
  requirement in your own words. Every run also writes
15
15
  `.kb/briefs/signoff/latest.json`, `latest.md` and `latest.html` (git-ignored);
16
- `latest.html` is a self-contained page with the full view.
16
+ `latest.html` is a self-contained page with the full view, meant to be opened
17
+ in a browser or published as a page, not attached as a file.
17
18
 
18
19
  ## Showing it on your host
19
20
 
@@ -21,7 +22,7 @@ requirement in your own words. Every run also writes
21
22
  | --- | --- |
22
23
  | Claude Code, Codex, Cursor, ZCode, VS Code chat | Paste the default output; `/kibi-signoff` (Claude Code, Cursor, ZCode) runs it. Offer `kibi signoff --format html --open` for the page |
23
24
  | OpenCode terminal | `kibi signoff --format md` and paste the fenced block unchanged: kibi-opencode draws it as a card, and `/kibi-signoff` reopens it |
24
- | Replies sent through a messaging tool (cloud or project threads, chat bots) | Pass the default output as the message text, and attach or publish `.kb/briefs/signoff/latest.html` next to it when the tool can carry a file or a page |
25
+ | Replies sent through a messaging tool (cloud or project threads, chat bots) | Pass the default output as the message text. Share `latest.html` only as a rendered page: in Claude apps (claude.ai, the mobile and desktop apps, Claude Code on the web) publish it with the Artifact tool and give its link. Never attach the `.html` as a file: the Claude apps, Slack and most chat apps show it as raw source or a download. With no page tool, the message text is the whole view |
25
26
  | VS Code or Cursor with the kibi-vscode extension | The **Kibi: Show Requirements Signoff** panel follows every run |
26
27
  | Remote machine, no browser | Give the person the path of `latest.html` |
27
28
 
@@ -2,7 +2,7 @@
2
2
  id: kibi-freshness
3
3
  name: kibi-freshness
4
4
  description: Check exact Git attachment, branch migration/quarantine, compiled-store freshness, source linkage, and repair state before decisions or writes.
5
- version: 2.1.0
5
+ version: 2.2.0
6
6
  kibiCompatibility: ">=1.0.0"
7
7
  tags:
8
8
  - kibi
@@ -66,6 +66,10 @@ For every freshness, branch, or completion question, call `kb_status` first, the
66
66
  evidence-dependent closeout. Name the exact paths/symbol IDs and whether the
67
67
  result is fixed, accepted, or deferred.
68
68
  - If entities look stale, refresh context through an approved Kibi capability and then re-query.
69
+ - When asked whether a requirement is proven, quote its `evidenceLevel` and
70
+ `evidenceFloor` from `kb_coverage`. `pending_reproof` (receipts older than
71
+ the code) is stale evidence, not proof; `kibi prove` refreshes it, and
72
+ `kibi check --fresh-evidence` is the check that fails on it.
69
73
  - Preserve source-file traceability by carrying `sourceFile`, text references, and validation evidence through discovery, mutation, and completion.
70
74
  - Do not read or edit files inside `.kb` directly; use the selected Kibi interface instead.
71
75
  - Kibi authors tracked files but never Git-stages or commits them; ordinary Git workflows remain responsible for review and commit.
@@ -2,7 +2,7 @@
2
2
  id: kibi-traceability
3
3
  name: kibi-traceability
4
4
  description: Maintain source-first requirement, scenario, test, symbol, and proof traceability through Kibi's peer interfaces.
5
- version: 2.0.0
5
+ version: 2.2.0
6
6
  kibiCompatibility: ">=1.0.0"
7
7
  tags:
8
8
  - kibi
@@ -64,3 +64,13 @@ stale snapshots, unavailable receipts, and incomplete grounding explicit.
64
64
  Fresh proof requires a current verification snapshot, the exact contracted E2E
65
65
  command, an append-only receipt, and current symbol coordinates. Structural
66
66
  coverage and a green check are not proof by themselves.
67
+
68
+ Report each requirement's `evidenceLevel` from `kb_coverage` as it is:
69
+ `proved` only when certificate proofs (exhaustive, typecheck, arithmetic,
70
+ smt) derive every applicable claim, named in each contract's `proves`
71
+ (`claimSummary` and `unprovedClaims` say which are missing), `tested` for fresh passing E2E receipts,
72
+ `asserted` when only a person stands behind it, `unverified` otherwise. Its
73
+ `evidenceFloor` says what `kb_check`'s `evidence-floor` rule requires:
74
+ `below` is a traceability gap to close with links, tests and `kibi prove`;
75
+ `pending_reproof` means the receipts are older than the code and need
76
+ `kibi prove`. Never lower `required_evidence` to clear either.
@@ -2,7 +2,7 @@
2
2
  id: kibi-usage
3
3
  name: Kibi Usage
4
4
  description: Use Kibi's source-first, exact-Git, migration-aware, proof-aware operations safely across MCP or the trusted local CLI, including partial completion repair.
5
- version: 2.24.0
5
+ version: 2.27.0
6
6
  kibiCompatibility: ">=1.0.0"
7
7
  tags:
8
8
  - kibi
@@ -434,9 +434,11 @@ safe normative claims; use `observation` or `meta` for bug/workaround notes and
434
434
  tests, symbol ownership, and fresh proof-bearing receipts before claiming proof.
435
435
  For an existing product KB that needs semantic backfill, read
436
436
  `resources/kb-improvement.md`, and `resources/proof.md` for the proof workflow.
437
- When a proof ratchet fails, follow Debugging proof regressions in
438
- `resources/proof.md`: use `kibi proof explain` and compare current proof state
439
- to committed `proof/baseline.json` with `kibi proof impact`.
437
+ Each current requirement has an evidence floor (`required_evidence`, else
438
+ `tested` when firm); certificate proof kinds (exhaustive, typecheck,
439
+ arithmetic, smt) reach `proved` for the claims their contract names in
440
+ `proves`, and a requirement is proved only when every claim is. When the `evidence-floor` rule fails, follow Debugging
441
+ proof regressions in `resources/proof.md` and use `kibi proof explain`.
440
442
 
441
443
  ## Predicate Ontology Decision Tree
442
444
 
@@ -17,12 +17,18 @@ reports what happened as `kibi.proof-run.v1`; Kibi evaluates proof.
17
17
  ```bash
18
18
  kibi prove --test TEST-<id>
19
19
  # or: kibi prove --requirement REQ-<id> | --integration <id> | --all
20
+ # add --stale to rerun only tests without a current passing receipt
21
+ # add --resume to continue an interrupted run (same selector)
20
22
  ```
21
23
 
24
+ With `--test`, `--requirement` or `--stale`, a direct `playwright test`
25
+ integration runs only the selected tests' `proof_bindings[].source_file`
26
+ specs; wrappers get them as `KIBI_PROOF_SOURCE_FILES`.
27
+
22
28
  `kibi prove` captures the workspace snapshot, runs each integration's
23
29
  producer once (`shell: false`), revalidates the snapshot, evaluates the
24
30
  artifact against every selected contract, and appends idempotent
25
- `kibi.proof-receipt.v1` receipts.
31
+ `kibi.proof-receipt.v2` receipts (v1 receipts stay valid).
26
32
  3. Confirm with `kb_status` (fresh, current snapshot) and `kb_coverage`.
27
33
 
28
34
  Never hand-write receipts. Kibi derives them from validated
@@ -51,6 +57,13 @@ proof_bindings: # optional provenance metadata
51
57
 
52
58
  Provenance lives in `proof_bindings`; the contract stays semantic.
53
59
 
60
+ `success_policy: own_results_first_attempt` judges each obligation by its own
61
+ `native_case` result when the run failed only in execution (other cases
62
+ failed), so one unrelated failing case does not fail every receipt of a
63
+ Playwright suite. Aggregate-run obligations, run-level errors, timeouts,
64
+ interruptions and setup failures still refuse every obligation. Keep
65
+ `all_required_first_attempt` unless the user wants per-case judgement.
66
+
54
67
  - Every `required_proofs[].symbol_id` must name an existing `symbol` entity,
55
68
  or `kb_check` reports `proof-contract-symbols`. Create the symbols first
56
69
  (`kb_upsert`, narrow method-level granularity, never a `type-shape`
@@ -85,7 +98,10 @@ replacing one named integration.
85
98
  `--command` the proposal is the `package.json` `test` script or the
86
99
  detected runner again), or make the run attributable per test: have the
87
100
  command write a `kibi.proof-test-report.v1` to the path in
88
- `KIBI_PROOF_TEST_REPORT` so each test is judged by its own steps.
101
+ `KIBI_PROOF_TEST_REPORT` so each test is judged by its own steps. The
102
+ shipped `kibi proof run-steps` does that from `proof/steps.json`
103
+ (`[{test_id, steps: [[argv...]]}]`); use it as the integration command
104
+ instead of writing a producer script.
89
105
  - `producer: playwright` (or custom) — the child emits `kibi.proof-run.v1`
90
106
  itself (bundled reporter: `kibi-cli/playwright-reporter`).
91
107
  - `producer: junit` / `tap` — Kibi converts the native report at `artifact`
@@ -126,8 +142,11 @@ Every requirement row also carries `evidenceLevel`, the strength of what backs
126
142
  it, and `evidence`, the entries that earned it (each with `kind`, `scope` and
127
143
  `level`):
128
144
 
129
- - `proved`: a re-checkable certificate covers every case. No proof kind issues
130
- certificates yet, so nothing reaches it today.
145
+ - `proved`: the requirement is `tested` and every applicable claim has a
146
+ derived, code-scope binding from a fresh certificate that still re-checks
147
+ (see Certificate proof kinds). The entry has `kind: certificate` and lists
148
+ the tests. `claimSummary` counts claims per level and `unprovedClaims`
149
+ lists the claims below proved.
131
150
  - `tested`: `proofStatus` is `tested`; fresh E2E receipts cover every linked
132
151
  scenario.
133
152
  - `asserted`: a person stands behind the statement (approved, or firm by
@@ -138,6 +157,94 @@ Report the level as it is. Never call an `asserted` or `unverified`
138
157
  requirement proven or tested, and never call `tested` proved. Firmness is a
139
158
  separate axis: it says how sure the person is, not how strong the evidence is.
140
159
 
160
+ ## Certificate proof kinds
161
+
162
+ A contract's `kind` says what its evidence can reach. The runner kinds `e2e`
163
+ (the default), `example` and `property` support `tested`. The certificate
164
+ kinds support `proved`, and only when Kibi re-checks the certificate the test
165
+ left:
166
+
167
+ - `exhaustive`: the test runs a check on every member of a finite domain.
168
+ Set `domain_source: { symbol_id: SYM-<domain> }` to the symbol that defines
169
+ the domain (add `export: <name>` when the export is not named like the
170
+ symbol's title), and import that symbol in the proof file. Kibi loads the
171
+ export itself (bun, the workspace's tsx, or node; for a `.py` domain
172
+ `KIBI_PYTHON`, the active or project `.venv`/`venv`, then `python3`:
173
+ Enum values, dict keys, list/tuple/set items) and rejects a
174
+ certificate that does not cover exactly its members, so a hand-listed or
175
+ partial domain stays `tested`. An import from build output is mapped back
176
+ to its source through `tsconfig.json` `outDir`/`rootDir`.
177
+ - `typecheck`: a witness file that stops compiling when a domain member
178
+ goes unhandled (a switch ending in a `never` assignment, or a
179
+ `satisfies Record<Domain, ...>` map). Set `witness.path` and
180
+ `domain_source`; the witness must import the domain. Kibi compiles the
181
+ witness itself (strict, with the workspace's TypeScript), so `typescript`
182
+ must be installed in the workspace.
183
+ - `arithmetic`: a claim on one `int` or `real` variable decided exactly from
184
+ typed facts. Set `constraint_source: { fact_ids: [FACT-...] }` to the
185
+ numeric `property_value` facts (one subject and property); the
186
+ certificate's variable is their `property_key` and its assumptions are
187
+ exactly their constraints. To read the value from the code instead, set
188
+ `value_source: [{ symbol_id: SYM-<constant>, export: <name> }]`; Kibi
189
+ evaluates the number export itself and adds `variable eq value` as an
190
+ assumption.
191
+ - `smt`: an SMT-LIB query that declares the facts' property as a constant,
192
+ asserts each `constraint_source` fact constraint and then the claim's
193
+ negation. Kibi re-runs z3 or cvc5 on it and accepts only `unsat`.
194
+
195
+ `arithmetic` and `smt` from `constraint_source` alone prove that the
196
+ knowledge base's facts entail the claim, not that code follows the facts:
197
+ their claim bindings have scope `intent` and the claim stays `tested`. Use
198
+ `value_source` (its symbols `covered_by` the test) for scope `code`. A test
199
+ whose numbers are not in typed facts or code constants stays `tested`.
200
+
201
+ Every certificate contract names the claims it proves in `proves:
202
+ [CLAIM-...]` (blocking `proof-contract-claims` from schema 12). Kibi derives
203
+ each claim's obligation from its grounding fact: a set fact (`value_type:
204
+ set`, `value_set: [...]`) needs the `exhaustive` domain or the `typecheck`
205
+ domain type to be exactly the set; a numeric fact needs the `arithmetic`
206
+ claim or the negated `smt` assertion to be its constraint. The receipt
207
+ records one binding per claim: `derived` (checked, the only kind that
208
+ proves), `attested` (the fact has no derivation; counts as tested) or
209
+ `rejected` with the reason. Model an enumerated claim as a set fact and a
210
+ bound as a numeric fact before writing its certificate. `kibi proof explain
211
+ REQ-...` shows each claim with its bindings.
212
+
213
+ Build the certificate with `kibi-cli/proof-certificates`
214
+ (`exhaustiveCertificate`, `typecheckCertificate`, `arithmeticCertificate`,
215
+ `smtCertificate`), fail the test when it records a failure
216
+ (`failedMembers`), and call `writeCodeCertificate`; it writes to the
217
+ directory `kibi prove` sets in `KIBI_PROOF_CERTIFICATES` and does nothing
218
+ elsewhere. A Python test writes the same `kibi.code-certificate.v1` JSON
219
+ to that directory itself. Wire the KB: the proof file symbol is
220
+ `executable_for` the test and named in `required_proofs`; the domain symbol
221
+ `implements` the requirement and is `covered_by` the test; the test
222
+ `validates` one of the requirement's scenarios. `proved` is per claim: a
223
+ multi-claim requirement is proved only when certificates derive every
224
+ applicable claim, and reads `tested` with `n/m claims proved` otherwise. A
225
+ rejected certificate leaves the receipt at `tested` with
226
+ `certificate_rejection` naming why; fix the proof, never the receipt. If a
227
+ stored certificate stops re-checking later, coverage and `kibi proof
228
+ explain` list it under `certificateRejections`. Use a
229
+ certificate kind only when the domain or claim is genuinely finite or
230
+ decidable; an e2e test that samples cases stays `tested`.
231
+
232
+ ## Evidence floors
233
+
234
+ Each current requirement accepts a weakest level, its floor: the
235
+ `required_evidence` field (`proved`, `tested`, `asserted` or `unverified`),
236
+ or, when absent, `tested` for a firm requirement and no floor otherwise.
237
+ `kb_check`'s `evidence-floor` rule fails while the level is below the floor;
238
+ coverage rows show it as `evidenceFloor` (`required`, `source`, `status`).
239
+ A requirement whose receipts are only older than the code is
240
+ `pending_reproof` and passes a plain check; `kibi check --fresh-evidence`
241
+ fails it, and is what CI runs after `kibi prove`.
242
+
243
+ Fix a finding by raising the level: add the scenario, the end-to-end
244
+ test with a proof contract and the receipts, or have a person approve the
245
+ requirement. Lower `required_evidence` only when a person decides the
246
+ requirement does not need that evidence, and say why in the requirement.
247
+
141
248
  ## Knowledge-base certificates
142
249
 
143
250
  `kb_check` (`kibi check`) proves facts about the KB itself in its
@@ -182,19 +289,22 @@ feasibility are not certified yet; their own rules still decide them.
182
289
 
183
290
  ## After code changes
184
291
 
185
- Receipts bind to the snapshot, contract hash, and execution fingerprint at
186
- run time. Any code or source change moves the snapshot and stales receipts:
187
- re-run `kibi prove` for the affected selection, then confirm `kb_status` and
188
- `kb_coverage` before handoff.
292
+ Receipts bind to the contract, the test document (its links excluded) and
293
+ the code of the symbols they cover. A change to that code stales them:
294
+ re-run `kibi prove --stale` (or the affected selection), then confirm
295
+ `kb_status` and `kb_coverage` before handoff. Type-shape symbols covered by a
296
+ unit test count only while that unit test has a current passing receipt, so
297
+ prove unit tests that cover type-shape symbols too.
189
298
 
190
299
  Full reference: `docs/proving-requirements.md`.
191
300
 
192
301
  ## Debugging proof regressions
193
302
 
194
- When a proof ratchet fails, diagnose first. Do not treat
195
- `proof/baseline.json` as the thing to edit.
303
+ When the `evidence-floor` rule fails, diagnose first. Do not lower
304
+ `required_evidence` to make it pass.
196
305
 
197
- 1. Do not refresh `proof/baseline.json` as the first fix.
306
+ 1. Read the finding: it names the requirement, its level, its floor and where
307
+ the floor comes from (`explicit` or `firmness`).
198
308
  2. Identify the exact requirement and symbol responsible for the regression.
199
309
  3. Use Kibi proof diagnostics rather than reverse-engineering
200
310
  `requirement_proof.pl`:
@@ -202,14 +312,9 @@ When a proof ratchet fails, diagnose first. Do not treat
202
312
  ```bash
203
313
  kibi proof explain REQ-<id>
204
314
  kibi proof explain SYM-<id>
205
- kibi proof impact
315
+ kibi check --rules evidence-floor
206
316
  ```
207
317
 
208
- `kibi proof impact` compares the current Proof projection to
209
- `HEAD:proof/baseline.json` (the committed ratchet snapshot, not the
210
- working-tree file). It is diagnostic: fingerprint differences are reported
211
- and the command exits 0 on successful evaluation. The strict ratchet remains
212
- `scripts/check-proof-baseline.mjs`.
213
318
  4. For `missing_production_symbol_coverage`, inspect symbol role, owning
214
319
  requirement, `covered_by`, candidate test scope, the requirement scenario
215
320
  chain, and the current proof receipt. `kibi proof explain` prints those as
@@ -231,5 +336,5 @@ When a proof ratchet fails, diagnose first. Do not treat
231
336
  `covered_by` relationship semantically correct.
232
337
  10. Prefer one meaningful E2E scenario covering multiple internal functions
233
338
  plus focused unit tests for edge cases, rather than an E2E test per helper.
234
- 11. Refresh the baseline only after a genuine intentional proof-state
235
- improvement requires the ratchet snapshot to be updated.
339
+ 11. A `pending_reproof` finding under `--fresh-evidence` needs `kibi prove`
340
+ for the tests behind the requirement, not a KB change.
@@ -116,7 +116,7 @@ The canonical workflow for any KB operation follows this pattern:
116
116
  7. **Create endpoints**: validated `kb_upsert` for new entities, sequentially
117
117
  8. **Link**: validated `kb_upsert` with `requires_rule`, `requires_predicate`, `constrains`, or `requires_property`, sequentially
118
118
  9. **Validate coverage and consistency**: targeted `rule-safety`, `rule-verifiability`, `semantic-completeness`, `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`, then final full `kb_check`
119
- 10. **Prove execution**: read `kb_status.proofSnapshot`, run `kibi prove` so each configured integration executes once and its `kibi.proof-run.v1` artifact is evaluated against every selected test's `kibi.proof-contract.v1` obligations, appending idempotent `kibi.proof-receipt.v1` receipts; then re-run `kb_coverage`. Never promote durable test status into fresh evidence.
119
+ 10. **Prove execution**: read `kb_status.proofSnapshot`, run `kibi prove` so each configured integration executes once and its `kibi.proof-run.v1` artifact is evaluated against every selected test's `kibi.proof-contract.v1` obligations, appending idempotent `kibi.proof-receipt.v2` receipts; then re-run `kb_coverage` and read each requirement's `evidenceLevel` and `evidenceFloor`. Never promote durable test status into fresh evidence.
120
120
  11. **Repair incrementally**: require `kb_coverage.repairPlan.scope.complete`, apply only one `ready` dependency batch per requirement, validate before every sequential write, and rerun coverage before selecting the next batch
121
121
  12. **Gate workflow evidence**: when `.kb/usage.log` exists, run `kibi usage-metrics --format json --require-acceptance`; repair ranked telemetry diagnostics and never treat stale or insufficient evidence as a pass
122
122
 
@@ -144,7 +144,7 @@ choose package managers, ground semantic claims, resolve contradictions, rerun
144
144
  E2E tests, rewrite receipt history, remap authored symbols, or accept
145
145
  limitations. Those actions remain explicit review/operator/execution steps.
146
146
 
147
- For `e2e_receipt_freshness_low`, query each listed requirement/test gap and run `kibi prove --requirement <id>` (or the covering integration); this appends proof receipts idempotently and preserves history. If `coverage_depth_review` conflicts with a coverage row whose `proofStages.passingE2e.status` is `passed`, report the diagnostic as a stale heuristic and keep any independent proof gaps unresolved.
147
+ For `e2e_receipt_freshness_low`, query each listed requirement/test gap and run `kibi prove --requirement <id>` (or the covering integration); this appends proof receipts idempotently and preserves history. If `coverage_depth_review` conflicts with a coverage row whose `proofStages.passingE2e.status` is `passed`, report the diagnostic as a stale heuristic and keep any independent proof gaps unresolved. For `coarse_anchor_only_review`, the requirement is implemented only by whole-file anchors: link the functions, methods or types that implement it (with `covered_by` to their tests) so its `tested` evidence is tied to that code.
148
148
 
149
149
  ## Creating a New Feature
150
150
  ```
@@ -172,8 +172,8 @@ Do not create a test-fact pair. Facts describe invariants; requirements or scena
172
172
 
173
173
  1. Confirm the exact `REQ -> SCEN -> TEST` path and require typed `verification_scope: end_to_end`; direct requirement-to-test links do not satisfy the conservative scenario stage.
174
174
  2. Read `kb_status` and retain its available `proofSnapshot`. Stop if the runtime reports `unknown`; proof must fail closed when the code identity cannot be computed.
175
- 3. Run the exact E2E command against that snapshot. Record runner, command, start/finish timestamps, outcome, an environment SHA-256, and an artifact/output SHA-256. Do not mint a passed receipt from an authored test status or from an unexecuted assertion.
176
- 4. Preserve every existing receipt byte-for-byte and append the derived `kibi.proof-receipt.v1` object with strictly later `finished_at`. Earlier receipts may bind older contracts or fingerprints; they remain audit history but cannot prove the current contract. Mutation and incremental sync reject history removal, rewriting, and reordering.
175
+ 3. Run `kibi prove --test TEST-<id>` (or `--requirement`, `--integration`, `--all`). It runs the configured producer once against that snapshot and appends a `kibi.proof-receipt.v2` receipt per evaluated contract. Never hand-write a receipt, and never mint a passed receipt from an authored test status or from an unexecuted assertion.
176
+ 4. Receipts are append-only. Earlier receipts, including `kibi.proof-receipt.v1` ones, may bind older contracts or fingerprints; they remain audit history but cannot prove the current contract. Mutation and incremental sync reject history removal, rewriting, and reordering.
177
177
  5. Re-read `kb_status`; if the snapshot changed during the run, discard the candidate as proof and rerun against the new snapshot. Then run `kb_coverage` and inspect `proofStages.passingE2e.receiptEvidence` plus gap codes.
178
178
 
179
179
  Only the newest receipt matching the live snapshot, current contract hash, and current execution fingerprint qualifies, and it must be passed, no more than seven days old, and no more than five minutes in the future. Wrong-snapshot and older-contract history is retained but cannot prove the current test. `missing_proof_receipt`, `stale_proof_receipt`, `failed_proof_receipt`, `invalid_proof_receipt`, `proof_contract_mismatch`, and `proof_snapshot_unavailable` are repair states, not warnings to waive.