kibi-cursor 0.6.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/.cursor-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +171 -0
  3. package/README.md +13 -10
  4. package/agent-plugin/plugin.json +1 -1
  5. package/agent-plugin/skills/kibi-bootstrap/SKILL.md +58 -0
  6. package/agent-plugin/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
  7. package/agent-plugin/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
  8. package/agent-plugin/skills/kibi-bootstrap/resources/operation-access.md +5 -0
  9. package/agent-plugin/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
  10. package/agent-plugin/skills/kibi-freshness/SKILL.md +40 -10
  11. package/agent-plugin/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
  12. package/agent-plugin/skills/kibi-freshness/resources/operation-access.md +6 -0
  13. package/agent-plugin/skills/kibi-freshness/resources/source-authoring.md +7 -0
  14. package/agent-plugin/skills/kibi-traceability/SKILL.md +47 -47
  15. package/agent-plugin/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
  16. package/agent-plugin/skills/kibi-traceability/resources/operation-access.md +5 -0
  17. package/agent-plugin/skills/kibi-traceability/resources/source-authoring.md +6 -0
  18. package/agent-plugin/skills/kibi-traceability/resources/traceability.md +8 -0
  19. package/agent-plugin/skills/kibi-usage/SKILL.md +115 -239
  20. package/agent-plugin/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
  21. package/agent-plugin/skills/kibi-usage/resources/kb-improvement.md +38 -0
  22. package/agent-plugin/skills/kibi-usage/resources/operation-access.md +36 -38
  23. package/agent-plugin/skills/kibi-usage/resources/relationship-directions.md +3 -3
  24. package/agent-plugin/skills/kibi-usage/resources/source-authoring.md +31 -0
  25. package/agent-plugin/skills/kibi-usage/resources/workflows.md +56 -3
  26. package/bin/launch-kibi-mcp.d.mts +18 -0
  27. package/bin/launch-kibi-mcp.mjs +378 -0
  28. package/commands/kibi-bootstrap.md +19 -0
  29. package/dist/.cursor-plugin/plugin.json +1 -1
  30. package/dist/bin/launch-kibi-mcp.d.mts +18 -0
  31. package/dist/bin/launch-kibi-mcp.mjs +378 -0
  32. package/dist/commands/kibi-bootstrap.md +19 -0
  33. package/dist/hook-input.d.ts +2 -0
  34. package/dist/hook-input.js +10 -0
  35. package/dist/hook-runner.js +34 -12
  36. package/dist/hook-state-storage.js +3 -0
  37. package/dist/hook-state.d.ts +2 -0
  38. package/dist/hook-state.js +3 -0
  39. package/dist/mcp.json +2 -2
  40. package/dist/messages.js +6 -1
  41. package/dist/path-policy.js +43 -1
  42. package/dist/skills/.canon-hash.json +21 -7
  43. package/dist/skills/kibi-bootstrap/SKILL.md +58 -0
  44. package/dist/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
  45. package/dist/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
  46. package/dist/skills/kibi-bootstrap/resources/operation-access.md +5 -0
  47. package/dist/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
  48. package/dist/skills/kibi-freshness/SKILL.md +40 -10
  49. package/dist/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
  50. package/dist/skills/kibi-freshness/resources/operation-access.md +6 -0
  51. package/dist/skills/kibi-freshness/resources/source-authoring.md +7 -0
  52. package/dist/skills/kibi-traceability/SKILL.md +47 -47
  53. package/dist/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
  54. package/dist/skills/kibi-traceability/resources/operation-access.md +5 -0
  55. package/dist/skills/kibi-traceability/resources/source-authoring.md +6 -0
  56. package/dist/skills/kibi-traceability/resources/traceability.md +8 -0
  57. package/dist/skills/kibi-usage/SKILL.md +115 -239
  58. package/dist/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
  59. package/dist/skills/kibi-usage/resources/kb-improvement.md +38 -0
  60. package/dist/skills/kibi-usage/resources/operation-access.md +36 -38
  61. package/dist/skills/kibi-usage/resources/relationship-directions.md +3 -3
  62. package/dist/skills/kibi-usage/resources/source-authoring.md +31 -0
  63. package/dist/skills/kibi-usage/resources/workflows.md +56 -3
  64. package/mcp.json +2 -2
  65. package/package.json +4 -3
  66. package/skills/.canon-hash.json +21 -7
  67. package/skills/kibi-bootstrap/SKILL.md +58 -0
  68. package/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
  69. package/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
  70. package/skills/kibi-bootstrap/resources/operation-access.md +5 -0
  71. package/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
  72. package/skills/kibi-freshness/SKILL.md +40 -10
  73. package/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
  74. package/skills/kibi-freshness/resources/operation-access.md +6 -0
  75. package/skills/kibi-freshness/resources/source-authoring.md +7 -0
  76. package/skills/kibi-traceability/SKILL.md +47 -47
  77. package/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
  78. package/skills/kibi-traceability/resources/operation-access.md +5 -0
  79. package/skills/kibi-traceability/resources/source-authoring.md +6 -0
  80. package/skills/kibi-traceability/resources/traceability.md +8 -0
  81. package/skills/kibi-usage/SKILL.md +115 -239
  82. package/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
  83. package/skills/kibi-usage/resources/kb-improvement.md +38 -0
  84. package/skills/kibi-usage/resources/operation-access.md +36 -38
  85. package/skills/kibi-usage/resources/relationship-directions.md +3 -3
  86. package/skills/kibi-usage/resources/source-authoring.md +31 -0
  87. package/skills/kibi-usage/resources/workflows.md +56 -3
  88. package/agent-plugin/skills/init-kibi/SKILL.md +0 -62
  89. package/commands/init-kibi.md +0 -21
  90. package/dist/commands/init-kibi.md +0 -21
  91. package/dist/skills/init-kibi/SKILL.md +0 -62
  92. package/skills/init-kibi/SKILL.md +0 -62
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kibi-cursor",
3
3
  "displayName": "Kibi",
