@agent-wiki/mcp 0.22.3 → 0.22.6
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/README.md +31 -0
- package/dist/cli.js +177 -0
- package/dist/cli.js.map +1 -1
- package/dist/evidence-migration.js +1 -1
- package/dist/evidence-migration.js.map +1 -1
- package/dist/evidence-report.d.ts +70 -1
- package/dist/evidence-report.d.ts.map +1 -1
- package/dist/evidence-report.js +228 -5
- package/dist/evidence-report.js.map +1 -1
- package/dist/evidence-report.test.js +176 -0
- package/dist/evidence-report.test.js.map +1 -1
- package/dist/evidence-search.d.ts +71 -0
- package/dist/evidence-search.d.ts.map +1 -1
- package/dist/evidence-search.js +104 -1
- package/dist/evidence-search.js.map +1 -1
- package/dist/evidence-search.test.js +58 -1
- package/dist/evidence-search.test.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/okf-compat.d.ts +152 -0
- package/dist/okf-compat.d.ts.map +1 -0
- package/dist/okf-compat.js +604 -0
- package/dist/okf-compat.js.map +1 -0
- package/dist/okf-compat.test.d.ts +2 -0
- package/dist/okf-compat.test.d.ts.map +1 -0
- package/dist/okf-compat.test.js +234 -0
- package/dist/okf-compat.test.js.map +1 -0
- package/dist/okf-export.d.ts +63 -0
- package/dist/okf-export.d.ts.map +1 -0
- package/dist/okf-export.js +655 -0
- package/dist/okf-export.js.map +1 -0
- package/dist/okf-export.test.d.ts +2 -0
- package/dist/okf-export.test.d.ts.map +1 -0
- package/dist/okf-export.test.js +469 -0
- package/dist/okf-export.test.js.map +1 -0
- package/dist/okf-import.d.ts +136 -0
- package/dist/okf-import.d.ts.map +1 -0
- package/dist/okf-import.js +471 -0
- package/dist/okf-import.js.map +1 -0
- package/dist/okf-import.test.d.ts +2 -0
- package/dist/okf-import.test.d.ts.map +1 -0
- package/dist/okf-import.test.js +339 -0
- package/dist/okf-import.test.js.map +1 -0
- package/dist/okf-trust.test.d.ts +2 -0
- package/dist/okf-trust.test.d.ts.map +1 -0
- package/dist/okf-trust.test.js +223 -0
- package/dist/okf-trust.test.js.map +1 -0
- package/dist/okf.d.ts +128 -0
- package/dist/okf.d.ts.map +1 -0
- package/dist/okf.js +659 -0
- package/dist/okf.js.map +1 -0
- package/dist/search-currency.d.ts +44 -0
- package/dist/search-currency.d.ts.map +1 -0
- package/dist/search-currency.js +111 -0
- package/dist/search-currency.js.map +1 -0
- package/dist/search.d.ts +19 -0
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js.map +1 -1
- package/dist/server.d.ts +0 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +753 -49
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +848 -0
- package/dist/server.test.js.map +1 -1
- package/dist/wiki-graph.d.ts +126 -0
- package/dist/wiki-graph.d.ts.map +1 -0
- package/dist/wiki-graph.js +479 -0
- package/dist/wiki-graph.js.map +1 -0
- package/dist/wiki-graph.test.d.ts +2 -0
- package/dist/wiki-graph.test.d.ts.map +1 -0
- package/dist/wiki-graph.test.js +216 -0
- package/dist/wiki-graph.test.js.map +1 -0
- package/dist/wiki.d.ts +140 -1
- package/dist/wiki.d.ts.map +1 -1
- package/dist/wiki.js +509 -23
- package/dist/wiki.js.map +1 -1
- package/dist/worklist.d.ts +43 -0
- package/dist/worklist.d.ts.map +1 -0
- package/dist/worklist.js +147 -0
- package/dist/worklist.js.map +1 -0
- package/dist/worklist.test.d.ts +2 -0
- package/dist/worklist.test.d.ts.map +1 -0
- package/dist/worklist.test.js +233 -0
- package/dist/worklist.test.js.map +1 -0
- package/docs/evidence-envelope.md +26 -1
- package/docs/okf-adoption-plan.md +566 -0
- package/docs/okf-compat-plan.md +418 -0
- package/docs/okf-extensions.md +245 -0
- package/docs/open-knowledge-format.md +280 -0
- package/docs/tools.md +264 -2
- package/package.json +1 -1
- package/schemas/agent-wiki-okf.schema.json +130 -0
- package/skills/agent-wiki/SKILL.md +7 -0
- package/skills/agent-wiki/references/tools-reference.md +80 -3
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
# Open Knowledge Format
|
|
2
|
+
|
|
3
|
+
> **Note (December 2026):** this document describes agent-wiki's own package
|
|
4
|
+
> format, now called the **agent-wiki package profile**. It is not the Open
|
|
5
|
+
> Knowledge Format specification published by Google Cloud and maintained at
|
|
6
|
+
> [open-knowledge-format/open-knowledge-format](https://github.com/open-knowledge-format/open-knowledge-format).
|
|
7
|
+
> For how agent-wiki relates to that specification, see
|
|
8
|
+
> [`okf-compat-plan.md`](okf-compat-plan.md).
|
|
9
|
+
|
|
10
|
+
This document defines the Open Knowledge Format direction for `agent-wiki`.
|
|
11
|
+
|
|
12
|
+
The name intentionally borrows from the Open Knowledge Foundation's open knowledge principles, not from a Google product. Google Data Commons and recent LLM-Wiki research are important adjacent references, but `agent-wiki` should define its own Git-native package format for agent-maintained knowledge.
|
|
13
|
+
|
|
14
|
+
For the current-state audit, feasibility assessment, and phased implementation
|
|
15
|
+
plan, see [`okf-adoption-plan.md`](okf-adoption-plan.md).
|
|
16
|
+
|
|
17
|
+
## Position
|
|
18
|
+
|
|
19
|
+
`agent-wiki` should become:
|
|
20
|
+
|
|
21
|
+
> an open, machine-readable, Git-native knowledge package format for AI agents
|
|
22
|
+
|
|
23
|
+
This means a knowledge base is not only a set of Markdown notes. It is a portable package with immutable source evidence, compiled wiki pages, schemas, provenance, indexes, and lintable policies.
|
|
24
|
+
|
|
25
|
+
## Why This Matters
|
|
26
|
+
|
|
27
|
+
Most retrieval systems expose knowledge as query-time chunks. That is useful, but it leaves core lifecycle questions unresolved:
|
|
28
|
+
|
|
29
|
+
- What source material produced this claim?
|
|
30
|
+
- Can another agent import and inspect the knowledge base without vendor lock-in?
|
|
31
|
+
- Which pages are grounded, synthesized, stale, or unsupported?
|
|
32
|
+
- Which source documents are still uncompiled?
|
|
33
|
+
- Can the knowledge base be diffed, reviewed, reverted, and audited?
|
|
34
|
+
|
|
35
|
+
The Open Knowledge Format answers these questions through files that can live in any Git repository.
|
|
36
|
+
|
|
37
|
+
## Relationship To OKF
|
|
38
|
+
|
|
39
|
+
OKF here means Open Knowledge Foundation and the broader open knowledge tradition.
|
|
40
|
+
|
|
41
|
+
The Open Definition states that knowledge is open when people are free to access, use, modify, and share it, subject at most to measures that preserve provenance and openness. It also requires machine readability and open formats.
|
|
42
|
+
|
|
43
|
+
For `agent-wiki`, that translates into product requirements:
|
|
44
|
+
|
|
45
|
+
- the package should use plain, inspectable files
|
|
46
|
+
- the package should declare license and source policy
|
|
47
|
+
- source evidence should preserve provenance
|
|
48
|
+
- compiled knowledge should be editable and reviewable
|
|
49
|
+
- format rules should be documented and lintable
|
|
50
|
+
- no hosted service should be required to read or move the package
|
|
51
|
+
|
|
52
|
+
## Relationship To Google Data Commons
|
|
53
|
+
|
|
54
|
+
Google Data Commons is an open knowledge graph for public datasets. It standardizes public data through schemas and APIs so different Data Commons instances can interoperate and be queried as a larger graph.
|
|
55
|
+
|
|
56
|
+
`agent-wiki` is different:
|
|
57
|
+
|
|
58
|
+
- Data Commons is primarily a structured public data graph.
|
|
59
|
+
- `agent-wiki` is a repository-native knowledge compiler for agents.
|
|
60
|
+
- Data Commons normalizes datasets into common schemas and APIs.
|
|
61
|
+
- `agent-wiki` preserves raw evidence, compiles mutable wiki pages, and records provenance for agent use.
|
|
62
|
+
|
|
63
|
+
The useful lesson is interoperability: a knowledge package should be portable, schema-aware, and queryable without assuming one central host.
|
|
64
|
+
|
|
65
|
+
## Relationship To LLM-Wiki
|
|
66
|
+
|
|
67
|
+
LLM-Wiki research argues that agent retrieval should work more like reasoning: search, read, traverse links, and correct structural errors over time. That aligns strongly with `agent-wiki`.
|
|
68
|
+
|
|
69
|
+
The difference is implementation emphasis:
|
|
70
|
+
|
|
71
|
+
- LLM-Wiki is a retrieval architecture pattern.
|
|
72
|
+
- `agent-wiki` should be a concrete package format and toolchain.
|
|
73
|
+
- LLM-Wiki focuses on agent-native retrieval behavior.
|
|
74
|
+
- `agent-wiki` adds Git-native provenance, source immutability, lint, evidence envelopes, and package-level governance.
|
|
75
|
+
|
|
76
|
+
## Package Layout
|
|
77
|
+
|
|
78
|
+
A conforming Open Knowledge Format package should use this shape:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
agent-wiki-package/
|
|
82
|
+
agent-wiki.yaml
|
|
83
|
+
raw/
|
|
84
|
+
wiki/
|
|
85
|
+
schemas/
|
|
86
|
+
indexes/
|
|
87
|
+
evidence/
|
|
88
|
+
logs/
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### `agent-wiki.yaml`
|
|
92
|
+
|
|
93
|
+
Package manifest.
|
|
94
|
+
|
|
95
|
+
Minimum fields:
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
name: payroll-modernization-knowledge
|
|
99
|
+
version: 0.1.0
|
|
100
|
+
license: MIT
|
|
101
|
+
format: agent-wiki-okf
|
|
102
|
+
format_version: 0.1
|
|
103
|
+
owner: platform-team
|
|
104
|
+
created_at: 2026-06-20
|
|
105
|
+
source_policy:
|
|
106
|
+
raw_immutable: true
|
|
107
|
+
require_sha256: true
|
|
108
|
+
wiki_policy:
|
|
109
|
+
require_sources_for_grounded_pages: true
|
|
110
|
+
allow_synthesis_pages: true
|
|
111
|
+
evidence_policy:
|
|
112
|
+
allow_unsupported_pages: warn
|
|
113
|
+
require_abstain_signal: true
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The manifest is the package contract. OKF v0.1 manifests are validated by
|
|
117
|
+
`wiki_admin action: "format-check"` against
|
|
118
|
+
`schemas/agent-wiki-okf.schema.json` and deterministic validation rules. The
|
|
119
|
+
same check now includes a package inventory and conformance findings; use
|
|
120
|
+
`wiki_admin action: "rebuild"` with `okf_report: true` to persist that report at
|
|
121
|
+
`evidence/okf-report.json`.
|
|
122
|
+
|
|
123
|
+
### `raw/`
|
|
124
|
+
|
|
125
|
+
Immutable source evidence.
|
|
126
|
+
|
|
127
|
+
Rules:
|
|
128
|
+
|
|
129
|
+
- raw files are write-once
|
|
130
|
+
- each raw file should have a stable hash
|
|
131
|
+
- re-ingesting a same-name source creates a new version rather than mutating the old one
|
|
132
|
+
- raw files should be cited by compiled wiki pages through frontmatter `sources`
|
|
133
|
+
|
|
134
|
+
### `wiki/`
|
|
135
|
+
|
|
136
|
+
Mutable compiled knowledge.
|
|
137
|
+
|
|
138
|
+
Rules:
|
|
139
|
+
|
|
140
|
+
- pages are Markdown
|
|
141
|
+
- pages use `[[wikilinks]]` for graph edges
|
|
142
|
+
- pages should include frontmatter describing type, sources, synthesis status, freshness, and confidence where applicable
|
|
143
|
+
- pages may be rewritten as understanding improves
|
|
144
|
+
|
|
145
|
+
Example:
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
---
|
|
149
|
+
type: system-component
|
|
150
|
+
sources:
|
|
151
|
+
- raw/PAYROLL.cbl
|
|
152
|
+
evidence:
|
|
153
|
+
confidence: strong
|
|
154
|
+
basis: deterministic
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
# PAYROLL
|
|
158
|
+
|
|
159
|
+
Compiled operational knowledge about the PAYROLL program.
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### `schemas/`
|
|
163
|
+
|
|
164
|
+
Reusable page and entity templates.
|
|
165
|
+
|
|
166
|
+
Schemas should define expected frontmatter, required sections, and entity-specific fields. They are not only documentation; they should become validation inputs.
|
|
167
|
+
|
|
168
|
+
### `indexes/`
|
|
169
|
+
|
|
170
|
+
Derived search and graph artifacts.
|
|
171
|
+
|
|
172
|
+
Examples:
|
|
173
|
+
|
|
174
|
+
- BM25 index metadata
|
|
175
|
+
- vector index metadata when hybrid search is enabled
|
|
176
|
+
- link graph snapshots
|
|
177
|
+
- directory-level topic indexes
|
|
178
|
+
|
|
179
|
+
Indexes are rebuildable. They should not be treated as primary evidence.
|
|
180
|
+
|
|
181
|
+
### `evidence/`
|
|
182
|
+
|
|
183
|
+
Provenance, claim lineage, and confidence artifacts.
|
|
184
|
+
|
|
185
|
+
This layer complements page-level frontmatter and tool responses. It should support questions like:
|
|
186
|
+
|
|
187
|
+
- Which raw sources support this page?
|
|
188
|
+
- Which claims are synthesized from multiple sources?
|
|
189
|
+
- Which pages are unsupported?
|
|
190
|
+
- Which retrieval answers should abstain?
|
|
191
|
+
|
|
192
|
+
### `logs/`
|
|
193
|
+
|
|
194
|
+
Operational telemetry for improvement loops.
|
|
195
|
+
|
|
196
|
+
Examples:
|
|
197
|
+
|
|
198
|
+
- unsupported write logs
|
|
199
|
+
- search abstain logs
|
|
200
|
+
- coverage reports
|
|
201
|
+
- lint reports
|
|
202
|
+
- future agent edit proposals
|
|
203
|
+
|
|
204
|
+
Logs are evidence for maintaining the knowledge package, not the package's source of truth.
|
|
205
|
+
|
|
206
|
+
## Page Classes
|
|
207
|
+
|
|
208
|
+
The format should distinguish at least these page classes:
|
|
209
|
+
|
|
210
|
+
| Class | Meaning | Required evidence |
|
|
211
|
+
|-------|---------|-------------------|
|
|
212
|
+
| grounded | directly supported by raw sources | `sources` required |
|
|
213
|
+
| synthesis | combines multiple grounded pages or sources | `synthesis: true` and rationale |
|
|
214
|
+
| index | navigational or generated overview | generation metadata |
|
|
215
|
+
| unsupported | agent-authored without sources | flagged and discouraged |
|
|
216
|
+
| stale | source-backed but likely outdated | freshness metadata |
|
|
217
|
+
|
|
218
|
+
This classification is central to agent behavior. Agents should treat unsupported and stale pages differently from grounded pages.
|
|
219
|
+
|
|
220
|
+
## Interoperability Principles
|
|
221
|
+
|
|
222
|
+
A conforming package should be:
|
|
223
|
+
|
|
224
|
+
- **file-native**: readable without a database
|
|
225
|
+
- **Git-native**: diffable, reviewable, revertable
|
|
226
|
+
- **machine-readable**: manifests and frontmatter parse cleanly
|
|
227
|
+
- **open-format**: no proprietary container required
|
|
228
|
+
- **portable**: can move across MCP clients and agent runtimes
|
|
229
|
+
- **provenance-preserving**: source evidence survives export/import
|
|
230
|
+
- **lintable**: structural and evidence rules are checkable
|
|
231
|
+
|
|
232
|
+
## Non-Goals
|
|
233
|
+
|
|
234
|
+
This format is not:
|
|
235
|
+
|
|
236
|
+
- a replacement for RDF, Wikidata, or Data Commons
|
|
237
|
+
- a hosted knowledge graph service
|
|
238
|
+
- a vector database format
|
|
239
|
+
- a claim that all knowledge must be open-licensed
|
|
240
|
+
- a model training dataset format
|
|
241
|
+
|
|
242
|
+
It is a package format for agent-maintained operational knowledge.
|
|
243
|
+
|
|
244
|
+
## Initial Compliance Checklist
|
|
245
|
+
|
|
246
|
+
A repository is OKF-aligned when:
|
|
247
|
+
|
|
248
|
+
- it has an `agent-wiki.yaml` manifest
|
|
249
|
+
- raw sources are immutable and hashable
|
|
250
|
+
- wiki pages use Markdown with parseable frontmatter
|
|
251
|
+
- grounded pages cite raw sources
|
|
252
|
+
- synthesis pages are marked as synthesis
|
|
253
|
+
- generated indexes are rebuildable
|
|
254
|
+
- lint reports broken links, unsupported pages, stale pages, and raw coverage
|
|
255
|
+
- the package can be copied to another machine and read without hosted services
|
|
256
|
+
|
|
257
|
+
## Roadmap
|
|
258
|
+
|
|
259
|
+
Near-term:
|
|
260
|
+
|
|
261
|
+
1. Define `agent-wiki.yaml` schema. Done for OKF v0.1.
|
|
262
|
+
2. Add `wiki_admin action: "format-check"`. Done for OKF v0.1.
|
|
263
|
+
3. Emit package metadata during `wiki_admin rebuild`. Done as
|
|
264
|
+
`evidence/okf-report.json` with `okf_report: true`.
|
|
265
|
+
4. Add export/import tests for raw, wiki, schemas, indexes, and evidence.
|
|
266
|
+
|
|
267
|
+
Later:
|
|
268
|
+
|
|
269
|
+
1. Define a stable `format_version`.
|
|
270
|
+
2. Add compatibility guarantees.
|
|
271
|
+
3. Add a package conformance test suite.
|
|
272
|
+
4. Publish example OKF packages.
|
|
273
|
+
|
|
274
|
+
## References
|
|
275
|
+
|
|
276
|
+
- Open Definition 2.1: https://opendefinition.org/od/2.1/en/
|
|
277
|
+
- Open Knowledge Foundation: https://okfn.org/en/
|
|
278
|
+
- Data Commons paper: https://arxiv.org/abs/2309.13054
|
|
279
|
+
- Google Agent2Agent Protocol announcement: https://developers.googleblog.com/en/a2a-a-new-era-of-agent-interoperability/
|
|
280
|
+
- LLM-Wiki paper: https://arxiv.org/abs/2605.25480
|
package/docs/tools.md
CHANGED
|
@@ -20,8 +20,25 @@ agent-wiki exposes 15 public tools through the Model Context Protocol.
|
|
|
20
20
|
| `wiki_write` | Create or update a page (auto-timestamps, auto-classify, auto-route to nested dirs, auto-link). Triggers index rebuild. Pass `return_content: true` to get the final page content back — eliminates a follow-up `wiki_read`. Response includes `autoLinked` count. |
|
|
21
21
|
| `wiki_delete` | Delete a page (guards system pages). Triggers index rebuild — stale indexes and empty dirs are cleaned up. |
|
|
22
22
|
| `wiki_list` | List pages, filter by entity type or tag |
|
|
23
|
+
| `wiki_graph` | Query the `[[wikilink]]` graph between pages. Select `query_type`: `backlinks`, `neighbors`, `orphans`, `broken_links`, or `shortest_path`. Read-only; built from the pages on every call. See [`wiki_graph` query types](#wiki_graph-query-types). |
|
|
23
24
|
| `wiki_search` | Full-text search with BM25 scoring, synonym expansion, fuzzy matching, and CJK support. Use `type` or `tags` to filter without a separate `wiki_list` call. Optional hybrid BM25+vector mode: enable `search.hybrid: true` in `.agent-wiki.yaml`, then run `wiki_admin` with `action: "rebuild"` to embed all pages. Returns `knowledge_gap` when no results found — includes suggested page slug, title, type, and tags for `wiki_write`. |
|
|
24
|
-
| `wiki_admin` | Unified wiki maintenance tool. Select `action`: `init`, `config`, `rebuild`, `lint`,
|
|
25
|
+
| `wiki_admin` | Unified wiki maintenance tool. Select `action`: `init`, `config`, `format-check`, `rebuild`, `lint`, `evidence-report`, `reconcile`, `import`, `export`, `verify`, or `worklist`. `format-check` validates the agent-wiki package manifest (`agent-wiki.yaml`), package inventory, and conformance findings; `rebuild` regenerates indexes/timeline and search vectors, and can persist `wiki/evidence-report.md` or `evidence/okf-report.json`; `lint` runs health checks and optional auto-fixes; `evidence-report` aggregates evidence-first telemetry into a corpus-level Markdown summary (see [Evidence-first surface](#evidence-first-surface) below). |
|
|
26
|
+
|
|
27
|
+
### `wiki_graph` query types
|
|
28
|
+
|
|
29
|
+
| Query Type | Arguments | Returns |
|
|
30
|
+
|------------|-----------|---------|
|
|
31
|
+
| `backlinks` | `page`, `limit?` | Pages that link to `page`, each with the link as written and the line it sits on. |
|
|
32
|
+
| `neighbors` | `page`, `depth?` (default 1, max 3), `include_system?`, `limit?` | Pages within `depth` hops, following links both ways, with hop count, direction and the page they were reached through. |
|
|
33
|
+
| `orphans` | `limit?` | Pages no other page links to. System pages are not reported, but a link from one counts (the same rule `wiki_admin` `lint` uses). |
|
|
34
|
+
| `broken_links` | `limit?` | `[[links]]` whose target is no page, plus bare links whose name several pages share (`ambiguous_links`, with the candidates). |
|
|
35
|
+
| `shortest_path` | `from`, `to`, `max_depth?` (default 6, max 10), `directed?`, `include_system?` | The shortest chain of links between two pages, with the link behind every step. |
|
|
36
|
+
|
|
37
|
+
`page`, `from` and `to` take a path or a slug: `concept-gil`, `concept-gil.md`, `topic/foo`, or a bare name when only one page has it.
|
|
38
|
+
|
|
39
|
+
`neighbors` and `shortest_path` leave system pages (`index.md`, `log.md`, `timeline.md`, `*/index.md`) out of the walk unless `include_system: true`: the generated index links to every page, so with it every pair of pages is two hops apart.
|
|
40
|
+
|
|
41
|
+
Link resolution follows `graph-viewer`: an exact path first, then a unique basename. Each page pair counts once and self-links are dropped.
|
|
25
42
|
|
|
26
43
|
## Code Analysis — Language Plugins
|
|
27
44
|
|
|
@@ -89,6 +106,41 @@ These tools were consolidated into other tools and are no longer part of the def
|
|
|
89
106
|
| `code_trace_variable` / `code_impact` | `code_query` with `query_type` |
|
|
90
107
|
| `knowledge_ingest_batch` / `knowledge_digest_write` | `knowledge_ingest` with `mode` |
|
|
91
108
|
|
|
109
|
+
## Package Profile Checks
|
|
110
|
+
|
|
111
|
+
`wiki_admin` with `action: "format-check"` validates the agent-wiki package
|
|
112
|
+
profile. It checks `agent-wiki.yaml` at the package root, validates the
|
|
113
|
+
manifest against profile v0.1 rules, inventories raw/wiki/schema/index/evidence
|
|
114
|
+
surfaces, and emits conformance findings.
|
|
115
|
+
|
|
116
|
+
This is agent-wiki's own format (earlier called "OKF v0.1"; file and argument
|
|
117
|
+
names still carry `okf`). It does not check conformance with the upstream Open
|
|
118
|
+
Knowledge Format; see [`okf-compat-plan.md`](okf-compat-plan.md).
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
agent-wiki call wiki_admin '{"action":"format-check"}'
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The response is a structured report with `ok`, `issues`, `manifestPath`,
|
|
125
|
+
`packageRoot`, `checked`, `inventory`, and `conformance` fields. Missing or
|
|
126
|
+
invalid manifests return `ok: false` with actionable issues; workspaces without
|
|
127
|
+
a manifest still run normally.
|
|
128
|
+
|
|
129
|
+
To persist the same package inventory/conformance report as a portable artifact:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
agent-wiki call wiki_admin '{"action":"rebuild","okf_report":true}'
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
This writes `evidence/okf-report.json`. The report includes raw integrity and
|
|
136
|
+
coverage counts, wiki page classes, schema files, generated system pages,
|
|
137
|
+
optional cache presence, evidence report presence, and local telemetry-log
|
|
138
|
+
presence.
|
|
139
|
+
|
|
140
|
+
`agent-wiki.yaml` is the portable package manifest. `.agent-wiki.yaml` remains
|
|
141
|
+
runtime/operator config for workspace paths, security settings, search tuning,
|
|
142
|
+
and local plugin options.
|
|
143
|
+
|
|
92
144
|
## Directory Structure & Auto-Generated Indexes
|
|
93
145
|
|
|
94
146
|
Pages can be organized into nested directories. `wiki_admin` with `action: "rebuild"` (and every `wiki_write`/`wiki_delete`) automatically generates `index.md` at each directory level.
|
|
@@ -185,6 +237,22 @@ derived_from: [concept-yolo.md, concept-ssd.md, concept-rcnn.md]
|
|
|
185
237
|
| **Exact phrase boost** | Full query phrase in title (+8), slug (+6), or body (+3) |
|
|
186
238
|
| **Postings union** | Only scores documents containing at least one query term — skips the rest of the corpus |
|
|
187
239
|
|
|
240
|
+
### Ranking by currency
|
|
241
|
+
|
|
242
|
+
Relevance ranking does not know that one of two matching pages was retired, or that the report it summarises has been replaced. After scoring, `wiki_search` therefore applies what is known about each page:
|
|
243
|
+
|
|
244
|
+
| What is known about the page | Effect on its score |
|
|
245
|
+
|------------------------------|---------------------|
|
|
246
|
+
| `status: deprecated` | × 0.5 |
|
|
247
|
+
| `stale_after` has passed or cannot be read | × 0.8 |
|
|
248
|
+
| a cited raw source has changed, is gone or has a newer version | × 0.85 |
|
|
249
|
+
|
|
250
|
+
A result that was lowered carries `demoted` with the reasons, and `relevance` with the score the match itself earned. A clearly better match still wins; a comparable one does not.
|
|
251
|
+
|
|
252
|
+
Then, between two results that are as good as tied (scores within 3%), the one whose content changed last comes first, and is marked `promoted`.
|
|
253
|
+
|
|
254
|
+
This is not an age decay. A page is not ranked lower for being old: an old page whose source has not changed is better evidence than a recent one whose source has. Only stated facts move a result, and age only decides a tie.
|
|
255
|
+
|
|
188
256
|
### Hybrid BM25+Vector Search
|
|
189
257
|
|
|
190
258
|
Hybrid mode re-ranks BM25 candidates using dense vector similarity, improving recall for semantic queries ("how does auth work?" rather than exact keywords).
|
|
@@ -240,7 +308,11 @@ Every retrieval / query / read tool returns an `evidence: EvidenceEnvelope` fiel
|
|
|
240
308
|
| `code_query field_lineage` | `strong` when ANY family produces a deterministic-tier match (copybook deterministic, CALL boundary deterministic, or DB2 entry). `weak` when only inferred matches exist across copybook high-confidence / CALL boundary high / semantic-inferred families. `absent` + `abstain` when only ambiguous matches or no match across all families. Mapped from COBOL lineage tiers via `cobolTierToEvidence`. |
|
|
241
309
|
| `code_query impact` | `strong` + `deterministic` only when every reachable edge is deterministic and every node resolved; otherwise `weak` + `inferred` reflecting the weakest link in the path. |
|
|
242
310
|
| `code_query dataflow_edges` | `strong` for non-empty edge lists; `absent` + `abstain` when the filter matches nothing. |
|
|
243
|
-
| `
|
|
311
|
+
| `wiki_graph` | A direct `[[link]]` (backlinks, 1-hop neighbors, 1-hop path) is `strong` + `deterministic`. A path or neighbourhood over 2+ hops is `weak` + `inferred`: every link is real, but a chain of links does not show the ends are related. Orphans, broken links and a `shortest_path` stopped by `max_depth` are `absent` + `unsupported` + `abstain`; an empty result the graph can vouch for (no backlinks, no path in a fully searched graph) is `absent` + `deterministic` + `abstain`. |
|
|
312
|
+
| `wiki_search`, `wiki_search_read`, drifted page | A cited page whose raw source changed, disappeared or got a newer version after the page was written drops `strong` to `weak` (see [Source drift](#source-drift)). |
|
|
313
|
+
| `wiki_search`, `wiki_search_read`, not-current page | A cited page whose own frontmatter says `status` is not `stable`, or whose `stale_after` has passed or cannot be parsed, drops `strong` to `weak` (see [Reading OKF v0.3 pages](#reading-okf-v03-pages)). |
|
|
314
|
+
| `wiki_admin reconcile` | Always `inferred`, never `deterministic`: `weak` + `inferred` both when it shows the two claims and after a winner is recorded, with both pages and their `raw/` sources in `provenance`. `absent` + `abstain` when the pair has no open contradiction. |
|
|
315
|
+
| `wiki_search`, `wiki_search_read` | Built by `buildSearchEnvelope` from BM25 score relative to the corpus floor (2.0) and the top1/top2 ratio. `wiki_search_read` further downgrades by the top read page's metadata (no sources, `synthesis: true`, `legacyUnsupported`, staleness). A cited page with an open contradiction in the index drops `strong` to `weak`, and the rationale names the counter-claim page (see [Contradictions](#contradictions)). |
|
|
244
316
|
|
|
245
317
|
### `wiki_write` evidence classification
|
|
246
318
|
|
|
@@ -280,6 +352,196 @@ The env var takes precedence over the YAML and accepts only `true` / `false` (ca
|
|
|
280
352
|
| `legacyUnsupported: true` | Set by the one-shot Phase 2a migration on pre-existing user-authored pages with empty sources. Preserved across edits until the page is updated to grounded or synthesis. |
|
|
281
353
|
| `synthesis: true` | Author-set or migration-set marker for legitimate synthesis pages. Equivalent to `type: synthesis` for classification purposes. |
|
|
282
354
|
|
|
355
|
+
### Source drift
|
|
356
|
+
|
|
357
|
+
A page with `sources: [raw/report.md]` is grounded in that file as it was when the page was written. Raw files are immutable through the API, but the ground still shifts: a newer version is ingested (`report_v2.md`), a parsed artifact is regenerated, or a file is replaced on disk.
|
|
358
|
+
|
|
359
|
+
**Sealing.** Every `wiki_write` records the SHA-256 of each cited raw file next to `sources`:
|
|
360
|
+
|
|
361
|
+
```yaml
|
|
362
|
+
sources:
|
|
363
|
+
- raw/report.md
|
|
364
|
+
- https://example.com/q3
|
|
365
|
+
sources_sha:
|
|
366
|
+
raw/report.md: 3b1f…
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Only entries that resolve to a file under `raw/` are sealed; URLs are not. The map is rebuilt on every write, so editing a page re-seals it. A hand-written `sources_sha` is replaced.
|
|
370
|
+
|
|
371
|
+
**Detection.** `wiki_admin` `lint` and `rebuild` compare each sealed page with `raw/` and persist the result to `.source-drift-index.json` in the workspace. A cited source has drifted when:
|
|
372
|
+
|
|
373
|
+
| Reason | Meaning |
|
|
374
|
+
|--------|---------|
|
|
375
|
+
| `changed` | the file's SHA-256 differs from the sealed one |
|
|
376
|
+
| `missing` | the file is gone |
|
|
377
|
+
| `superseded` | a newer version in the same version chain (see `raw_versions`) was added **after** the page was last written |
|
|
378
|
+
|
|
379
|
+
A page written while the newer version already existed and still citing the old one is not flagged: that is a choice made with the new version in view.
|
|
380
|
+
|
|
381
|
+
The page's frontmatter is **not** rewritten. Drift is a relationship between a page and the raw layer, so it lives in the index only. Lint reports each one as a `source-drift` warning.
|
|
382
|
+
|
|
383
|
+
**Search downgrade.** When one of the top 3 results of `wiki_search` / `wiki_search_read` is in the index, a `strong` envelope becomes `weak` with the rationale "cited raw source has changed since this page was written", naming the page and the source. Search reads the index only (one `stat` per query).
|
|
384
|
+
|
|
385
|
+
**Clearing it.** Check the page against the current source and write it again. The next `lint` or `rebuild` drops it from the index.
|
|
386
|
+
|
|
387
|
+
**Pages written before sealing existed** have no `sources_sha`. Their baseline is unknown, so they are never downgraded; they are counted as "not sealed yet" and sealed on their next write. There is no batch re-seal: sealing every old page at once would assert that each one still matches its sources, which nobody has checked.
|
|
388
|
+
|
|
389
|
+
The evidence report (`wiki_admin` `action: "evidence-report"`) has a **Source drift** section with the counts and the drifted pages, computed live.
|
|
390
|
+
|
|
391
|
+
### Worklist: what needs attention
|
|
392
|
+
|
|
393
|
+
Lint reports a changed source, lint reports a contradiction, search notes a lapsed review, `raw_coverage` lists unread files. `agent-wiki worklist` (or `wiki_admin` with `action: "worklist"`) puts them in one list, ordered by what goes wrong if the item is left:
|
|
394
|
+
|
|
395
|
+
| Kind | On the list because | What to do |
|
|
396
|
+
|------|---------------------|------------|
|
|
397
|
+
| `rewrite` | A page cites a raw source that is gone, has changed, or has a newer version | Read the current source, correct the page, write it again |
|
|
398
|
+
| `reconcile` | Two pages state different things | Check both, then `wiki_admin` `reconcile` |
|
|
399
|
+
| `review` | A page was changed after its last review, or is past its `stale_after` | Check it; `wiki_admin` `verify` if it holds, rewrite if not |
|
|
400
|
+
| `ingest` | A raw file that no page cites yet | `raw_read` it and write what it adds |
|
|
401
|
+
|
|
402
|
+
Within a kind, the page that more pages rest on comes first: the ones that link to it and the synthesis pages derived from it (`dependents`). Unread files are listed newest first. A new version of a file that a page already cites appears once, as the reason to rewrite that page.
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
agent-wiki worklist
|
|
406
|
+
agent-wiki worklist --kind rewrite --limit 10
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Each item has `kind`, `priority`, `page` or `raw`, `reason`, `action`, and `dependents` when there are any. `summary` counts all items, whatever `kind` and `limit` select. Doing the work takes the item off the list.
|
|
410
|
+
|
|
411
|
+
`raw_ingest` with `auto_version` also says at once which pages cite the earlier version of the file just added (`affected_pages`).
|
|
412
|
+
|
|
413
|
+
### Reading OKF v0.3 pages
|
|
414
|
+
|
|
415
|
+
Pages written in upstream [Open Knowledge Format](https://github.com/open-knowledge-format/open-knowledge-format) v0.3 shape can sit in `wiki/` next to native pages. Nothing is converted; the reader accepts both.
|
|
416
|
+
|
|
417
|
+
| OKF shape | How agent-wiki reads it |
|
|
418
|
+
|-----------|-------------------------|
|
|
419
|
+
| `sources` as mappings with `resource` | Each `resource` counts as a source, so the page is grounded. An entry without `resource` is ignored. |
|
|
420
|
+
| Markdown links `[text](target.md)` | Links, like `[[wikilinks]]`: they feed `wiki_graph`, orphan and broken-link checks. A leading `/` resolves from `wiki/`, anything else from the page's directory. Inline, reference-style and shortcut references; links in fenced, inline or indented code are skipped. A Markdown link names exactly one file: unlike a wikilink it is never matched by basename, so `[orders](/orders.md)` is broken when only `tables/orders.md` exists. In `wiki_graph` output such a link appears as a path from the wiki root with a leading slash (`/tables/orders`). |
|
|
421
|
+
| One item where a list is expected | A list of one (`tags: finance`, a single `sources` or `verified` mapping). |
|
|
422
|
+
| `index.md`, `log.md` at any level | Lint does not ask them for frontmatter or report them as orphans. `index.md` is a system page at every level, as before. A nested `log.md` is otherwise still an ordinary page, so a wiki that already has one keeps it. |
|
|
423
|
+
| Bundle metadata on the root `index.md` (`okf_version`, `title`, `description`, `license`, `x-*`) | Kept when the index is rebuilt. |
|
|
424
|
+
| Unknown keys, at any depth | Kept on write. |
|
|
425
|
+
|
|
426
|
+
**Trust and lifecycle.** For the top 3 results, `wiki_search` and `wiki_search_read` read the page's own statements and put them on the result as `okf`:
|
|
427
|
+
|
|
428
|
+
```json
|
|
429
|
+
{ "path": "metrics/gross-margin.md", "okf": { "trust_tier": "human-reviewed", "status": "stable", "stale_after": "2026-12-31T00:00:00Z", "stale": false } }
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
- `trust_tier` is `unverified`, `machine-confirmed` or `human-reviewed`, computed from `verified` events at or after `generated.at`. Only a `human:` actor gives the top tier. A page with neither `generated` nor `verified` has no tier.
|
|
433
|
+
- A result with `status` other than `stable`, or with a `stale_after` that has passed or cannot be parsed, lowers a `strong` envelope to `weak`. The rationale says why and, for a deprecated page, names what `superseded_by` points to.
|
|
434
|
+
- The trust tier never raises the envelope. It lowers it only on request: `wiki_search` with `min_trust: "human-reviewed"` (or `"machine-confirmed"`) turns `strong` into `weak` when the top cited page is below that tier, and the rationale says which tier the page has.
|
|
435
|
+
- `review_lapsed: true` means the page has a review that was made before its content last changed. The rationale then says so under `Trust:`. Confidence is not lowered for this: the page is no worse than one nobody ever reviewed, but a reader should not take the old sign-off for the new text.
|
|
436
|
+
|
|
437
|
+
**Recording trust.** agent-wiki keeps both fields itself:
|
|
438
|
+
|
|
439
|
+
- **`generated`** is written by `wiki_write`: `{ by, at }`. `by` is the `actor` argument, or `agent-wiki/<version>` when none is given. `at` moves only when the page content changes. A change of tags, whitespace or `[[wikilink]]` markup (which is what agent-wiki's own auto-linking adds) is a trivial edit and leaves it alone. Code and Markdown links are compared exactly.
|
|
440
|
+
- **`verified`** is appended by `agent-wiki verify <page> --by human:ana` (or `wiki_admin` with `action: "verify"`, `page`, `by`). Nothing else in the page changes. `by` is an actor: `human:<id>` for a person, `process:<id>` for an automated check, `<producer>/<version>` for an agent. Only `human:` gives the human-reviewed tier.
|
|
441
|
+
- `wiki_write` does not take `generated` or `verified` from the submitted frontmatter. A write cannot add, change or remove a review.
|
|
442
|
+
|
|
443
|
+
The consequence is the rule of §5.3: when a page that a human reviewed is rewritten, `generated.at` moves past the review, and the page is unverified until someone reviews the new text. The earlier review stays in the file as history.
|
|
444
|
+
|
|
445
|
+
The tier is an advisory signal, not access control. Whoever can call the tool can record a review under any actor name; each review is written to the operation log.
|
|
446
|
+
|
|
447
|
+
**Importing a bundle.** `agent-wiki import <path>` (or `wiki_admin` with `action: "import"`) brings a whole OKF v0.3 bundle into `wiki/`. `<path>` is a directory or a `.zip`; a tarball has to be unpacked first.
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
agent-wiki import ./acme-retail --dry-run # check and list, write nothing
|
|
451
|
+
agent-wiki import ./acme-retail.zip
|
|
452
|
+
agent-wiki import ./acme-retail --overwrite # replace files that already exist
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
1. **Check.** The bundle is checked against §11.1 of the spec. One that is not conformant is refused and nothing is written. Each finding names the file, the line and the rule, with the same codes the upstream validator uses:
|
|
456
|
+
|
|
457
|
+
| Code | Rule |
|
|
458
|
+
|------|------|
|
|
459
|
+
| `E002` | frontmatter does not parse as a YAML mapping, or its closing `---` is missing (§4) |
|
|
460
|
+
| `E007` | frontmatter repeats a key (§4) |
|
|
461
|
+
| `E004` | an `index.md` below the bundle root has frontmatter (§8) |
|
|
462
|
+
| `E006` | a `log.md` has frontmatter (§9) |
|
|
463
|
+
| `E005` | a `log.md` date heading is not `YYYY-MM-DD` (§9) |
|
|
464
|
+
|
|
465
|
+
Warnings never block an import. They point at what a consumer ignores or reads as not current: a Markdown file that is not a concept (`W120`), a `sources` entry without `resource` (`W106`), a `verified` event without `by` and `at` (`W104`), a `status` outside the vocabulary (`W105`), an unreadable `stale_after` (`W101`), a `superseded_by` that leads nowhere (`W116`), a missing `okf_version` (`W125`), two paths that differ only by case (`AW01`).
|
|
466
|
+
|
|
467
|
+
2. **Copy.** Concepts, other Markdown files and assets are copied byte for byte to the same relative path, so the bundle root becomes the wiki root and paths with a leading `/` keep their meaning. Nothing is converted or re-serialised.
|
|
468
|
+
|
|
469
|
+
3. **Rebuild.** The index is rebuilt, as after any bulk change.
|
|
470
|
+
|
|
471
|
+
What is not copied, and why (all listed under `skipped` in the report):
|
|
472
|
+
|
|
473
|
+
- **Root `log.md`**: agent-wiki keeps its own operation log there. The bundle's history is not carried over.
|
|
474
|
+
- **`index.md` below the root**: agent-wiki regenerates directory indexes.
|
|
475
|
+
- **Root `index.md`** as a file: its bundle metadata (`okf_version`, `title`, `description`, `license`, extension keys) is merged into the wiki's `index.md`, where a rebuild keeps it.
|
|
476
|
+
- **Root `timeline.md` and `evidence-report.md`**: agent-wiki generates these on every rebuild, so a copy would be lost at once. Reported as warning `AW03`; rename the file in the bundle to keep it. The same holds for a path a code-analysis plugin writes or removes on rebuild, such as `cobol/field-lineage.md`.
|
|
477
|
+
- **Dot-paths and symbolic links**: not part of a bundle (§3.2). Links are never followed.
|
|
478
|
+
|
|
479
|
+
Existing files are never replaced silently: if any target path exists, the whole import is refused unless `overwrite` is set. A wiki holds one bundle root, so importing a second, different bundle also needs `overwrite`. A wiki file standing where the bundle needs a directory is refused even with `overwrite`, before anything is written. An archive entry that would land outside the archive is refused.
|
|
480
|
+
|
|
481
|
+
A bundle wrapped in one extra folder (as archives usually are) is recognised by the root `index.md` inside that folder. Without a root `index.md`, the given directory is taken as the bundle root.
|
|
482
|
+
|
|
483
|
+
**Exporting a bundle.** `agent-wiki export --out <dir>` (or `wiki_admin` with `action: "export"`) writes the workspace as an OKF v0.3 bundle that other OKF tools can read. The workspace itself is not changed.
|
|
484
|
+
|
|
485
|
+
```bash
|
|
486
|
+
agent-wiki export --out ./bundle
|
|
487
|
+
agent-wiki export --out ./bundle --overwrite # replace an earlier export
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
What the export translates:
|
|
491
|
+
|
|
492
|
+
| In the workspace | In the bundle |
|
|
493
|
+
|------------------|---------------|
|
|
494
|
+
| `[[slug]]`, `[[slug\|alias]]` | `[Title](relative/path.md)`, `[alias](relative/path.md)`. Wikilinks inside code are left alone. |
|
|
495
|
+
| `sources: [raw/report.pdf]` | `sources: [{ resource: /references/raw/report.pdf }]`, and the file is copied there with its `.meta.yaml` sidecar |
|
|
496
|
+
| `sources: [https://…]` | `sources: [{ resource: https://… }]` |
|
|
497
|
+
| `sources_sha` | `x-agent-wiki-sha256` inside the matching `sources` entry |
|
|
498
|
+
| `derived_from: [a.md]` | a `sources` entry `{ resource: /a.md, x-agent-wiki-relation: derived_from }` |
|
|
499
|
+
| `updated` | `generated: { by: agent-wiki/<version>, at: <updated> }` |
|
|
500
|
+
| `created`, `synthesis`, `unsupported`, `reconciles`, `decisions`, … | `x-agent-wiki-created`, `x-agent-wiki-synthesis`, … |
|
|
501
|
+
| manifest `name`, `description`, `license` | root `index.md` frontmatter, with `okf_version: "0.3"` |
|
|
502
|
+
| manifest `wiki_policy.stale_after_days` | `stale_after` on each page: `updated` plus that many days |
|
|
503
|
+
| open contradictions | `x-agent-wiki-disputed-by: [/other.md]` |
|
|
504
|
+
| source drift | `x-agent-wiki-source-drift: [{ resource, reason }]` |
|
|
505
|
+
| `index.md`, `log.md` | regenerated in the forms of §8 and §9 |
|
|
506
|
+
|
|
507
|
+
Things to know:
|
|
508
|
+
|
|
509
|
+
- **A wikilink with no page to point at becomes plain text.** A dangling link is a warning for OKF validators. The report lists these under `links_unresolved`.
|
|
510
|
+
- **Raw Markdown files are copied as `<name>.md.txt`.** In a bundle every `.md` file is a page. The content is unchanged, so the sealed hash still matches.
|
|
511
|
+
- **`timeline.md` and `evidence-report.md` are not exported.** Both are derived from the other pages.
|
|
512
|
+
- **A page that is already in OKF form is copied byte for byte.** Exporting a workspace that holds an imported bundle gives that bundle back, apart from `log.md`.
|
|
513
|
+
- **The output directory must be empty or not exist.** With `overwrite`, an earlier export is cleared first; a directory that is not an OKF bundle is never cleared.
|
|
514
|
+
- The exported bundle is checked with the same rules the importer applies; anything found is in `findings`.
|
|
515
|
+
|
|
516
|
+
A bundle exported by agent-wiki and imported again keeps its meaning: the `x-agent-wiki-*` keys are read back as the native keys, so a reconciliation page still settles its contradiction.
|
|
517
|
+
|
|
518
|
+
See [`okf-compat-plan.md`](okf-compat-plan.md) for what is still planned.
|
|
519
|
+
|
|
520
|
+
### Contradictions
|
|
521
|
+
|
|
522
|
+
`wiki_admin` `lint` already detects pages that state different numbers or dates for the same claim. Three things now consume that result.
|
|
523
|
+
|
|
524
|
+
**Index.** `lint` and `rebuild` persist `.contradiction-index.json` in the workspace: for each disputed page, the pages it disagrees with. Search reads this file (one `stat` per query, re-read only when it changed) and never runs detection itself. Without the file, search does nothing extra.
|
|
525
|
+
|
|
526
|
+
**Search downgrade.** When one of the top 3 results of `wiki_search` / `wiki_search_read` is in the index, a `strong` envelope becomes `weak`, the rationale names the counter-claim page, and that page is added to `provenance`. `weak` stays `weak`; an abstaining envelope is left alone.
|
|
527
|
+
|
|
528
|
+
**Reconcile.** `wiki_admin` with `action: "reconcile"`:
|
|
529
|
+
|
|
530
|
+
```bash
|
|
531
|
+
# 1. See both claims and where each page says its claim comes from
|
|
532
|
+
agent-wiki call wiki_admin '{"action":"reconcile","page_a":"yolo-origin.md","page_b":"yolo-history.md"}'
|
|
533
|
+
# 2. Record your decision
|
|
534
|
+
agent-wiki call wiki_admin '{"action":"reconcile","page_a":"yolo-origin.md","page_b":"yolo-history.md","winner":"yolo-origin.md","note":"The original paper is dated 2015."}'
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
Step 2 writes `reconciliation-<a>-vs-<b>-<hash>.md`, a `type: synthesis` page that quotes both claims, lists both pages' sources and states which was kept and why. The hash is of the exact page pair, so `a/b.md` and `a-b.md` never share a file. Its frontmatter carries the state: `reconciles: [a, b]`, `reconciled_claims: [...]`, and `decisions`, one record per claim with its own `winner`, `superseded`, both excerpts, `note` and `decided_at`. Reconciling a later disagreement between the same pair adds a decision and keeps the earlier ones, which may have gone the other way. Neither of the two pages is edited.
|
|
538
|
+
|
|
539
|
+
A contradiction counts as settled only when a reconciliation page names the same two pages **and** the same claim, so a new disagreement between the pair is reported again. Settled contradictions leave the index and the `contradictions` list of `lint`, which reports their number as `reconciledContradictions`. Delete the reconciliation page to reopen the question.
|
|
540
|
+
|
|
541
|
+
The tool never picks a winner. The outcome is the caller's judgement, so the envelope is `inferred` and never `deterministic`.
|
|
542
|
+
|
|
543
|
+
The index is as fresh as the last `lint`, `rebuild` or `reconcile`: editing a page does not update it.
|
|
544
|
+
|
|
283
545
|
### Corpus-level evidence report
|
|
284
546
|
|
|
285
547
|
`wiki_admin action: "evidence-report"` aggregates the four telemetry surfaces — page frontmatter, the per-write counter, the search log, and the COBOL field-lineage diagnostics artifact — into a single `EvidenceReport`. The structured report is returned alongside the rendered Markdown; pass `write: true` to also persist it to `wiki/evidence-report.md`. Section breakdown and field semantics: [`evidence-envelope.md` §"Corpus-level evidence report (Phase 4)"](evidence-envelope.md#corpus-level-evidence-report-phase-4).
|
package/package.json
CHANGED