kibi-cursor 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor-plugin/plugin.json +1 -1
- package/CHANGELOG.md +10 -0
- package/README.md +15 -0
- package/agent-plugin/plugin.json +1 -1
- package/agent-plugin/skills/kibi-freshness/SKILL.md +1 -1
- package/agent-plugin/skills/kibi-usage/SKILL.md +37 -12
- package/agent-plugin/skills/kibi-usage/resources/operation-access.md +1 -1
- package/agent-plugin/skills/kibi-usage/resources/proof.md +105 -0
- package/agent-plugin/skills/kibi-usage/resources/workflows.md +6 -6
- package/dist/.cursor-plugin/plugin.json +1 -1
- package/dist/rules/kibi-workflow.mdc +16 -1
- package/dist/skills/.canon-hash.json +5 -4
- package/dist/skills/kibi-freshness/SKILL.md +1 -1
- package/dist/skills/kibi-usage/SKILL.md +37 -12
- package/dist/skills/kibi-usage/resources/operation-access.md +1 -1
- package/dist/skills/kibi-usage/resources/proof.md +105 -0
- package/dist/skills/kibi-usage/resources/workflows.md +6 -6
- package/package.json +1 -1
- package/rules/kibi-workflow.mdc +16 -1
- package/skills/.canon-hash.json +5 -4
- package/skills/kibi-freshness/SKILL.md +1 -1
- package/skills/kibi-usage/SKILL.md +37 -12
- package/skills/kibi-usage/resources/operation-access.md +1 -1
- package/skills/kibi-usage/resources/proof.md +105 -0
- package/skills/kibi-usage/resources/workflows.md +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-cursor",
|
|
3
3
|
"displayName": "Kibi",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "Optional Cursor adapter for Kibi. Requires SWI-Prolog 9+ and project-local kibi-cli, kibi-mcp, and kibi-core 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,15 @@
|
|
|
1
1
|
# kibi-cursor
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Cursor agents now get an always-on CLI recipe when Kibi MCP tools are missing, instead of treating Kibi as unavailable.
|
|
8
|
+
|
|
9
|
+
- Put the exact `npx --no-install kibi <route> --input -` command, MCP-to-CLI name mapping, and Shell-approval language in the always-applied workflow rule.
|
|
10
|
+
- Keep published plugin hooks advisory and untrusted by default; dogfood still opts into `--trusted-workspace` locally.
|
|
11
|
+
- Document the operator prerequisites (Agent mode, Shell, trusted workspace, project-local CLI) for the fallback to run.
|
|
12
|
+
|
|
3
13
|
## 1.0.0
|
|
4
14
|
|
|
5
15
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -135,6 +135,21 @@ Per the thin-adapter architecture, `kibi-cursor` does not:
|
|
|
135
135
|
- **Editor-specific value**: Cursor hooks for read/write reminders and session freshness follow-ups
|
|
136
136
|
- **Foundation**: `kibi-core`, `kibi-cli`, and `kibi-mcp` remain required for project-local operations
|
|
137
137
|
|
|
138
|
+
## CLI fallback when MCP is unavailable
|
|
139
|
+
|
|
140
|
+
The always-on `kibi-workflow` rule selects the trusted project-local CLI when Kibi MCP tools are not in the tool list. Hooks stay advisory and never execute that CLI themselves.
|
|
141
|
+
|
|
142
|
+
For the agent to actually run the fallback, the Cursor session needs:
|
|
143
|
+
|
|
144
|
+
- Agent mode with Shell enabled (Ask mode cannot run the CLI)
|
|
145
|
+
- A trusted workspace, or explicit operator approval of the project-local CLI
|
|
146
|
+
- Project-local `kibi-cli` (use `npx --no-install kibi` or `bunx --no-install kibi`; never a global or installing runner)
|
|
147
|
+
- Plugin rules loaded in the Cursor harness
|
|
148
|
+
|
|
149
|
+
If MCP tools are visible, use MCP and do not use this CLI path. If Shell is unavailable or the workspace is untrusted, stop and ask the operator; do not probe the CLI.
|
|
150
|
+
|
|
151
|
+
A Cursor model invoked outside Cursor's plugin harness will not load this rule. Inject the same always-on guidance into that host's system prompt or `AGENTS.md`.
|
|
152
|
+
|
|
138
153
|
## License
|
|
139
154
|
|
|
140
155
|
AGPL-3.0-or-later
|
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": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
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://github.com/Looted/kibi/blob/develop/docs/install.md",
|
|
@@ -39,7 +39,7 @@ echo '{}' | npx --no-install kibi status --input -
|
|
|
39
39
|
matching `branch.json`; a `legacy_compat` attachment is read-only until an
|
|
40
40
|
explicit old/new migration is approved.
|
|
41
41
|
- Inspect bounded `staleReasons` (indexed source missing/newer or documentation
|
|
42
|
-
source newer) and `
|
|
42
|
+
source newer) and `proofSnapshotChanges`. Kibi deliberately reports
|
|
43
43
|
editor/config paths such as editor dot-directories; do not silently ignore them.
|
|
44
44
|
- Use `kb_query`, or `query --input`, with `sourceFile` and text references for source-linked discovery.
|
|
45
45
|
- Re-run `kb_search`, or `search --input`, after sync gaps or stale context are detected.
|
|
@@ -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.1.
|
|
5
|
+
version: 2.1.1
|
|
6
6
|
kibiCompatibility: ">=1.0.0"
|
|
7
7
|
tags:
|
|
8
8
|
- kibi
|
|
@@ -19,6 +19,7 @@ resources:
|
|
|
19
19
|
- resources/relationship-directions.md
|
|
20
20
|
- resources/fact-lanes.md
|
|
21
21
|
- resources/workflows.md
|
|
22
|
+
- resources/proof.md
|
|
22
23
|
- resources/ui-requirements.md
|
|
23
24
|
- resources/logic-ir.md
|
|
24
25
|
- resources/kb-improvement.md
|
|
@@ -67,13 +68,28 @@ mutability, and Prolog requirements of each operation.
|
|
|
67
68
|
Kibi never Git-stages or commits those files. Do not read or edit `.kb`
|
|
68
69
|
directly.
|
|
69
70
|
5. Finish with targeted and final `kb_check`, then read status/coverage and
|
|
70
|
-
|
|
71
|
+
report the five independent closeout fields (not one inferred success flag).
|
|
71
72
|
|
|
72
73
|
Run `kb_check` with specific rules during iteration and the unfiltered final
|
|
73
74
|
check. Never fire `kb_upsert` calls in parallel; create or confirm endpoint
|
|
74
75
|
entities before linking them. The canonical MCP names are `kb_search`,
|
|
75
76
|
`kb_query`, `kb_upsert`, and `kb_check`.
|
|
76
77
|
|
|
78
|
+
## Closeout fields
|
|
79
|
+
|
|
80
|
+
End every task with these five independent fields:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
taskOutcome: complete | interim | blocked
|
|
84
|
+
kbState: clean_fresh | stale | dirty | legacy_compat | not_evaluated
|
|
85
|
+
verificationState: fresh | dirty | unavailable | not_evaluated
|
|
86
|
+
proofState: proven | mixed | unresolved | not_evaluated
|
|
87
|
+
limitationDisposition: none | accepted | unaccepted | not_applicable
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`taskOutcome` is whether the requested work finished. The other fields are
|
|
91
|
+
observed system state. A clean check can coexist with unresolved proof.
|
|
92
|
+
|
|
77
93
|
## Exact Git attachment
|
|
78
94
|
|
|
79
95
|
The active ref is the exact KB identity. `KIBI_BRANCH` is used verbatim; Git's
|
|
@@ -114,22 +130,31 @@ safe normative claims; use `observation` or `meta` for bug/workaround notes and
|
|
|
114
130
|
`flag` only for actual runtime/config gates. Requirements require scenarios,
|
|
115
131
|
tests, symbol ownership, and fresh proof-bearing receipts before claiming proof.
|
|
116
132
|
For an existing product KB that needs semantic backfill, read
|
|
117
|
-
`resources/kb-improvement.md
|
|
133
|
+
`resources/kb-improvement.md`, and `resources/proof.md` for the proof workflow.
|
|
118
134
|
|
|
119
135
|
## Predicate Ontology Decision Tree
|
|
120
136
|
|
|
121
|
-
Call `kb_semantic_advisor
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
137
|
+
Call `kb_semantic_advisor` on the complete prose before encoding a clause.
|
|
138
|
+
Set requirement `logic_claims` to exactly the assertive `claim_key` values.
|
|
139
|
+
For each relational clause, call `kb_suggest_predicates` with that clause and
|
|
140
|
+
`existingLogicClaims`. If lexical rank is a false positive, retry with the
|
|
141
|
+
reviewed `schemaId`. If `binding_status` is `incomplete`, supply
|
|
142
|
+
`argumentBindings` and retry. Persist `fact_kind: predicate` with the same
|
|
143
|
+
`claim_key` / `claim_text`, then link `REQ -> fact` with `requires_predicate`.
|
|
144
|
+
Use `kb_model_requirement` for strict scalar clauses. Use
|
|
145
|
+
`fact_kind: observation` only for a true ontology gap. The manifest is not
|
|
146
|
+
grounding: run `logic-coverage` so each key binds to one ground fact.
|
|
147
|
+
Relationship direction is fixed, and every `from` in a relationship batch
|
|
148
|
+
must equal the upserted entity ID.
|
|
127
149
|
|
|
128
150
|
## Symbol-First Traceability
|
|
129
151
|
|
|
130
|
-
Represent implementation ownership with a `symbol` entity
|
|
131
|
-
|
|
132
|
-
|
|
152
|
+
Represent implementation ownership with a `symbol` entity that has
|
|
153
|
+
`sourceFile`, `implements` to the requirement, and `covered_by` to the test.
|
|
154
|
+
Prolog `symbol-coverage` also requires the test to `validates` the requirement
|
|
155
|
+
(or the requirement `verified_by` the test). `covered_by` alone is not
|
|
156
|
+
enough. Do not rely on legacy `// implements REQ-xxx` comments as the
|
|
157
|
+
traceability record.
|
|
133
158
|
|
|
134
159
|
## Complete Logical Coverage
|
|
135
160
|
|
|
@@ -26,7 +26,7 @@ per operation. Effects are authoritative for mutability and adapter annotations.
|
|
|
26
26
|
| `kb_sparql_remote` | `sparql-remote` | --input JSON | read | no | network-read | peer; capability-selected | kibi.kb_sparql_remote.v1 | no | safe | yes | yes |
|
|
27
27
|
| `kb_compile_intent` | `compile-intent` | --input JSON | read | yes | kb-read, workspace-read | peer; capability-selected | kibi.kb_compile_intent.v1 | no | safe | no | yes |
|
|
28
28
|
| `kb_apply_plan` | `apply-plan` | --input JSON | write | yes | kb-read, kb-write, workspace-read, workspace-write | peer; capability-selected | kibi.kb_apply_plan.v1 | yes | unsafe | no | yes |
|
|
29
|
-
| `
|
|
29
|
+
| `kb_ingest_proof` | `ingest-proof` | --input JSON | write | yes | kb-read, kb-write, workspace-read | peer; capability-selected | kibi.kb_ingest_proof.v1 | yes | unsafe | no | yes |
|
|
30
30
|
|
|
31
31
|
## JSON execution recipe
|
|
32
32
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Proof and Verification Workflow
|
|
2
|
+
|
|
3
|
+
Use this resource when a requirement must be proven before handoff, when
|
|
4
|
+
wiring a proof-bearing test, or when `kb_ingest_proof` or `kibi prove`
|
|
5
|
+
rejected evidence.
|
|
6
|
+
|
|
7
|
+
Kibi does not support test runners. Kibi supports proof evidence. Any
|
|
8
|
+
producer (Playwright, pytest, JUnit, TAP, shell commands, database harnesses)
|
|
9
|
+
reports what happened as `kibi.proof-run.v1`; Kibi evaluates proof.
|
|
10
|
+
|
|
11
|
+
## Golden path
|
|
12
|
+
|
|
13
|
+
1. Query the test (`kb_query`, `type: test`) and read its
|
|
14
|
+
`kibi.proof-contract.v1`, `proof_bindings`, and `verification_scope`.
|
|
15
|
+
2. Run the configured producer through the canonical command:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
kibi prove --test TEST-<id>
|
|
19
|
+
# or: kibi prove --requirement REQ-<id> | --integration <id> | --all
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`kibi prove` captures the workspace snapshot, runs each integration's
|
|
23
|
+
producer once (`shell: false`), revalidates the snapshot, evaluates the
|
|
24
|
+
artifact against every selected contract, and appends idempotent
|
|
25
|
+
`kibi.proof-receipt.v1` receipts.
|
|
26
|
+
3. Confirm with `kb_status` (fresh, current snapshot) and `kb_coverage`.
|
|
27
|
+
|
|
28
|
+
Never hand-write receipts. Kibi derives them from validated
|
|
29
|
+
`kibi.proof-run.v1` artifacts only.
|
|
30
|
+
|
|
31
|
+
## Proof contracts
|
|
32
|
+
|
|
33
|
+
A proof-bearing test declares explicit obligations (never a Cartesian
|
|
34
|
+
cases-times-projects matrix):
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
verification_scope: end_to_end
|
|
38
|
+
verification_perspective: consumer
|
|
39
|
+
proof_contract:
|
|
40
|
+
version: kibi.proof-contract.v1
|
|
41
|
+
integration: web-e2e # id from .kb/proof/integrations.json
|
|
42
|
+
required_proofs:
|
|
43
|
+
- symbol_id: SYM-PW-4F2A9C61B7D03E85
|
|
44
|
+
target: chromium # browser, runtime, db, device, or default
|
|
45
|
+
success_policy: all_required_first_attempt
|
|
46
|
+
proof_bindings: # optional provenance metadata
|
|
47
|
+
- symbol_id: SYM-PW-4F2A9C61B7D03E85
|
|
48
|
+
target: chromium
|
|
49
|
+
native_id: tests/checkout.spec.ts::accepts a card
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Provenance lives in `proof_bindings`; the contract stays semantic.
|
|
53
|
+
|
|
54
|
+
## Integration configuration
|
|
55
|
+
|
|
56
|
+
`.kb/proof/integrations.json` (`kibi.proof-integration.v1`) is tracked,
|
|
57
|
+
Kibi-managed configuration describing evidence production only:
|
|
58
|
+
|
|
59
|
+
- `producer: command` — Kibi synthesizes the envelope from the process
|
|
60
|
+
outcome; obligations are bound with `aggregate_run` provenance and the
|
|
61
|
+
single process invocation counts as the known first attempt.
|
|
62
|
+
- `producer: playwright` (or custom) — the child emits `kibi.proof-run.v1`
|
|
63
|
+
itself (bundled reporter: `kibi-cli/playwright-reporter`).
|
|
64
|
+
- `producer: junit` / `tap` — Kibi converts the native report at `artifact`
|
|
65
|
+
using each test's `proof_bindings`; standard formats carry no retry
|
|
66
|
+
history, so attempts are reported as `unavailable` and fail the strict
|
|
67
|
+
first-attempt policy closed.
|
|
68
|
+
|
|
69
|
+
Cosmetic edits (descriptions, labels) never stale proof. Execution-relevant
|
|
70
|
+
edits (command, artifact, targets, options, bindings, contract) change the
|
|
71
|
+
effective fingerprint and do.
|
|
72
|
+
|
|
73
|
+
## Attempt semantics (factual, never optimistic)
|
|
74
|
+
|
|
75
|
+
- `attempts: {status: "complete", entries: [...]}` — known history; the
|
|
76
|
+
strict policy requires a passing **first** entry.
|
|
77
|
+
- `attempts: {status: "unavailable"}` — unknown native history; the strict
|
|
78
|
+
policy fails closed, except `aggregate_run` results, which are satisfied by
|
|
79
|
+
the Kibi-launched process attempt when the run passed with exit code 0.
|
|
80
|
+
- `run.outcome` is authoritative: a failed, errored, cancelled, interrupted,
|
|
81
|
+
or `no_results` run proves nothing, even with passing individual results.
|
|
82
|
+
|
|
83
|
+
## Common rejections
|
|
84
|
+
|
|
85
|
+
- `No proof integration configuration` — bootstrap has not configured proof
|
|
86
|
+
for this repository yet; do not hand-wave, run the bootstrap proof step.
|
|
87
|
+
- `captured snapshot is not the live workspace snapshot` — the tree changed
|
|
88
|
+
between capture and ingest; re-run `kibi prove`.
|
|
89
|
+
- `artifact command_argv does not match the configured command` — the
|
|
90
|
+
artifact came from a different command than `integrations.json` configures.
|
|
91
|
+
- `attempt history unavailable` — the producer could not prove first-attempt
|
|
92
|
+
success for a native-case obligation; use a producer with complete history
|
|
93
|
+
or accept aggregate provenance.
|
|
94
|
+
- `proof_receipts is append-only` — receipts are append-only; update tests
|
|
95
|
+
through the engine (which appends) or include the existing history when
|
|
96
|
+
authoring test files directly.
|
|
97
|
+
|
|
98
|
+
## After code changes
|
|
99
|
+
|
|
100
|
+
Receipts bind to the snapshot, contract hash, and execution fingerprint at
|
|
101
|
+
run time. Any code or source change moves the snapshot and stales receipts:
|
|
102
|
+
re-run `kibi prove` for the affected selection, then confirm `kb_status` and
|
|
103
|
+
`kb_coverage` before handoff.
|
|
104
|
+
|
|
105
|
+
Full reference: `docs/proving-requirements.md`.
|
|
@@ -25,7 +25,7 @@ Receipt reuse is safe only when the live verification snapshot, contract hash,
|
|
|
25
25
|
freshness window, and every required case result still match. Otherwise rerun
|
|
26
26
|
the contracted command. If the contract changed, retain every older receipt
|
|
27
27
|
unchanged, append evidence for the current contract, and keep proof unresolved
|
|
28
|
-
with `
|
|
28
|
+
with `proof_contract_mismatch` until that current receipt exists.
|
|
29
29
|
Obsolete symbols require current extraction or Git evidence before
|
|
30
30
|
remap/deletion; transfer coverage only when existing test evidence supports it,
|
|
31
31
|
then sync and read back status. Same-version packages with different export
|
|
@@ -46,7 +46,7 @@ The canonical workflow for any KB operation follows this pattern:
|
|
|
46
46
|
7. **Create endpoints**: validated `kb_upsert` for new entities, sequentially
|
|
47
47
|
8. **Link**: validated `kb_upsert` with `requires_rule`, `requires_predicate`, `constrains`, or `requires_property`, sequentially
|
|
48
48
|
9. **Validate coverage and consistency**: targeted `rule-safety`, `rule-verifiability`, `semantic-completeness`, `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`, then final full `kb_check`
|
|
49
|
-
10. **Prove execution**: read `kb_status.
|
|
49
|
+
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.
|
|
50
50
|
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
|
|
51
51
|
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
|
|
52
52
|
|
|
@@ -74,7 +74,7 @@ choose package managers, ground semantic claims, resolve contradictions, rerun
|
|
|
74
74
|
E2E tests, rewrite receipt history, remap authored symbols, or accept
|
|
75
75
|
limitations. Those actions remain explicit review/operator/execution steps.
|
|
76
76
|
|
|
77
|
-
For `e2e_receipt_freshness_low`, query each listed requirement/test gap and run
|
|
77
|
+
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.
|
|
78
78
|
|
|
79
79
|
## Creating a New Feature
|
|
80
80
|
```
|
|
@@ -101,12 +101,12 @@ Do not create a test-fact pair. Facts describe invariants; requirements or scena
|
|
|
101
101
|
## Fresh E2E Receipt Workflow
|
|
102
102
|
|
|
103
103
|
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.
|
|
104
|
-
2. Read `kb_status` and retain its available `
|
|
104
|
+
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.
|
|
105
105
|
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.
|
|
106
|
-
4. Preserve every existing receipt byte-for-byte and append the derived `kibi.
|
|
106
|
+
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.
|
|
107
107
|
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.
|
|
108
108
|
|
|
109
|
-
Only the newest receipt matching
|
|
109
|
+
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.
|
|
110
110
|
|
|
111
111
|
## Predicate-First Requirement Modeling
|
|
112
112
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-cursor",
|
|
3
3
|
"displayName": "Kibi",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "Optional Cursor adapter for Kibi. Requires SWI-Prolog 9+ and project-local kibi-cli, kibi-mcp, and kibi-core before the bundled MCP server can start.",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|
|
7
7
|
"author": {
|
|
@@ -3,7 +3,22 @@ description: Kibi capability-based discovery-first workflow and KB mutation disc
|
|
|
3
3
|
alwaysApply: true
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Use Kibi via MCP tools when available, or via CLI JSON routes when MCP is unavailable.
|
|
6
|
+
Use Kibi via MCP tools when available, or via CLI JSON routes when MCP is unavailable.
|
|
7
|
+
|
|
8
|
+
Interface selection:
|
|
9
|
+
1. If any `kb_*` or `kibi_kb_*` tool is in the tool list, use MCP only. Do not use the CLI path.
|
|
10
|
+
2. Else if Shell (or equivalent) is available and the project-local CLI is trusted, run the non-installing JSON recipe below. Missing MCP tools does not mean Kibi is unavailable.
|
|
11
|
+
3. Else stop and tell the operator. Do not probe the CLI, do not install packages, and do not infer MCP availability from config file existence.
|
|
12
|
+
4. Shell is in-policy only for the trusted project-local `npx --no-install kibi ...` (or `bunx --no-install kibi ...`) command when step 2 applies.
|
|
13
|
+
5. Never use a global fallback, an installing runner, or an unapproved route. Do not read or edit `.kb/` files directly.
|
|
14
|
+
|
|
15
|
+
CLI JSON recipe (stdin is one UTF-8 JSON object):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
printf '%s\n' '{"query":"checkout","limit":10}' | npx --no-install kibi search --input -
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Map canonical MCP names to CLI routes by dropping the `kb_` prefix and replacing `_` with `-` (`kb_search` → `search`, `kb_find_gaps` → `find-gaps`, `kb_query` → `query`, `kb_status` → `status`, `kb_check` → `check`, `kb_upsert` → `upsert`).
|
|
7
22
|
|
|
8
23
|
Discovery workflow:
|
|
9
24
|
- Start with `kb_search` for broad discovery.
|
|
@@ -4,7 +4,7 @@
|
|
|
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-freshness/SKILL.md": "
|
|
7
|
+
"kibi-freshness/SKILL.md": "fa90d34663ddd6f03468008fb26e4417211f7b7d46ffde082291747743464c54",
|
|
8
8
|
"kibi-freshness/resources/branch-lifecycle.md": "ebc01b19fe3dca8df5fc0175978963f6f1204f71f7c805cb2a5fb1b277ac78e4",
|
|
9
9
|
"kibi-freshness/resources/operation-access.md": "4e1db9294ee540cd29b8b3a2532a81e7894d5b4228b39e99ba48b37212f489f3",
|
|
10
10
|
"kibi-freshness/resources/source-authoring.md": "41a0547ce4d2a112a0f3671d36720f07c447864db3b473e94eb88a8ce2d371ff",
|
|
@@ -13,14 +13,15 @@
|
|
|
13
13
|
"kibi-traceability/resources/operation-access.md": "39f7972ab7f4ae7479e78f7072bb50e8e6c4cdf4f857425f69d2522d37db437c",
|
|
14
14
|
"kibi-traceability/resources/source-authoring.md": "408c6ee2bef1b84e0194c0538ef929c26a0a617e631b2234247388140dbbdd08",
|
|
15
15
|
"kibi-traceability/resources/traceability.md": "38c290a0bc71bd1692e115f22694743946e2f69630e134acfd43cee5f613fb88",
|
|
16
|
-
"kibi-usage/SKILL.md": "
|
|
16
|
+
"kibi-usage/SKILL.md": "ed42d8f6caf8048b81c05f670018c5f341e0667e3fa4aff2bf11277e9deb3c2f",
|
|
17
17
|
"kibi-usage/resources/branch-lifecycle.md": "f1bf359e9826e83c548f3cd0287f8175a62456527b0132b06b3f9f74aa59b7d6",
|
|
18
18
|
"kibi-usage/resources/fact-lanes.md": "41b28023a57593009867ea0ebc8e9f3f05c3bd837144772d12844423f922e763",
|
|
19
19
|
"kibi-usage/resources/kb-improvement.md": "17e8b6cf6a0dd43b443a2bfd92e7205d099647a5f1c75fe85413a6cea63d86c6",
|
|
20
20
|
"kibi-usage/resources/logic-ir.md": "151675d0ffa813cb9e271084102a3af42de369b8f9a0c64866af0cdc4d924063",
|
|
21
|
-
"kibi-usage/resources/operation-access.md": "
|
|
21
|
+
"kibi-usage/resources/operation-access.md": "e8b4a3676892d2f7e2cfd708ec4ad1f41b6f296e1eb3a5ecc047f43322b4a92a",
|
|
22
|
+
"kibi-usage/resources/proof.md": "e1a44ea4bf342afebb0aaa7800221067a511f6607c687ac38db6392b7e3d9f9a",
|
|
22
23
|
"kibi-usage/resources/relationship-directions.md": "a357072d3370db9b7d80e505795f952909a68778cc18b1d089970de91e4fda46",
|
|
23
24
|
"kibi-usage/resources/source-authoring.md": "ac4f1a9b5785462f8c3530bdcdb82ad9a0ee1f4049454ae28bf4df09ff267ebd",
|
|
24
25
|
"kibi-usage/resources/ui-requirements.md": "b7c31ab1affa3ab25ae5242d8fd8c4d546532d1cafc65d84088375317c1682cc",
|
|
25
|
-
"kibi-usage/resources/workflows.md": "
|
|
26
|
+
"kibi-usage/resources/workflows.md": "776b97a794325e7012a230d2b9fc32fc89b2a51df45dfd8498cad49170bdc43d"
|
|
26
27
|
}
|
|
@@ -39,7 +39,7 @@ echo '{}' | npx --no-install kibi status --input -
|
|
|
39
39
|
matching `branch.json`; a `legacy_compat` attachment is read-only until an
|
|
40
40
|
explicit old/new migration is approved.
|
|
41
41
|
- Inspect bounded `staleReasons` (indexed source missing/newer or documentation
|
|
42
|
-
source newer) and `
|
|
42
|
+
source newer) and `proofSnapshotChanges`. Kibi deliberately reports
|
|
43
43
|
editor/config paths such as editor dot-directories; do not silently ignore them.
|
|
44
44
|
- Use `kb_query`, or `query --input`, with `sourceFile` and text references for source-linked discovery.
|
|
45
45
|
- Re-run `kb_search`, or `search --input`, after sync gaps or stale context are detected.
|
|
@@ -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.1.
|
|
5
|
+
version: 2.1.1
|
|
6
6
|
kibiCompatibility: ">=1.0.0"
|
|
7
7
|
tags:
|
|
8
8
|
- kibi
|
|
@@ -19,6 +19,7 @@ resources:
|
|
|
19
19
|
- resources/relationship-directions.md
|
|
20
20
|
- resources/fact-lanes.md
|
|
21
21
|
- resources/workflows.md
|
|
22
|
+
- resources/proof.md
|
|
22
23
|
- resources/ui-requirements.md
|
|
23
24
|
- resources/logic-ir.md
|
|
24
25
|
- resources/kb-improvement.md
|
|
@@ -67,13 +68,28 @@ mutability, and Prolog requirements of each operation.
|
|
|
67
68
|
Kibi never Git-stages or commits those files. Do not read or edit `.kb`
|
|
68
69
|
directly.
|
|
69
70
|
5. Finish with targeted and final `kb_check`, then read status/coverage and
|
|
70
|
-
|
|
71
|
+
report the five independent closeout fields (not one inferred success flag).
|
|
71
72
|
|
|
72
73
|
Run `kb_check` with specific rules during iteration and the unfiltered final
|
|
73
74
|
check. Never fire `kb_upsert` calls in parallel; create or confirm endpoint
|
|
74
75
|
entities before linking them. The canonical MCP names are `kb_search`,
|
|
75
76
|
`kb_query`, `kb_upsert`, and `kb_check`.
|
|
76
77
|
|
|
78
|
+
## Closeout fields
|
|
79
|
+
|
|
80
|
+
End every task with these five independent fields:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
taskOutcome: complete | interim | blocked
|
|
84
|
+
kbState: clean_fresh | stale | dirty | legacy_compat | not_evaluated
|
|
85
|
+
verificationState: fresh | dirty | unavailable | not_evaluated
|
|
86
|
+
proofState: proven | mixed | unresolved | not_evaluated
|
|
87
|
+
limitationDisposition: none | accepted | unaccepted | not_applicable
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`taskOutcome` is whether the requested work finished. The other fields are
|
|
91
|
+
observed system state. A clean check can coexist with unresolved proof.
|
|
92
|
+
|
|
77
93
|
## Exact Git attachment
|
|
78
94
|
|
|
79
95
|
The active ref is the exact KB identity. `KIBI_BRANCH` is used verbatim; Git's
|
|
@@ -114,22 +130,31 @@ safe normative claims; use `observation` or `meta` for bug/workaround notes and
|
|
|
114
130
|
`flag` only for actual runtime/config gates. Requirements require scenarios,
|
|
115
131
|
tests, symbol ownership, and fresh proof-bearing receipts before claiming proof.
|
|
116
132
|
For an existing product KB that needs semantic backfill, read
|
|
117
|
-
`resources/kb-improvement.md
|
|
133
|
+
`resources/kb-improvement.md`, and `resources/proof.md` for the proof workflow.
|
|
118
134
|
|
|
119
135
|
## Predicate Ontology Decision Tree
|
|
120
136
|
|
|
121
|
-
Call `kb_semantic_advisor
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
137
|
+
Call `kb_semantic_advisor` on the complete prose before encoding a clause.
|
|
138
|
+
Set requirement `logic_claims` to exactly the assertive `claim_key` values.
|
|
139
|
+
For each relational clause, call `kb_suggest_predicates` with that clause and
|
|
140
|
+
`existingLogicClaims`. If lexical rank is a false positive, retry with the
|
|
141
|
+
reviewed `schemaId`. If `binding_status` is `incomplete`, supply
|
|
142
|
+
`argumentBindings` and retry. Persist `fact_kind: predicate` with the same
|
|
143
|
+
`claim_key` / `claim_text`, then link `REQ -> fact` with `requires_predicate`.
|
|
144
|
+
Use `kb_model_requirement` for strict scalar clauses. Use
|
|
145
|
+
`fact_kind: observation` only for a true ontology gap. The manifest is not
|
|
146
|
+
grounding: run `logic-coverage` so each key binds to one ground fact.
|
|
147
|
+
Relationship direction is fixed, and every `from` in a relationship batch
|
|
148
|
+
must equal the upserted entity ID.
|
|
127
149
|
|
|
128
150
|
## Symbol-First Traceability
|
|
129
151
|
|
|
130
|
-
Represent implementation ownership with a `symbol` entity
|
|
131
|
-
|
|
132
|
-
|
|
152
|
+
Represent implementation ownership with a `symbol` entity that has
|
|
153
|
+
`sourceFile`, `implements` to the requirement, and `covered_by` to the test.
|
|
154
|
+
Prolog `symbol-coverage` also requires the test to `validates` the requirement
|
|
155
|
+
(or the requirement `verified_by` the test). `covered_by` alone is not
|
|
156
|
+
enough. Do not rely on legacy `// implements REQ-xxx` comments as the
|
|
157
|
+
traceability record.
|
|
133
158
|
|
|
134
159
|
## Complete Logical Coverage
|
|
135
160
|
|
|
@@ -26,7 +26,7 @@ per operation. Effects are authoritative for mutability and adapter annotations.
|
|
|
26
26
|
| `kb_sparql_remote` | `sparql-remote` | --input JSON | read | no | network-read | peer; capability-selected | kibi.kb_sparql_remote.v1 | no | safe | yes | yes |
|
|
27
27
|
| `kb_compile_intent` | `compile-intent` | --input JSON | read | yes | kb-read, workspace-read | peer; capability-selected | kibi.kb_compile_intent.v1 | no | safe | no | yes |
|
|
28
28
|
| `kb_apply_plan` | `apply-plan` | --input JSON | write | yes | kb-read, kb-write, workspace-read, workspace-write | peer; capability-selected | kibi.kb_apply_plan.v1 | yes | unsafe | no | yes |
|
|
29
|
-
| `
|
|
29
|
+
| `kb_ingest_proof` | `ingest-proof` | --input JSON | write | yes | kb-read, kb-write, workspace-read | peer; capability-selected | kibi.kb_ingest_proof.v1 | yes | unsafe | no | yes |
|
|
30
30
|
|
|
31
31
|
## JSON execution recipe
|
|
32
32
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Proof and Verification Workflow
|
|
2
|
+
|
|
3
|
+
Use this resource when a requirement must be proven before handoff, when
|
|
4
|
+
wiring a proof-bearing test, or when `kb_ingest_proof` or `kibi prove`
|
|
5
|
+
rejected evidence.
|
|
6
|
+
|
|
7
|
+
Kibi does not support test runners. Kibi supports proof evidence. Any
|
|
8
|
+
producer (Playwright, pytest, JUnit, TAP, shell commands, database harnesses)
|
|
9
|
+
reports what happened as `kibi.proof-run.v1`; Kibi evaluates proof.
|
|
10
|
+
|
|
11
|
+
## Golden path
|
|
12
|
+
|
|
13
|
+
1. Query the test (`kb_query`, `type: test`) and read its
|
|
14
|
+
`kibi.proof-contract.v1`, `proof_bindings`, and `verification_scope`.
|
|
15
|
+
2. Run the configured producer through the canonical command:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
kibi prove --test TEST-<id>
|
|
19
|
+
# or: kibi prove --requirement REQ-<id> | --integration <id> | --all
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`kibi prove` captures the workspace snapshot, runs each integration's
|
|
23
|
+
producer once (`shell: false`), revalidates the snapshot, evaluates the
|
|
24
|
+
artifact against every selected contract, and appends idempotent
|
|
25
|
+
`kibi.proof-receipt.v1` receipts.
|
|
26
|
+
3. Confirm with `kb_status` (fresh, current snapshot) and `kb_coverage`.
|
|
27
|
+
|
|
28
|
+
Never hand-write receipts. Kibi derives them from validated
|
|
29
|
+
`kibi.proof-run.v1` artifacts only.
|
|
30
|
+
|
|
31
|
+
## Proof contracts
|
|
32
|
+
|
|
33
|
+
A proof-bearing test declares explicit obligations (never a Cartesian
|
|
34
|
+
cases-times-projects matrix):
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
verification_scope: end_to_end
|
|
38
|
+
verification_perspective: consumer
|
|
39
|
+
proof_contract:
|
|
40
|
+
version: kibi.proof-contract.v1
|
|
41
|
+
integration: web-e2e # id from .kb/proof/integrations.json
|
|
42
|
+
required_proofs:
|
|
43
|
+
- symbol_id: SYM-PW-4F2A9C61B7D03E85
|
|
44
|
+
target: chromium # browser, runtime, db, device, or default
|
|
45
|
+
success_policy: all_required_first_attempt
|
|
46
|
+
proof_bindings: # optional provenance metadata
|
|
47
|
+
- symbol_id: SYM-PW-4F2A9C61B7D03E85
|
|
48
|
+
target: chromium
|
|
49
|
+
native_id: tests/checkout.spec.ts::accepts a card
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Provenance lives in `proof_bindings`; the contract stays semantic.
|
|
53
|
+
|
|
54
|
+
## Integration configuration
|
|
55
|
+
|
|
56
|
+
`.kb/proof/integrations.json` (`kibi.proof-integration.v1`) is tracked,
|
|
57
|
+
Kibi-managed configuration describing evidence production only:
|
|
58
|
+
|
|
59
|
+
- `producer: command` — Kibi synthesizes the envelope from the process
|
|
60
|
+
outcome; obligations are bound with `aggregate_run` provenance and the
|
|
61
|
+
single process invocation counts as the known first attempt.
|
|
62
|
+
- `producer: playwright` (or custom) — the child emits `kibi.proof-run.v1`
|
|
63
|
+
itself (bundled reporter: `kibi-cli/playwright-reporter`).
|
|
64
|
+
- `producer: junit` / `tap` — Kibi converts the native report at `artifact`
|
|
65
|
+
using each test's `proof_bindings`; standard formats carry no retry
|
|
66
|
+
history, so attempts are reported as `unavailable` and fail the strict
|
|
67
|
+
first-attempt policy closed.
|
|
68
|
+
|
|
69
|
+
Cosmetic edits (descriptions, labels) never stale proof. Execution-relevant
|
|
70
|
+
edits (command, artifact, targets, options, bindings, contract) change the
|
|
71
|
+
effective fingerprint and do.
|
|
72
|
+
|
|
73
|
+
## Attempt semantics (factual, never optimistic)
|
|
74
|
+
|
|
75
|
+
- `attempts: {status: "complete", entries: [...]}` — known history; the
|
|
76
|
+
strict policy requires a passing **first** entry.
|
|
77
|
+
- `attempts: {status: "unavailable"}` — unknown native history; the strict
|
|
78
|
+
policy fails closed, except `aggregate_run` results, which are satisfied by
|
|
79
|
+
the Kibi-launched process attempt when the run passed with exit code 0.
|
|
80
|
+
- `run.outcome` is authoritative: a failed, errored, cancelled, interrupted,
|
|
81
|
+
or `no_results` run proves nothing, even with passing individual results.
|
|
82
|
+
|
|
83
|
+
## Common rejections
|
|
84
|
+
|
|
85
|
+
- `No proof integration configuration` — bootstrap has not configured proof
|
|
86
|
+
for this repository yet; do not hand-wave, run the bootstrap proof step.
|
|
87
|
+
- `captured snapshot is not the live workspace snapshot` — the tree changed
|
|
88
|
+
between capture and ingest; re-run `kibi prove`.
|
|
89
|
+
- `artifact command_argv does not match the configured command` — the
|
|
90
|
+
artifact came from a different command than `integrations.json` configures.
|
|
91
|
+
- `attempt history unavailable` — the producer could not prove first-attempt
|
|
92
|
+
success for a native-case obligation; use a producer with complete history
|
|
93
|
+
or accept aggregate provenance.
|
|
94
|
+
- `proof_receipts is append-only` — receipts are append-only; update tests
|
|
95
|
+
through the engine (which appends) or include the existing history when
|
|
96
|
+
authoring test files directly.
|
|
97
|
+
|
|
98
|
+
## After code changes
|
|
99
|
+
|
|
100
|
+
Receipts bind to the snapshot, contract hash, and execution fingerprint at
|
|
101
|
+
run time. Any code or source change moves the snapshot and stales receipts:
|
|
102
|
+
re-run `kibi prove` for the affected selection, then confirm `kb_status` and
|
|
103
|
+
`kb_coverage` before handoff.
|
|
104
|
+
|
|
105
|
+
Full reference: `docs/proving-requirements.md`.
|
|
@@ -25,7 +25,7 @@ Receipt reuse is safe only when the live verification snapshot, contract hash,
|
|
|
25
25
|
freshness window, and every required case result still match. Otherwise rerun
|
|
26
26
|
the contracted command. If the contract changed, retain every older receipt
|
|
27
27
|
unchanged, append evidence for the current contract, and keep proof unresolved
|
|
28
|
-
with `
|
|
28
|
+
with `proof_contract_mismatch` until that current receipt exists.
|
|
29
29
|
Obsolete symbols require current extraction or Git evidence before
|
|
30
30
|
remap/deletion; transfer coverage only when existing test evidence supports it,
|
|
31
31
|
then sync and read back status. Same-version packages with different export
|
|
@@ -46,7 +46,7 @@ The canonical workflow for any KB operation follows this pattern:
|
|
|
46
46
|
7. **Create endpoints**: validated `kb_upsert` for new entities, sequentially
|
|
47
47
|
8. **Link**: validated `kb_upsert` with `requires_rule`, `requires_predicate`, `constrains`, or `requires_property`, sequentially
|
|
48
48
|
9. **Validate coverage and consistency**: targeted `rule-safety`, `rule-verifiability`, `semantic-completeness`, `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`, then final full `kb_check`
|
|
49
|
-
10. **Prove execution**: read `kb_status.
|
|
49
|
+
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.
|
|
50
50
|
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
|
|
51
51
|
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
|
|
52
52
|
|
|
@@ -74,7 +74,7 @@ choose package managers, ground semantic claims, resolve contradictions, rerun
|
|
|
74
74
|
E2E tests, rewrite receipt history, remap authored symbols, or accept
|
|
75
75
|
limitations. Those actions remain explicit review/operator/execution steps.
|
|
76
76
|
|
|
77
|
-
For `e2e_receipt_freshness_low`, query each listed requirement/test gap and run
|
|
77
|
+
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.
|
|
78
78
|
|
|
79
79
|
## Creating a New Feature
|
|
80
80
|
```
|
|
@@ -101,12 +101,12 @@ Do not create a test-fact pair. Facts describe invariants; requirements or scena
|
|
|
101
101
|
## Fresh E2E Receipt Workflow
|
|
102
102
|
|
|
103
103
|
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.
|
|
104
|
-
2. Read `kb_status` and retain its available `
|
|
104
|
+
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.
|
|
105
105
|
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.
|
|
106
|
-
4. Preserve every existing receipt byte-for-byte and append the derived `kibi.
|
|
106
|
+
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.
|
|
107
107
|
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.
|
|
108
108
|
|
|
109
|
-
Only the newest receipt matching
|
|
109
|
+
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.
|
|
110
110
|
|
|
111
111
|
## Predicate-First Requirement Modeling
|
|
112
112
|
|
package/package.json
CHANGED
package/rules/kibi-workflow.mdc
CHANGED
|
@@ -3,7 +3,22 @@ description: Kibi capability-based discovery-first workflow and KB mutation disc
|
|
|
3
3
|
alwaysApply: true
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Use Kibi via MCP tools when available, or via CLI JSON routes when MCP is unavailable.
|
|
6
|
+
Use Kibi via MCP tools when available, or via CLI JSON routes when MCP is unavailable.
|
|
7
|
+
|
|
8
|
+
Interface selection:
|
|
9
|
+
1. If any `kb_*` or `kibi_kb_*` tool is in the tool list, use MCP only. Do not use the CLI path.
|
|
10
|
+
2. Else if Shell (or equivalent) is available and the project-local CLI is trusted, run the non-installing JSON recipe below. Missing MCP tools does not mean Kibi is unavailable.
|
|
11
|
+
3. Else stop and tell the operator. Do not probe the CLI, do not install packages, and do not infer MCP availability from config file existence.
|
|
12
|
+
4. Shell is in-policy only for the trusted project-local `npx --no-install kibi ...` (or `bunx --no-install kibi ...`) command when step 2 applies.
|
|
13
|
+
5. Never use a global fallback, an installing runner, or an unapproved route. Do not read or edit `.kb/` files directly.
|
|
14
|
+
|
|
15
|
+
CLI JSON recipe (stdin is one UTF-8 JSON object):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
printf '%s\n' '{"query":"checkout","limit":10}' | npx --no-install kibi search --input -
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Map canonical MCP names to CLI routes by dropping the `kb_` prefix and replacing `_` with `-` (`kb_search` → `search`, `kb_find_gaps` → `find-gaps`, `kb_query` → `query`, `kb_status` → `status`, `kb_check` → `check`, `kb_upsert` → `upsert`).
|
|
7
22
|
|
|
8
23
|
Discovery workflow:
|
|
9
24
|
- Start with `kb_search` for broad discovery.
|
package/skills/.canon-hash.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
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-freshness/SKILL.md": "
|
|
7
|
+
"kibi-freshness/SKILL.md": "fa90d34663ddd6f03468008fb26e4417211f7b7d46ffde082291747743464c54",
|
|
8
8
|
"kibi-freshness/resources/branch-lifecycle.md": "ebc01b19fe3dca8df5fc0175978963f6f1204f71f7c805cb2a5fb1b277ac78e4",
|
|
9
9
|
"kibi-freshness/resources/operation-access.md": "4e1db9294ee540cd29b8b3a2532a81e7894d5b4228b39e99ba48b37212f489f3",
|
|
10
10
|
"kibi-freshness/resources/source-authoring.md": "41a0547ce4d2a112a0f3671d36720f07c447864db3b473e94eb88a8ce2d371ff",
|
|
@@ -13,14 +13,15 @@
|
|
|
13
13
|
"kibi-traceability/resources/operation-access.md": "39f7972ab7f4ae7479e78f7072bb50e8e6c4cdf4f857425f69d2522d37db437c",
|
|
14
14
|
"kibi-traceability/resources/source-authoring.md": "408c6ee2bef1b84e0194c0538ef929c26a0a617e631b2234247388140dbbdd08",
|
|
15
15
|
"kibi-traceability/resources/traceability.md": "38c290a0bc71bd1692e115f22694743946e2f69630e134acfd43cee5f613fb88",
|
|
16
|
-
"kibi-usage/SKILL.md": "
|
|
16
|
+
"kibi-usage/SKILL.md": "ed42d8f6caf8048b81c05f670018c5f341e0667e3fa4aff2bf11277e9deb3c2f",
|
|
17
17
|
"kibi-usage/resources/branch-lifecycle.md": "f1bf359e9826e83c548f3cd0287f8175a62456527b0132b06b3f9f74aa59b7d6",
|
|
18
18
|
"kibi-usage/resources/fact-lanes.md": "41b28023a57593009867ea0ebc8e9f3f05c3bd837144772d12844423f922e763",
|
|
19
19
|
"kibi-usage/resources/kb-improvement.md": "17e8b6cf6a0dd43b443a2bfd92e7205d099647a5f1c75fe85413a6cea63d86c6",
|
|
20
20
|
"kibi-usage/resources/logic-ir.md": "151675d0ffa813cb9e271084102a3af42de369b8f9a0c64866af0cdc4d924063",
|
|
21
|
-
"kibi-usage/resources/operation-access.md": "
|
|
21
|
+
"kibi-usage/resources/operation-access.md": "e8b4a3676892d2f7e2cfd708ec4ad1f41b6f296e1eb3a5ecc047f43322b4a92a",
|
|
22
|
+
"kibi-usage/resources/proof.md": "e1a44ea4bf342afebb0aaa7800221067a511f6607c687ac38db6392b7e3d9f9a",
|
|
22
23
|
"kibi-usage/resources/relationship-directions.md": "a357072d3370db9b7d80e505795f952909a68778cc18b1d089970de91e4fda46",
|
|
23
24
|
"kibi-usage/resources/source-authoring.md": "ac4f1a9b5785462f8c3530bdcdb82ad9a0ee1f4049454ae28bf4df09ff267ebd",
|
|
24
25
|
"kibi-usage/resources/ui-requirements.md": "b7c31ab1affa3ab25ae5242d8fd8c4d546532d1cafc65d84088375317c1682cc",
|
|
25
|
-
"kibi-usage/resources/workflows.md": "
|
|
26
|
+
"kibi-usage/resources/workflows.md": "776b97a794325e7012a230d2b9fc32fc89b2a51df45dfd8498cad49170bdc43d"
|
|
26
27
|
}
|
|
@@ -39,7 +39,7 @@ echo '{}' | npx --no-install kibi status --input -
|
|
|
39
39
|
matching `branch.json`; a `legacy_compat` attachment is read-only until an
|
|
40
40
|
explicit old/new migration is approved.
|
|
41
41
|
- Inspect bounded `staleReasons` (indexed source missing/newer or documentation
|
|
42
|
-
source newer) and `
|
|
42
|
+
source newer) and `proofSnapshotChanges`. Kibi deliberately reports
|
|
43
43
|
editor/config paths such as editor dot-directories; do not silently ignore them.
|
|
44
44
|
- Use `kb_query`, or `query --input`, with `sourceFile` and text references for source-linked discovery.
|
|
45
45
|
- Re-run `kb_search`, or `search --input`, after sync gaps or stale context are detected.
|
|
@@ -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.1.
|
|
5
|
+
version: 2.1.1
|
|
6
6
|
kibiCompatibility: ">=1.0.0"
|
|
7
7
|
tags:
|
|
8
8
|
- kibi
|
|
@@ -19,6 +19,7 @@ resources:
|
|
|
19
19
|
- resources/relationship-directions.md
|
|
20
20
|
- resources/fact-lanes.md
|
|
21
21
|
- resources/workflows.md
|
|
22
|
+
- resources/proof.md
|
|
22
23
|
- resources/ui-requirements.md
|
|
23
24
|
- resources/logic-ir.md
|
|
24
25
|
- resources/kb-improvement.md
|
|
@@ -67,13 +68,28 @@ mutability, and Prolog requirements of each operation.
|
|
|
67
68
|
Kibi never Git-stages or commits those files. Do not read or edit `.kb`
|
|
68
69
|
directly.
|
|
69
70
|
5. Finish with targeted and final `kb_check`, then read status/coverage and
|
|
70
|
-
|
|
71
|
+
report the five independent closeout fields (not one inferred success flag).
|
|
71
72
|
|
|
72
73
|
Run `kb_check` with specific rules during iteration and the unfiltered final
|
|
73
74
|
check. Never fire `kb_upsert` calls in parallel; create or confirm endpoint
|
|
74
75
|
entities before linking them. The canonical MCP names are `kb_search`,
|
|
75
76
|
`kb_query`, `kb_upsert`, and `kb_check`.
|
|
76
77
|
|
|
78
|
+
## Closeout fields
|
|
79
|
+
|
|
80
|
+
End every task with these five independent fields:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
taskOutcome: complete | interim | blocked
|
|
84
|
+
kbState: clean_fresh | stale | dirty | legacy_compat | not_evaluated
|
|
85
|
+
verificationState: fresh | dirty | unavailable | not_evaluated
|
|
86
|
+
proofState: proven | mixed | unresolved | not_evaluated
|
|
87
|
+
limitationDisposition: none | accepted | unaccepted | not_applicable
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`taskOutcome` is whether the requested work finished. The other fields are
|
|
91
|
+
observed system state. A clean check can coexist with unresolved proof.
|
|
92
|
+
|
|
77
93
|
## Exact Git attachment
|
|
78
94
|
|
|
79
95
|
The active ref is the exact KB identity. `KIBI_BRANCH` is used verbatim; Git's
|
|
@@ -114,22 +130,31 @@ safe normative claims; use `observation` or `meta` for bug/workaround notes and
|
|
|
114
130
|
`flag` only for actual runtime/config gates. Requirements require scenarios,
|
|
115
131
|
tests, symbol ownership, and fresh proof-bearing receipts before claiming proof.
|
|
116
132
|
For an existing product KB that needs semantic backfill, read
|
|
117
|
-
`resources/kb-improvement.md
|
|
133
|
+
`resources/kb-improvement.md`, and `resources/proof.md` for the proof workflow.
|
|
118
134
|
|
|
119
135
|
## Predicate Ontology Decision Tree
|
|
120
136
|
|
|
121
|
-
Call `kb_semantic_advisor
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
137
|
+
Call `kb_semantic_advisor` on the complete prose before encoding a clause.
|
|
138
|
+
Set requirement `logic_claims` to exactly the assertive `claim_key` values.
|
|
139
|
+
For each relational clause, call `kb_suggest_predicates` with that clause and
|
|
140
|
+
`existingLogicClaims`. If lexical rank is a false positive, retry with the
|
|
141
|
+
reviewed `schemaId`. If `binding_status` is `incomplete`, supply
|
|
142
|
+
`argumentBindings` and retry. Persist `fact_kind: predicate` with the same
|
|
143
|
+
`claim_key` / `claim_text`, then link `REQ -> fact` with `requires_predicate`.
|
|
144
|
+
Use `kb_model_requirement` for strict scalar clauses. Use
|
|
145
|
+
`fact_kind: observation` only for a true ontology gap. The manifest is not
|
|
146
|
+
grounding: run `logic-coverage` so each key binds to one ground fact.
|
|
147
|
+
Relationship direction is fixed, and every `from` in a relationship batch
|
|
148
|
+
must equal the upserted entity ID.
|
|
127
149
|
|
|
128
150
|
## Symbol-First Traceability
|
|
129
151
|
|
|
130
|
-
Represent implementation ownership with a `symbol` entity
|
|
131
|
-
|
|
132
|
-
|
|
152
|
+
Represent implementation ownership with a `symbol` entity that has
|
|
153
|
+
`sourceFile`, `implements` to the requirement, and `covered_by` to the test.
|
|
154
|
+
Prolog `symbol-coverage` also requires the test to `validates` the requirement
|
|
155
|
+
(or the requirement `verified_by` the test). `covered_by` alone is not
|
|
156
|
+
enough. Do not rely on legacy `// implements REQ-xxx` comments as the
|
|
157
|
+
traceability record.
|
|
133
158
|
|
|
134
159
|
## Complete Logical Coverage
|
|
135
160
|
|
|
@@ -26,7 +26,7 @@ per operation. Effects are authoritative for mutability and adapter annotations.
|
|
|
26
26
|
| `kb_sparql_remote` | `sparql-remote` | --input JSON | read | no | network-read | peer; capability-selected | kibi.kb_sparql_remote.v1 | no | safe | yes | yes |
|
|
27
27
|
| `kb_compile_intent` | `compile-intent` | --input JSON | read | yes | kb-read, workspace-read | peer; capability-selected | kibi.kb_compile_intent.v1 | no | safe | no | yes |
|
|
28
28
|
| `kb_apply_plan` | `apply-plan` | --input JSON | write | yes | kb-read, kb-write, workspace-read, workspace-write | peer; capability-selected | kibi.kb_apply_plan.v1 | yes | unsafe | no | yes |
|
|
29
|
-
| `
|
|
29
|
+
| `kb_ingest_proof` | `ingest-proof` | --input JSON | write | yes | kb-read, kb-write, workspace-read | peer; capability-selected | kibi.kb_ingest_proof.v1 | yes | unsafe | no | yes |
|
|
30
30
|
|
|
31
31
|
## JSON execution recipe
|
|
32
32
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Proof and Verification Workflow
|
|
2
|
+
|
|
3
|
+
Use this resource when a requirement must be proven before handoff, when
|
|
4
|
+
wiring a proof-bearing test, or when `kb_ingest_proof` or `kibi prove`
|
|
5
|
+
rejected evidence.
|
|
6
|
+
|
|
7
|
+
Kibi does not support test runners. Kibi supports proof evidence. Any
|
|
8
|
+
producer (Playwright, pytest, JUnit, TAP, shell commands, database harnesses)
|
|
9
|
+
reports what happened as `kibi.proof-run.v1`; Kibi evaluates proof.
|
|
10
|
+
|
|
11
|
+
## Golden path
|
|
12
|
+
|
|
13
|
+
1. Query the test (`kb_query`, `type: test`) and read its
|
|
14
|
+
`kibi.proof-contract.v1`, `proof_bindings`, and `verification_scope`.
|
|
15
|
+
2. Run the configured producer through the canonical command:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
kibi prove --test TEST-<id>
|
|
19
|
+
# or: kibi prove --requirement REQ-<id> | --integration <id> | --all
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`kibi prove` captures the workspace snapshot, runs each integration's
|
|
23
|
+
producer once (`shell: false`), revalidates the snapshot, evaluates the
|
|
24
|
+
artifact against every selected contract, and appends idempotent
|
|
25
|
+
`kibi.proof-receipt.v1` receipts.
|
|
26
|
+
3. Confirm with `kb_status` (fresh, current snapshot) and `kb_coverage`.
|
|
27
|
+
|
|
28
|
+
Never hand-write receipts. Kibi derives them from validated
|
|
29
|
+
`kibi.proof-run.v1` artifacts only.
|
|
30
|
+
|
|
31
|
+
## Proof contracts
|
|
32
|
+
|
|
33
|
+
A proof-bearing test declares explicit obligations (never a Cartesian
|
|
34
|
+
cases-times-projects matrix):
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
verification_scope: end_to_end
|
|
38
|
+
verification_perspective: consumer
|
|
39
|
+
proof_contract:
|
|
40
|
+
version: kibi.proof-contract.v1
|
|
41
|
+
integration: web-e2e # id from .kb/proof/integrations.json
|
|
42
|
+
required_proofs:
|
|
43
|
+
- symbol_id: SYM-PW-4F2A9C61B7D03E85
|
|
44
|
+
target: chromium # browser, runtime, db, device, or default
|
|
45
|
+
success_policy: all_required_first_attempt
|
|
46
|
+
proof_bindings: # optional provenance metadata
|
|
47
|
+
- symbol_id: SYM-PW-4F2A9C61B7D03E85
|
|
48
|
+
target: chromium
|
|
49
|
+
native_id: tests/checkout.spec.ts::accepts a card
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Provenance lives in `proof_bindings`; the contract stays semantic.
|
|
53
|
+
|
|
54
|
+
## Integration configuration
|
|
55
|
+
|
|
56
|
+
`.kb/proof/integrations.json` (`kibi.proof-integration.v1`) is tracked,
|
|
57
|
+
Kibi-managed configuration describing evidence production only:
|
|
58
|
+
|
|
59
|
+
- `producer: command` — Kibi synthesizes the envelope from the process
|
|
60
|
+
outcome; obligations are bound with `aggregate_run` provenance and the
|
|
61
|
+
single process invocation counts as the known first attempt.
|
|
62
|
+
- `producer: playwright` (or custom) — the child emits `kibi.proof-run.v1`
|
|
63
|
+
itself (bundled reporter: `kibi-cli/playwright-reporter`).
|
|
64
|
+
- `producer: junit` / `tap` — Kibi converts the native report at `artifact`
|
|
65
|
+
using each test's `proof_bindings`; standard formats carry no retry
|
|
66
|
+
history, so attempts are reported as `unavailable` and fail the strict
|
|
67
|
+
first-attempt policy closed.
|
|
68
|
+
|
|
69
|
+
Cosmetic edits (descriptions, labels) never stale proof. Execution-relevant
|
|
70
|
+
edits (command, artifact, targets, options, bindings, contract) change the
|
|
71
|
+
effective fingerprint and do.
|
|
72
|
+
|
|
73
|
+
## Attempt semantics (factual, never optimistic)
|
|
74
|
+
|
|
75
|
+
- `attempts: {status: "complete", entries: [...]}` — known history; the
|
|
76
|
+
strict policy requires a passing **first** entry.
|
|
77
|
+
- `attempts: {status: "unavailable"}` — unknown native history; the strict
|
|
78
|
+
policy fails closed, except `aggregate_run` results, which are satisfied by
|
|
79
|
+
the Kibi-launched process attempt when the run passed with exit code 0.
|
|
80
|
+
- `run.outcome` is authoritative: a failed, errored, cancelled, interrupted,
|
|
81
|
+
or `no_results` run proves nothing, even with passing individual results.
|
|
82
|
+
|
|
83
|
+
## Common rejections
|
|
84
|
+
|
|
85
|
+
- `No proof integration configuration` — bootstrap has not configured proof
|
|
86
|
+
for this repository yet; do not hand-wave, run the bootstrap proof step.
|
|
87
|
+
- `captured snapshot is not the live workspace snapshot` — the tree changed
|
|
88
|
+
between capture and ingest; re-run `kibi prove`.
|
|
89
|
+
- `artifact command_argv does not match the configured command` — the
|
|
90
|
+
artifact came from a different command than `integrations.json` configures.
|
|
91
|
+
- `attempt history unavailable` — the producer could not prove first-attempt
|
|
92
|
+
success for a native-case obligation; use a producer with complete history
|
|
93
|
+
or accept aggregate provenance.
|
|
94
|
+
- `proof_receipts is append-only` — receipts are append-only; update tests
|
|
95
|
+
through the engine (which appends) or include the existing history when
|
|
96
|
+
authoring test files directly.
|
|
97
|
+
|
|
98
|
+
## After code changes
|
|
99
|
+
|
|
100
|
+
Receipts bind to the snapshot, contract hash, and execution fingerprint at
|
|
101
|
+
run time. Any code or source change moves the snapshot and stales receipts:
|
|
102
|
+
re-run `kibi prove` for the affected selection, then confirm `kb_status` and
|
|
103
|
+
`kb_coverage` before handoff.
|
|
104
|
+
|
|
105
|
+
Full reference: `docs/proving-requirements.md`.
|
|
@@ -25,7 +25,7 @@ Receipt reuse is safe only when the live verification snapshot, contract hash,
|
|
|
25
25
|
freshness window, and every required case result still match. Otherwise rerun
|
|
26
26
|
the contracted command. If the contract changed, retain every older receipt
|
|
27
27
|
unchanged, append evidence for the current contract, and keep proof unresolved
|
|
28
|
-
with `
|
|
28
|
+
with `proof_contract_mismatch` until that current receipt exists.
|
|
29
29
|
Obsolete symbols require current extraction or Git evidence before
|
|
30
30
|
remap/deletion; transfer coverage only when existing test evidence supports it,
|
|
31
31
|
then sync and read back status. Same-version packages with different export
|
|
@@ -46,7 +46,7 @@ The canonical workflow for any KB operation follows this pattern:
|
|
|
46
46
|
7. **Create endpoints**: validated `kb_upsert` for new entities, sequentially
|
|
47
47
|
8. **Link**: validated `kb_upsert` with `requires_rule`, `requires_predicate`, `constrains`, or `requires_property`, sequentially
|
|
48
48
|
9. **Validate coverage and consistency**: targeted `rule-safety`, `rule-verifiability`, `semantic-completeness`, `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`, then final full `kb_check`
|
|
49
|
-
10. **Prove execution**: read `kb_status.
|
|
49
|
+
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.
|
|
50
50
|
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
|
|
51
51
|
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
|
|
52
52
|
|
|
@@ -74,7 +74,7 @@ choose package managers, ground semantic claims, resolve contradictions, rerun
|
|
|
74
74
|
E2E tests, rewrite receipt history, remap authored symbols, or accept
|
|
75
75
|
limitations. Those actions remain explicit review/operator/execution steps.
|
|
76
76
|
|
|
77
|
-
For `e2e_receipt_freshness_low`, query each listed requirement/test gap and run
|
|
77
|
+
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.
|
|
78
78
|
|
|
79
79
|
## Creating a New Feature
|
|
80
80
|
```
|
|
@@ -101,12 +101,12 @@ Do not create a test-fact pair. Facts describe invariants; requirements or scena
|
|
|
101
101
|
## Fresh E2E Receipt Workflow
|
|
102
102
|
|
|
103
103
|
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.
|
|
104
|
-
2. Read `kb_status` and retain its available `
|
|
104
|
+
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.
|
|
105
105
|
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.
|
|
106
|
-
4. Preserve every existing receipt byte-for-byte and append the derived `kibi.
|
|
106
|
+
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.
|
|
107
107
|
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.
|
|
108
108
|
|
|
109
|
-
Only the newest receipt matching
|
|
109
|
+
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.
|
|
110
110
|
|
|
111
111
|
## Predicate-First Requirement Modeling
|
|
112
112
|
|