4
- "version": "0.6.0",
4
+ "version": "1.0.0",
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,176 @@
1
1
  # kibi-cursor
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 9e6fb3f: Kibi now uses one opinionated project contract: all Kibi-managed knowledge lives under `.kb/`, check enforcement is owned by the installed Kibi version, and projects can no longer weaken health by disabling rules or relocating entity paths in `.kb/config.json`. Existing repositories must run `kibi migrate --yes` to move legacy `documentation/...` knowledge into the canonical layout and adopt `.kb/manifest.json`.
8
+
9
+ Advisory modeling checks still run by default, but they report as non-blocking quality diagnostics instead of failing `kibi check`. Migration rewrites the old blanket `.kb/` gitignore stanza so authored lanes are trackable, and a malformed leftover `config.json` blocks the one-way cutover instead of guessing default paths.
10
+
11
+ - Remove user-configurable entity paths and persistent `checks.rules` overrides; retire `.kb/config.json` after migration.
12
+ - Introduce `.kb/manifest.json` for Kibi-owned lifecycle metadata (schema version, semantic backfill state).
13
+ - Add one-way legacy storage migration (`documentation/` and custom configured paths → `.kb/<lane>/`).
14
+ - Split check results by enforcement class: canonical → blocking violations; advisory → quality diagnostics; migration → explicit `--rules` only. Default execution is derived from the class (no separate `runsByDefault` flag).
15
+ - Normalize legacy Kibi `.gitignore` fences during init and migrate; treat `.kb/migrations/` as derived runtime state.
16
+ - Fail closed when leftover `.kb/config.json` cannot be parsed.
17
+ - Update init, sync, hooks, staged evidence, doctor, migration-plan, and integration packages for canonical paths.
18
+ - Generate the requirement-health report on pull requests as a `kibi-pr-report` artifact; keep GitHub Pages deployment on the default branch only.
19
+ - OpenCode treats canonical `.kb/` entity lanes as knowledge that requires evidence; only derived runtime trees (and leftover `config.json`) are ignored.
20
+ - Cursor and Codex hook path policy treat canonical `.kb/` lanes as tracked knowledge, not opaque compiled-store paths.
21
+ - Pending relationship shards are not treated as symbols manifests during source discovery.
22
+
23
+ - 4c75e4d: Kibi onboarding now separates repository initialization from teaching Kibi about an existing codebase. After `kibi init`, an agent can run the `kibi-bootstrap` workflow to produce a reviewable, hash-bound plan and apply the exact approved plan safely. The old autopilot and init-kibi public names are removed so new users see one clear bootstrap path.
24
+
25
+ - Replace `kb_autopilot_generate`/`autopilot-generate` with `kb_plan_bootstrap`/`plan-bootstrap`.
26
+ - Add `kibi.bootstrap-plan.v1` validation, deterministic approval hashes, dependency ordering, stale-plan checks, and typed bootstrap recovery through `kb_apply_plan`.
27
+ - Synchronize the four canonical skill mirrors and update client adapters, docs, fixtures, and SkillOpt cases.
28
+
29
+ ### Patch Changes
30
+
31
+ - a2acea9: Kibi now has a source-first, exact-Git runtime contract for first-party
32
+ adapters. CLI JSON and MCP structured results share a versioned envelope with
33
+ effect and repair information, while branch stores are hashed and explicitly
34
+ identity-bound. The mutation path can author tracked source documents and
35
+ canonical relationship shards without staging or committing them.
36
+
37
+ - Add the `kibi-runtime` first-party integration package.
38
+ - Add exact branch-store manifests, explicit legacy migration/quarantine, and
39
+ typed result/effect contracts.
40
+ - Add source-first document writes, relationship-shard updates, and deletion
41
+ approval plans.
42
+
43
+ - 3d7d04f: Generic MCP and CLI agents now discover Kibi's operating rules from bundled skills instead of a long copy-paste prompt. Improving an existing product KB is covered by a `kibi-usage` resource rather than a second manual, so agent guidance stays in one place and cannot drift from the packaged workflow.
44
+
45
+ - Add `kibi-usage` `resources/kb-improvement.md` and bump that skill to 2.1.0.
46
+ - Replace `docs/prompts/llm-rules.md` with `docs/generic-agent-onboarding.md`.
47
+ - Remove the obsolete retroactive-init prompt; bootstrap stays in the `kibi-bootstrap` skill.
48
+
49
+ - 29793c7: The Cursor stop hook no longer starts an extra Kibi follow-up after you only deliver a plan. Reads and search no longer look like source edits, so plan mode can finish without an impact-check nudge. If that same turn actually edited source or updated the knowledge base, the existing follow-up still runs.
50
+
51
+ - Record dirty paths only from known editable tools.
52
+ - Treat `CreatePlan` as plan delivery and stay silent at stop unless that turn also edited source or mutated the KB.
53
+ - Skip follow-up when `stop.status` is `aborted` or `error`.
54
+
55
+ - 8db2e37: Cursor plugin users can now enable Kibi without adding a separate project MCP configuration. The plugin finds the `kibi-mcp` version installed in the opened project, starts it inside that workspace, and reports a clear setup error when the dependency is missing. It never downloads or falls back to a global Kibi runtime.
56
+
57
+ - Replace the plugin MCP `npx --no-install` command with the packaged consumer-workspace launcher.
58
+ - Cover isolated and packed plugin launches, workspace selection, package-layout resolution, exit codes, and signal forwarding.
59
+
60
+ - 535dea8: Agents can now keep working in synthetic, detached, or unreadable workspaces while Kibi reports the migration work it can evaluate. Coverage and checks preserve their useful domain results when branch status is unavailable, and the Codex/Cursor skill assets now stay aligned with their published plugin metadata.
61
+
62
+ - Keep status-derived migration actions read-only and append them only when branch resolution succeeds.
63
+ - Preserve the shared migration-plan contract across coverage and checks without requiring a Prolog-backed status query in non-Git harnesses.
64
+ - Synchronize plugin manifests and freshness skill CLI examples for the next coordinated patch release.
65
+
66
+ - b746960: Kibi now teaches and enforces requirement supersession in one consistent
67
+ direction: the replacement points to the requirement it replaces. Reversed
68
+ edges can no longer hide a newer contradictory policy merely by making that
69
+ newer requirement non-current. Relationship checks also block authored links
70
+ that have silently disappeared from compiled knowledge.
71
+
72
+ - Document `supersedes` as new-to-old across bundled and generated skills.
73
+ - Reject reversed supersession when tracked source history proves that the
74
+ purported replacement predates its target.
75
+ - Restrict legacy branch migration to literal-to-hashed storage conversion for
76
+ the same exact Git identity; every cross-identity pair is refused.
77
+ - Cover exact-Git branch policy conflicts and approved evolution with Prolog
78
+ regression tests.
79
+ - Preserve partial-upsert relationship projections and validate
80
+ authored-to-compiled relationship parity.
81
+
82
+ - Updated dependencies [6ca08bb]
83
+ - Updated dependencies [a2acea9]
84
+ - Updated dependencies [33262f8]
85
+ - Updated dependencies [9e6fb3f]
86
+ - Updated dependencies [3d7d04f]
87
+ - Updated dependencies [2d6cc59]
88
+ - Updated dependencies [8f71f1a]
89
+ - Updated dependencies [a07fad5]
90
+ - Updated dependencies [2e68da9]
91
+ - Updated dependencies [4cf383b]
92
+ - Updated dependencies [7bc4f61]
93
+ - Updated dependencies [15b5825]
94
+ - Updated dependencies [51fb55b]
95
+ - Updated dependencies [1ca62af]
96
+ - Updated dependencies [f1a6d5c]
97
+ - Updated dependencies [1ca62af]
98
+ - Updated dependencies [44fd818]
99
+ - Updated dependencies [8fe890c]
100
+ - Updated dependencies
101
+ - Updated dependencies [7654339]
102
+ - Updated dependencies [c77d3f1]
103
+ - Updated dependencies [967cef7]
104
+ - Updated dependencies [395e38f]
105
+ - Updated dependencies
106
+ - Updated dependencies [535dea8]
107
+ - Updated dependencies [5fdb828]
108
+ - Updated dependencies [b97329a]
109
+ - Updated dependencies [4c75e4d]
110
+ - Updated dependencies [c942344]
111
+ - Updated dependencies [07803e4]
112
+ - Updated dependencies [b746960]
113
+ - Updated dependencies [400e88c]
114
+ - kibi-cli@1.0.0
115
+ - kibi-mcp@1.0.0
116
+
117
+ ## Unreleased
118
+
119
+ ### Patch Changes
120
+
121
+ - The published Cursor plugin now launches the `kibi-mcp` installed in the opened project, even when Cursor starts plugin processes from the plugin installation directory. The launcher preserves the consumer workspace as the child cwd and `KIBI_WORKSPACE`, and fails with an actionable message when the project-local package is missing.
122
+
123
+ - Replace plugin MCP's ambient `npx --no-install` invocation with the packaged consumer-local resolver.
124
+ - Add isolated and packed-artifact coverage for workspace resolution, package layouts, exit codes, signals, and missing-runtime failures.
125
+
126
+ ## 0.6.3
127
+
128
+ ### Patch Changes
129
+
130
+ - Existing Kibi installations now receive an agent-guided migration workflow instead of opaque repair advice. Status, checks, and coverage expose one deterministic, hash-bound action plan; agents can safely apply only explicitly approved automatic repairs while semantic, proof, package, and operator work remains visible for review. This makes damaged or legacy KBs recoverable without direct `.kb` edits and gives every run an auditable post-application readback.
131
+
132
+ - Add `kibi.migration-plan.v2` fragments to the 21-operation surfaces and support hash/action authorization in `kb_apply_plan` and `kibi migrate --apply-safe`.
133
+ - Add lazy status/planning and deterministic schema, branch, storage, coordinate, and recovery action execution with workspace-root-safe CLI/MCP parity.
134
+ - Refresh agent skills, traceability fixtures, and SkillOpt coverage for migration safety boundaries and five-axis closeout reporting.
135
+
136
+ ## 0.6.2
137
+
138
+ ### Patch Changes
139
+
140
+ - de7b85a: Verification contracts can now evolve without forcing projects to erase valid historical test evidence. Kibi preserves every earlier receipt, accepts a newly appended receipt for the current contract, and only treats evidence matching both the current contract and live code snapshot as proof.
141
+
142
+ - Separate immutable receipt-history validation from current-contract binding during verification ingest.
143
+ - Report `verification_contract_mismatch` as an explicit proof gap until current-contract evidence is appended.
144
+ - Teach the usage skill and SkillOpt evaluator to preserve older-contract receipts and forbid history rewrites.
145
+
146
+ - 584336b: Agents now get consistent guidance when execution proof, structural coverage, and KB freshness disagree. Current-contract E2E evidence is recorded as v2 without rewriting history, and full checks no longer report a contradictory weak-depth warning when the same live receipt already proves the scenario-backed test. Receipt freshness repairs also identify the affected requirements and tests so agents can rerun the exact contract.
147
+
148
+ - Share snapshot-bound proof evidence with full quality diagnostics.
149
+ - Add bounded receipt-gap telemetry and v2-native remediation guidance.
150
+ - Document and test the new receipt and proof-aware diagnostic requirements.
151
+ - Refresh the mirrored usage skills and dogfood-derived SkillOpt expectations.
152
+ - Keep the MCP package contract verifier self-contained with an explicit semver development dependency and matching workspace lock ranges.
153
+
154
+ - Kibi can now explain a missing or damaged branch-local KB without changing it. Agents receive a precise recovery path, preserving the existing store before a deliberate rebuild, and no longer need to guess whether a clean check also means a clean, fresh KB.
155
+
156
+ - Add non-mutating branch-store inspection to status and a preview-first `kibi branch recover --apply` workflow.
157
+ - Restrict branch migration to the detected historical `master` -> legacy `main` compatibility attachment; arbitrary branch moves are refused.
158
+ - Refresh CLI/MCP status documentation, mirrored agent skills, and release-gate packed consumer coverage.
159
+
160
+ - ef75929: Kibi’s release checks now validate compiled package APIs and dependency ranges in isolated npm and pnpm consumers, while the usage skill and private SkillOpt evaluator report task completion, KB freshness, verification, proof, and accepted limitations independently. Consumer repositories keep ownership of their local artifact update scripts and dependency overrides.
161
+
162
+ - Remove library-side consumer dogfood installers and retain release-only packed checks.
163
+ - Add deterministic closeout expectations and dogfood-derived held-out cases.
164
+
165
+ ## 0.6.1
166
+
167
+ ### Patch Changes
168
+
169
+ - Dogfood projects now get branch-local knowledge bases that follow the exact Git ref, actionable stale-source diagnostics, and a sanctioned relationship cleanup path. Verification receipts and packed package provenance are stricter and reproducible, while agents receive conservative symbol-recovery guidance and explicit interim-state signals. This prevents silent `master`/`main` drift and makes passing E2E evidence distinguishable from complete semantic proof.
170
+
171
+ - Remove implicit branch-name normalization and add previewed legacy branch migration.
172
+ - Add exact relationship deletion, v2 receipt/schema parity, status diagnostics, dogfood package manifests, and SkillOpt cases.
173
+
3
174
  ## 0.6.0
