kibi-cursor 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/.cursor-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +49 -0
  3. package/README.md +16 -1
  4. package/agent-plugin/mcp.json +10 -0
  5. package/agent-plugin/plugin.json +11 -0
  6. package/agent-plugin/skills/init-kibi/SKILL.md +62 -0
  7. package/agent-plugin/skills/kibi-freshness/SKILL.md +44 -0
  8. package/agent-plugin/skills/kibi-traceability/SKILL.md +54 -0
  9. package/agent-plugin/skills/kibi-usage/SKILL.md +270 -0
  10. package/agent-plugin/skills/kibi-usage/resources/fact-lanes.md +235 -0
  11. package/agent-plugin/skills/kibi-usage/resources/logic-ir.md +43 -0
  12. package/agent-plugin/skills/kibi-usage/resources/operation-access.md +44 -0
  13. package/agent-plugin/skills/kibi-usage/resources/relationship-directions.md +119 -0
  14. package/agent-plugin/skills/kibi-usage/resources/ui-requirements.md +96 -0
  15. package/agent-plugin/skills/kibi-usage/resources/workflows.md +80 -0
  16. package/dist/.cursor-plugin/plugin.json +1 -1
  17. package/dist/messages.d.ts +2 -2
  18. package/dist/messages.js +2 -2
  19. package/dist/skills/.canon-hash.json +6 -4
  20. package/dist/skills/kibi-usage/SKILL.md +35 -9
  21. package/dist/skills/kibi-usage/resources/fact-lanes.md +11 -1
  22. package/dist/skills/kibi-usage/resources/logic-ir.md +43 -0
  23. package/dist/skills/kibi-usage/resources/operation-access.md +19 -19
  24. package/dist/skills/kibi-usage/resources/ui-requirements.md +96 -0
  25. package/dist/skills/kibi-usage/resources/workflows.md +21 -6
  26. package/package.json +3 -2
  27. package/skills/.canon-hash.json +6 -4
  28. package/skills/kibi-usage/SKILL.md +35 -9
  29. package/skills/kibi-usage/resources/fact-lanes.md +11 -1
  30. package/skills/kibi-usage/resources/logic-ir.md +43 -0
  31. package/skills/kibi-usage/resources/operation-access.md +19 -19
  32. package/skills/kibi-usage/resources/ui-requirements.md +96 -0
  33. package/skills/kibi-usage/resources/workflows.md +21 -6
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kibi-cursor",
3
3
  "displayName": "Kibi",
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "description": "Optional Cursor adapter for Kibi. Requires SWI-Prolog 9+ and project-local kibi-cli, kibi-mcp, and kibi-core before the bundled MCP server can start.",
6
6
  "license": "AGPL-3.0-or-later",
