@agent-wiki/mcp 0.21.1 → 0.21.4
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/dist/atlassian.d.ts +23 -0
- package/dist/atlassian.d.ts.map +1 -1
- package/dist/atlassian.js +92 -1
- package/dist/atlassian.js.map +1 -1
- package/dist/atlassian.test.d.ts +7 -0
- package/dist/atlassian.test.d.ts.map +1 -0
- package/dist/atlassian.test.js +220 -0
- package/dist/atlassian.test.js.map +1 -0
- package/dist/cobol/__tests__/field-lineage.test.js +525 -1
- package/dist/cobol/__tests__/field-lineage.test.js.map +1 -1
- package/dist/cobol/__tests__/parser.test.js +32 -0
- package/dist/cobol/__tests__/parser.test.js.map +1 -1
- package/dist/cobol/evidence-mapping.d.ts +1 -1
- package/dist/cobol/evidence-mapping.d.ts.map +1 -1
- package/dist/cobol/evidence-mapping.js +1 -0
- package/dist/cobol/evidence-mapping.js.map +1 -1
- package/dist/cobol/field-lineage.d.ts +53 -2
- package/dist/cobol/field-lineage.d.ts.map +1 -1
- package/dist/cobol/field-lineage.js +339 -16
- package/dist/cobol/field-lineage.js.map +1 -1
- package/dist/cobol/parser.d.ts.map +1 -1
- package/dist/cobol/parser.js +7 -0
- package/dist/cobol/parser.js.map +1 -1
- package/dist/evidence-report.d.ts +10 -0
- package/dist/evidence-report.d.ts.map +1 -1
- package/dist/evidence-report.js +23 -1
- package/dist/evidence-report.js.map +1 -1
- package/dist/evidence-report.test.js +32 -0
- package/dist/evidence-report.test.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -1
- package/dist/server.js.map +1 -1
- package/docs/evidence-envelope.md +61 -2
- package/docs/tools.md +67 -1
- package/package.json +1 -1
package/docs/tools.md
CHANGED
|
@@ -21,7 +21,7 @@ agent-wiki exposes 15 public tools through the Model Context Protocol.
|
|
|
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
23
|
| `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`, or `
|
|
24
|
+
| `wiki_admin` | Unified wiki maintenance tool. Select `action`: `init`, `config`, `rebuild`, `lint`, or `evidence-report`. `rebuild` regenerates indexes/timeline and search vectors; `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). |
|
|
25
25
|
|
|
26
26
|
## Code Analysis — Language Plugins
|
|
27
27
|
|
|
@@ -38,6 +38,7 @@ agent-wiki exposes 15 public tools through the Model Context Protocol.
|
|
|
38
38
|
| `impact` | Query the compiled COBOL knowledge graph for downstream impact. Returns affected nodes grouped by dependency depth, with evidence and unresolved/lower-confidence markers. |
|
|
39
39
|
| `procedure_flow` | Query PERFORM flow inside one parsed source file. Returns section-level and paragraph-level flow, plus optional focused traversal from one procedure. |
|
|
40
40
|
| `field_lineage` | Query compiled field-lineage artifacts. Returns matches across three lineage families: deterministic shared-copybook reuse, inferred cross-copybook candidates (high-confidence + ambiguous), CALL boundary field flow (caller USING ↔ callee LINKAGE), and DB2 cross-program data flow via shared tables (writer/reader pairs with host variables). Each family appears only if the corresponding parsed evidence exists. |
|
|
41
|
+
| `dataflow_edges` | Query field-level dataflow edges from a parsed source file: `MOVE`/`COMPUTE`/`ADD` assignment, `EXEC SQL` host-variable, and `CALL USING` parameter edges. Filter with `from`/`to`, or set `field` + `transitive: true` to follow chains across the full graph (bounded by `max_depth`, default 10; `direction`: `downstream` / `upstream` / `both`). |
|
|
41
42
|
|
|
42
43
|
## Orchestration
|
|
43
44
|
|
|
@@ -223,6 +224,71 @@ After setup, every `wiki_write` automatically embeds the new page — no manual
|
|
|
223
224
|
|
|
224
225
|
**Vector index persistence:** Embeddings are cached in `wiki/.search-vectors.json`. The index is invalidated and rebuilt automatically if you change `search.model`.
|
|
225
226
|
|
|
227
|
+
## Evidence-first surface
|
|
228
|
+
|
|
229
|
+
Every retrieval / query / read tool returns an `evidence: EvidenceEnvelope` field alongside its existing payload. The envelope is purely additive — agents that don't know about it can ignore it; agents that do can branch on `confidence` (`strong` / `weak` / `absent`) and `abstain` without parsing tool-specific detail. Full contract and adoption history: [`evidence-envelope.md`](evidence-envelope.md).
|
|
230
|
+
|
|
231
|
+
### Tool responses that carry `evidence`
|
|
232
|
+
|
|
233
|
+
| Tool | Envelope shape |
|
|
234
|
+
|------|----------------|
|
|
235
|
+
| `raw_read` | `strong` + `deterministic`; `provenance: [{ raw }]`. Round-trippable file read. |
|
|
236
|
+
| `raw_coverage` | `strong` + `deterministic`; rationale carries the SHA-256-based covered/total ratio. |
|
|
237
|
+
| `code_parse` | `strong` + `deterministic`; rationale carries unit/procedure/symbol/relation counts. |
|
|
238
|
+
| `code_query trace_variable` | `strong` when references found, `absent` + `abstain` when none. |
|
|
239
|
+
| `code_query procedure_flow` | `strong` when the parsed model has sections/paragraphs, `absent` + `abstain` when empty. |
|
|
240
|
+
| `code_query field_lineage` | `strong` (deterministic match), `weak` (inferred high-confidence), or `absent` + `abstain` (ambiguous-only or no match). Mapped from COBOL lineage tiers via `cobolTierToEvidence`. |
|
|
241
|
+
| `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
|
+
| `code_query dataflow_edges` | `strong` for non-empty edge lists; `absent` + `abstain` when the filter matches nothing. |
|
|
243
|
+
| `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). |
|
|
244
|
+
|
|
245
|
+
### `wiki_write` evidence classification
|
|
246
|
+
|
|
247
|
+
Every non-system `wiki_write` is classified by frontmatter and routed through one of five outcomes. Both `.agent-wiki/evidence-write-counter.jsonl` (denominator — every classified write) and `.agent-wiki/evidence-write-log.jsonl` (numerator — distinct unsupported transitions and rejected attempts) tick accordingly. Both logs rotate at 10 MB / 30 days during `wiki_admin lint`.
|
|
248
|
+
|
|
249
|
+
| Outcome | Trigger | Effect |
|
|
250
|
+
|---------|---------|--------|
|
|
251
|
+
| `grounded` | non-empty `sources: [...]` | Counter ticks; any prior `unsupported` / `legacyUnsupported` flag is cleared. |
|
|
252
|
+
| `synthesis` | `synthesis: true` or `type: synthesis` | Counter ticks as `synthesis`; same flag-clearing as grounded. |
|
|
253
|
+
| `unsupported` | empty `sources`, no synthesis flag, page not legacy | Stamps `unsupported: true` into frontmatter; counter ticks; the unsupported log fires only on the *transition* into unsupported (deduped across re-edits). |
|
|
254
|
+
| `legacy` | empty `sources`, no synthesis flag, but page already carries `legacyUnsupported: true` | Preserves the legacy marker; counter ticks as `legacy`; unsupported log stays silent. |
|
|
255
|
+
| `rejected` | empty `sources`, no synthesis flag, **and** Phase 2b reject mode is on | `wiki_write` throws; counter ticks as `rejected`; unsupported log fires with `rejected: true` and `rejectReason: "fresh"` or `"legacy"`. |
|
|
256
|
+
|
|
257
|
+
System pages (`index.md`, `log.md`, `timeline.md`, nested `*/index.md`, `evidence-report.md`) are excluded from classification — they're synthesis by construction and would otherwise flood the signal.
|
|
258
|
+
|
|
259
|
+
#### Phase 2b reject mode
|
|
260
|
+
|
|
261
|
+
Phase 2b ships disabled. Toggle it on once the warn-mode would-reject ratio settles, via either:
|
|
262
|
+
|
|
263
|
+
```yaml
|
|
264
|
+
# .agent-wiki.yaml
|
|
265
|
+
evidence:
|
|
266
|
+
reject_unsupported_writes: true
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
export AGENT_WIKI_EVIDENCE_REJECT_UNSUPPORTED=true
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
The env var takes precedence over the YAML and accepts only `true` / `false` (case-insensitive — `1` / `yes` are intentionally **not** truthy). The error message differentiates `fresh` (a brand-new unsupported page) from `legacy` (an attempt to update a `legacyUnsupported` page without resolving its evidence status). Reads of legacy pages are unaffected — only updates require committing to grounded or synthesis.
|
|
274
|
+
|
|
275
|
+
#### Frontmatter flags written by the classifier
|
|
276
|
+
|
|
277
|
+
| Flag | Meaning |
|
|
278
|
+
|------|---------|
|
|
279
|
+
| `unsupported: true` | Stamped on writes with empty `sources` and no synthesis flag, in warn mode. Cleared automatically when the page later gains `sources` or `synthesis: true`. |
|
|
280
|
+
| `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
|
+
| `synthesis: true` | Author-set or migration-set marker for legitimate synthesis pages. Equivalent to `type: synthesis` for classification purposes. |
|
|
282
|
+
|
|
283
|
+
### Corpus-level evidence report
|
|
284
|
+
|
|
285
|
+
`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).
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
agent-wiki call wiki_admin '{"action":"evidence-report"}'
|
|
289
|
+
agent-wiki call wiki_admin '{"action":"evidence-report","write":true}'
|
|
290
|
+
```
|
|
291
|
+
|
|
226
292
|
## Auto-Linking
|
|
227
293
|
|
|
228
294
|
Every `wiki_write` automatically scans the page body for mentions of existing page titles and injects `[[slug|text]]` links:
|
package/package.json
CHANGED