kibi-runtime 2.14.0 → 2.14.2

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.
@@ -2,7 +2,7 @@
2
2
  id: kibi-usage
3
3
  name: Kibi Usage
4
4
  description: Use Kibi's source-first, exact-Git, migration-aware, proof-aware operations safely across MCP or the trusted local CLI, including partial completion repair.
5
- version: 2.15.0
5
+ version: 2.15.3
6
6
  kibiCompatibility: ">=1.0.0"
7
7
  tags:
8
8
  - kibi
@@ -82,6 +82,41 @@ different workspace than the one you asked for; its `detail.reason` says why.
82
82
  Use the CLI from your working directory instead: `npx --no-install kibi ...`
83
83
  runs where you are and needs no `workspaceRoot`.
84
84
 
85
+ ## Reading a hook snippet
86
+
87
+ On hosts where Kibi hooks are installed, a short block
88
+ arrives before you read or edit a file whose symbols are linked to
89
+ requirements. It is projected from `.kb/symbols.yaml`, not from the store, so
90
+ it is a pointer to the knowledge, never proof. Each line answers one question:
91
+
92
+ - `Kibi knowledge for <path> (symbol manifest):` and the `- REQ-… — <symbol
93
+ titles>` rows: the requirements the file's symbols implement, lead
94
+ requirement first. Read the lead requirement with `kb_query({id})` before
95
+ changing behavior.
96
+ - `REQ-… must keep true: FACT-…` (edit only): the ground facts the lead
97
+ requirement requires. An edit that breaks one of them is a requirement
98
+ change: supersede and remodel the requirement, do not code around the fact.
99
+ - `Decision: ADR-…` (edit only): the decision behind the lead requirement.
100
+ - `Covered by: TEST-…` and `Test code for: …`: the tests that prove the
101
+ file's symbols; run or update them with the edit.
102
+ - `The edit is inside <symbol>, which implements REQ-…`: the symbol the edit
103
+ lands in.
104
+ - `Next layer: …`: the exact `kb_query` and `kb_search(... sourceLocations)`
105
+ calls that return the full detail.
106
+ - The `kb_check({sourceFiles:[…], includeImpactDiagnostics:true,
107
+ includeWorkingTreeDiff:true})` line (edit only): run it after the edit. The
108
+ Stop hook reminds you once per session of files edited without it.
109
+
110
+ A file already shown this session gets only the one-line `Kibi: this edit to
111
+ <path> is inside <symbol>` update; the facts and tests from its first snippet
112
+ still apply. `Kibi: no symbol in <path> is linked to a requirement yet` means
113
+ the file is unowned: find the governing requirement with `kb_search` and
114
+ `sourceLocations`, then link a symbol to it with `implements` through
115
+ `kb_upsert`. Without a readable manifest (`Kibi: the hook could not read
116
+ .kb/symbols.yaml`) snippets are off for this session; `kb_query({sourceFile})`
117
+ still answers and `kibi sync` regenerates the manifest. The search tip and the
118
+ `.kb/` note appear once per session and need no action.
119
+
85
120
  ## Safe workflow
86
121
 
87
122
  1. Always discover before you mutate: start with `kb_search`, then exact-filter with `kb_query`. Use
@@ -334,6 +369,8 @@ For each relational clause, call `kb_model` with `mode: "predicates"`, that clau
334
369
  reviewed `schemaId`. If `binding_status` is `incomplete`, supply
335
370
  `argumentBindings` and retry. Persist `fact_kind: predicate` with the same
336
371
  `claim_key` / `claim_text`, then link `REQ -> fact` with `requires_predicate`.
372
+ `claim_key` is derived from `claim_text`, so a ground fact may send the exact
373
+ clause alone and Kibi fills the key in; a sent key must equal the derived one.
337
374
  Use `kb_model` with `mode: "requirement"` for strict scalar clauses. Use
338
375
  `fact_kind: observation` only for a true ontology gap. The manifest is not
339
376
  grounding: run `logic-coverage` so each key binds to one ground fact.
@@ -6,7 +6,7 @@ Requirement prose remains the human-readable source. Facts add queryable semanti
6
6
 
7
7
  Logical coverage is clause-based, not entity-based. Give `kb_model` (`mode: "analyze"`) the complete requirement body and verify that its `clauses` list contains every atomic obligation. Supply the `clauses` input yourself when automatic splitting would combine or omit obligations. For every normative clause:
8
8
 