4
175
 
5
176
  ### Minor Changes
package/README.md CHANGED
@@ -12,7 +12,7 @@ Install these **before** enabling the plugin MCP server:
12
12
  | --- | --- |
13
13
  | **SWI-Prolog 9+** (`swipl` on `PATH`) | Powers Kibi inference and validation |
14
14
  | **`kibi-cli`** | Project CLI (`kibi` command) |
15
- | **`kibi-mcp`** | MCP server the plugin's `mcp.json` invokes via `npx --no-install kibi-mcp` |
15
+ | **`kibi-mcp`** | MCP server installed in the opened project; the plugin launcher resolves this package without downloading it |
16
16
  | **`kibi-core`** | Shared graph/runtime dependency |
17
17
 
18
18
  ```bash
@@ -25,7 +25,7 @@ Full setup: [docs/install.md](https://github.com/Looted/kibi/blob/develop/docs/i
25
25
 
26
26
  Add this plugin only after the base packages work in your project.
27
27
 
28
- **Git worktrees:** the published plugin MCP entry (`npx --no-install kibi-mcp`) needs `kibi-mcp` resolvable from that worktree's `node_modules` (run install there). For this monorepo's dogfood path, prefer project `.cursor/mcp.json`, which can fall back to the primary checkout's built MCP — see [DEV.md](./DEV.md#linked-worktrees).
28
+ **Git worktrees:** the published plugin MCP entry resolves `kibi-mcp` from the opened worktree's `node_modules` (run install there). The plugin does not download or bundle a Kibi runtime. For this monorepo's dogfood path, prefer project `.cursor/mcp.json`, which can fall back to the primary checkout's built MCP — see [DEV.md](./DEV.md#linked-worktrees).
29
29
 
30
30
  ## Installation
31
31
 
@@ -55,14 +55,17 @@ cp -r "$(npm root)/kibi-cursor" ~/.cursor/plugins/local/kibi-cursor
55
55
 
56
56
  ## MCP configuration
57
57
 
58
- The plugin bundles `mcp.json` pointing at the project-local `kibi-mcp` binary:
58
+ The plugin bundles `mcp.json` with a thin launcher that locates and starts the
59
+ `kibi-mcp` package installed in the opened project. The launcher runs from the
60
+ consumer workspace and sets `KIBI_WORKSPACE` to that root; it never downloads,
61
+ bundles, or falls back to a global Kibi runtime:
59
62
 
60
63
  ```json