7
7
  "author": {
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # kibi-cursor
2
2
 
3
+ ## 0.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5e4e126: Agents no longer treat Kibi's CLI as an MCP fallback. MCP tools and the trusted project-local CLI are presented as peer surfaces over the same 18 operations, and agent guidance now selects whichever interface is visible and approved in the current environment. The CLI's `--input` JSON routes remain first-class for agent automation, with no preference order implied.
8
+
9
+ - Reframe `kibi-usage` Interface Selection and the operation-access preference column to peer surfaces.
10
+ - Update OpenCode prompt injection, enforcement, and init-kibi guidance.
11
+ - Update the MCP init-kibi prompt and the staged-impact evidence resolution text.
12
+ - Re-sync the Cursor and Codex skill bundles.
13
+
14
+ - Codex and Cursor users now receive the same verified prose-to-logic guidance as the Kibi CLI. The bundled `kibi-usage` skill explains proposition coverage, typed Logic IR safety, predicate recovery, and contradiction-aware validation without relying on repository-specific release conventions.
15
+
16
+ - Synchronize the Logic IR, fact-lane, workflow, and portable skill guidance into both agent bundles.
17
+ - Keep the bundled skill manifests and canonical hashes aligned with the CLI public skill.
18
+
19
+ - 5e4e126: Kibi now ships as a portable Agent Plugin alongside the existing Cursor Plugin. The open Agent Plugins standard (agent-plugins.org) packages Kibi's Agent Skills and MCP server so any compatible client — Cursor, Copilot, OpenCode, and others — loads Kibi's capabilities without client-specific adaptation. The Cursor Plugin keeps Cursor-only components (rules, commands, hooks), and both formats are listed in the same marketplace.
20
+
21
+ - Add a committed portable Agent Plugin artifact at `agent-plugin/` with a conformant `plugin.json` manifest (plugin.schema.json 1.0.0).
22
+ - Generate the artifact's `mcp.json` with the required `$schema` and `stdio` server type.
23
+ - List the Agent Plugin (`plugins/kibi-agent-plugin`) in the repo marketplace alongside `kibi-cursor`.
24
+ - Add `scripts/build-agent-plugin.ts` to regenerate the artifact and keep its skills in sync with the canonical bundle.
25
+
26
+ - 2a85fc8: Kibi can now track whether every atomic clause in a normative requirement has a queryable logical representation. Readable prose remains intact, while stable claim keys, linked strict-property or predicate facts, and a requirement manifest expose incomplete modeling before it silently weakens contradiction detection. Exact opposite polarities over the same ground predicate now produce a contradiction.
27
+
28
+ - Remove repository-specific release and optimizer-corpus text from `kibi-usage`.
29
+ - Add portable clause-complete prose-to-ground-predicate/property guidance and examples.
30
+ - Preserve logical claim and predicate-schema fields through Markdown sync.
31
+ - Add semantic-advisor clause inventories, merged claim manifests, and the `logic-coverage` check.
32
+ - Enable manifest validation by default and report every current unmanifested requirement as explicit backfill debt.
33
+ - Detect exact `assert`/`deny` conflicts over the same ground predicate.
34
+ - Normalize trailing clause punctuation so formatting variants share one claim identity.
35
+ - Enforce a one-claim/one-ground-fact mapping and reject duplicate logical terms masquerading as separate coverage.
36
+ - Preserve every target when exact query results contain repeated relationship types.
37
+ - Keep semantic-advisor readiness partial until every normative claim has a distinct logical grounding slot.
38
+ - Drain machine-readable CLI output before the explicit process exit so large results are complete without leaving runtime handles alive.
39
+ - Preserve and enforce claim-key patterns, uniqueness, and paired provenance through MCP schema registration.
40
+ - Synchronize the corrected skill into the Codex and Cursor bundles.
41
+
42
+ - 2f9073c: Kibi now ships optional guidance for recording UI and visual expectations, so agents working on a screen can discover "where things live" and cannot silently drift the layout. A prose requirement anchors the full visual description, checkable positions, alignment, and header ordering decompose into strict facts that reject conflicting writes, and relational alignment uses the built-in `visual_layout_rule` predicate. The lane is per-project: non-UI projects simply never model UI subjects, and no validation rule requires them.
43
+
44
+ Also, `kb_status` within a long-lived MCP session now observes same-session file and KB changes instead of returning a stale cached result. Compound Prolog goals (such as the status query) are no longer cached in one-shot mode, so a status check after a source or documentation edit reports the current freshness state.
45
+
46
+ - Add `docs/ui-requirements.md` with the three-layer UI modeling guide, payload-shaped examples, and the check workflow.
47
+ - Point the modeling cheatsheet decision tree, agent LLM rules, and the AGENTS quick references at the new UI lane.
48
+ - Add a self-contained `kibi-usage` skill resource (`resources/ui-requirements.md`), declare it in the skill manifest, and add a UI modeling workflow section.
49
+ - Synchronize the updated `kibi-usage` skill into the Codex and Cursor bundles.
50
+ - Keep compound Prolog goals out of the one-shot query cache so `kb_status` reports fresh state after same-session writes.
51
+
3
52
  ## 0.5.0
4
53
 
5
54
  ### Minor Changes
package/README.md CHANGED
@@ -31,7 +31,7 @@ Add this plugin only after the base packages work in your project.
31
31
 
32
32
  ### Cursor Marketplace (recommended)
33
33
 
34
- Submit or install from the Kibi repository marketplace at `.cursor-plugin/marketplace.json`, which points at `./plugins/kibi-cursor`.
34
+ Submit or install from the Kibi repository marketplace at `.cursor-plugin/marketplace.json`, which points at `./plugins/kibi-cursor` (Cursor Plugin) and `./plugins/kibi-agent-plugin` (portable Agent Plugin). Cursor detects the format from the plugin manifest, so both install from the same marketplace.
35
35
 
36
36
  For local testing before marketplace publication, copy a real directory tree into Cursor's user-plugins folder. Symlinks are rejected when the target lives outside `plugins/local` (common on WSL):
37
37
 
@@ -83,6 +83,21 @@ Manual MCP fallback (no plugin install required):
83
83
  }