9
- - preserve the returned stable key as `claim_key` and the exact clause as `claim_text` on its ground fact;
9
+ - put the exact clause as `claim_text` on its ground fact, with the returned stable key as `claim_key` or none (Kibi derives a missing key; a sent key must match);
10
10
  - add the key to the exact current `logic_claims` set, removing only stale keys whose propositions no longer exist in the source;
11
11
  - link it through exactly one `requires_property` for `property_value`, one `requires_predicate` for `predicate`, or one `requires_rule` for a safe `rule` fact;
12
12
  - leave ambiguity and ontology gaps visibly unresolved—observations do not satisfy `logic-coverage`.
@@ -68,14 +68,16 @@ id: FACT-SUSPENDED-PUBLISH-DENIED
68
68
  status: active
69
69
  fact_kind: predicate
70
70
  predicate_name: permission_rule
71
- predicate_args: [suspended_user, publish, articles, deny]
71
+ predicate_args: [suspended_user, publish, article, deny]
72
72
  polarity: deny
73
- canonical_key: permission_rule(suspended_user,publish,articles,deny)
73
+ canonical_key: permission_rule(suspended_user,publish,article,deny)
74
74
  claim_key: <advisor-issued key for this exact clause>
75
75
  claim_text: Suspended users must not publish articles.
76
76
  relationship: { type: requires_predicate, from: REQ-SUSPENDED-PUBLISH-DENIED, to: FACT-SUSPENDED-PUBLISH-DENIED }
77
77
  ```
78
78
 
79
+ Inferred bindings drop the article and singularise the resource (`articles` becomes `article`, `any analysis request` and `analysis requests` both become `analysis_request`), so an allow and a deny on the same actor, action and resource share one key. Grants read the same as `allowed`: `may`, `can`, `is allowed to`, `are permitted to`, `must be able to`, `are able to`, `have permission to` and `are entitled to` all select `permission_rule` with `polarity: assert`.
80
+
79
81
  If another current requirement links an `assert` fact with the same predicate namespace, name, and ordered arguments, `domain-contradictions` reports the pair. More complex semantic conflicts require a shared canonical schema and arguments; do not assume Kibi can prove arbitrary equivalence between differently shaped predicates.
80
82
 
81
83
  The full logical representation of a requirement is the conjunction of all of its linked ground property and predicate terms. Conditions, exceptions, permissions, and ordering constraints remain explicit arguments of their declared schemas. Contradiction detection therefore depends on equivalent prose reusing the same predicate name, argument roles, ordered canonical values, and opposing polarity rather than inventing synonymous terms.
@@ -126,8 +126,8 @@ diagnostics (`symbol_semantic_review_needed`).
126
126
  `requires_predicate`.
127
127
  3. Scalar placement/alignment/order clauses: `kb_model` (`mode: "requirement"`), apply the strict
128
128
  subject/property plan and `constrains` / `requires_property`.
129
- 4. Preserve `claim_key` / `claim_text`; merge every key into the requirement
130
- `logic_claims` manifest.
129
+ 4. Preserve `claim_key` / `claim_text` (a missing key is derived from the
130
+ text); merge every key into the requirement `logic_claims` manifest.
131
131
  5. `kb_upsert` with `dryRun: true`, create endpoints first, then sequential `kb_upsert`.
132
132
  6. `kb_check` with `logic-coverage`, `predicate-verifiability`, `domain-contradictions`,
133
133
  then a final unfiltered `kb_check`.
@@ -203,7 +203,7 @@ Optional per-project workflow for recording what the screen should look like. No
203
203
  2. Run `kb_model` with `mode: "analyze"` on the description; audit or supply `clauses`.
204
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
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.
206
- 5. Preserve `claim_key` / `claim_text` on every ground fact and merge every key into the requirement `logic_claims` manifest.
206
+ 5. Preserve `claim_key` / `claim_text` on every ground fact (a missing `claim_key` is derived from `claim_text`) and merge every key into the requirement `logic_claims` manifest.
207
207
  6. Model UI components as `symbol` entities with `sourceFile` and `symbol_role: behavioral`, linked `implements` to the requirement.
208
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`.
209
209
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kibi-runtime",
3
- "version": "2.14.0",
3
+ "version": "2.14.2",
4
4
  "description": "Narrow first-party runtime contracts and adapters for Kibi operations.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "gray-matter": "^4.0.3",
21
- "kibi-core": "^0.20.0",
22
- "kibi-plugin-builtin": "^0.5.0",
21
+ "kibi-core": "^0.21.0",
22
+ "kibi-plugin-builtin": "^0.5.1",
23
23
  "kibi-swipl": "^1.0.1"
24
24
  },
25
25
  "devDependencies": {