61
64
  {
62
65
  "mcpServers": {
63
66
  "kibi": {
64
- "command": "npx",
65
- "args": ["--no-install", "kibi-mcp"]
67
+ "command": "node",
68
+ "args": ["bin/launch-kibi-mcp.mjs", "${workspaceFolder}"]
66
69
  }
67
70
  }
68
71
  }
@@ -90,7 +93,7 @@ Manual MCP fallback (no plugin install required):
90
93
  ```
91
94
  agent-plugin/
92
95
  ├── plugin.json # agent-plugins.org/schemas/1.0.0/plugin.schema.json
93
- ├── skills/ # canonical Kibi Agent Skills (kibi-usage, init-kibi, ...)
96
+ ├── skills/ # canonical Kibi Agent Skills (kibi-usage, kibi-bootstrap, ...)
94
97
  └── mcp.json # agent-plugins.org/schemas/1.0.0/mcp.schema.json (stdio kibi-mcp)
95
98
  ```
96
99
 
@@ -103,18 +106,18 @@ agent-plugin/
103
106
  ### Discovery-first rules and skills
104
107
 
105
108
  - **Rules**: always-on capability-based workflow guidance plus optional traceability rules for source files.
106
- - **Skills**: `kibi-usage`, `init-kibi`, `kibi-freshness`, and `kibi-traceability`.
107
- - **Commands**: `/init-kibi` documents the `kb_autopilot_generate` bootstrap workflow.
109
+ - **Skills**: `kibi-usage`, `kibi-bootstrap`, `kibi-freshness`, and `kibi-traceability`.
110
+ - **Commands**: `/kibi-bootstrap` documents the `kb_plan_bootstrap` bootstrap workflow.
108
111
 
109
112
  ### Advisory editor hooks
110
113
 