84
84
  ```
85
85
 
86
+ ## Portable Agent Plugin (Agent Plugins standard)
87
+
88
+ `kibi-cursor` also ships a portable [Agent Plugins](https://agent-plugins.org) build at `agent-plugin/`. The Agent Plugins open standard (v1.0.0) packages Agent Skills and MCP servers for any compatible client — Cursor, Copilot, OpenCode, and others — so the same Kibi capabilities load without client-specific adaptation.
89
+
90
+ ```
91
+ agent-plugin/
92
+ ├── plugin.json # agent-plugins.org/schemas/1.0.0/plugin.schema.json
93
+ ├── skills/ # canonical Kibi Agent Skills (kibi-usage, init-kibi, ...)
94
+ └── mcp.json # agent-plugins.org/schemas/1.0.0/mcp.schema.json (stdio kibi-mcp)
95
+ ```
96
+
97
+ - Cursor loads the portable build directly; Cursor-only components (rules, commands, hooks) remain in the `.cursor-plugin` Cursor Plugin build.
98
+ - Both formats are listed in the same marketplace; pick the format your client needs.
99
+ - The portable build still requires the project-local `kibi-cli`, `kibi-mcp`, and `kibi-core` packages plus SWI-Prolog 9+ (see Prerequisites above).
100
+
86
101
  ## Features
87
102
 
88
103
  ### Discovery-first rules and skills
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
3
+ "mcpServers": {
4
+ "kibi": {
5
+ "type": "stdio",
6
+ "command": "npx",
7
+ "args": ["--no-install", "kibi-mcp"]
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
+ "name": "kibi",
4
+ "version": "0.5.1",
5
+ "description": "Repo-local, per-branch, queryable knowledge base. Portable Agent Plugin packaging Kibi's Agent Skills and MCP server.",
6
+ "author": { "name": "Kibi" },
7
+ "homepage": "https://github.com/Looted/kibi/blob/develop/docs/install.md",
8
+ "repository": "https://github.com/Looted/kibi.git",
9
+ "license": "AGPL-3.0-or-later",
10
+ "keywords": ["kibi", "mcp", "knowledge-base", "traceability", "swi-prolog"]
11
+ }
@@ -0,0 +1,62 @@
1
+ ---
2
+ id: init-kibi
3
+ name: init-kibi
4
+ description: Bootstrap and model knowledge safely using approved Kibi MCP initialization and mutation workflow.
5
+ version: 1.0.0
6
+ kibiCompatibility: "*"
7
+ tags:
8
+ - kibi
9
+ - mcp
10
+ - bootstrap
11
+ - agent-guidance
12
+ ---
13
+ ## Goal
14
+
15
+ Set up or refresh Kibi knowledge for the current branch through approved Kibi interfaces only. Maintain source-file traceability for every repository-backed claim, and require explicit operator approval before any mutation.
16
+
17
+ ## Interface Selection
18
+
19
+ 1. If approved Kibi MCP tools are visible, use the MCP route.
20
+ 2. Otherwise, in a trusted workspace, use the canonical project-local CLI fallback: `npx --no-install kibi ...` or `bunx --no-install kibi ...`.
21
+ 3. If neither approved MCP tools nor the project-local CLI are available, stop and tell the operator to enable or install Kibi for this workspace.
22
+ 4. Never use a global fallback, an installing runner, or any route outside the approved Kibi interface.
23
+
24
+ Use `kibi-usage/resources/operation-access.md` for the exact operation-to-route mapping. The CLI preview route accepts the same JSON object as `kb_autopilot_generate`:
25
+
26
+ ```bash
27
+ echo '{"maxCandidates":25,"minConfidence":0.8}' | npx --no-install kibi autopilot-generate --input -
28
+ ```
29
+
30
+ ## Capability Workflow
31
+
32
+ - Generate a read-only bootstrap preview with `kb_autopilot_generate`, or the dedicated CLI route `autopilot-generate --input`.
33
+ - Show the generated preview and obtain explicit approval before writes.
34
+ - Apply reviewed entity creation or updates with `kb_upsert`, or `upsert --input`.
35
+ - If cleanup is needed, use `kb_delete`, or `delete --input`, only after checking dependencies and obtaining approval for the specific removal.
36
+ - Finish with `kb_check`, or `check --input`, to validate the branch snapshot.
37
+
38
+ ## Guidance
39
+
40
+ - Keep mutation requests explicit, small, and sequential.
41
+ - Prefer source-linked entities so future `kb_query` lookups can verify repository context against source files.
42
+ - Preserve traceability by linking facts, claims, scenarios, and tests to concrete project files whenever repository evidence supports it.
43
+ - Do not read or edit files inside `.kb` directly; all changes go through the selected Kibi interface.
44
+ - Ask at most four bounded context questions, and only when repository evidence is insufficient.
45
+ - Stop at the documented operator repair boundary if the setup appears partial, inconsistent, or unsupported by the approved interface.
46
+
47
+ ## Public Training Trajectories
48
+
49
+ - `init-kibi-bootstrap-analysis-train-1`: Analyze the cold-start repository and produce a read-only bootstrap preview using only the public Kibi MCP surface.
50
+ - `init-kibi-bootstrap-analysis-train-2`: Analyze the cold-start repository and produce a read-only bootstrap preview using only the public Kibi MCP surface.
51
+ - `init-kibi-bounded-context-questions-train-1`: Ask only the bounded context questions needed before bootstrap synthesis using only the public Kibi MCP surface.
52
+ - `init-kibi-bounded-context-questions-train-2`: Ask only the bounded context questions needed before bootstrap synthesis using only the public Kibi MCP surface.
53
+ - `init-kibi-approval-sequential-writes-train-1`: Apply the approved bootstrap plan sequentially and finish with validation using only the public Kibi MCP surface.
54
+ - `init-kibi-approval-sequential-writes-train-2`: Apply the approved bootstrap plan sequentially and finish with validation using only the public Kibi MCP surface.
55
+ - `init-kibi-repair-escalation-train-1`: Identify the partial setup and stop at the documented operator repair boundary using only the public Kibi MCP surface.
56
+ - `init-kibi-repair-escalation-train-2`: Identify the partial setup and stop at the documented operator repair boundary using only the public Kibi MCP surface.
57
+
58
+ ## Training Data
59
+
60
+ ```json
61
+ [{"taskId":"init-kibi-bootstrap-analysis-train-1","family":"bootstrap-analysis","reflection":"Analyze the cold-start repository and produce a read-only bootstrap preview. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-bootstrap-analysis-train-2","family":"bootstrap-analysis","reflection":"Analyze the cold-start repository and produce a read-only bootstrap preview. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"init-kibi-bounded-context-questions-train-1","family":"bounded-context-questions","reflection":"Ask only the bounded context questions needed before bootstrap synthesis. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-bounded-context-questions-train-2","family":"bounded-context-questions","reflection":"Ask only the bounded context questions needed before bootstrap synthesis. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"init-kibi-approval-sequential-writes-train-1","family":"approval-sequential-writes","reflection":"Apply the approved bootstrap plan sequentially and finish with validation. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-approval-sequential-writes-train-2","family":"approval-sequential-writes","reflection":"Apply the approved bootstrap plan sequentially and finish with validation. This is train case 2; use only the public Kibi MCP surface."},{"taskId":"init-kibi-repair-escalation-train-1","family":"repair-escalation","reflection":"Identify the partial setup and stop at the documented operator repair boundary. This is train case 1; use only the public Kibi MCP surface."},{"taskId":"init-kibi-repair-escalation-train-2","family":"repair-escalation","reflection":"Identify the partial setup and stop at the documented operator repair boundary. This is train case 2; use only the public Kibi MCP surface."}]
62
+ ```
@@ -0,0 +1,44 @@
1
+ ---
2
+ id: kibi-freshness
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: "*"
7
+ tags:
8
+ - kibi
9
+ - mcp
10
+ - freshness
11
+ - agent-guidance
12
+ ---
13
+ ## Goal
14
+
15
+ Help agents decide whether Kibi knowledge is current enough to support safe changes while preserving source-file traceability and approved interface boundaries.
16
+
17
+ ## Interface Selection
18
+
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
+
24
+ Use `kibi-usage/resources/operation-access.md` for exact dedicated routes. A project-local CLI freshness check is executable as:
25
+
26
+ ```bash
27
+ echo '{}' | npx --no-install kibi status --input -
28
+ ```
29
+
30
+ ## Capability Workflow
31
+
32
+ - 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.
33
+ - Use `kb_query`, or `query --input`, with `sourceFile` and text references for source-linked discovery.
34
+ - Re-run `kb_search`, or `search --input`, after sync gaps or stale context are detected.
35
+ - If knowledge must change, use the selected interface's `kb_upsert`/`upsert` or `kb_delete`/`delete` operation sequentially, then finish with `kb_check`/`check`.
36
+
37
+ ## Guidance
38
+
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.
41
+ - If entities look stale, refresh context through an approved Kibi capability and then re-query.
42
+ - Preserve source-file traceability by carrying `sourceFile`, text references, and validation evidence through discovery, mutation, and completion.
43
+ - 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.
@@ -0,0 +1,54 @@
1
+ ---
2
+ id: kibi-traceability
3
+ name: kibi-traceability
4
+ description: Maintain requirement, scenario, and test traceability through Kibi MCP tools.
5
+ version: 1.0.0
6
+ kibiCompatibility: "*"
7
+ tags:
8
+ - kibi
9
+ - mcp
10
+ - traceability
11
+ - agent-guidance
12
+ ---
13
+ ## Goal
14
+
15
+ Validate and strengthen requirement, scenario, test, behavioral-symbol, and source-file traceability before and after code changes.
16
+
17
+ ## Interface Selection
18
+
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
+ - Use `kb_delete` or `delete --input` only for explicit cleanup of obsolete records or relationships.
38
+
39
+ ## Guidance
40
+
41
+ - Prefer source-linked relationships so requirements, scenarios, tests, symbols, and files can be traced cleanly.
42
+ - Preserve source-file traceability whenever adding or changing requirements, scenarios, tests, facts, behavioral symbols, or implementation links.
43
+ - Preserve the canonical chain `REQ-* -> SCEN-* -> TEST-*` when adding or changing requirements.
44
+ - Production symbols should implement requirements; test symbols should remain executable evidence for tests.
45
+ - 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.
46
+ - Treat `symbol_semantic_review_needed` as a prompt to inspect linked requirements and tests; Kibi reports graph links but does not prove prose semantics.
47
+ - Do not read or edit files inside `.kb` directly; all modeling and cleanup goes through the selected Kibi interface.
48
+ - 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.
49
+
50
+ Public training trajectories:
51
+ [{"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."}]
52
+
53
+ Previous development gate:
54
+ {"mean":0,"hardPasses":0,"worstFamilyMean":0}
@@ -0,0 +1,270 @@
1
+ ---
2
+ id: kibi-usage
3
+ name: Kibi Usage
4
+ description: Guides agents to use Kibi MCP, facts, relationships, and validation correctly
5
+ version: 1.3.0
6
+ kibiCompatibility: ">=0.11.0"
7
+ tags:
8
+ - kibi
9
+ - mcp
10
+ - knowledge-base
11
+ - traceability
12
+ - agent-guidance
13
+ resources:
14
+ - resources/relationship-directions.md
15
+ - resources/fact-lanes.md
16
+ - resources/workflows.md
17
+ - resources/operation-access.md
18
+ - resources/ui-requirements.md
19
+ - resources/logic-ir.md
20
+ ---
21
+ # Kibi Usage
22
+
23
+ Consult this skill before any Kibi knowledge base operation, on first interaction with a Kibi-enabled repo, after stale or dirty KB status is suspected, and before mutations.
24
+
25
+ ## Interface Selection
26
+
27
+ Kibi exposes two peer surfaces over the same 18 operations: visible MCP tools and the trusted project-local CLI. Both accept the same business input and effects (see `resources/operation-access.md`). Choose by what is visible and approved in the current environment — MCP and the CLI are equal choices, not a preference order:
28
+
29
+ 1. If Kibi MCP tools are visible and approved in the current environment, use MCP.
30
+ 2. Otherwise, in a trusted workspace, use the project-local CLI through a non-installing runner: `npx --no-install kibi ...` or `bunx --no-install kibi ...`. The CLI is a peer interface, not a fallback.
31
+ 3. If the project-local CLI is unavailable or too old for the needed route, stop and tell the operator to enable or install Kibi.
32
+ 4. Never use a global fallback or an installing runner. Never probe or install packages as a side effect of interface selection.
33
+
34
+ Use exact MCP tool names, dedicated CLI routes, input modes, effects, and Prolog requirements from `resources/operation-access.md`. Do not invent a generic operation runner. Do not read or edit files inside `.kb/` directly.
35
+
36
+ CLI JSON mode accepts MCP-shaped business input at `--input <file|->`.
37
+
38
+ ```bash
39
+ echo '{"type":"req","id":"REQ-001","properties":{"title":"Test","status":"open"}}' | npx --no-install kibi upsert --input -
40
+ ```
41
+
42
+ ```bash
43
+ echo '{"query":"authentication","limit":10}' | bunx --no-install kibi search --input -
44
+ ```
45
+
46
+ ## MCP Tool Names
47
+
48
+ Kibi canonical MCP names include `kb_search`, `kb_query`, `kb_upsert`, `kb_check`, `kb_status`, `kb_validate_upsert`, and related `kb_*` tools. OpenCode may expose prefixed identifiers such as `kibi_kb_search`, `kibi_kb_query`, and `kibi_kb_upsert`. Use the visible Kibi MCP tool identifiers and map them back to canonical operations before reasoning about behavior.
49
+
50
+ ## Discovery First
51
+
52
+ Always discover before you mutate. Start exploratory work with `kb_search` across metadata and markdown body text. Split broad queries into one to three focused probes and review top hits before concluding knowledge is absent.
53
+
54
+ Use `kb_query` for exact lookups by `id`, `type`, `tags`, or `sourceFile`. Use `kb_status` when branch attachment, freshness, or stale context could affect the decision. Mutate only after discovery confirms the target state.
55
+
56
+ ## Approval Boundaries
57
+
58
+ Do not perform Kibi mutations unless the current task calls for knowledge-base changes or the user explicitly asks for them. Discovery and validation are acceptable when needed to understand impact, freshness, traceability, or existing requirements.
59
+
60
+ Kibi guidance does not define a repository's package manager, branch names, release scripts, or publishing workflow. Follow the repository's own instructions for those concerns. Never use Kibi interface selection to install packages, change dependency manifests, or bypass sandbox and approval boundaries.
61
+
62
+ ## Relationship Directions
63
+
64
+ Relationship direction is fixed and semantic. Reversed links break traceability queries and validation.
65
+
66
+ | Relationship | Direction | Meaning |
67
+ |-------------|-----------|---------|
68
+ | `implements` | symbol -> req | Symbol owns or implements requirement behavior |
69
+ | `specified_by` | req -> scenario | Requirement is specified by a scenario |
70
+ | `verified_by` | req/scenario -> test | Requirement or scenario is verified by a test |
71
+ | `validates` | test -> req/scenario | Test validates a requirement or scenario |
72
+ | `executable_for` | symbol -> test | Symbol is executable test code for a test entity |
73
+ | `constrains` | req -> fact(subject) | Requirement constrains a domain fact |
74
+ | `requires_property` | req -> fact(property_value) | Requirement requires a property value |
75
+ | `requires_predicate` | req -> fact(predicate) | Requirement requires a ground ontology predicate |
76
+ | `supersedes` | old-req -> new-req | Old requirement is replaced by new requirement |
77
+ | `covered_by` | symbol -> test | Production symbol has coverage evidence from a test |
78
+
79
+ Before/after for reversed direction:
80
+
81
+ - Wrong: `relationships: [{ type: "implements", from: "REQ-001", to: "SYM-001" }]`
82
+ - Right: `relationships: [{ type: "implements", from: "SYM-001", to: "REQ-001" }]`
83
+
84
+ ## Symbol-First Traceability
85
+
86
+ Preserve source-file traceability whenever creating or updating requirements, facts, scenarios, tests, or symbols. Prefer durable `sourceFile` references and symbol coordinates that point to tracked repository files. For code ownership, create or update a `symbol` entity and add an `implements` relationship from the symbol to the requirement; link symbols to tests with `covered_by` when coverage evidence is needed.
87
+
88
+ Do not use legacy `// implements REQ-xxx` comments as the primary marker for new or modified code. Use comments only as a temporary compatibility fallback when symbol metadata cannot be updated in the same task.
89
+
90
+ Preferred traceability model:
91
+
92
+ ```yaml
93
+ symbol:
94
+ id: SYM-admin-billing-policy
95
+ title: Admin billing policy check
96
+ status: active
97
+ sourceFile: src/admin/billing.ts
98
+ relationships:
99
+ - type: implements
100
+ from: SYM-admin-billing-policy
101
+ to: REQ-ADMIN-BILLING-POLICY
102
+ ```
103
+
104
+ ## Typed Logic IR Lane
105
+
106
+ Readable prose is retained for people, while every assertive proposition is inventoried and either grounded in a strict fact, a predicate fact, or a safe typed rule. Use the required extraction pass followed by an adversarial coverage audit; do not let a high-confidence single suggestion stand in for the rest of a compound requirement. Load `resources/logic-ir.md` for the IR grammar, proposition ledger, safety boundary, and proof semantics.
107
+
108
+ Use `kb_semantic_advisor` with up to three typed `interpretations` for ambiguous clauses. Kibi canonicalizes alternatives and keeps materially different meanings unresolved. Create `fact_kind: rule_schema` and `fact_kind: rule` endpoints from `kb_model_requirement`'s validated plan, then link `req -> rule` with `requires_rule`. Run `rule-safety`, `rule-verifiability`, `semantic-completeness`, `logic-coverage`, and `domain-contradictions`; unresolved, incomplete, or timed-out reasoning is not evidence of consistency.
109
+
110
+ The portable skill body must carry the core contract even when its detailed resources are unavailable: `kb_semantic_advisor` returns a `propositions[]` ledger and `semantic_inventory`; submit typed `interpretations` when wording has more than one plausible logical reading; validate modeled conditions through `kibi.logic.v1`; and preserve unresolved propositions as explicit gaps. Do not read or edit files inside `.kb` directly.
111
+
112
+ ## Strict Fact Lane
113
+
114
+ Normative requirements that must participate in contradiction blocking use the strict fact lane. Create a `fact_kind: subject` fact and link it from the requirement via `constrains`. Create a `fact_kind: property_value` fact and link it via `requires_property`.
115
+
116
+ ```yaml
117
+ id: FACT-USER-ROLE
118
+ fact_kind: subject
119
+ subject_key: user.role_assignment
120
+ ```
121
+
122
+ ```yaml
123
+ id: REQ-019
124
+ relationships:
125
+ - type: constrains
126
+ from: REQ-019
127
+ to: FACT-USER-ROLE
128
+ - type: requires_property
129
+ from: REQ-019
130
+ to: FACT-LIMIT-3
131
+ ```
132
+
133
+ Model one semantic claim per strict `property_value` fact. Reusing the same `subject_key` and `property_key` lets `domain-contradictions` compare requirements mechanically. If a new requirement intentionally changes a value, create a replacement requirement and link the old requirement to the new one with `supersedes` instead of leaving two current contradictory requirements.
134
+
135
+ Use `kb_model_requirement` for automated strict-fact modeling when available. It generates subject and property_value facts, links them with `constrains` and `requires_property`, and handles low-confidence downgrades to observation facts automatically.
136
+
137
+ Granular fact examples for coherence checks include `REQ-ROLE-SET-2` versus `REQ-ROLE-SET-3` on `user.roles.allowed_set` (`user,admin` versus `user,admin,superadmin`) and `REQ-ADMIN-CAN-MANAGE-BILLING` versus `REQ-ONLY-SUPERADMIN-MANAGES-BILLING` on `billing.manage.allowed_actor`. See `resources/fact-lanes.md`; `domain-contradictions` uses these canonical keys.
138
+
139
+ ## UI / Visual Requirement Modeling
140
+
141
+ Optional, per-project lane for recording what the screen should look like so UI edits cannot silently drift from the spec. Non-UI projects skip it; no check rule requires it.
142
+
143
+ Use three layers: a prose `req` as the searchable anchor, strict `property_value` facts for checkable positions/alignment/order (linked `constrains` / `requires_property`, so incompatible values on the same subject/property are rejected on write unless `supersedes`), and relational predicates linked with `requires_predicate` (built-in `visual_layout_rule(subject, relation, target)` for "X must remain visually aligned with Y"). Model UI components as `symbol` entities with `sourceFile` and `symbol_role: behavioral`, linked `implements` to the requirement, so component edits surface the visual spec in impact diagnostics. Full payloads and workflow: `resources/ui-requirements.md`.
144
+
145
+ ## Complete Logical Coverage
146
+
147
+ Readable prose is not evidence that a requirement is machine-checkable. Before treating a normative requirement as modeled, decompose its entire body into atomic normative clauses and ground every clause. One correct fact or relationship never proves that the other prose is covered.
148
+
149
+ 1. Call `kb_semantic_advisor` with the complete requirement prose. When the automatic split is incomplete or a sentence contains multiple obligations, pass an explicit `clauses` array containing every atomic normative clause.
150
+ 2. Use the stable `claim_key` returned for each clause. Every ground `property_value` or `predicate` fact must preserve that key in `claim_key` and preserve the clause in `claim_text`. Use the advisor-returned inventory exactly; do not add punctuation or wording variants of an existing clause.
151
+ 3. Put the complete set of keys in the requirement's `logic_claims` manifest. Merge returned keys with existing values; never overwrite earlier claims while modeling a later clause.
152
+ 4. Ground each key through exactly one suitable logical lane: `requires_property` to one strict `property_value` fact, `requires_predicate` to one ground `predicate` fact, or `requires_rule` to one safe `rule` fact. A subject fact supports a strict claim but does not ground a key by itself. Observation, meta, ambiguity, and ontology-gap facts explicitly remain unresolved and do not count as logical coverage.
153
+ 5. Run `kb_check` with `logic-coverage`, `rule-safety`, `rule-verifiability`, `semantic-completeness`, `predicate-verifiability`, and `domain-contradictions`. `logic-coverage` enforces a one-claim/one-ground-fact mapping and rejects distinct claim keys that encode the same logical term; human or agent review still confirms that the atomic clauses exhaust the prose and that each ground term preserves its meaning.
154
+
155
+ Kibi emits a non-blocking logical-coverage debt diagnostic for every current requirement without a manifest, independent of title wording. The `logic-coverage` rule is enabled by default for requirements that do declare manifests, so an unfiltered final check catches missing or orphaned ground claims while legacy requirements remain explicit backfill work.
156
+
157
+ A complete `logic_claims` manifest alone is not a complete model. Semantic-advisor readiness remains partial until the payload has at least one distinct `requires_property`, `requires_predicate`, or `requires_rule` grounding slot per assertive claim. This count prevents one token edge from suppressing the remaining plans; only `logic-coverage` readback proves that each slot reaches the fact with the matching claim key.
158
+
159
+ Never invent, reuse across different clauses, or manually alter a claim key. Kibi derives it from `claim_text` and rejects mismatched mutation and Markdown inputs.
160
+
161
+ For a compound requirement, the manifest and linked facts form a clause-completeness contract:
162
+
163
+ ```yaml
164
+ requirement:
165
+ id: REQ-CHECKOUT-RETENTION
166
+ logic_claims: [CLAIM-A1B2C3D4E5F60718, CLAIM-18273645AABBCCDD]
167
+ facts:
168
+ - fact_kind: predicate
169
+ claim_key: CLAIM-A1B2C3D4E5F60718
170
+ claim_text: Checkout requires payment authorization before submission.
171
+ - fact_kind: property_value
172
+ claim_key: CLAIM-18273645AABBCCDD
173
+ claim_text: Customer data must be retained for 7 years.
174
+ ```
175
+
176
+ The example keys are illustrative; use only keys returned for the exact clause text.
177
+
178
+ ## Predicate Ontology Decision Tree
179
+
180
+ Preserve the readable requirement prose. Facts add a machine-queryable model; they do not replace prose, and stored predicate facts are data queried by Kibi's Prolog layer rather than executable Prolog supplied by the agent.
181
+
182
+ 1. Call `kb_semantic_advisor` on the complete prose, verify its atomic clause inventory, and choose one lane per clause.
183
+ 2. For each relational clause, call `kb_suggest_predicates` with that clause and the current `existingLogicClaims`. Read each candidate as a Prolog-shaped ground term `predicate_name(arg1,...,argN)`: the schema fixes the predicate name, arity, argument roles, and argument order.
184
+ 3. Accept a candidate only when its meaning and every ordered argument fit the prose. Use the returned `applyPlan`, including its exact `predicate_name`, `predicate_args`, `canonical_key`, and `polarity`; never invent a predicate name, reorder arguments, add variables, or write a raw Prolog clause.
185
+ 4. Create or confirm the requirement and `fact_kind: predicate` endpoints, preserve `claim_key` and `claim_text`, merge the returned `logicClaims` into the requirement, then link requirement -> predicate fact with `requires_predicate`. Treat the requirement's logical representation as the conjunction of every linked ground term. Encode a prohibition with `polarity: deny` on the fitting positive schema, not a made-up negative predicate. An `assert` and `deny` requirement over the same namespace, name, and ordered arguments are a blocking `domain-contradictions` conflict, so requirements must reuse the same canonical schema and argument vocabulary for equivalent domain claims.
186
+ 5. Use an existing built-in or project-local `fact_kind: predicate_schema`. Create a new schema only when the task explicitly authorizes ontology extension and supplies a stable name, arity, `argument_names`, and `argument_types`; otherwise record `fact_kind: observation` with `review:ontology-gap`.
187
+ 6. For each scalar, threshold, duration, boolean, enum-set, or cardinality clause, use `kb_model_requirement` with the current `existingLogicClaims` and the strict subject/property lane instead. For ambiguity or a lexical false positive, preserve the prose as a review observation, apply its returned `relates_to` review anchor when present, and report the requirement as logically incomplete. Use `review:ambiguity` for unresolved scope or interpretation and `review:keyword-false-positive` when a vocabulary match is not a domain assertion.
188
+ 7. Validate every payload, create endpoints first, apply `kb_upsert` calls sequentially, read back all affected IDs, and run targeted `rule-safety`, `rule-verifiability`, `semantic-completeness`, `logic-coverage`, `predicate-verifiability`, and `domain-contradictions` checks before the final unfiltered `kb_check`. Exact query output can return an array when one relationship type has multiple targets; verify every target rather than reading only one edge.
189
+
190
+ ### Schema-aware proposition boundary
191
+
192
+ A declared project-local predicate schema can encode one complete relation whose ordered arguments name several facets of the same claim. Do not split those arguments into separate propositions, invent one predicate per noun, or pass an explicit `clauses` array merely to enumerate the schema arguments. First ask `kb_semantic_advisor` about the complete sentence; add clauses only for independently asserted propositions that are not represented by the selected relation. For a schema-backed relation, preserve the one claim key for the complete relation, create the supporting `predicate_schema` with its minimal declared signature (supporting schemas do not carry `claim_key` or `logic_claims`), call `kb_suggest_predicates` on the complete claim, and apply its exact plan to create one ground predicate fact with the ordered schema arguments and that claim key. If `kb_model_requirement` returns an apply plan, execute that plan sequentially; do not fall back to observation facts when an explicitly declared schema fits. If a schema write is rejected, use `kb_validate_upsert` to reduce it to the supported signature, then retry once before considering an ontology gap.
193
+
194
+ ### Hard lane gates for unresolved prose and supplied schemas
195
+
196
+ The advisor's proposition `status` is a safety gate, not a confidence hint. A `nonlogical` proposition (including `subjective`, rationale, example, heading, or commentary) never receives a `logic_claims` entry and never goes through `kb_suggest_predicates` or `kb_model_requirement`; preserve the complete prose as one `fact_kind: observation` only when an auditable record is useful. Do not manufacture atomic clauses from a subjective sentence merely because it contains `when`, a domain noun, or the word `predicate`. An `ambiguous` proposition remains an ambiguity observation until the operator supplies a typed interpretation. An `ontology_gap` remains unresolved unless an approved schema or validated IR is actually available.
197
+
198
+ When authorized task input contains `projectLocalSchemas`, those declarations are the schema authority even if the first advisor or predicate lookup calls them an ontology gap. Do not treat an empty candidate list as final: create the minimal declared `predicate_schema` endpoint first, then call `kb_suggest_predicates` again on the one complete claim (with the current `existingLogicClaims`) and apply the resulting ground predicate plan. Preserve the single claim key for that relation; do not add keys for schema arguments. If the lookup still cannot return a plan after the declared schema exists, validate the exact schema-backed predicate payload once and report the remaining blocker rather than inventing a different predicate. For prohibition cues (`must not`, `never`, `cannot`, `forbidden`), use the positive schema with `polarity: deny`; never silently change it to `assert` or encode the negation in a new predicate name.
199
+
200
+ Example: “Checkout requires payment authorization before order submission” fits `dependency_rule(subject, prerequisite, dependent)`. The ground model is `dependency_rule(checkout,payment_authorization,order_submission)`, stored as:
201
+
202
+ ```yaml
203
+ fact_kind: predicate
204
+ predicate_name: dependency_rule
205
+ predicate_args: [checkout, payment_authorization, order_submission]
206
+ canonical_key: dependency_rule(checkout,payment_authorization,order_submission)
207
+ polarity: assert
208
+ claim_key: <claim key returned by kb_semantic_advisor>
209
+ claim_text: Checkout requires payment authorization before order submission.
210
+ ```
211
+
212
+ Link the requirement to that predicate fact with `requires_predicate`. Do not use `verified_by`, `requires_predicate`, or another relationship type as the `predicate_name`; graph relationships and ontology predicates are different layers.
213
+
214
+ Detailed built-in, project-local, deny, strict-scalar, ambiguous, false-positive, and ontology-gap examples are immutable reference material in `resources/fact-lanes.md` and `resources/workflows.md`.
215
+
216
+ ## Fact vs Flag
217
+
218
+ Use `flag` for runtime or config gates only, such as feature flags, kill-switches, and deferred capabilities.
219
+
220
+ Bugs, incidents, and workarounds belong in `fact` entities with `fact_kind: observation` or `meta`. These fact kinds are excluded from contradiction inference, making them appropriate for non-blocking evidence. Do not create a `flag` named like a bug to track a defect.
221
+
222
+ ## Create Before Link
223
+
224
+ Always confirm or create endpoint entities before linking them. Query target IDs with `kb_query` first. If an endpoint does not exist, create it with `kb_upsert` before creating the relationship. Relationships to missing entities produce dangling references that `kb_check` will flag.
225
+
226
+ For `kb_upsert`, keep relationship rows anchored to the entity being upserted: each row's `from` must equal the upserted entity ID. If you need a `SYM -> REQ` link, upsert the symbol endpoint first, then link that symbol to the requirement.
227
+
228
+ Keep symbol payloads minimal: include only fields needed to identify the symbol, status, and source traceability. Put extra prose, examples, or audit notes in documentation or evidence artifacts instead of custom `kb_upsert.properties`; strict `kb_upsert.properties` rejects unknown fields.
229
+
230
+ When a generic `Query failed` appears, do not keep retrying the same payload. First call `kb_validate_upsert`, query or create missing endpoints, reduce the payload to required fields, and retry once. If it still fails, report the blocker.
231
+
232
+ ## Small Behavior Fix Impact Evidence
233
+
234
+ For a behavior-changing source edit, first query for an existing requirement. If no requirement exists, create one for the corrected behavior. Model strict facts from that requirement when the invariant is contradiction-sensitive.
235
+
236
+ Do not link facts directly to tests. Facts describe invariants; requirements or scenarios are verified by executable tests. Use `REQ -> TEST` with `verified_by` or `TEST -> REQ` with `validates`, then link the requirement to facts with `constrains` and `requires_property`. Link touched production symbols to requirements with `implements` and to tests with `covered_by` when coverage evidence is needed.
237
+
238
+ Kibi operation writes do not automatically stage markdown evidence. When a staged hook requires impact evidence, ensure tracked documentation artifacts for requirements, facts, tests, symbol metadata, or coordinate refreshes are authored and staged alongside source changes.
239
+
240
+ ## Sequential Upserts
241
+
242
+ Never fire `kb_upsert` calls in parallel. Execute them sequentially to avoid lock contention and ensure deterministic ordering, especially when creating chains of related entities.
243
+
244
+ ## Checks
245
+
246
+ Run `kb_check` with specific rules during iteration for fast feedback. For normative requirement modeling, include `rules: ["rule-safety", "rule-verifiability", "semantic-completeness", "logic-coverage", "predicate-verifiability", "domain-contradictions"]`; add `required-fields` and `no-dangling-refs` after writes. Run a full `kb_check` without rule filters before declaring Kibi work complete.
247
+
248
+ The `domain-contradictions` rule detects conflicts between strict-lane facts linked to requirements. When a contradiction is found, the supported escape hatch is `supersedes`: create a new requirement that supersedes the old one, then link the new requirement to updated facts.
249
+
250
+ ## Stale or Dirty KB Handling
251
+
252
+ Call `kb_status` when branch KB context may be stale or after switching context. Report freshness findings to the user rather than relying on outdated KB context. If `kb_status` indicates a schema migration is needed, ask the user or operator to handle it outside the agent session.
253
+
254
+ ## Anti-Patterns and Remediation
255
+
256
+ | Anti-Pattern | Problem | Remediation |
257
+ |-------------|---------|-------------|
258
+ | Reversed relationship direction | Traceability queries break | Verify direction against the relationship table above |
259
+ | Legacy implements comments | Comments are not durable queryable symbols | Create or update a `symbol` entity and link it to the requirement |
260
+ | Bug-as-flag | `flag` misused for defect tracking | Use `fact` with `fact_kind: observation` or `meta` |
261
+ | Parallel upserts | Lock contention and nondeterminism | Execute `kb_upsert` calls sequentially |
262
+ | Embedded scenarios in reqs | Violates canonical traceability chain | Create separate `req`, `scen`, and `test` entities |
263
+ | Missing `kb_check` | Undetected dangling refs and violations | Run targeted checks during work, full check at completion |
264
+ | Tags as multi-ID lookup | Tags are metadata, not identifiers | Use `kb_query` with explicit `id` values |
265
+ | `relates_to` for strict modeling | Loses contradiction safety | Use `constrains` and `requires_property` instead |
266
+ | One fact for a compound requirement | Leaves untracked prose outside contradiction checks | Decompose all atomic clauses, preserve claim keys, and validate `logic_claims` with `logic-coverage` |
267
+ | Replacing `logic_claims` on each call | Discards previously grounded clauses | Pass existing keys and merge the returned manifest |
268
+ | Observation counted as coverage | Ambiguity or ontology gaps appear machine-checkable | Keep the claim unresolved until a strict or predicate ground fact exists |
269
+ | Relationship type used as predicate name | Confuses graph edges with ontology terms | Select a declared predicate schema and keep `requires_predicate` as the req -> fact edge |
270
+ | `status: implemented` on requirements | Not a valid lifecycle status | Use a valid status such as `closed`, add an `implemented` tag, and link evidence instead |