kibi-cursor 2.1.1 → 2.3.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 +106 -0
- package/README.md +7 -3
- package/agent-plugin/plugin.json +1 -1
- package/agent-plugin/skills/kibi-bootstrap/SKILL.md +52 -11
- package/agent-plugin/skills/kibi-bootstrap/resources/bootstrap.md +12 -1
- package/agent-plugin/skills/kibi-usage/SKILL.md +82 -18
- package/agent-plugin/skills/kibi-usage/resources/fact-lanes.md +5 -5
- package/agent-plugin/skills/kibi-usage/resources/kb-improvement.md +1 -1
- package/agent-plugin/skills/kibi-usage/resources/logic-ir.md +2 -2
- package/agent-plugin/skills/kibi-usage/resources/operation-access.md +29 -1
- package/agent-plugin/skills/kibi-usage/resources/ui-requirements.md +4 -4
- package/agent-plugin/skills/kibi-usage/resources/workflows.md +42 -25
- package/bin/launch-kibi-mcp.mjs +4 -1
- package/commands/kibi-bootstrap.md +4 -1
- package/dist/.cursor-plugin/plugin.json +1 -1
- package/dist/bin/launch-kibi-mcp.mjs +4 -1
- package/dist/commands/kibi-bootstrap.md +4 -1
- package/dist/guidance.d.ts +8 -0
- package/dist/guidance.js +13 -0
- package/dist/hook-runner.d.ts +12 -0
- package/dist/hook-runner.js +98 -2
- package/dist/skills/.canon-hash.json +9 -9
- package/dist/skills/kibi-bootstrap/SKILL.md +52 -11
- package/dist/skills/kibi-bootstrap/resources/bootstrap.md +12 -1
- package/dist/skills/kibi-usage/SKILL.md +82 -18
- package/dist/skills/kibi-usage/resources/fact-lanes.md +5 -5
- package/dist/skills/kibi-usage/resources/kb-improvement.md +1 -1
- package/dist/skills/kibi-usage/resources/logic-ir.md +2 -2
- package/dist/skills/kibi-usage/resources/operation-access.md +29 -1
- package/dist/skills/kibi-usage/resources/ui-requirements.md +4 -4
- package/dist/skills/kibi-usage/resources/workflows.md +42 -25
- package/dist/source-linked-requirements.d.ts +13 -3
- package/dist/source-linked-requirements.js +14 -15
- package/package.json +2 -2
- package/skills/.canon-hash.json +9 -9
- package/skills/kibi-bootstrap/SKILL.md +52 -11
- package/skills/kibi-bootstrap/resources/bootstrap.md +12 -1
- package/skills/kibi-usage/SKILL.md +82 -18
- package/skills/kibi-usage/resources/fact-lanes.md +5 -5
- package/skills/kibi-usage/resources/kb-improvement.md +1 -1
- package/skills/kibi-usage/resources/logic-ir.md +2 -2
- package/skills/kibi-usage/resources/operation-access.md +29 -1
- package/skills/kibi-usage/resources/ui-requirements.md +4 -4
- package/skills/kibi-usage/resources/workflows.md +42 -25
|
@@ -4,11 +4,12 @@ Generated from the public `OperationSpec` catalog. CLI JSON and MCP structured
|
|
|
4
4
|
content use the same `KibiResult` envelope (protocol 1); result data is versioned
|
|
5
5
|
per operation. Effects are authoritative for mutability and adapter annotations.
|
|
6
6
|
|
|
7
|
-
|
|
|
7
|
+
| Operation | CLI route | Input mode | Mutability | Requires Prolog | Effects | Interface | Result version | Destructive | Retry safety | Open-world | Output schema |
|
|
8
8
|
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
9
9
|
| `kb_skills_list` | `skills-list` | --input JSON | read | no | local-read | peer; capability-selected | kibi.kb_skills_list.v1 | no | safe | no | yes |
|
|
10
10
|
| `kb_skills_load` | `skills-load` | --input JSON | read | no | local-read | peer; capability-selected | kibi.kb_skills_load.v1 | no | safe | no | yes |
|
|
11
11
|
| `kb_skills_read` | `skills-read` | --input JSON | read | no | local-read | peer; capability-selected | kibi.kb_skills_read.v1 | no | safe | no | yes |
|
|
12
|
+
| `kb_skills` | `skill` | --input JSON | read | no | local-read | peer; capability-selected | kibi.kb_skills.v1 | no | safe | no | yes |
|
|
12
13
|
| `kb_query` | `query` | --input JSON or flags | read | yes | kb-read | peer; capability-selected | kibi.kb_query.v1 | no | safe | no | yes |
|
|
13
14
|
| `kb_search` | `search` | --input JSON or flags | read | yes | kb-read | peer; capability-selected | kibi.kb_search.v1 | no | safe | no | yes |
|
|
14
15
|
| `kb_status` | `status` | --input JSON or flags | read | no | kb-read, workspace-read | peer; capability-selected | kibi.kb_status.v1 | no | safe | no | yes |
|
|
@@ -18,6 +19,7 @@ per operation. Effects are authoritative for mutability and adapter annotations.
|
|
|
18
19
|
| `kb_semantic_advisor` | `semantic-advisor` | --input JSON | read | no | local-read | peer; capability-selected | kibi.kb_semantic_advisor.v1 | no | safe | no | yes |
|
|
19
20
|
| `kb_model_requirement` | `model-requirement` | --input JSON | read | yes | kb-read | peer; capability-selected | kibi.kb_model_requirement.v1 | no | safe | no | yes |
|
|
20
21
|
| `kb_suggest_predicates` | `suggest-predicates` | --input JSON | read | yes | kb-read | peer; capability-selected | kibi.kb_suggest_predicates.v1 | no | safe | no | yes |
|
|
22
|
+
| `kb_model` | `model` | --input JSON | read | yes | kb-read | peer; capability-selected | kibi.kb_model.v1 | no | safe | no | yes |
|
|
21
23
|
| `kb_plan_bootstrap` | `plan-bootstrap` | --input JSON | read | no | workspace-read | peer; capability-selected | kibi.kb_plan_bootstrap.v1 | no | safe | no | yes |
|
|
22
24
|
| `kb_validate_upsert` | `validate-upsert` | --input JSON | read | yes | kb-read | peer; capability-selected | kibi.kb_validate_upsert.v1 | no | safe | no | yes |
|
|
23
25
|
| `kb_upsert` | `upsert` | --input JSON | write | yes | kb-write, workspace-write | peer; capability-selected | kibi.kb_upsert.v1 | yes | unsafe | no | yes |
|
|
@@ -29,6 +31,28 @@ per operation. Effects are authoritative for mutability and adapter annotations.
|
|
|
29
31
|
| `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 |
|
|
30
32
|
| `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 |
|
|
31
33
|
|
|
34
|
+
## MCP tools versus catalog operations
|
|
35
|
+
|
|
36
|
+
The MCP server registers 16 tools. Most carry their catalog operation name; the
|
|
37
|
+
operations below are reached through a consolidated MCP call instead, while the
|
|
38
|
+
CLI keeps their dedicated routes. Result payloads (for example
|
|
39
|
+
`recommended_tools`, `suggested_next_tool`, or repair-plan steps) still name
|
|
40
|
+
catalog operations, so translate them with this list.
|
|
41
|
+
|
|
42
|
+
- `kb_skills_list`: MCP `kb_skills` with `action: "list"`; CLI `kibi skills list` (`skills-list`)
|
|
43
|
+
- `kb_skills_load`: MCP `kb_skills` with `action: "load"`; CLI `kibi skills load` (`skills-load`)
|
|
44
|
+
- `kb_skills_read`: MCP `kb_skills` with `action: "read"`; CLI `kibi skills read` (`skills-read`)
|
|
45
|
+
- `kb_semantic_advisor`: MCP `kb_model` with `mode: "analyze"`; CLI `kibi semantic-advisor` (`semantic-advisor`)
|
|
46
|
+
- `kb_model_requirement`: MCP `kb_model` with `mode: "requirement"`; CLI `kibi model-requirement` (`model-requirement`)
|
|
47
|
+
- `kb_suggest_predicates`: MCP `kb_model` with `mode: "predicates"`; CLI `kibi suggest-predicates` (`suggest-predicates`)
|
|
48
|
+
- `kb_validate_upsert`: MCP `kb_upsert` with `dryRun: true`; CLI `kibi validate-upsert` (`validate-upsert`)
|
|
49
|
+
- `kb_sparql_remote`: MCP `kb_sparql_remote`, registered only when `KIBI_MCP_OPTIONAL_TOOLS` names it; CLI `kibi sparql-remote` (`sparql-remote`)
|
|
50
|
+
|
|
51
|
+
The consolidated tools also have their own CLI routes: `kibi skill` for
|
|
52
|
+
`kb_skills` and `kibi model` for `kb_model`. `kb_job_status` is likewise
|
|
53
|
+
opt-in through `KIBI_MCP_OPTIONAL_TOOLS`; without it, `kb_check` with
|
|
54
|
+
`async: true` runs synchronously.
|
|
55
|
+
|
|
32
56
|
## JSON execution recipe
|
|
33
57
|
|
|
34
58
|
Use a trusted project-local, non-installing runner. Stdin contains one UTF-8 JSON
|
|
@@ -41,3 +65,7 @@ printf '%s\n' '{"query":"authentication","limit":10}' | npx --no-install kibi se
|
|
|
41
65
|
`_diagnostic_telemetry` is adapter metadata, not business input. Never copy it
|
|
42
66
|
into entity properties. On `committed_with_repairs`, follow typed required
|
|
43
67
|
`nextActions` and do not retry the original mutation.
|
|
68
|
+
|
|
69
|
+
`workspaceRoot` is an MCP-only routing argument naming the directory a call is
|
|
70
|
+
about (see the kibi-usage skill). The CLI JSON routes do not accept it; they
|
|
71
|
+
always run in the current directory.
|
|
@@ -82,14 +82,14 @@ diagnostics (`symbol_semantic_review_needed`).
|
|
|
82
82
|
|
|
83
83
|
## Workflow
|
|
84
84
|
|
|
85
|
-
1. `
|
|
86
|
-
2. Relational clauses: `
|
|
85
|
+
1. `kb_model` (`mode: "analyze"`) on the full description; audit or supply `clauses`.
|
|
86
|
+
2. Relational clauses: `kb_model` (`mode: "predicates"`), apply the predicate plan and
|
|
87
87
|
`requires_predicate`.
|
|
88
|
-
3. Scalar placement/alignment/order clauses: `
|
|
88
|
+
3. Scalar placement/alignment/order clauses: `kb_model` (`mode: "requirement"`), apply the strict
|
|
89
89
|
subject/property plan and `constrains` / `requires_property`.
|
|
90
90
|
4. Preserve `claim_key` / `claim_text`; merge every key into the requirement
|
|
91
91
|
`logic_claims` manifest.
|
|
92
|
-
5. `
|
|
92
|
+
5. `kb_upsert` with `dryRun: true`, create endpoints first, then sequential `kb_upsert`.
|
|
93
93
|
6. `kb_check` with `logic-coverage`, `predicate-verifiability`, `domain-contradictions`,
|
|
94
94
|
then a final unfiltered `kb_check`.
|
|
95
95
|
|
|
@@ -35,21 +35,22 @@ edits dependency configuration.
|
|
|
35
35
|
|
|
36
36
|
## Choosing a discovery mode
|
|
37
37
|
|
|
38
|
-
`kb_search`
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
decide
|
|
38
|
+
`kb_search` defaults to deterministic intent ranking (`rankingMode:
|
|
39
|
+
"intent-v1"`), so a natural-language question is a valid query. Pass
|
|
40
|
+
`rankingMode: "legacy"` for the older lexical ranking. The inputs, not the tool
|
|
41
|
+
name, decide how results are ranked.
|
|
42
42
|
|
|
43
43
|
- **Exact identity** — you already know the ID. Use `kb_query`, not search.
|
|
44
44
|
- **Literal token** — a symbol, file, or error string that appears verbatim.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
Keep the query close to the literal text; `rankingMode: "legacy"` ranks it
|
|
46
|
+
lexically.
|
|
47
|
+
- **Question or behavior** — "what governs how checkout handles a declined
|
|
48
|
+
card?". Ask it directly, and ground it with facets from what you actually
|
|
49
|
+
know:
|
|
48
50
|
|
|
49
51
|
```json
|
|
50
52
|
{
|
|
51
|
-
"query": "declined card during checkout",
|
|
52
|
-
"rankingMode": "intent-v1",
|
|
53
|
+
"query": "what governs a declined card during checkout?",
|
|
53
54
|
"semanticFacets": {
|
|
54
55
|
"actors": ["shopper"],
|
|
55
56
|
"actions": ["pay"],
|
|
@@ -66,7 +67,6 @@ decide the path.
|
|
|
66
67
|
```json
|
|
67
68
|
{
|
|
68
69
|
"query": "checkout total rounding",
|
|
69
|
-
"rankingMode": "intent-v1",
|
|
70
70
|
"sourceLocations": [{ "path": "src/checkout.ts", "symbol": "computeTotal" }]
|
|
71
71
|
}
|
|
72
72
|
```
|
|
@@ -75,8 +75,25 @@ Supply facets only from the request, the code, or prior results. Inventing
|
|
|
75
75
|
facets fabricates evidence and biases ranking. Intent mode abstains below
|
|
76
76
|
`minScore` instead of returning weak matches; an abstention is an explicit
|
|
77
77
|
no-answer, so widen the query or drop to lexical search rather than treating it
|
|
78
|
-
as "nothing exists".
|
|
79
|
-
|
|
78
|
+
as "nothing exists". A literal identifier lookup is still best served
|
|
79
|
+
lexically.
|
|
80
|
+
|
|
81
|
+
On the first page, intent mode also returns an answer layer in `data.answer`
|
|
82
|
+
(`kibi.search-answer.v1`; turn it off with `answer: false`):
|
|
83
|
+
|
|
84
|
+
- `governing` — current requirements matched by the query or linked to a
|
|
85
|
+
matched entity, each with `via` (how it was reached) and its linked `facts`,
|
|
86
|
+
`scenarios`, `tests`, and `adrs`.
|
|
87
|
+
- `rationale` — ADRs that explain the decisions.
|
|
88
|
+
- `notGoverning` — superseded or deprecated requirements, with `supersededBy`
|
|
89
|
+
when known. Never read these as current policy; superseded entities are also
|
|
90
|
+
demoted in the ranked results.
|
|
91
|
+
- `observations` — observation/meta facts, which are notes, not rules.
|
|
92
|
+
- `truncated` and `note` — the layer is size-bounded; an empty `governing`
|
|
93
|
+
list is not evidence that nothing governs the change.
|
|
94
|
+
|
|
95
|
+
The answer layer is graph traversal: discovery, not proof. Use `kb_check` and
|
|
96
|
+
`kb_coverage` for consistency and proof status.
|
|
80
97
|
|
|
81
98
|
Results are summaries by default: identifying metadata, score, reasons, and a
|
|
82
99
|
snippet. Read them to pick candidates, then `kb_query` those IDs for full
|
|
@@ -88,12 +105,12 @@ planning a behavior change; a search receipt is not comprehension.
|
|
|
88
105
|
|
|
89
106
|
The canonical workflow for any KB operation follows this pattern:
|
|
90
107
|
|
|
91
|
-
1. **Discover**: `kb_search` with focused probes; pick the mode above
|
|
108
|
+
1. **Discover**: `kb_search` with focused probes or a direct question; read `data.answer`, and pick the mode above
|
|
92
109
|
2. **Confirm**: `kb_query` for exact IDs and state
|
|
93
110
|
3. **Inspect**: `kb_status` when freshness matters
|
|
94
|
-
4. **Decompose**: `
|
|
95
|
-
5. **Choose per-clause lanes**: strict facts for scalar claims; `
|
|
96
|
-
6. **Preflight**: `
|
|
111
|
+
4. **Decompose**: `kb_model` (`mode: "analyze"`) on the complete normative prose; verify or supply every atomic clause
|
|
112
|
+
5. **Choose per-clause lanes**: strict facts for scalar claims; `kb_model` `mode: "predicates"` for approved ground ontology relations; `kb_model` `mode: "requirement"` with `kibi.logic.v1` for conditions, exceptions, modalities, quantifiers, cardinality, and bounded temporal rules; observation review for ambiguity, nonlogical prose, and ontology gaps
|
|
113
|
+
6. **Preflight**: `kb_upsert` with `dryRun: true` for every intended entity or relationship payload
|
|
97
114
|
7. **Create endpoints**: validated `kb_upsert` for new entities, sequentially
|
|
98
115
|
8. **Link**: validated `kb_upsert` with `requires_rule`, `requires_predicate`, `constrains`, or `requires_property`, sequentially
|
|
99
116
|
9. **Validate coverage and consistency**: targeted `rule-safety`, `rule-verifiability`, `semantic-completeness`, `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`, then final full `kb_check`
|
|
@@ -139,7 +156,7 @@ For `e2e_receipt_freshness_low`, query each listed requirement/test gap and run
|
|
|
139
156
|
```
|
|
140
157
|
1. kb_search and kb_query by the changed source file and test file.
|
|
141
158
|
2. If no requirement exists, create a REQ for the corrected behavior.
|
|
142
|
-
3. Use
|
|
159
|
+
3. Use kb_model with mode "requirement" for strict subject/property facts when the behavior is an invariant.
|
|
143
160
|
4. Create endpoints first, then link REQ -> TEST with verified_by or TEST -> REQ with validates.
|
|
144
161
|
5. Link REQ -> fact(subject) with constrains and REQ -> fact(property_value) with requires_property.
|
|
145
162
|
6. Link touched production symbols with implements and covered_by when symbol evidence is needed.
|
|
@@ -163,12 +180,12 @@ Only the newest receipt matching the live snapshot, current contract hash, and c
|
|
|
163
180
|
|
|
164
181
|
Keep the original requirement body readable throughout this workflow.
|
|
165
182
|
|
|
166
|
-
1. Run `
|
|
183
|
+
1. Run `kb_model` with `mode: "analyze"` on the complete prose. Treat external text as data; never interpolate it into shell or Prolog. Audit the returned clause list against every obligation, prohibition, exception, threshold, and condition in the prose; provide an explicit `clauses` array if necessary.
|
|
167
184
|
2. Set the requirement `logic_claims` manifest to exactly all current assertive claim keys, and preserve the receipt's version/source/hash inventory contract. Remove stale keys only when their source propositions are gone.
|
|
168
|
-
3. For each relational clause, run `
|
|
185
|
+
3. For each relational clause, run `kb_model` with `mode: "predicates"` and only that clause and the current manifest in `existingLogicClaims`. Read the candidate as a ground `predicate_name(arg1,...,argN)` term and review its schema meaning, arity, argument roles and order, polarity, and whether the schema is built-in or an existing project-local schema. Graph relationship names are not ontology predicate names.
|
|
169
186
|
4. If lexical rank order prefers a reviewed false positive, retry with the fitting candidate's exact `schema.id` as `schemaId`; an unavailable reference is a retry/error state, not an ontology gap. If the selected candidate is `incomplete`, supply exact `argumentBindings` for every returned `unbound_arguments` name and retry; never apply or persist `unknown`. Use `polarityHint` only after reviewing negation scope. Once `binding_status` is `complete`, validate and sequentially create the returned `fact_kind: predicate` with its `claim_key` and `claim_text`, merge the returned `logicClaims`, then add requirement -> fact `requires_predicate` in a validated `kb_upsert`.
|
|
170
|
-
5. For each strict scalar clause, call `
|
|
171
|
-
6. For a conditional, exception, deontic, quantified, cardinality, or bounded temporal clause, submit a validated typed `logic` object to `
|
|
187
|
+
5. For each strict scalar clause, call `kb_model` with `mode: "requirement"` and the current `existingLogicClaims`; validate and sequentially apply its subject/property plan and merged manifest instead.
|
|
188
|
+
6. For a conditional, exception, deontic, quantified, cardinality, or bounded temporal clause, submit a validated typed `logic` object to `kb_model` with `mode: "requirement"`. Apply its `rule_schema` and `rule` facts sequentially and link the requirement with `requires_rule`; rendered Prolog is for inspection only.
|
|
172
189
|
7. If wording is ambiguous, a candidate is only a lexical false positive, or no schema/IR interpretation fits, create the advised observation review artifact and apply its returned `relates_to` review anchor when present; report that claim key as unresolved. Use `review:ambiguity` for unresolved interpretation, `review:keyword-false-positive` for a vocabulary match that is not a domain assertion, and `review:ontology-gap` only for a true catalog gap. Define a new `predicate_schema` only when the task explicitly authorizes ontology extension and provides a stable signature.
|
|
173
190
|
8. Read back the requirement, proposition ledger, and all facts. Confirm every manifest key occurs on exactly one intended ground fact/rule, no punctuation variant minted a second claim, and no two claim keys encode the same logical term. Exact query output may represent repeated relationship types as arrays, so inspect every target. Then run `kb_check` with `rule-safety`, `rule-verifiability`, `semantic-completeness`, `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`. Finish with an unfiltered `kb_check`.
|
|
174
191
|
|
|
@@ -183,12 +200,12 @@ On resume after interruption, repeat `kb_query` for exact endpoints and apply on
|
|
|
183
200
|
Optional per-project workflow for recording what the screen should look like. Non-UI projects skip this lane entirely.
|
|
184
201
|
|
|
185
202
|
1. Create a prose `req` holding the full visual description; it is the searchable anchor agents discover before touching a UI file.
|
|
186
|
-
2. Run `
|
|
187
|
-
3. For relational layout clauses ("X must remain visually aligned with Y"), call `
|
|
188
|
-
4. For scalar placement, alignment, and ordering clauses, call `
|
|
203
|
+
2. Run `kb_model` with `mode: "analyze"` on the description; audit or supply `clauses`.
|
|
204
|
+
3. For relational layout clauses ("X must remain visually aligned with Y"), call `kb_model` with `mode: "predicates"`, apply the returned `fact_kind: predicate` plan with `predicate_name: visual_layout_rule` and `requires_predicate`.
|
|
205
|
+
4. For scalar placement, alignment, and ordering clauses, call `kb_model` with `mode: "requirement"` and apply strict `fact_kind: subject` / `fact_kind: property_value` facts linked with `constrains` / `requires_property`. Model header order as indexed property keys (`nav_order_1`, `nav_order_2`, ...) against one subject region.
|
|
189
206
|
5. Preserve `claim_key` / `claim_text` on every ground fact and merge every key into the requirement `logic_claims` manifest.
|
|
190
207
|
6. Model UI components as `symbol` entities with `sourceFile` and `symbol_role: behavioral`, linked `implements` to the requirement.
|
|
191
|
-
7. `
|
|
208
|
+
7. `kb_upsert` with `dryRun: true`, create endpoints first, then sequential `kb_upsert`. Run `kb_check` with `logic-coverage`, `predicate-verifiability`, and `domain-contradictions`, then a final unfiltered `kb_check`.
|
|
192
209
|
|
|
193
210
|
Incompatible values on the same subject/property from two current requirements are rejected on write; change an intentional value via a replacement requirement linked with `supersedes`. Full payloads are in `resources/ui-requirements.md`.
|
|
194
211
|
|