111
114
  Hooks are warning-only and never replace MCP/CLI behavior:
112
115
 
113
- - **sessionStart**: bootstrap reminder when `.kb/config.json` is missing.
116
+ - **sessionStart**: bootstrap reminder when `.kb/manifest.json` is missing.
114
117
  - **preToolUse**: warns on explicit direct `.kb/**` edits without blocking.
115
118
  - **beforeReadFile** and **postToolUse (Read)**: inject source-linked lookup guidance once per path per session.
116
119
  - **postToolUse (Write/Edit)**: inject traceability and freshness guidance once per path per session, including `kb_check({sourceFiles:[...], includeImpactDiagnostics:true, includeWorkingTreeDiff:true})` for meaningful source edits.
117
- - **stop**: emits a single freshness or impact-check follow-up when meaningful paths changed during the session.
120
+ - **stop**: emits a single freshness or impact-check follow-up when meaningful paths were **edited** during the turn (reads and search do not count). Plan delivery (`CreatePlan`) stays silent unless that same turn also edited source or mutated the KB.
118
121
 
119
122
  ### What the plugin does not do
120
123
 
@@ -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": "0.6.0",
4
+ "version": "1.0.0",
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",
@@ -0,0 +1,58 @@
1
+ ---
2
+ id: kibi-bootstrap
3
+ name: kibi-bootstrap
4
+ description: Bootstrap Kibi from the current Git checkout with exact Git attachment, preview approval, source-first writes, and repair-safe completion.
5
+ version: 3.0.0
6
+ kibiCompatibility: ">=1.0.0"
7
+ tags:
8
+ - kibi
9
+ - bootstrap
10
+ - source-first
11
+ - agent-guidance
12
+ resources:
13
+ - resources/bootstrap.md
14
+ - resources/branch-lifecycle.md
15
+ - resources/source-authoring.md
16
+ - resources/operation-access.md
17
+ ---
18
+ ## Goal
19
+
20
+ Seed branch-local Kibi knowledge for an attached but thin repository without
21
+ creating a parallel human-maintained ticket system. Ask at most four bounded
22
+ context questions only when the planner says repository evidence is
23
+ insufficient; agents own deterministic translation and humans resolve genuine
24
+ ambiguity. A seeded repository hands off to the normal Kibi workflow.
25
+
26
+ ## Interface and preview
27
+
28
+ Use the visible approved MCP surface or the trusted project-local CLI as equal
29
+ peer interfaces. If neither is available, stop. Run `kb_plan_bootstrap` (or
30
+ `plan-bootstrap --input`) read-only. If it returns `needs_context`, ask only its
31
+ bounded questions (never more than four), then rerun the planner. Show the
32
+ complete returned `structuredContent.plan`, including its canonical hash, and
33
+ get explicit approval before any write. Pass that plan object unchanged to
34
+ `kb_apply_plan`; do not reconstruct it from preview fields.
35
+
36
+ For CLI JSON, use the trusted route with `--input` (for example
37
+ `printf '%s\n' '{}' | kibi status --input -`); MCP and CLI are semantic peers.
38
+ Read the branch-lifecycle and source-authoring resources before migration,
39
+ source writes, or repair actions.
40
+
41
+ ## Apply and verify
42
+
43
+ Apply the approved `kibi.bootstrap-plan.v1` by calling `kb_apply_plan` with the
44
+ exact plan and approved hash. The operation owns dependency ordering,
45
+ source-first writes, sequential mutation, and recovery journaling. Direct
46
+ `kb_upsert` is forbidden for every kibi-bootstrap task, including after
47
+ approval; never replay plan actions manually. Use `kb_delete` only for an
48
+ approved hash-bound deletion plan; evolve requirements with `supersedes`.
49
+ Finish with `kb_check` and `kb_status`.
50
+
51
+ Consume the versioned `kibiProtocol: 1` result envelope: inspect `status`, `effects`,
52
+ `diagnostics`, and `nextActions`. On `committed_with_repairs`, execute required
53
+ repair actions and never retry the original mutation.
54
+
55
+ Kibi may author tracked Markdown/YAML/manifests and relationship shards
56
+ transactionally, but never Git-stages or commits them. Never read or edit
57
+ `.kb` directly. Missing exact branch stores are compiled from this checkout's
58
+ tracked sources by `kibi sync`; Kibi does not copy another branch's store.
@@ -0,0 +1,11 @@
1
+ # Bootstrap resource
2
+
3
+ `kb_plan_bootstrap` is read-only and returns `kibi.bootstrap-plan.v1`. Review
4
+ candidate evidence, exact actions, dependencies, expected snapshots, source
5
+ hashes, bounded questions, diagnostics, and the canonical `planHash` before
6
+ approving. A preview does not authorize source edits. After approval, pass the
7
+ unchanged returned `structuredContent.plan` to `kb_apply_plan` once with its
8
+ approved hash; inspect its typed result
9
+ and follow `nextActions` if it returns `committed_with_repairs`. Direct
10
+ `kb_upsert` is forbidden for every bootstrap task; never manually replay the
11
+ plan through it.
@@ -0,0 +1,7 @@
1
+ # Branch lifecycle
2
+
3
+ Use the exact `KIBI_BRANCH` value or Git symbolic HEAD. Hashed stores carry a
4
+ matching `branch.json`; missing stores are compiled from tracked sources by
5
+ `kibi sync`. Legacy literal stores require explicit migration. Kibi never
6
+ copies stores between branches or resolves Git conflicts. Read the preview,
7
+ approval hash, quarantine, restore, and purge details before lifecycle work.
@@ -0,0 +1,5 @@
1
+ # Operation access
2
+
3
+ MCP tools and the trusted project-local CLI are peer surfaces for the same
4
+ operation contracts. Use the dedicated JSON route; parse the shared
5
+ `KibiResult` envelope and follow required `nextActions` after partial commits.
@@ -0,0 +1,8 @@
1
+ # Source authoring
2
+
3
+ Tracked documents, manifests, and relationship shards are authoritative.
4
+ Kibi may write them transactionally but does not stage or commit them. Use
5
+ `document.path` for ambiguous new targets, preserve existing bodies when the
6
+ body is omitted, and use hash-bound deletion plans. On
7
+ `committed_with_repairs`, follow typed `nextActions` and never retry the
8
+ original mutation.
@@ -1,14 +1,18 @@
1
1
  ---
