kibi-cursor 2.9.3 → 2.9.6
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.
- package/.cursor-plugin/plugin.json +1 -1
- package/CHANGELOG.md +96 -0
- package/agent-plugin/plugin.json +1 -1
- package/agent-plugin/skills/kibi-commit-review/SKILL.md +8 -8
- package/agent-plugin/skills/kibi-commit-review/resources/staged-gate.md +6 -6
- package/agent-plugin/skills/kibi-decisions/SKILL.md +5 -2
- package/agent-plugin/skills/kibi-decisions/resources/decision-records.md +4 -1
- package/agent-plugin/skills/kibi-freshness/SKILL.md +2 -2
- package/agent-plugin/skills/kibi-traceability/SKILL.md +3 -2
- package/agent-plugin/skills/kibi-usage/SKILL.md +5 -3
- package/agent-plugin/skills/kibi-usage/resources/proof.md +105 -9
- package/dist/.cursor-plugin/plugin.json +1 -1
- package/dist/skills/.canon-hash.json +8 -8
- package/dist/skills/kibi-commit-review/SKILL.md +8 -8
- package/dist/skills/kibi-commit-review/resources/staged-gate.md +6 -6
- package/dist/skills/kibi-decisions/SKILL.md +5 -2
- package/dist/skills/kibi-decisions/resources/decision-records.md +4 -1
- package/dist/skills/kibi-freshness/SKILL.md +2 -2
- package/dist/skills/kibi-traceability/SKILL.md +3 -2
- package/dist/skills/kibi-usage/SKILL.md +5 -3
- package/dist/skills/kibi-usage/resources/proof.md +105 -9
- package/package.json +1 -1
- package/skills/.canon-hash.json +8 -8
- package/skills/kibi-commit-review/SKILL.md +8 -8
- package/skills/kibi-commit-review/resources/staged-gate.md +6 -6
- package/skills/kibi-decisions/SKILL.md +5 -2
- package/skills/kibi-decisions/resources/decision-records.md +4 -1
- package/skills/kibi-freshness/SKILL.md +2 -2
- package/skills/kibi-traceability/SKILL.md +3 -2
- package/skills/kibi-usage/SKILL.md +5 -3
- package/skills/kibi-usage/resources/proof.md +105 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-cursor",
|
|
3
3
|
"displayName": "Kibi",
|
|
4
|
-
"version": "2.9.
|
|
4
|
+
"version": "2.9.6",
|
|
5
5
|
"description": "Optional Cursor adapter for Kibi. Requires project-local kibi-cli, kibi-mcp, and kibi-core (SWI-Prolog is bundled on Linux and macOS) before the bundled MCP server can start.",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|
|
7
7
|
"author": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,101 @@
|
|
|
1
1
|
# kibi-cursor
|
|
2
2
|
|
|
3
|
+
## 2.9.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 90e1657: Source proofs no longer prove false claims about module paths, routes and file captures, and they read real projects' schemas, validators and middleware.
|
|
8
|
+
|
|
9
|
+
Fixed, where a false claim could be proved:
|
|
10
|
+
- Set fact members that contain a slash (`rxjs/operators`, `node:fs/promises`, `GET /api/users`, `finance/de`) were cut to their last path segment before Kibi compared them, so "the app must never import rxjs/operators" could prove while the app imported it. Members are now compared whole.
|
|
11
|
+
- The environment extractor now reads through `as`, `<T>` and `satisfies` casts, so `(import.meta as X).env.FOO` is read and an environment object (or `import.meta` itself) handed to a variable fails the read instead of hiding later reads.
|
|
12
|
+
- A glob that matches no file, and SQL migrations with no `CREATE TABLE`, now fail the read, so a mistyped pattern cannot decide a `subset_of` or `excludes` fact over an empty set.
|
|
13
|
+
- A `required_fields` or `nullable_fields` fact with `subset_of` or `excludes` is refused with a reason instead of being compared with whatever members the contract selected.
|
|
14
|
+
|
|
15
|
+
Readers:
|
|
16
|
+
- The SQL migration replay reads quoted and schema-qualified names (`"public"."messages"`), several actions per `ALTER TABLE`, `ADD PRIMARY KEY` and `DROP CONSTRAINT` of a foreign key, keeps `$$` function bodies whole, and skips actions that change no column, nullability or foreign key (row level security, triggers, ownership, defaults, column types). Supabase migration folders now read.
|
|
17
|
+
- The validator reader reads valibot objects, and any field that is a Standard Schema.
|
|
18
|
+
- `names_from` names middleware that a zero-argument factory export makes (`requireAuthentication()`) after the factory.
|
|
19
|
+
- The `thrown` extractor reads `throw createX()` as `createX`.
|
|
20
|
+
- A glob `capture` with `**` reads `finance/de` instead of `finance/de/`.
|
|
21
|
+
- A source read's dependencies follow tsconfig `extends` and workspace packages linked into `node_modules`, so a change in a sibling package stales the receipt.
|
|
22
|
+
- A claim a source proof derives is bound with the new scope `source`.
|
|
23
|
+
|
|
24
|
+
Modeling:
|
|
25
|
+
- "Every X must have Y" becomes a `required_fields` fact only when the sentence names a schema (a table, object, model and similar, or the words field, column or property), so "Every organization must have an owner" stays a behavioural claim.
|
|
26
|
+
- "A member can never become owner" models `member->owner` (the article was read as the state), and the machine may go unnamed.
|
|
27
|
+
- Scoped package names (`@supabase/supabase-js`), "must be exactly A and B" sets and "at least 30 routes under /api/orgs" counts are recognised.
|
|
28
|
+
- `kb_model` in requirement mode accepts the `includes`, `subset_of`, `excludes` and `matches` operators and a list `value` for set facts.
|
|
29
|
+
|
|
30
|
+
The kibi-usage skill (2.32.0) and the proof guide describe the reader details, the empty-read rule and the minimum kibi-cli for the certificate builders.
|
|
31
|
+
|
|
32
|
+
## 2.9.5
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- c118085: Formal proofs now reach the claims real services make about their routes, database schemas, configuration and code. A new `source` certificate proof kind lets Kibi read a project source itself and check a set fact against what it read, so the test only has to run:
|
|
37
|
+
- `json` and `yaml` read keys, values or items at a path; `glob` reads matching files (or what each `*` matched); `openapi` reads operations, unsecured operations, security schemes or responses.
|
|
38
|
+
- `references` reads environment variables, imports, calls, string arguments, thrown errors or property accesses from TypeScript, JavaScript and Python files. A member Kibi cannot read statically, such as a computed environment variable name, fails the read with its location instead of leaving it out.
|
|
39
|
+
- `schema` reads tables, columns, required or nullable columns and foreign keys from Drizzle, Prisma or SQL migrations.
|
|
40
|
+
- `routes` reads a Hono or Express app's routes and the middleware each route runs, including mounted routers.
|
|
41
|
+
- `validator` reads a zod or pydantic schema's fields, required fields or optional fields.
|
|
42
|
+
|
|
43
|
+
A receipt for a source proof goes stale when any file the read touched changes.
|
|
44
|
+
|
|
45
|
+
Set facts gain the `subset_of` ("must be one of") and `excludes` ("must never use") operators alongside `eq` and `includes`. Field claims (`required_fields`, `nullable_fields`) accept `table.field` members, and a `middleware` fact with `includes` requires every matching route to run the listed middleware.
|
|
46
|
+
|
|
47
|
+
State machine proofs decide temporal claims: a `reachable_pairs` fact with `excludes` ("a cancelled invoice can never become paid") and a `required_waypoints` fact ("every path from draft to paid must pass through approved"). Every machine projection accepts the four set operators.
|
|
48
|
+
|
|
49
|
+
A `rule` contract can take a domain from a project source, and a predicate with `harness_for: [SYM-...]` proves its claim at the new `harness` scope when the predicate is a test harness that drives real code. `value_source` accepts `{source, measure: count}`.
|
|
50
|
+
|
|
51
|
+
The semantic advisor and `kibi model` turn these sentence shapes into the matching facts. `kibi-cli/proof-certificates` adds `sourceCertificate` and `readProjectSource`.
|
|
52
|
+
|
|
53
|
+
The kibi-usage skill (2.31.0) explains the new kind and operators. kibi-traceability (2.3.0) lists every certificate kind that reaches proved and the code or harness scope it needs, kibi-freshness (2.3.0) says a changed file a source proof read also leaves its receipt pending re-proof, and kibi-decisions (1.4.0) says a firm rule a certificate kind can check is proved by a certificate test.
|
|
54
|
+
|
|
55
|
+
## 2.9.4
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- 4d55860: Claim-bound proofs are easier to adopt on an existing project.
|
|
60
|
+
- A count claim over a collection reads the collection itself: a `value_source` entry with `measure: count` uses the size of a list, set, map or object export, so "exactly 32 tools" no longer needs a number export added beside the list just for the proof.
|
|
61
|
+
- `kibi migrate`'s claim-binding reviews now list every modeled claim the test reaches through its scenarios, with the binding a certificate of its kind would get (provable, attested only, or why the kind cannot express the fact), instead of an empty list when no claim was provable as modeled.
|
|
62
|
+
- The semantic advisor models "every member of S has P" requirements as a set fact named for P whose value is S, so the property stays in the requirement instead of only in the test.
|
|
63
|
+
|
|
64
|
+
Deleting an `implements` relationship now also removes the target from a symbol's legacy `links:` list in `symbols.yaml` (dropping the list when it empties), so the deleted edge no longer comes back on the next `kibi sync --rebuild`.
|
|
65
|
+
|
|
66
|
+
The kibi-usage skill (2.28.0) explains count measures and every-member claims.
|
|
67
|
+
|
|
68
|
+
- 42566ee: Formal proofs now reach claims that are not numbers. Three new certificate proof kinds read their model from the code and decide the claim exactly:
|
|
69
|
+
- `rule`: Kibi calls the code's predicate functions (`predicate_source`) on every combination of the finite domains the code exports (`domains`) and model checks the claim's fact against that table. A `kibi.logic.v1` rule must hold for every assignment of its variables, a predicate fact (including decision predicates such as `permission_rule`) must be decided as it says, and a set fact whose property names a predicate needs it to hold for every member. A failure names the assignment that breaks the rule.
|
|
70
|
+
- `state_machine`: Kibi reads a transition table or a `next(state, event)` function and checks the transitions, states, initial, terminal or reachable states a set fact names, exactly. Rules over a machine can use `transition`, `reachable`, `initial`, `terminal` and `state`.
|
|
71
|
+
- `regex`: Kibi decides whether the code's pattern (a JavaScript `RegExp` or a Python `re.compile`) accepts exactly the strings a fact's pattern describes, with each engine's own semantics for anchors, `.`, `\d` and case folding, and reports the shortest string only one side accepts. Patterns outside the regular subset (backreferences, lookaround, word boundaries and similar) are refused with the reason. A string constant is checked against an exact string fact the same way.
|
|
72
|
+
|
|
73
|
+
String facts gain the `matches` operator, and the semantic advisor models "X must match `re`", "X must be `value`" and "X transitions must be one of a -> b, ..." (and terminal, initial or reachable states) as facts these kinds prove. A `typecheck` proof of a set fact with `property_key: required_fields` checks that every member is a required, non-nullable field of the domain type. `kibi-cli/proof-certificates` adds `ruleCertificate`, `stateMachineCertificate`, `regexCertificate` and `failedCalls`.
|
|
74
|
+
|
|
75
|
+
The kibi-usage skill (2.29.0) explains the new kinds.
|
|
76
|
+
|
|
77
|
+
- 4f06fd5: The kibi-usage skill (2.27.1) now links the full proof reference to its published page, https://looted.github.io/kibi/reference/proving.html, instead of a repository path that does not exist in the projects using Kibi.
|
|
78
|
+
- 03197d8: The kibi-usage skill (2.29.3) lists all seven certificate proof kinds (`exhaustive`, `typecheck`, `arithmetic`, `smt`, `rule`, `state_machine` and `regex`) where it explains which tests reach `proved`.
|
|
79
|
+
- c99f89b: Fixes for the certificate proof kinds and for running Kibi from inside a repository:
|
|
80
|
+
- `kibi` run from a subdirectory of a Kibi workspace now uses the workspace's knowledge base (the nearest enclosing `.kb/manifest.json`), the way git finds its repository. Before, it compiled a second, empty branch store in the subdirectory, so queries returned nothing and `kibi prove` reported no proof integration. Relative `--input`, `--output`, `--certificates` and `--write-certificates` paths still resolve from where the command was typed. `kibi init` and an explicit `KIBI_WORKSPACE` keep the current directory.
|
|
81
|
+
- A receipt whose certificate re-checks but derives none of the claims it names now records `evidence_level: tested`, the level coverage reports, instead of `proved`. The same holds for the `kibi prove` result rows.
|
|
82
|
+
- Kibi compiles typecheck witnesses with the import resolution of the nearest `tsconfig.json` (`module`, `moduleResolution`, `paths` and similar), while the checking options stay fixed and strict. A project that resolves like a bundler no longer needs `.js` extensions in witness imports.
|
|
83
|
+
- TypeScript is loaded from the package nearest the witness first. TypeScript 7, which ships without the compiler API, is skipped for an older install further up, and named in the rejection when there is none ("add typescript@6 as a dev dependency"), instead of being reported as missing.
|
|
84
|
+
- A rejected `required_fields` claim names each field that breaks it ("deletedAt is optional or nullable", "x is not a field"), also when the test's own witness failed to compile.
|
|
85
|
+
- A rejected arithmetic certificate, including a `measure: count` claim, names a value that satisfies the assumptions and breaks the claim ("count = 5 satisfies them and breaks it").
|
|
86
|
+
- The typecheck exhaustiveness check reads the witness's syntax tree: a `never` type or a `satisfies` map counts, the word "never" in a comment does not. It now applies only to contracts without `proves`; with `proves`, Kibi checks each claim with its own witness.
|
|
87
|
+
- Set facts gain the `includes` operator for "every member of the set has the property" claims, which the semantic advisor now proposes. Two `includes` facts on the same property never contradict, and one contradicts an `eq` set only when it names a member the `eq` set leaves out. Before, "every role in owner and admin can invite" and "every role in owner, admin and member can invite" were refused as a value conflict. The KB consistency certificates model `includes` as containment.
|
|
88
|
+
|
|
89
|
+
The kibi-usage skill (2.29.1) describes the `includes` operator and the typecheck changes.
|
|
90
|
+
|
|
91
|
+
- bcbeebe: Follow-up fixes for the certificate proof kinds:
|
|
92
|
+
- A `rule` certificate now derives an `includes` set fact ("every role in owner and admin can invite"), checking the property on each listed member, so a true every-member claim reaches `proved`. Before, an `includes` fact was never read as a set and every binding to it was only attested. A `typecheck` certificate derives an `includes` fact on `required_fields`; the kinds that compare the whole set (`exhaustive`, a set-equality `typecheck`, `state_machine`) reject one, since they would read "at least these" as "exactly these".
|
|
93
|
+
- An arithmetic certificate whose assumptions contradict each other, such as a code count of 5 against a fact of exactly 4, is rejected with both values ("the assumptions contradict each other (count = 4 and count = 5) ...") instead of "the claim holds vacuously".
|
|
94
|
+
- A typecheck certificate whose own compile failed is rejected with the first error Kibi's compile of the witness reports, or with a note that Kibi's compile accepts it, instead of only "the type checker did not accept the witness". The declaration files the nearest `tsconfig.json` includes (a `reset.d.ts`, for example) are now part of the witness program.
|
|
95
|
+
- A receipt whose only derived claims are intent-scope (derived from the knowledge base's facts, with no value read from the code) records `evidence_level: tested`, the level coverage reports, instead of `proved`.
|
|
96
|
+
|
|
97
|
+
The kibi-usage skill (2.29.2) describes these and how to wire a count claim.
|
|
98
|
+
|
|
3
99
|
## 2.9.3
|
|
4
100
|
|
|
5
101
|
### Patch Changes
|
package/agent-plugin/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "kibi",
|
|
4
|
-
"version": "2.9.
|
|
4
|
+
"version": "2.9.6",
|
|
5
5
|
"description": "Repo-local, per-branch, queryable knowledge base. Portable Agent Plugin packaging Kibi's Agent Skills and MCP server.",
|
|
6
6
|
"author": { "name": "Kibi" },
|
|
7
7
|
"homepage": "https://looted.github.io/kibi/",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: kibi-commit-review
|
|
3
3
|
name: kibi-commit-review
|
|
4
|
-
description: "Use when kibi check --staged or the Kibi pre-commit hook blocks a commit (kibi_impact_evidence_missing, symbols_manifest_stale, symbol_granularity_violation, symbol-coverage, kibi check-generated drift, Staged impact review failed), or when preparing a commit or pull-request impact review. Covers reading the per-file Detail lines, authoring .kb/symbols.yaml symbol entries through kb_upsert,
|
|
5
|
-
version: 1.
|
|
4
|
+
description: "Use when kibi check --staged or the Kibi pre-commit hook blocks a commit (kibi_impact_evidence_missing, symbols_manifest_stale, symbol_granularity_violation, symbol-coverage, kibi check-generated drift, Staged impact review failed), or when preparing a commit or pull-request impact review. Covers reading the per-file Detail lines, authoring .kb/symbols.yaml symbol entries through kb_upsert, staging the tracked Kibi evidence with git add (symbol coordinates are derived and never staged), kb_prepare_impact_review for a staged or diff scope, the kibi signoff requirements summary to show before a commit, and how merge commits and migration renames are judged."
|
|
5
|
+
version: 1.3.0
|
|
6
6
|
kibiCompatibility: ">=1.0.0"
|
|
7
7
|
tags:
|
|
8
8
|
- kibi
|
|
@@ -55,17 +55,17 @@ Never read or open any file under `.kb`, not even read-only with a file tool to
|
|
|
55
55
|
- New or uncovered symbols: author a `symbol` entity per listed symbol
|
|
56
56
|
through `kb_upsert` (`title` = the member the extractor names,
|
|
57
57
|
`sourceFile`, `status: active`, `symbol_role: behavioral`, `implements`
|
|
58
|
-
to the requirement, `covered_by` to the test).
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
to the requirement, `covered_by` to the test).
|
|
59
|
+
- Only lines moved: nothing to do. Symbol coordinates are derived locally
|
|
60
|
+
by every sync and never committed.
|
|
61
61
|
- No behavior change (a genuine false positive): see the audited
|
|
62
62
|
no-impact note in `resources/staged-gate.md`; it never covers a real
|
|
63
63
|
behavior change.
|
|
64
64
|
4. **Stage the evidence.** Kibi authors tracked files but never Git-stages or
|
|
65
65
|
commits them. `git status --short .kb` lists what it wrote; `git add` the
|
|
66
|
-
entity Markdown, `.kb/relationships/` shards
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
entity Markdown, `.kb/relationships/` shards and `.kb/symbols.yaml` that
|
|
67
|
+
belong to this change (use `git add -p` when the files hold unrelated
|
|
68
|
+
edits). `.kb/symbol-coordinates.yaml` is gitignored; never stage it.
|
|
69
69
|
5. **Re-run** `kibi check --staged` (and `kibi check-generated --staged` when it
|
|
70
70
|
failed) until it passes. Never bypass the hook (`--no-verify`) unless the
|
|
71
71
|
person says so.
|
|
@@ -8,10 +8,10 @@ not the working tree, so a fix counts only once it is staged.
|
|
|
8
8
|
## Reading a finding
|
|
9
9
|
|
|
10
10
|
```text
|
|
11
|
-
symbols_manifest_stale: .kb/
|
|
11
|
+
symbols_manifest_stale: .kb/symbols.yaml does not cover the declarations of staged source files: src/billing/refund.ts
|
|
12
12
|
Detail: src/billing/refund.ts — extraction finds 4 symbol(s), evidence covers 3.
|
|
13
13
|
Not in .kb/symbols.yaml: approveRefund (line 42)
|
|
14
|
-
Suggestion: Author .kb/symbols.yaml entries for the uncovered symbols (kibi upsert, with implements/covered_by links)
|
|
14
|
+
Suggestion: Author .kb/symbols.yaml entries for the uncovered symbols (kibi upsert, with implements/covered_by links). Stage .kb/symbols.yaml with the behavior edit, then re-run kibi check --staged.
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
- Detail lines name every symbol, never a shortened list. `Evidence without a
|
|
@@ -24,15 +24,15 @@ symbols_manifest_stale: .kb/symbol-coordinates.yaml is stale or missing for stag
|
|
|
24
24
|
|
|
25
25
|
| Id or message | Cause | Fix |
|
|
26
26
|
| --- | --- | --- |
|
|
27
|
-
| `kibi_impact_evidence_missing` | A staged behavior edit (changed lines in exported or behavior-bearing code, not comments or formatting) has no staged Kibi evidence. Test-only edits do not need it unless they add executable test symbols. | Query the owning knowledge; update it when behavior changed; stage entity Markdown under `.kb
|
|
28
|
-
| `symbols_manifest_stale` |
|
|
27
|
+
| `kibi_impact_evidence_missing` | A staged behavior edit (changed lines in exported or behavior-bearing code, not comments or formatting) has no staged Kibi evidence. Test-only edits do not need it unless they add executable test symbols. | Query the owning knowledge; update it when behavior changed; stage entity Markdown under `.kb/` or authored `.kb/symbols.yaml` entries for the listed symbols. A file whose every declaration already has a `.kb/symbols.yaml` entry needs nothing more. |
|
|
28
|
+
| `symbols_manifest_stale` | A staged behavior file declares symbols `.kb/symbols.yaml` has no entry for, or an entry names a declaration that is gone. | Author entries for the listed symbols, re-point or retire entries whose declaration is gone, and stage `.kb/symbols.yaml`. Coordinates are derived locally and never staged. |
|
|
29
29
|
| `symbol_granularity_violation` | A changed behavioral member is owned only by a coarse class or module symbol while a narrower declaration exists. | Add a symbol for the member itself (`title` = `Class.method` or the exported function) with its own links; use `granularity_reason` (`config-artifact`, `module-level-behavior`, `extractor-miss`, `legacy-link`, `test-suite`) only when it is true. |
|
|
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
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
|
-
| `kibi check-generated --staged` drift | The staged `.kb/symbols.yaml` or `.kb/symbol-coordinates.yaml`
|
|
35
|
+
| `kibi check-generated --staged` drift | The staged `.kb/symbols.yaml` is not in the layout sync writes, or `.kb/symbol-coordinates.yaml` is tracked. | `kibi sync --refresh-symbol-coordinates`, review the diff, stage only the intended hunks (`git add -p`); untrack a tracked coordinates file with `kibi migrate` (or `git rm --cached`). |
|
|
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
38
|
The staged gate does not judge evidence levels: the `evidence-floor` rule
|
|
@@ -98,6 +98,6 @@ does not prove it. Put the person's id there only when they reviewed it.
|
|
|
98
98
|
npx --no-install kibi check --staged # the gate
|
|
99
99
|
npx --no-install kibi check --staged --format json # with full evidence
|
|
100
100
|
npx --no-install kibi check-generated --staged # manifest drift
|
|
101
|
-
npx --no-install kibi sync --refresh-symbol-coordinates #
|
|
101
|
+
npx --no-install kibi sync --refresh-symbol-coordinates # rebuild local coordinates
|
|
102
102
|
git status --short .kb # what Kibi wrote
|
|
103
103
|
```
|
|
@@ -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.
|
|
5
|
+
version: 1.4.0
|
|
6
6
|
kibiCompatibility: ">=1.0.0"
|
|
7
7
|
tags:
|
|
8
8
|
- kibi
|
|
@@ -80,7 +80,10 @@ name the missing capability. Never read or edit `.kb/` files directly.
|
|
|
80
80
|
run `kibi prove`. Otherwise set `required_evidence: asserted`, say in the
|
|
81
81
|
body that no end-to-end test proves the rule yet, and report it as
|
|
82
82
|
asserted, not tested. Kibi's bootstrap and migration give an untested firm
|
|
83
|
-
rule the same floor.
|
|
83
|
+
rule the same floor. When the rule is a claim a certificate kind checks
|
|
84
|
+
(allowed values, transitions, a pattern, a rule over roles, a config,
|
|
85
|
+
route or schema read), a certificate test proves it instead: see
|
|
86
|
+
Certificate proof kinds in kibi-usage `resources/proof.md`.
|
|
84
87
|
- **The person changes a rule:** supersede it (new requirement linked
|
|
85
88
|
`supersedes` new -> old, `firmness: firm` when the old one was firm, a
|
|
86
89
|
`## Why this changed` section of at least 12 words naming their instruction
|
|
@@ -62,7 +62,10 @@ validation, not the write.
|
|
|
62
62
|
the `evidence-floor` check while it is recorded. Drop it (the floor goes
|
|
63
63
|
back to `tested`) once an end-to-end test with a proof contract and a
|
|
64
64
|
passing `kibi prove` receipt covers the rule's scenario; never set it below
|
|
65
|
-
`asserted` on a firm rule.
|
|
65
|
+
`asserted` on a firm rule. A rule that a certificate kind checks (allowed
|
|
66
|
+
values, transitions, a pattern, a rule over roles, a config, route or
|
|
67
|
+
schema read) can instead be proved by a certificate test; see Certificate
|
|
68
|
+
proof kinds in kibi-usage `resources/proof.md`.
|
|
66
69
|
- Your own choice is `default`; a guess is `exploratory`. Write the value
|
|
67
70
|
explicitly whenever you record a decision.
|
|
68
71
|
- For strict modeling (claim keys, predicate facts) follow `kibi-usage`,
|
|
@@ -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.
|
|
5
|
+
version: 2.3.0
|
|
6
6
|
kibiCompatibility: ">=1.0.0"
|
|
7
7
|
tags:
|
|
8
8
|
- kibi
|
|
@@ -68,7 +68,7 @@ For every freshness, branch, or completion question, call `kb_status` first, the
|
|
|
68
68
|
- If entities look stale, refresh context through an approved Kibi capability and then re-query.
|
|
69
69
|
- When asked whether a requirement is proven, quote its `evidenceLevel` and
|
|
70
70
|
`evidenceFloor` from `kb_coverage`. `pending_reproof` (receipts older than
|
|
71
|
-
the code) is stale evidence, not proof; `kibi prove` refreshes it, and
|
|
71
|
+
the code, or than a file a `source` proof read) is stale evidence, not proof; `kibi prove` refreshes it, and
|
|
72
72
|
`kibi check --fresh-evidence` is the check that fails on it.
|
|
73
73
|
- Preserve source-file traceability by carrying `sourceFile`, text references, and validation evidence through discovery, mutation, and completion.
|
|
74
74
|
- Do not read or edit files inside `.kb` directly; use the selected Kibi interface instead.
|
|
@@ -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.
|
|
5
|
+
version: 2.3.0
|
|
6
6
|
kibiCompatibility: ">=1.0.0"
|
|
7
7
|
tags:
|
|
8
8
|
- kibi
|
|
@@ -67,7 +67,8 @@ coverage and a green check are not proof by themselves.
|
|
|
67
67
|
|
|
68
68
|
Report each requirement's `evidenceLevel` from `kb_coverage` as it is:
|
|
69
69
|
`proved` only when certificate proofs (exhaustive, typecheck, arithmetic,
|
|
70
|
-
smt
|
|
70
|
+
smt, rule, state_machine, regex, source) bound at code or harness scope
|
|
71
|
+
derive every applicable claim (intent-scope bindings stay `tested`), named in each contract's `proves`
|
|
71
72
|
(`claimSummary` and `unprovedClaims` say which are missing), `tested` for fresh passing E2E receipts,
|
|
72
73
|
`asserted` when only a person stands behind it, `unverified` otherwise. Its
|
|
73
74
|
`evidenceFloor` says what `kb_check`'s `evidence-floor` rule requires:
|
|
@@ -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.
|
|
5
|
+
version: 2.32.0
|
|
6
6
|
kibiCompatibility: ">=1.0.0"
|
|
7
7
|
tags:
|
|
8
8
|
- kibi
|
|
@@ -436,8 +436,10 @@ 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
437
|
Each current requirement has an evidence floor (`required_evidence`, else
|
|
438
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.
|
|
439
|
+
arithmetic, smt, rule, state_machine, regex, source) reach `proved` for the claims their contract names in
|
|
440
|
+
`proves`, and a requirement is proved only when every claim is. A rule
|
|
441
|
+
predicate bound with `harness_for` (scope `harness`) also counts toward
|
|
442
|
+
`proved`; an intent-scope binding stays `tested`. When the `evidence-floor` rule fails, follow Debugging
|
|
441
443
|
proof regressions in `resources/proof.md` and use `kibi proof explain`.
|
|
442
444
|
|
|
443
445
|
## Predicate Ontology Decision Tree
|
|
@@ -178,8 +178,14 @@ left:
|
|
|
178
178
|
goes unhandled (a switch ending in a `never` assignment, or a
|
|
179
179
|
`satisfies Record<Domain, ...>` map). Set `witness.path` and
|
|
180
180
|
`domain_source`; the witness must import the domain. Kibi compiles the
|
|
181
|
-
witness itself (strict, with the workspace's TypeScript
|
|
182
|
-
|
|
181
|
+
witness itself (strict, with the workspace's TypeScript and the import
|
|
182
|
+
resolution and declaration files of the nearest `tsconfig.json`), so
|
|
183
|
+
`typescript` must be
|
|
184
|
+
installed in the workspace (TypeScript 7 has no compiler API: add
|
|
185
|
+
`typescript@6` as a dev dependency). With `proves`, Kibi decides each
|
|
186
|
+
claim with its own witness and reports the fields or members that break
|
|
187
|
+
it. When the test's compile failed, the rejection adds the first error
|
|
188
|
+
Kibi's own compile of the witness reports.
|
|
183
189
|
- `arithmetic`: a claim on one `int` or `real` variable decided exactly from
|
|
184
190
|
typed facts. Set `constraint_source: { fact_ids: [FACT-...] }` to the
|
|
185
191
|
numeric `property_value` facts (one subject and property); the
|
|
@@ -187,10 +193,93 @@ left:
|
|
|
187
193
|
exactly their constraints. To read the value from the code instead, set
|
|
188
194
|
`value_source: [{ symbol_id: SYM-<constant>, export: <name> }]`; Kibi
|
|
189
195
|
evaluates the number export itself and adds `variable eq value` as an
|
|
190
|
-
assumption.
|
|
196
|
+
assumption. For a count claim over a collection ("exactly 32 tools") add
|
|
197
|
+
`measure: count` and name the list, set, map or object export; Kibi uses
|
|
198
|
+
its size, so do not add a number export just for the proof. A count
|
|
199
|
+
claim needs only `value_source`. Naming the claim's own fact in
|
|
200
|
+
`constraint_source` assumes the claim: without `value_source` Kibi counts
|
|
201
|
+
that derivation as intent only (tested), and with it a code value that
|
|
202
|
+
breaks the claim shows up as contradictory assumptions, which the
|
|
203
|
+
rejection names.
|
|
204
|
+
A claim that every member of a closed set has a property ("Every currency
|
|
205
|
+
in GBP, ILS and ZAR must fail closed") is a set fact whose `property_key`
|
|
206
|
+
names the property, whose `value_set` is the members and whose operator
|
|
207
|
+
is `includes` (other members may have the property too, so two such
|
|
208
|
+
claims over different sets do not contradict). Prove it with `rule`: Kibi
|
|
209
|
+
checks the property on each listed member. The kinds that compare the
|
|
210
|
+
whole set (`exhaustive`, `state_machine`) reject an `includes` fact.
|
|
191
211
|
- `smt`: an SMT-LIB query that declares the facts' property as a constant,
|
|
192
212
|
asserts each `constraint_source` fact constraint and then the claim's
|
|
193
213
|
negation. Kibi re-runs z3 or cvc5 on it and accepts only `unsat`.
|
|
214
|
+
- `rule`: decisions over finite domains. Set `predicate_source: {<predicate>:
|
|
215
|
+
{ symbol_id }}` to the function behind each predicate the claim uses (it
|
|
216
|
+
takes the arguments in order and returns a boolean) and `domains: {<type>:
|
|
217
|
+
{ symbol_id }}` to the export listing each argument type's values. Kibi
|
|
218
|
+
calls every function on every combination and model checks the claim's
|
|
219
|
+
fact: a `kibi.logic.v1` rule fact (from `kb_model_requirement` with
|
|
220
|
+
`logic`) must hold for every assignment, a predicate fact must be decided
|
|
221
|
+
as it says, and a set fact whose `property_key` names a predicate needs it
|
|
222
|
+
true for every member. A type name is also a one-argument predicate
|
|
223
|
+
(`role(R)`) to range a variable. A failure names the assignment. A domain
|
|
224
|
+
can come from the project instead of an export (`domains: {<type>:
|
|
225
|
+
{source: {...}}}`, see `source` below). When the predicate is a test
|
|
226
|
+
harness that drives real code (it calls the handler with each role), add
|
|
227
|
+
`harness_for: [SYM-...]` naming that code; the claim binds with scope
|
|
228
|
+
`harness`, which proves, and those symbols must be `covered_by` the test.
|
|
229
|
+
Add `export: <name>` to a `predicate_source` entry when the function's
|
|
230
|
+
export is not the symbol's title.
|
|
231
|
+
- `state_machine`: set `domain_source` to the transition table (object or
|
|
232
|
+
Map from state to next states, or `[from, to]` pairs) or to a
|
|
233
|
+
`next(state, event)` function with `domains: {state, event}`;
|
|
234
|
+
`initial_source` names the initial state. Model "transitions must be one of
|
|
235
|
+
a -> b, ..." as a `transitions` set fact (members `a->b`), and terminal,
|
|
236
|
+
initial or reachable states as `terminal_states`, `initial_states` or
|
|
237
|
+
`reachable_states` set facts; Kibi checks that projection exactly.
|
|
238
|
+
Temporal claims use two more projections: "a cancelled invoice can never
|
|
239
|
+
become paid" is a `reachable_pairs` fact with `operator: excludes` and
|
|
240
|
+
member `cancelled->paid`, and "every path from draft to paid must pass
|
|
241
|
+
through approved" is a `required_waypoints` fact with member
|
|
242
|
+
`draft->paid via approved` (paid must be reachable from draft, and not
|
|
243
|
+
once approved is removed). Any projection also takes `includes`,
|
|
244
|
+
`subset_of` and `excludes`. Rules over a machine use `transition`,
|
|
245
|
+
`reachable`, `initial`, `terminal`, `state`.
|
|
246
|
+
- `regex`: set `pattern_source` to a `RegExp`, a Python `re.compile(...)` or
|
|
247
|
+
a string constant. Model "X must match `re`" as a string fact with
|
|
248
|
+
`operator: matches` (a JavaScript pattern with the `u` flag, matched
|
|
249
|
+
whole); Kibi decides exact language equality and reports the shortest
|
|
250
|
+
string only one side accepts. Backreferences, lookaround, `\b`, the `g`,
|
|
251
|
+
`y`, `m` and `v` flags, Python `\d`/`\w` without `re.ASCII` and
|
|
252
|
+
non-ASCII letters under `i` are refused with the reason. An exact string
|
|
253
|
+
fact (`eq`/`neq`) checks a constant.
|
|
254
|
+
- `source`: Kibi reads a project source itself and checks a set fact
|
|
255
|
+
against what it read, so the test only runs the proof (it may write
|
|
256
|
+
nothing, or `sourceCertificate({ testId })`). Set `source: {reader, ...}`:
|
|
257
|
+
`json`/`yaml` (`file`, `path`, `select`), `glob` (`pattern`, `capture`),
|
|
258
|
+
`openapi` (`file`, `select: operations|unsecured_operations|...`),
|
|
259
|
+
`references` (`files`, `extract: env|imports|calls|string_args|thrown|
|
|
260
|
+
property`), `schema` (`format: drizzle|prisma|sql`, `select:
|
|
261
|
+
tables|columns|required_columns|nullable_columns|foreign_keys`), `routes`
|
|
262
|
+
(Hono or Express app export, `path_prefix`, `names_from`, `select:
|
|
263
|
+
routes|middleware`) or `validator` (zod, valibot or pydantic, `select:
|
|
264
|
+
fields|required_fields|optional_fields`). A member Kibi cannot read
|
|
265
|
+
statically (a computed env name, a dynamic import, an env object handed
|
|
266
|
+
to a variable) fails the read with its location, and so does an empty
|
|
267
|
+
read (a glob matching no file, migrations with no `CREATE TABLE`), so a
|
|
268
|
+
read is never silently partial. Model the claim as a set fact: `eq`
|
|
269
|
+
(exactly), `includes` (at least), `subset_of` ("must be one of"),
|
|
270
|
+
`excludes` ("must never use"); `property_key: required_fields` or
|
|
271
|
+
`nullable_fields` (only `eq`/`includes`) with bare members `name` for
|
|
272
|
+
"every table" (it also covers tables added later) or `table.name` for
|
|
273
|
+
one; `middleware` with `includes` for "every route under /p must use M"
|
|
274
|
+
(Kibi checks each route). Name middleware with `names_from`: a
|
|
275
|
+
zero-argument factory export such as `requireAuth()` names the
|
|
276
|
+
middleware it returns `requireAuth`. Write the fact with `kb_model`
|
|
277
|
+
(requirement mode, `operator` plus a list `value`) or `kb_upsert`. The
|
|
278
|
+
receipt stales when a file the read touched changes, and the claim binds
|
|
279
|
+
with scope `source`. `value_source` accepts `{source, measure: count}`.
|
|
280
|
+
The builders need kibi-cli 2.33.0 or newer in the project. The env
|
|
281
|
+
extractor reads `process.env`, `import.meta.env`, `Bun.env`,
|
|
282
|
+
`Deno.env.get`, `os.environ` and `os.getenv`, through casts.
|
|
194
283
|
|
|
195
284
|
`arithmetic` and `smt` from `constraint_source` alone prove that the
|
|
196
285
|
knowledge base's facts entail the claim, not that code follows the facts:
|
|
@@ -202,8 +291,11 @@ Every certificate contract names the claims it proves in `proves:
|
|
|
202
291
|
[CLAIM-...]` (blocking `proof-contract-claims` from schema 12). Kibi derives
|
|
203
292
|
each claim's obligation from its grounding fact: a set fact (`value_type:
|
|
204
293
|
set`, `value_set: [...]`) needs the `exhaustive` domain or the `typecheck`
|
|
205
|
-
domain type to be exactly the set
|
|
206
|
-
|
|
294
|
+
domain type to be exactly the set (with `property_key: required_fields`,
|
|
295
|
+
`typecheck` instead needs every member to be a required, non-nullable field
|
|
296
|
+
of the domain type); a numeric fact needs the `arithmetic` claim or the
|
|
297
|
+
negated `smt` assertion to be its constraint; rule, predicate, machine and
|
|
298
|
+
string facts need the `rule`, `state_machine` or `regex` checks above. The receipt
|
|
207
299
|
records one binding per claim: `derived` (checked, the only kind that
|
|
208
300
|
proves), `attested` (the fact has no derivation; counts as tested) or
|
|
209
301
|
`rejected` with the reason. Model an enumerated claim as a set fact and a
|
|
@@ -212,13 +304,16 @@ REQ-...` shows each claim with its bindings.
|
|
|
212
304
|
|
|
213
305
|
Build the certificate with `kibi-cli/proof-certificates`
|
|
214
306
|
(`exhaustiveCertificate`, `typecheckCertificate`, `arithmeticCertificate`,
|
|
215
|
-
`smtCertificate`
|
|
216
|
-
|
|
307
|
+
`smtCertificate`, `ruleCertificate`, `stateMachineCertificate`,
|
|
308
|
+
`regexCertificate`, `sourceCertificate`; `readProjectSource` returns Kibi's
|
|
309
|
+
read for a test that wants to assert on it), fail the test when it records a failure
|
|
310
|
+
(`failedMembers`, `failedCalls`), and call `writeCodeCertificate`; it writes to the
|
|
217
311
|
directory `kibi prove` sets in `KIBI_PROOF_CERTIFICATES` and does nothing
|
|
218
312
|
elsewhere. A Python test writes the same `kibi.code-certificate.v1` JSON
|
|
219
313
|
to that directory itself. Wire the KB: the proof file symbol is
|
|
220
314
|
`executable_for` the test and named in `required_proofs`; the domain symbol
|
|
221
|
-
|
|
315
|
+
(and every symbol a rule, machine or pattern contract names) `implements`
|
|
316
|
+
the requirement and is `covered_by` the test; the test
|
|
222
317
|
`validates` one of the requirement's scenarios. `proved` is per claim: a
|
|
223
318
|
multi-claim requirement is proved only when certificates derive every
|
|
224
319
|
applicable claim, and reads `tested` with `n/m claims proved` otherwise. A
|
|
@@ -296,7 +391,8 @@ re-run `kibi prove --stale` (or the affected selection), then confirm
|
|
|
296
391
|
unit test count only while that unit test has a current passing receipt, so
|
|
297
392
|
prove unit tests that cover type-shape symbols too.
|
|
298
393
|
|
|
299
|
-
Full reference:
|
|
394
|
+
Full reference: [Proving requirements](https://looted.github.io/kibi/reference/proving.html)
|
|
395
|
+
(`docs/proving-requirements.md` in the Kibi repository).
|
|
300
396
|
|
|
301
397
|
## Debugging proof regressions
|
|
302
398
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-cursor",
|
|
3
3
|
"displayName": "Kibi",
|
|
4
|
-
"version": "2.9.
|
|
4
|
+
"version": "2.9.6",
|
|
5
5
|
"description": "Optional Cursor adapter for Kibi. Requires project-local kibi-cli, kibi-mcp, and kibi-core (SWI-Prolog is bundled on Linux and macOS) before the bundled MCP server can start.",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|
|
7
7
|
"author": {
|
|
@@ -4,27 +4,27 @@
|
|
|
4
4
|
"kibi-bootstrap/resources/branch-lifecycle.md": "c854264ce888439140883a3fc636db5e522f020dd27b30a5c1ecc4105b64ed13",
|
|
5
5
|
"kibi-bootstrap/resources/operation-access.md": "b5a6a59e72d800c376e7fad79132897623c32a0ce152a1e8d73f9628b444db51",
|
|
6
6
|
"kibi-bootstrap/resources/source-authoring.md": "bf296e62f69474e01797d6cb9469bf624551dca834dd188abb6e705bd96fa586",
|
|
7
|
-
"kibi-commit-review/SKILL.md": "
|
|
8
|
-
"kibi-commit-review/resources/staged-gate.md": "
|
|
9
|
-
"kibi-decisions/SKILL.md": "
|
|
10
|
-
"kibi-decisions/resources/decision-records.md": "
|
|
7
|
+
"kibi-commit-review/SKILL.md": "cd3a0d5ed5e2e7562995180e440dce1aa1607d3d072d3400e966e988725ed399",
|
|
8
|
+
"kibi-commit-review/resources/staged-gate.md": "37f750f327bb9202c1f30989763f4f1205b906cf672318ca50887d7984bc3e08",
|
|
9
|
+
"kibi-decisions/SKILL.md": "02685fa50f093025782986bfe009940e934c3a64d47858920815e7eb66b0c523",
|
|
10
|
+
"kibi-decisions/resources/decision-records.md": "b201e619c48daf6ebe5989991a96f6c0573adb6c37abf814b9d34b7a1cd423c6",
|
|
11
11
|
"kibi-decisions/resources/signoff-views.md": "123da13a3f2b30b5672044a1284626e218d3088411f84f2692746f95e06c1393",
|
|
12
|
-
"kibi-freshness/SKILL.md": "
|
|
12
|
+
"kibi-freshness/SKILL.md": "b5c4f24bebdb5b4e0d04c2fa1176fc33ace35334b0c0b6ca943d6f445dc9b69e",
|
|
13
13
|
"kibi-freshness/resources/branch-lifecycle.md": "ebc01b19fe3dca8df5fc0175978963f6f1204f71f7c805cb2a5fb1b277ac78e4",
|
|
14
14
|
"kibi-freshness/resources/operation-access.md": "4e1db9294ee540cd29b8b3a2532a81e7894d5b4228b39e99ba48b37212f489f3",
|
|
15
15
|
"kibi-freshness/resources/source-authoring.md": "41a0547ce4d2a112a0f3671d36720f07c447864db3b473e94eb88a8ce2d371ff",
|
|
16
|
-
"kibi-traceability/SKILL.md": "
|
|
16
|
+
"kibi-traceability/SKILL.md": "57323b0093dd46bed900bcd21cc1d3ba0eacb14f3580fb9e655cf366e4370e2c",
|
|
17
17
|
"kibi-traceability/resources/branch-lifecycle.md": "50f1a6355aa9185d412b2474db1a64e112944625d2465be0adbf93ada3273c1f",
|
|
18
18
|
"kibi-traceability/resources/operation-access.md": "39f7972ab7f4ae7479e78f7072bb50e8e6c4cdf4f857425f69d2522d37db437c",
|
|
19
19
|
"kibi-traceability/resources/source-authoring.md": "408c6ee2bef1b84e0194c0538ef929c26a0a617e631b2234247388140dbbdd08",
|
|
20
20
|
"kibi-traceability/resources/traceability.md": "38c290a0bc71bd1692e115f22694743946e2f69630e134acfd43cee5f613fb88",
|
|
21
|
-
"kibi-usage/SKILL.md": "
|
|
21
|
+
"kibi-usage/SKILL.md": "36242e1ec0b461502d978f728d0946e654ea6e8871212ef298977c5e8e9b9767",
|
|
22
22
|
"kibi-usage/resources/branch-lifecycle.md": "f1bf359e9826e83c548f3cd0287f8175a62456527b0132b06b3f9f74aa59b7d6",
|
|
23
23
|
"kibi-usage/resources/fact-lanes.md": "899218f90396aa469b6e34aeb5f7ea1f38bf11bb326102319f376c213859fb33",
|
|
24
24
|
"kibi-usage/resources/kb-improvement.md": "a8408fce27342bdce6415a6718599e53fe00bb33aa1fd3dc42353ec6f61adcd7",
|
|
25
25
|
"kibi-usage/resources/logic-ir.md": "0e8ce8aad07433ab4803ec169149ff6c4e1cf8cf010af18fa6fd67862d9be807",
|
|
26
26
|
"kibi-usage/resources/operation-access.md": "eb455796c066787ffd3fae8db0db1d3e87a84265a57f06ae61e30103cd6aed66",
|
|
27
|
-
"kibi-usage/resources/proof.md": "
|
|
27
|
+
"kibi-usage/resources/proof.md": "f5ce2c97b676d3302e33992e7f803c3ffbbb0aa7a808adc00e82cdba33325467",
|
|
28
28
|
"kibi-usage/resources/relationship-directions.md": "0fdd67032c2d15299f772845fc4f807eb9435b09507bd87a5911ab33db2f143d",
|
|
29
29
|
"kibi-usage/resources/source-authoring.md": "cad93f1e0ae08a676f2de7492f9227677880302327e74d159618fea86ca50abe",
|
|
30
30
|
"kibi-usage/resources/ui-requirements.md": "f99c2a9a73bbb7bd92ce1f231db3056d544588be149a5b0d3f7cc6f28bc9eee9",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
id: kibi-commit-review
|
|
3
3
|
name: kibi-commit-review
|
|
4
|
-
description: "Use when kibi check --staged or the Kibi pre-commit hook blocks a commit (kibi_impact_evidence_missing, symbols_manifest_stale, symbol_granularity_violation, symbol-coverage, kibi check-generated drift, Staged impact review failed), or when preparing a commit or pull-request impact review. Covers reading the per-file Detail lines, authoring .kb/symbols.yaml symbol entries through kb_upsert,
|
|
5
|
-
version: 1.
|
|
4
|
+
description: "Use when kibi check --staged or the Kibi pre-commit hook blocks a commit (kibi_impact_evidence_missing, symbols_manifest_stale, symbol_granularity_violation, symbol-coverage, kibi check-generated drift, Staged impact review failed), or when preparing a commit or pull-request impact review. Covers reading the per-file Detail lines, authoring .kb/symbols.yaml symbol entries through kb_upsert, staging the tracked Kibi evidence with git add (symbol coordinates are derived and never staged), kb_prepare_impact_review for a staged or diff scope, the kibi signoff requirements summary to show before a commit, and how merge commits and migration renames are judged."
|
|
5
|
+
version: 1.3.0
|
|
6
6
|
kibiCompatibility: ">=1.0.0"
|
|
7
7
|
tags:
|
|
8
8
|
- kibi
|
|
@@ -55,17 +55,17 @@ Never read or open any file under `.kb`, not even read-only with a file tool to
|
|
|
55
55
|
- New or uncovered symbols: author a `symbol` entity per listed symbol
|
|
56
56
|
through `kb_upsert` (`title` = the member the extractor names,
|
|
57
57
|
`sourceFile`, `status: active`, `symbol_role: behavioral`, `implements`
|
|
58
|
-
to the requirement, `covered_by` to the test).
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
to the requirement, `covered_by` to the test).
|
|
59
|
+
- Only lines moved: nothing to do. Symbol coordinates are derived locally
|
|
60
|
+
by every sync and never committed.
|
|
61
61
|
- No behavior change (a genuine false positive): see the audited
|
|
62
62
|
no-impact note in `resources/staged-gate.md`; it never covers a real
|
|
63
63
|
behavior change.
|
|
64
64
|
4. **Stage the evidence.** Kibi authors tracked files but never Git-stages or
|
|
65
65
|
commits them. `git status --short .kb` lists what it wrote; `git add` the
|
|
66
|
-
entity Markdown, `.kb/relationships/` shards
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
entity Markdown, `.kb/relationships/` shards and `.kb/symbols.yaml` that
|
|
67
|
+
belong to this change (use `git add -p` when the files hold unrelated
|
|
68
|
+
edits). `.kb/symbol-coordinates.yaml` is gitignored; never stage it.
|
|
69
69
|
5. **Re-run** `kibi check --staged` (and `kibi check-generated --staged` when it
|
|
70
70
|
failed) until it passes. Never bypass the hook (`--no-verify`) unless the
|
|
71
71
|
person says so.
|
|
@@ -8,10 +8,10 @@ not the working tree, so a fix counts only once it is staged.
|
|
|
8
8
|
## Reading a finding
|
|
9
9
|
|
|
10
10
|
```text
|
|
11
|
-
symbols_manifest_stale: .kb/
|
|
11
|
+
symbols_manifest_stale: .kb/symbols.yaml does not cover the declarations of staged source files: src/billing/refund.ts
|
|
12
12
|
Detail: src/billing/refund.ts — extraction finds 4 symbol(s), evidence covers 3.
|
|
13
13
|
Not in .kb/symbols.yaml: approveRefund (line 42)
|
|
14
|
-
Suggestion: Author .kb/symbols.yaml entries for the uncovered symbols (kibi upsert, with implements/covered_by links)
|
|
14
|
+
Suggestion: Author .kb/symbols.yaml entries for the uncovered symbols (kibi upsert, with implements/covered_by links). Stage .kb/symbols.yaml with the behavior edit, then re-run kibi check --staged.
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
- Detail lines name every symbol, never a shortened list. `Evidence without a
|
|
@@ -24,15 +24,15 @@ symbols_manifest_stale: .kb/symbol-coordinates.yaml is stale or missing for stag
|
|
|
24
24
|
|
|
25
25
|
| Id or message | Cause | Fix |
|
|
26
26
|
| --- | --- | --- |
|
|
27
|
-
| `kibi_impact_evidence_missing` | A staged behavior edit (changed lines in exported or behavior-bearing code, not comments or formatting) has no staged Kibi evidence. Test-only edits do not need it unless they add executable test symbols. | Query the owning knowledge; update it when behavior changed; stage entity Markdown under `.kb
|
|
28
|
-
| `symbols_manifest_stale` |
|
|
27
|
+
| `kibi_impact_evidence_missing` | A staged behavior edit (changed lines in exported or behavior-bearing code, not comments or formatting) has no staged Kibi evidence. Test-only edits do not need it unless they add executable test symbols. | Query the owning knowledge; update it when behavior changed; stage entity Markdown under `.kb/` or authored `.kb/symbols.yaml` entries for the listed symbols. A file whose every declaration already has a `.kb/symbols.yaml` entry needs nothing more. |
|
|
28
|
+
| `symbols_manifest_stale` | A staged behavior file declares symbols `.kb/symbols.yaml` has no entry for, or an entry names a declaration that is gone. | Author entries for the listed symbols, re-point or retire entries whose declaration is gone, and stage `.kb/symbols.yaml`. Coordinates are derived locally and never staged. |
|
|
29
29
|
| `symbol_granularity_violation` | A changed behavioral member is owned only by a coarse class or module symbol while a narrower declaration exists. | Add a symbol for the member itself (`title` = `Class.method` or the exported function) with its own links; use `granularity_reason` (`config-artifact`, `module-level-behavior`, `extractor-miss`, `legacy-link`, `test-suite`) only when it is true. |
|
|
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
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
|
-
| `kibi check-generated --staged` drift | The staged `.kb/symbols.yaml` or `.kb/symbol-coordinates.yaml`
|
|
35
|
+
| `kibi check-generated --staged` drift | The staged `.kb/symbols.yaml` is not in the layout sync writes, or `.kb/symbol-coordinates.yaml` is tracked. | `kibi sync --refresh-symbol-coordinates`, review the diff, stage only the intended hunks (`git add -p`); untrack a tracked coordinates file with `kibi migrate` (or `git rm --cached`). |
|
|
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
38
|
The staged gate does not judge evidence levels: the `evidence-floor` rule
|
|
@@ -98,6 +98,6 @@ does not prove it. Put the person's id there only when they reviewed it.
|
|
|
98
98
|
npx --no-install kibi check --staged # the gate
|
|
99
99
|
npx --no-install kibi check --staged --format json # with full evidence
|
|
100
100
|
npx --no-install kibi check-generated --staged # manifest drift
|
|
101
|
-
npx --no-install kibi sync --refresh-symbol-coordinates #
|
|
101
|
+
npx --no-install kibi sync --refresh-symbol-coordinates # rebuild local coordinates
|
|
102
102
|
git status --short .kb # what Kibi wrote
|
|
103
103
|
```
|