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.
- package/.cursor-plugin/plugin.json +1 -1
- package/CHANGELOG.md +171 -0
- package/README.md +13 -10
- package/agent-plugin/plugin.json +1 -1
- package/agent-plugin/skills/kibi-bootstrap/SKILL.md +58 -0
- package/agent-plugin/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
- package/agent-plugin/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
- package/agent-plugin/skills/kibi-bootstrap/resources/operation-access.md +5 -0
- package/agent-plugin/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
- package/agent-plugin/skills/kibi-freshness/SKILL.md +40 -10
- package/agent-plugin/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
- package/agent-plugin/skills/kibi-freshness/resources/operation-access.md +6 -0
- package/agent-plugin/skills/kibi-freshness/resources/source-authoring.md +7 -0
- package/agent-plugin/skills/kibi-traceability/SKILL.md +47 -47
- package/agent-plugin/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
- package/agent-plugin/skills/kibi-traceability/resources/operation-access.md +5 -0
- package/agent-plugin/skills/kibi-traceability/resources/source-authoring.md +6 -0
- package/agent-plugin/skills/kibi-traceability/resources/traceability.md +8 -0
- package/agent-plugin/skills/kibi-usage/SKILL.md +115 -239
- package/agent-plugin/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
- package/agent-plugin/skills/kibi-usage/resources/kb-improvement.md +38 -0
- package/agent-plugin/skills/kibi-usage/resources/operation-access.md +36 -38
- package/agent-plugin/skills/kibi-usage/resources/relationship-directions.md +3 -3
- package/agent-plugin/skills/kibi-usage/resources/source-authoring.md +31 -0
- package/agent-plugin/skills/kibi-usage/resources/workflows.md +56 -3
- package/bin/launch-kibi-mcp.d.mts +18 -0
- package/bin/launch-kibi-mcp.mjs +378 -0
- package/commands/kibi-bootstrap.md +19 -0
- package/dist/.cursor-plugin/plugin.json +1 -1
- package/dist/bin/launch-kibi-mcp.d.mts +18 -0
- package/dist/bin/launch-kibi-mcp.mjs +378 -0
- package/dist/commands/kibi-bootstrap.md +19 -0
- package/dist/hook-input.d.ts +2 -0
- package/dist/hook-input.js +10 -0
- package/dist/hook-runner.js +34 -12
- package/dist/hook-state-storage.js +3 -0
- package/dist/hook-state.d.ts +2 -0
- package/dist/hook-state.js +3 -0
- package/dist/mcp.json +2 -2
- package/dist/messages.js +6 -1
- package/dist/path-policy.js +43 -1
- package/dist/skills/.canon-hash.json +21 -7
- package/dist/skills/kibi-bootstrap/SKILL.md +58 -0
- package/dist/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
- package/dist/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
- package/dist/skills/kibi-bootstrap/resources/operation-access.md +5 -0
- package/dist/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
- package/dist/skills/kibi-freshness/SKILL.md +40 -10
- package/dist/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
- package/dist/skills/kibi-freshness/resources/operation-access.md +6 -0
- package/dist/skills/kibi-freshness/resources/source-authoring.md +7 -0
- package/dist/skills/kibi-traceability/SKILL.md +47 -47
- package/dist/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
- package/dist/skills/kibi-traceability/resources/operation-access.md +5 -0
- package/dist/skills/kibi-traceability/resources/source-authoring.md +6 -0
- package/dist/skills/kibi-traceability/resources/traceability.md +8 -0
- package/dist/skills/kibi-usage/SKILL.md +115 -239
- package/dist/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
- package/dist/skills/kibi-usage/resources/kb-improvement.md +38 -0
- package/dist/skills/kibi-usage/resources/operation-access.md +36 -38
- package/dist/skills/kibi-usage/resources/relationship-directions.md +3 -3
- package/dist/skills/kibi-usage/resources/source-authoring.md +31 -0
- package/dist/skills/kibi-usage/resources/workflows.md +56 -3
- package/mcp.json +2 -2
- package/package.json +4 -3
- package/skills/.canon-hash.json +21 -7
- package/skills/kibi-bootstrap/SKILL.md +58 -0
- package/skills/kibi-bootstrap/resources/bootstrap.md +11 -0
- package/skills/kibi-bootstrap/resources/branch-lifecycle.md +7 -0
- package/skills/kibi-bootstrap/resources/operation-access.md +5 -0
- package/skills/kibi-bootstrap/resources/source-authoring.md +8 -0
- package/skills/kibi-freshness/SKILL.md +40 -10
- package/skills/kibi-freshness/resources/branch-lifecycle.md +7 -0
- package/skills/kibi-freshness/resources/operation-access.md +6 -0
- package/skills/kibi-freshness/resources/source-authoring.md +7 -0
- package/skills/kibi-traceability/SKILL.md +47 -47
- package/skills/kibi-traceability/resources/branch-lifecycle.md +7 -0
- package/skills/kibi-traceability/resources/operation-access.md +5 -0
- package/skills/kibi-traceability/resources/source-authoring.md +6 -0
- package/skills/kibi-traceability/resources/traceability.md +8 -0
- package/skills/kibi-usage/SKILL.md +115 -239
- package/skills/kibi-usage/resources/branch-lifecycle.md +31 -0
- package/skills/kibi-usage/resources/kb-improvement.md +38 -0
- package/skills/kibi-usage/resources/operation-access.md +36 -38
- package/skills/kibi-usage/resources/relationship-directions.md +3 -3
- package/skills/kibi-usage/resources/source-authoring.md +31 -0
- package/skills/kibi-usage/resources/workflows.md +56 -3
- package/agent-plugin/skills/init-kibi/SKILL.md +0 -62
- package/commands/init-kibi.md +0 -21
- package/dist/commands/init-kibi.md +0 -21
- package/dist/skills/init-kibi/SKILL.md +0 -62
- package/skills/init-kibi/SKILL.md +0 -62
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Source-first authoring
|
|
2
|
+
|
|
3
|
+
Tracked Markdown, YAML, symbol manifests, and relationship shards are the
|
|
4
|
+
authoritative project memory. Prolog/RDF state is a rebuildable compiled
|
|
5
|
+
artifact. Kibi may transactionally write tracked files, but it never stages or
|
|
6
|
+
commits them; ordinary Git workflows remain responsible for review and merge.
|
|
7
|
+
|
|
8
|
+
`kb_upsert` accepts `document.path` and `document.body`. Existing entities use
|
|
9
|
+
their authored source by default and preserve body bytes when `body` is omitted.
|
|
10
|
+
New requirements use `semantic_text` as their body. If a new entity has zero or
|
|
11
|
+
multiple configured writable targets, provide an explicit workspace-relative
|
|
12
|
+
`document.path`; absolute, traversal, and symlink escapes are rejected.
|
|
13
|
+
|
|
14
|
+
New files are compiled only while their exact bytes are covered by a pending-
|
|
15
|
+
source receipt. Sync compiles Git-tracked files plus those hash-bound pending
|
|
16
|
+
files; arbitrary untracked files are ignored. Stage the file in Git to absorb
|
|
17
|
+
and remove its receipt. A changed or missing pending file is a blocking hash
|
|
18
|
+
drift diagnostic. Unresolved Git index conflicts are likewise blocking; Kibi
|
|
19
|
+
never chooses a merge winner.
|
|
20
|
+
|
|
21
|
+
Relationship upserts and relationship deletes patch only the canonical shard,
|
|
22
|
+
preserving unrelated records. Authored entity deletion returns a hash-bound
|
|
23
|
+
plan; approve that plan through `kb_apply_plan`. Evolve requirements with a new
|
|
24
|
+
requirement and `supersedes`, rather than deleting the old semantic claim.
|
|
25
|
+
|
|
26
|
+
On `committed_with_repairs`, inspect `effects` and execute the typed required
|
|
27
|
+
`nextActions`. Never retry the original mutation after its authoritative commit.
|
|
28
|
+
Cancellation follows the same rule: wait for the terminal journal state. A
|
|
29
|
+
pre-commit rollback is retryable, a committed source with a failed derivative
|
|
30
|
+
is repairable, and an indeterminate outcome is non-retryable until its recovery
|
|
31
|
+
action resolves the journal.
|
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Workflows
|
|
2
2
|
|
|
3
|
+
## Closeout contract
|
|
4
|
+
|
|
5
|
+
End every task with these five independent fields (not a single inferred
|
|
6
|
+
success flag):
|
|
7
|
+
|
|
8
|
+
```text
|
|
9
|
+
taskOutcome: complete | interim | blocked
|
|
10
|
+
kbState: clean_fresh | stale | dirty | legacy_compat | not_evaluated
|
|
11
|
+
verificationState: fresh | dirty | unavailable | not_evaluated
|
|
12
|
+
proofState: proven | mixed | unresolved | not_evaluated
|
|
13
|
+
limitationDisposition: none | accepted | unaccepted | not_applicable
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`taskOutcome` describes whether the requested objective was completed. The
|
|
17
|
+
other fields describe observed system state. A clean check can coexist with a
|
|
18
|
+
stale or dirty KB; unresolved proof can coexist with a complete maintenance
|
|
19
|
+
task. An accepted limitation is an auditable operator decision, never logical
|
|
20
|
+
grounding, receipt editing, or proof. For every quality diagnostic, record its
|
|
21
|
+
ID, one of `fixed`, `accepted`, or `deferred`, and a rationale. Keep accepted
|
|
22
|
+
ontology gaps and historical telemetry limitations explicit.
|
|
23
|
+
|
|
24
|
+
Receipt reuse is safe only when the live verification snapshot, contract hash,
|
|
25
|
+
freshness window, and every required case result still match. Otherwise rerun
|
|
26
|
+
the contracted command. If the contract changed, retain every older receipt
|
|
27
|
+
unchanged, append evidence for the current contract, and keep proof unresolved
|
|
28
|
+
with `verification_contract_mismatch` until that current receipt exists.
|
|
29
|
+
Obsolete symbols require current extraction or Git evidence before
|
|
30
|
+
remap/deletion; transfer coverage only when existing test evidence supports it,
|
|
31
|
+
then sync and read back status. Same-version packages with different export
|
|
32
|
+
surfaces are a release defect: require a new package version and label any
|
|
33
|
+
project override temporary. This skill never selects a package manager or
|
|
34
|
+
edits dependency configuration.
|
|
35
|
+
|
|
3
36
|
## Discovery to Validation Sequence
|
|
4
37
|
|
|
5
38
|
The canonical workflow for any KB operation follows this pattern:
|
|
@@ -13,7 +46,7 @@ The canonical workflow for any KB operation follows this pattern:
|
|
|
13
46
|
7. **Create endpoints**: validated `kb_upsert` for new entities, sequentially
|
|
14
47
|
8. **Link**: validated `kb_upsert` with `requires_rule`, `requires_predicate`, `constrains`, or `requires_property`, sequentially
|
|
15
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`
|
|
16
|
-
10. **Prove execution**: read `kb_status.verificationSnapshot`, run each scenario-backed E2E command
|
|
49
|
+
10. **Prove execution**: read `kb_status.verificationSnapshot`, run each scenario-backed E2E command exactly as declared by its `verification_contract.v1` through `kibi verify`, append the derived `kibi.verification-receipt.v2`, and re-run `kb_coverage`; never promote durable test status into fresh evidence
|
|
17
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
|
|
18
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
|
|
19
52
|
|
|
@@ -23,6 +56,26 @@ Every current requirement without `logic_claims` remains visible as non-blocking
|
|
|
23
56
|
|
|
24
57
|
`kibi.telemetry-acceptance.v1` evaluates the latest 200 usage events and keeps process health separate from graph correctness. It requires at least 95% complete diagnostic telemetry and, when applicable, exact recent validation before every upsert and a same-requirement/current-hash advisor pass before requirement writes. It also evaluates source lookup misses, comparable complete-scope proof-gap recovery, receipt-specific coverage gaps, and mutation targets retried three or more times. Failed metrics become ranked `category: telemetry` quality diagnostics; missing current coverage fields or evidence older than seven days stays `insufficient_evidence`.
|
|
25
58
|
|
|
59
|
+
## Agent-guided migration
|
|
60
|
+
|
|
61
|
+
`kb_status`, unfiltered `kb_check`, and complete-scope `kb_coverage` may return
|
|
62
|
+
the shared `kibi.migration-plan.v2`. Treat it as a typed action graph: inspect
|
|
63
|
+
the canonical `planHash`, scope completeness, dependencies, safety class,
|
|
64
|
+
preconditions, postconditions, and evidence. Apply only ready automatic actions
|
|
65
|
+
with `autoApplicable: true` through an explicitly approved `kb_apply_plan` or
|
|
66
|
+
`kibi migrate --apply-safe` request containing the exact hash and action IDs.
|
|
67
|
+
Never infer an operation from a prose suggestion, and never apply a partial
|
|
68
|
+
plan's destructive symbol or relationship action.
|
|
69
|
+
|
|
70
|
+
The migration engine may normalize schema/config metadata, cut over validated
|
|
71
|
+
legacy storage with backups, migrate the exact historical branch attachment,
|
|
72
|
+
refresh coordinates, and perform provenance-proven stale cleanup. It does not
|
|
73
|
+
choose package managers, ground semantic claims, resolve contradictions, rerun
|
|
74
|
+
E2E tests, rewrite receipt history, remap authored symbols, or accept
|
|
75
|
+
limitations. Those actions remain explicit review/operator/execution steps.
|
|
76
|
+
|
|
77
|
+
For `e2e_receipt_freshness_low`, query each listed requirement/test gap and run its exact current contract through `kibi verify`; this appends v2 evidence and preserves older 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
|
+
|
|
26
79
|
## Creating a New Feature
|
|
27
80
|
```
|
|
28
81
|
1. kb_search to discover existing requirements and related knowledge
|
|
@@ -50,10 +103,10 @@ Do not create a test-fact pair. Facts describe invariants; requirements or scena
|
|
|
50
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.
|
|
51
104
|
2. Read `kb_status` and retain its available `verificationSnapshot`. Stop if the runtime reports `unknown`; proof must fail closed when the code identity cannot be computed.
|
|
52
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.
|
|
53
|
-
4. Preserve every existing receipt byte-for-byte and append
|
|
106
|
+
4. Preserve every existing receipt byte-for-byte and append the derived `kibi.verification-receipt.v2` object with strictly later `finished_at`. Earlier receipts may bind older contracts; they remain audit history but cannot prove the current contract. Mutation and incremental sync reject history removal, rewriting, and reordering.
|
|
54
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.
|
|
55
108
|
|
|
56
|
-
Only the newest receipt
|
|
109
|
+
Only the newest receipt matching both the live snapshot and current contract 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_verification_receipt`, `stale_verification_receipt`, `failed_verification_receipt`, `invalid_verification_receipt`, `verification_contract_mismatch`, and `verification_snapshot_unavailable` are repair states, not warnings to waive.
|
|
57
110
|
|
|
58
111
|
## Predicate-First Requirement Modeling
|
|
59
112
|
|
package/mcp.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-cursor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Kibi Cursor plugin - thin adapter for Cursor MCP integration and editor hooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
".cursor-plugin",
|
|
17
17
|
"mcp.json",
|
|
18
|
+
"bin",
|
|
18
19
|
"hooks",
|
|
19
20
|
"skills",
|
|
20
21
|
"rules",
|
|
@@ -41,8 +42,8 @@
|
|
|
41
42
|
"prepack": "npm run build"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
|
44
|
-
"kibi-cli": ">=0.
|
|
45
|
-
"kibi-mcp": ">=0.
|
|
45
|
+
"kibi-cli": ">=1.0.0",
|
|
46
|
+
"kibi-mcp": ">=1.0.0"
|
|
46
47
|
},
|
|
47
48
|
"peerDependenciesMeta": {
|
|
48
49
|
"kibi-cli": {
|
package/skills/.canon-hash.json
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"kibi-
|
|
4
|
-
"kibi-
|
|
5
|
-
"kibi-
|
|
2
|
+
"kibi-bootstrap/SKILL.md": "adf7ebe4985ee871e2f1d2d89fd90a20c596fa24460bfec4df525bdcebd3f1d6",
|
|
3
|
+
"kibi-bootstrap/resources/bootstrap.md": "e46d5dec74204d0652d4cba7061676c76c2f066bf6d98b073efa9fa44557be80",
|
|
4
|
+
"kibi-bootstrap/resources/branch-lifecycle.md": "c854264ce888439140883a3fc636db5e522f020dd27b30a5c1ecc4105b64ed13",
|
|
5
|
+
"kibi-bootstrap/resources/operation-access.md": "b5a6a59e72d800c376e7fad79132897623c32a0ce152a1e8d73f9628b444db51",
|
|
6
|
+
"kibi-bootstrap/resources/source-authoring.md": "bf296e62f69474e01797d6cb9469bf624551dca834dd188abb6e705bd96fa586",
|
|
7
|
+
"kibi-freshness/SKILL.md": "67c3eda1c7c12bbbc320e84119bd7a179d2dfc0189964d2f052e032b21a8af10",
|
|
8
|
+
"kibi-freshness/resources/branch-lifecycle.md": "ebc01b19fe3dca8df5fc0175978963f6f1204f71f7c805cb2a5fb1b277ac78e4",
|
|
9
|
+
"kibi-freshness/resources/operation-access.md": "4e1db9294ee540cd29b8b3a2532a81e7894d5b4228b39e99ba48b37212f489f3",
|
|
10
|
+
"kibi-freshness/resources/source-authoring.md": "41a0547ce4d2a112a0f3671d36720f07c447864db3b473e94eb88a8ce2d371ff",
|
|
11
|
+
"kibi-traceability/SKILL.md": "e3d559e149f11792a44fe9ae9d68f88933df9992df460abac33c8bfc468ddadb",
|
|
12
|
+
"kibi-traceability/resources/branch-lifecycle.md": "50f1a6355aa9185d412b2474db1a64e112944625d2465be0adbf93ada3273c1f",
|
|
13
|
+
"kibi-traceability/resources/operation-access.md": "39f7972ab7f4ae7479e78f7072bb50e8e6c4cdf4f857425f69d2522d37db437c",
|
|
14
|
+
"kibi-traceability/resources/source-authoring.md": "408c6ee2bef1b84e0194c0538ef929c26a0a617e631b2234247388140dbbdd08",
|
|
15
|
+
"kibi-traceability/resources/traceability.md": "38c290a0bc71bd1692e115f22694743946e2f69630e134acfd43cee5f613fb88",
|
|
16
|
+
"kibi-usage/SKILL.md": "3d347a430cb8be2017df34d22d151355abc5083173988dafb4c8433ee81281da",
|
|
17
|
+
"kibi-usage/resources/branch-lifecycle.md": "f1bf359e9826e83c548f3cd0287f8175a62456527b0132b06b3f9f74aa59b7d6",
|
|
6
18
|
"kibi-usage/resources/fact-lanes.md": "41b28023a57593009867ea0ebc8e9f3f05c3bd837144772d12844423f922e763",
|
|
19
|
+
"kibi-usage/resources/kb-improvement.md": "17e8b6cf6a0dd43b443a2bfd92e7205d099647a5f1c75fe85413a6cea63d86c6",
|
|
7
20
|
"kibi-usage/resources/logic-ir.md": "151675d0ffa813cb9e271084102a3af42de369b8f9a0c64866af0cdc4d924063",
|
|
8
|
-
"kibi-usage/resources/operation-access.md": "
|
|
9
|
-
"kibi-usage/resources/relationship-directions.md": "
|
|
21
|
+
"kibi-usage/resources/operation-access.md": "b33c5be8cab5c27dfa68b7655fad8a52cead6d3adacd2488f1779a1176007fbf",
|
|
22
|
+
"kibi-usage/resources/relationship-directions.md": "a357072d3370db9b7d80e505795f952909a68778cc18b1d089970de91e4fda46",
|
|
23
|
+
"kibi-usage/resources/source-authoring.md": "ac4f1a9b5785462f8c3530bdcdb82ad9a0ee1f4049454ae28bf4df09ff267ebd",
|
|
10
24
|
"kibi-usage/resources/ui-requirements.md": "b7c31ab1affa3ab25ae5242d8fd8c4d546532d1cafc65d84088375317c1682cc",
|
|
11
|
-
"kibi-usage/resources/workflows.md": "
|
|
25
|
+
"kibi-usage/resources/workflows.md": "1c6b8a2c40d3a3c3f4bdfe9165b3dae4a669b8ddb7808be9ff5b670cecceded8"
|
|
12
26
|
}
|
|
@@ -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,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
|
|
5
|
-
version:
|
|
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.
|
|
20
|
-
2.
|
|
21
|
-
3. If
|
|
22
|
-
4. Never use a global fallback
|
|
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
|
-
-
|
|
40
|
-
-
|
|
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
|
-
-
|
|
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,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
|
|
5
|
-
version:
|
|
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
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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,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
|
+
|