2
2
  id: kibi-freshness
3
3
  name: kibi-freshness
4
- description: Check branch freshness and source linkage quality before decisions or risky writes.
5
- version: 1.0.0
6
- kibiCompatibility: "*"
4
+ description: Check exact Git attachment, branch migration/quarantine, compiled-store freshness, source linkage, and repair state before decisions or writes.
5
+ version: 2.0.0
6
+ kibiCompatibility: ">=1.0.0"
7
7
  tags:
8
8
  - kibi
9
9
  - mcp
10
10
  - freshness
11
11
  - agent-guidance
12
+ resources:
13
+ - resources/branch-lifecycle.md
14
+ - resources/source-authoring.md
15
+ - resources/operation-access.md
12
16
  ---
13
17
  ## Goal
14
18
 
@@ -16,10 +20,10 @@ Help agents decide whether Kibi knowledge is current enough to support safe chan
16
20
 
17
21
  ## Interface Selection
18
22
 
19
- 1. If Kibi MCP tools are visible and approved for the workspace, use the MCP surface only.
20
- 2. Otherwise, in a trusted workspace, use the canonical project-local CLI fallback through `npx --no-install kibi ...` or `bunx --no-install kibi ...`.
21
- 3. If the project-local CLI is unavailable or too old, stop and tell the operator to enable or install Kibi.
22
- 4. Never use a global fallback or an installing runner.
23
+ 1. Use whichever approved peer is visible: MCP or the trusted project-local CLI.
24
+ 2. They have the same operation semantics and machine envelope; neither is preferred.
25
+ 3. If neither surface is available, stop and tell the operator which capability must be enabled.
26
+ 4. Never install packages, choose a package manager, or use a global fallback as part of freshness inspection.
23
27
 
24
28
  Use `kibi-usage/resources/operation-access.md` for exact dedicated routes. A project-local CLI freshness check is executable as:
25
29
 
@@ -30,15 +34,41 @@ echo '{}' | npx --no-install kibi status --input -
30
34
  ## Capability Workflow
31
35
 
32
36
  - Use `kb_status`, or `status --input`, first to confirm branch attachment, freshness state, dirty-worktree evidence, and whether the knowledge snapshot is safe to rely on.
37
+ - Treat `branchAttachment.gitBranch`, `branchAttachment.kbBranch`, and
38
+ `branchAttachment.storePath` as exact identities. Hashed stores require a
39
+ matching `branch.json`; a `legacy_compat` attachment is read-only until an
40
+ explicit old/new migration is approved.
41
+ - Inspect bounded `staleReasons` (indexed source missing/newer or documentation
42
+ source newer) and `verificationSnapshotChanges`. Kibi deliberately reports
43
+ editor/config paths such as editor dot-directories; do not silently ignore them.
33
44
  - Use `kb_query`, or `query --input`, with `sourceFile` and text references for source-linked discovery.
34
45
  - Re-run `kb_search`, or `search --input`, after sync gaps or stale context are detected.
35
46
  - If knowledge must change, use the selected interface's `kb_upsert`/`upsert` or `kb_delete`/`delete` operation sequentially, then finish with `kb_check`/`check`.
47
+ - If status returns `migrationPlan.version: kibi.migration-plan.v2`, inspect its
48
+ hash, scope, dependencies, and safety classes. Apply only ready automatic
49
+ actions with explicit hash/action approval through `kb_apply_plan` or
50
+ `kibi migrate --apply-safe`; escalate operator actions and never infer a
51
+ migration from prose suggestions.
52
+ - Parse the outer `kibiProtocol`/`resultVersion` envelope. If a mutation returns
53
+ `committed_with_repairs`, follow required typed `nextActions`; never retry the
54
+ original operation.
36
55
 
37
56
  ## Guidance
38
57
 
39
- - Prefer the public Kibi MCP surface whenever it is available and approved.
40
- - Never proceed with broad changes when freshness is stale and unresolved.
58
+ - Treat MCP and the trusted project-local CLI as equal peer surfaces.
59
+ - Report task outcome separately from KB, verification, proof, and limitation
60
+ state. A maintenance task can be complete with stale KB state or unresolved
61
+ proof only when its scoped objective is complete and the status is named
62
+ accurately; never call the KB clean/fresh in that case.
63
+ - A legacy attachment blocks mutation, and a dirty verification snapshot blocks
64
+ evidence-dependent closeout. Name the exact paths/symbol IDs and whether the
65
+ result is fixed, accepted, or deferred.
41
66
  - If entities look stale, refresh context through an approved Kibi capability and then re-query.
42
67
  - Preserve source-file traceability by carrying `sourceFile`, text references, and validation evidence through discovery, mutation, and completion.
43
68
  - Do not read or edit files inside `.kb` directly; use the selected Kibi interface instead.
44
- - Completion must state one freshness outcome: KB updated, no KB impact with rationale, or deferred/failed.
69
+ - Kibi authors tracked files but never Git-stages or commits them; ordinary Git workflows remain responsible for review and commit.
70
+ - Completion must state one freshness outcome: KB updated, no KB impact with rationale, or deferred/failed.
71
+
72
+ For exact branch lifecycle, quarantine, restore, and source-first writes, read
73
+ the shared `kibi-usage/resources/branch-lifecycle.md` and
74
+ `source-authoring.md` resources.
@@ -0,0 +1,7 @@
1
+ # Branch lifecycle
2
+
3
+ Use the exact `KIBI_BRANCH` value or Git symbolic HEAD. Hashed stores carry a
4
+ matching `branch.json`; missing stores are rebuilt from tracked sources by
5
+ `kibi sync`. Legacy literal stores require explicit migration. Kibi never copies
6
+ stores between branches or resolves Git conflicts.
7
+
@@ -0,0 +1,6 @@
1
+ # Operation access
2
+
3
+ Use visible approved MCP or the trusted project-local CLI. `kb_status`/`status`
4
+ is read-only and returns the shared versioned result envelope with exact branch,
5
+ store, freshness, effects, diagnostics, and typed next actions.
6
+
@@ -0,0 +1,7 @@
1
+ # Source authoring
2
+
3
+ Tracked documents and relationship shards are authoritative. Kibi may write
4
+ them transactionally but does not stage or commit them. Inspect `effects` and
5
+ typed `nextActions`; after `committed_with_repairs`, repair without retrying the
6
+ original mutation.
7
+
@@ -1,60 +1,60 @@
1
1
  ---
2
2
  id: kibi-traceability
3
3
  name: kibi-traceability
4
- description: Maintain requirement, scenario, and test traceability through Kibi MCP tools.
5
- version: 1.0.0
6
- kibiCompatibility: "*"
4
+ description: Maintain source-first requirement, scenario, test, symbol, and proof traceability through Kibi's peer interfaces.
5
+ version: 2.0.0
6
+ kibiCompatibility: ">=1.0.0"
7
7
  tags:
8
8
  - kibi
9
- - mcp
10
9
  - traceability
10
+ - source-first
11
+ - proof
11
12
  - agent-guidance
13
+ resources:
14
+ - resources/traceability.md
15
+ - resources/branch-lifecycle.md
16
+ - resources/source-authoring.md
17
+ - resources/operation-access.md
12
18
  ---
13
19
  ## Goal
14
20
 
15
- Validate and strengthen requirement, scenario, test, behavioral-symbol, and source-file traceability before and after code changes.
21
+ Keep product intent connected to implementation without a parallel ticket
22
+ bureaucracy. Requirements own symbols, requirements have clause-complete
23
+ semantics, scenarios have tests, and proof-bearing tests have fresh evidence.
16
24
 
17
25
  ## Interface Selection
18
26
 
19
- 1. If Kibi MCP tools are visible and approved, use the MCP surface as the primary authority.
20
- 2. Otherwise, in a trusted workspace, use the canonical project-local CLI fallback through `npx --no-install kibi ...` or `bunx --no-install kibi ...`.
21
- 3. If neither approved MCP tools nor the project-local CLI are available, or if the CLI is unavailable or too old, stop and tell the operator to enable or install Kibi.
22
- 4. Never use a global fallback or an installing runner.
23
-
24
- Use MCP routes for modeling, querying, checking, validation, and cleanup. Use the project-local CLI only as the fallback interface, passing JSON input through stdin. Example:
25
-
26
- ```bash
27
- echo '{"sourceFiles":["src/auth/login.ts"],"includeImpactDiagnostics":true,"includeWorkingTreeDiff":true}' | npx --no-install kibi check --input -
28
- ```
29
-
30
- ## Capability Workflow
31
-
32
- - Locate requirements through `kb_search` or `search --input`, then inspect exact records through `kb_query` or `query --input`.
33
- - Before meaningful edits, identify linked requirements, scenarios, tests, facts, source files, and behavioral symbols relevant to the planned change.
34
- - After meaningful source edits, run `kb_check({sourceFiles:[...], includeImpactDiagnostics:true, includeWorkingTreeDiff:true})` or the equivalent `check --input` JSON recipe before deciding whether traceability is current.
35
- - Apply traceability updates sequentially through `kb_upsert` or `upsert --input` for requirements, scenarios, tests, facts, behavioral symbols, and source-linked relationships.
36
- - Validate constraints and consistency through `kb_check` or `check --input` after updates.
37
- - Run `kb_coverage` by requirement after validation. Treat `coverageStatus` as structural compatibility only; use the separate `proofStatus`, `proofStages`, `proofGaps`, and ranked `proofRepairs` to decide whether the complete intent-to-code chain is proven.
38
- - Use `kb_delete` or `delete --input` only for explicit cleanup of obsolete records or relationships.
39
-
40
- ## Guidance
41
-
42
- - Prefer source-linked relationships so requirements, scenarios, tests, symbols, and files can be traced cleanly.
43
- - Preserve source-file traceability whenever adding or changing requirements, scenarios, tests, facts, behavioral symbols, or implementation links.
44
- - Preserve the canonical chain `REQ-* -> SCEN-* -> TEST-*` when adding or changing requirements.
45
- - Production symbols should implement requirements; test symbols should remain executable evidence for tests.
46
- - A proof-bearing test must be reached through the requirement's scenario, declare `verification_scope: end_to_end`, and carry a fresh passed `kibi.verification-receipt.v1` bound to the live `verificationSnapshot`. Link its executable code with `executable_for`; link each production symbol with `implements` and `covered_by` to that qualifying test. Durable `status: passing` is structural metadata, not execution proof.
47
- - Read `kb_status` immediately before a proof-bearing run, execute the exact recorded command, then append—not replace—the receipt history with test ID, scope, runner, command, snapshot, environment hash, timestamps, outcome, and artifact digest. Re-read coverage; wrong-snapshot, stale, failed, malformed, future-dated, or unavailable evidence must remain a gap.
48
- - A green structural count is not proof. Do not report success while a proposition is absent or unresolved, grounding is incomplete or non-bijective, contradiction analysis is incomplete, the E2E path is direct-only, its execution receipt is not fresh for the live snapshot, or proof-bearing symbols lack current generated coordinates.
49
- - Use `kb_coverage.repairPlan` to turn row-local `proofRepairs` into small dependency-ordered batches. Require `scope.complete: true` before treating it as a project-wide inventory, apply only `state: ready` work, and treat every `autoApplicable: false` batch as reviewed guidance rather than an executable mutation payload. Query current endpoints, follow its validation policy, keep upserts sequential, then rerun coverage after each batch; newly visible downstream gaps supersede the older plan. Never reinterpret `no_conflict_found` as universal consistency; it only describes the modeled ground claims Kibi could inspect.
50
- - When `.kb/usage.log` exists, run `kibi usage-metrics --format json --require-acceptance` after the final complete coverage call. A successful graph check does not override failed or insufficient `kibi.telemetry-acceptance.v1` evidence; follow ranked telemetry diagnostics for advisor/preflight bypasses, lookup misses, stalled proof recovery, receipt freshness, or repeated mutation failures.
51
- - Resolve impact at behavioral-symbol granularity when Kibi reports symbol-level diagnostics; avoid treating a whole file as impacted when the report identifies narrower linked behavior.
52
- - Treat `symbol_semantic_review_needed` as a prompt to inspect linked requirements and tests; Kibi reports graph links but does not prove prose semantics.
53
- - Do not read or edit files inside `.kb` directly; all modeling and cleanup goes through the selected Kibi interface.
54
- - Keep approval boundaries intact: only use Kibi MCP tools that are visible and approved, and only use the project-local CLI fallback in a trusted workspace.
55
-
56
- Public training trajectories:
57
- [{"taskId":"kibi-traceability-requirement-discovery-train-1","family":"requirement-discovery","reflection":"Discover the requirement linked to the supplied source symbol. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-requirement-discovery-train-2","family":"requirement-discovery","reflection":"Discover the requirement linked to the supplied source symbol. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-symbol-impact-granularity-train-1","family":"symbol-impact-granularity","reflection":"Resolve impact at behavioral symbol granularity rather than file granularity. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-symbol-impact-granularity-train-2","family":"symbol-impact-granularity","reflection":"Resolve impact at behavioral symbol granularity rather than file granularity. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-relationship-chain-train-1","family":"relationship-chain","reflection":"Trace the requirement, scenario, and test relationship chain. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-relationship-chain-train-2","family":"relationship-chain","reflection":"Trace the requirement, scenario, and test relationship chain. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-executable-coverage-train-1","family":"executable-coverage","reflection":"Establish executable test identity and behavioral coverage links. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"kibi-traceability-executable-coverage-train-2","family":"executable-coverage","reflection":"Establish executable test identity and behavioral coverage links. This is train case 2; use only the public Kibi MCP surface."}]
58
-
59
- Previous development gate:
60
- {"mean":0,"hardPasses":0,"worstFamilyMean":0}
27
+ Use the visible approved MCP tools or trusted project-local CLI as equal peer
28
+ interfaces. Select the surface by capability; neither is semantically preferred.
29
+ For CLI JSON, use a dedicated route such as
30
+ `printf '%s\n' '{}' | kibi status --input -`.
31
+
32
+ ## Workflow
33
+
34
+ Use the visible approved MCP tools or trusted project-local CLI as equal peer
35
+ interfaces. Discover with `kb_search`, exact-filter with `kb_query`, and inspect
36
+ `kb_status` before branch-sensitive work. Preserve `REQ-* -> SCEN-* -> TEST-*`;
37
+ link production symbols with `implements` and qualifying tests with
38
+ `executable_for`/`covered_by`.
39
+
40
+ After source edits, run targeted `kb_check` with impact diagnostics, update
41
+ tracked Markdown/YAML/manifests and canonical relationship shards through
42
+ sequential `kb_upsert`, then run final check and coverage. Kibi authors tracked
43
+ files transactionally but never Git-stages or commits them. Do not read or edit
44
+ `.kb` directly.
45
+
46
+ Use `kb_delete` only for intentional cleanup. Authored entity deletion returns a
47
+ hash-bound approval plan; requirements normally evolve through a new
48
+ requirement linked with `supersedes`. Relationship deletes patch shards while
49
+ preserving unrelated records.
50
+
51
+ ## Typed recovery and proof
52
+
53
+ Parse `kibiProtocol`, `resultVersion`, `status`, `effects`, diagnostics, and
54
+ typed `nextActions`. On `committed_with_repairs`, execute the required repair
55
+ action and never retry the original mutation. Keep ontology gaps, ambiguity,
56
+ stale snapshots, unavailable receipts, and incomplete grounding explicit.
57
+
58
+ Fresh proof requires a current verification snapshot, the exact contracted E2E
59
+ command, an append-only receipt, and current symbol coordinates. Structural
60
+ coverage and a green check are not proof by themselves.
@@ -0,0 +1,7 @@
1
+ # Branch lifecycle
2
+
3
+ The exact Git ref is the branch identity. Hashed stores are rebuildable
4
+ artifacts, missing stores compile from this checkout, and Git remains the sole
5
+ merge/conflict authority. Explicitly migrate legacy literal stores; do not copy
6
+ another branch's compiled state.
7
+
@@ -0,0 +1,5 @@
1
+ # Operation access
2
+
3
+ Use the shared operation contracts through approved MCP or the trusted project-local
4
+ CLI. Parse `kibiProtocol`, `resultVersion`, `status`, `effects`, diagnostics,
5
+ and typed `nextActions`; do not retry a mutation after authoritative commit.
@@ -0,0 +1,6 @@
1
+ # Source authoring
2
+
3
+ Use `document.path`/`document.body` for source-first writes. Preserve existing
4
+ body bytes when body is omitted, patch relationship shards without dropping
5
+ unrelated records, and follow typed repair actions after partial completion.
6
+
@@ -0,0 +1,8 @@
1
+ # Traceability detail
2
+
3
+ Model one requirement clause at a time. Use strict fact lanes for contradiction
4
+ checks, predicate schemas for project ontology, and observation/meta facts for
5
+ bugs and workarounds. Query all relationship endpoints before writing; a graph
6
+ link is not proof until the scenario, test, symbol, and fresh receipt are
7
+ readable at the current snapshot.
8
+