@agent-wiki/mcp 0.22.2 → 0.22.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/README.md +19 -1
- package/dist/cobol/__tests__/parser.test.js +134 -0
- package/dist/cobol/__tests__/parser.test.js.map +1 -1
- package/dist/cobol/parser.d.ts.map +1 -1
- package/dist/cobol/parser.js +50 -4
- package/dist/cobol/parser.js.map +1 -1
- package/dist/evidence-report.d.ts +53 -1
- package/dist/evidence-report.d.ts.map +1 -1
- package/dist/evidence-report.js +182 -3
- 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/server.d.ts.map +1 -1
- package/dist/server.js +143 -35
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +76 -0
- package/dist/server.test.js.map +1 -1
- package/docs/evidence-envelope.md +21 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Evidence Envelope
|
|
2
2
|
|
|
3
|
-
**Status: Phases 1–4 delivered. Phase 2b (hard reject) ships disabled and is operator-toggleable via `AGENT_WIKI_EVIDENCE_REJECT_UNSUPPORTED` once the
|
|
3
|
+
**Status: Phases 1–4 delivered. Phase 2b (hard reject) ships disabled and is operator-toggleable via `AGENT_WIKI_EVIDENCE_REJECT_UNSUPPORTED` once the [Phase 2b flip criteria](#phase-2b-flip-criteria) (concrete numeric gates: 4 weeks under 5% wouldRejectRatio + ≥ 50 writes + search abstain ≤ 30%) are met. The `Phase 2b readiness` section in `wiki/evidence-report.md` is the live verdict. Section "Phase 0 — design" below is preserved as the original contract; downstream sections describe what shipped.**
|
|
4
4
|
|
|
5
5
|
agent-wiki has accumulated many evidence-like features (raw provenance, frontmatter `sources`, COBOL lineage confidence tiers, graph edge evidence, lint, `raw_coverage`), but each tool exposes them differently. Agents using one tool's output have no reliable way to ask "is this match strong enough to act on?" The envelope is a unified contract every retrieval / query tool will adopt across the evidence-first program (#78).
|
|
6
6
|
|
|
@@ -150,6 +150,26 @@ The ratio is omitted when the counter file is empty (early deployments would oth
|
|
|
150
150
|
|
|
151
151
|
Without this hook in Phase 2a, Phase 2b is guesswork. Including it now means the data is collected from day one.
|
|
152
152
|
|
|
153
|
+
## Phase 2b flip criteria
|
|
154
|
+
|
|
155
|
+
Phase 2b ships disabled. The decision to flip `AGENT_WIKI_EVIDENCE_REJECT_UNSUPPORTED=true` (or set `evidence.reject_unsupported_writes: true` in `.agent-wiki.yaml`) is gated on telemetry rather than vibe. The evidence report exposes a **Phase 2b readiness** section that evaluates the gates below against the rolling windows already populated by Phases 1–4. Status is one of `ready` / `not-ready` / `insufficient-data`.
|
|
156
|
+
|
|
157
|
+
| Gate | Threshold | Window | Why this number |
|
|
158
|
+
|------|-----------|--------|-----------------|
|
|
159
|
+
| Total writes | ≥ 50 | last 4 weeks | Below 50 the ratio is too thin — one or two unsupported writes can flip a 0% week into 50%. Caught as `insufficient-data` rather than `not-ready`. |
|
|
160
|
+
| Weekly `wouldRejectRatio` | < 5% per week | each of the last 4 weeks (weeks with 0 writes carry no signal and pass by default) | Per-week (not pooled) so a single bad week blocks the flip. Captures whether the unsupported rate is **sustained** low rather than averaged-low across a spike. |
|
|
161
|
+
| Search abstain ratio | ≤ 30% | last 30 days, requires ≥ 10 searches | Phase 2b tightens the **supply** side of grounding (rejects unsupported writes). If search is already abstaining heavily, the corpus has retrieval problems too; flipping 2b in that state compounds the squeeze. Skipped when there isn't enough search activity to be meaningful. |
|
|
162
|
+
|
|
163
|
+
The thresholds are conservative — false-positive `ready` would block legitimate writes, which is worse than waiting another week.
|
|
164
|
+
|
|
165
|
+
**Workflow**:
|
|
166
|
+
|
|
167
|
+
1. Operators run `wiki_admin --action evidence-report --write=true` (or pass `evidence_report=true` to `wiki_admin --action rebuild` to fold report regeneration into the rebuild) periodically — daily for active corpora, weekly otherwise.
|
|
168
|
+
2. The rendered `wiki/evidence-report.md` shows the Phase 2b readiness verdict and per-gate pass/fail at the bottom. When `status: ready` and `currentlyEnabled: no`, the report includes the explicit `AGENT_WIKI_EVIDENCE_REJECT_UNSUPPORTED=true` knob to flip.
|
|
169
|
+
3. After flipping, the same gates keep monitoring — `currentlyEnabled: yes` plus continued passing gates is the steady state. If a regression pushes a gate back over its threshold while 2b is on, the report still shows the regression and operators decide whether to flip back to warn mode.
|
|
170
|
+
|
|
171
|
+
These numbers can be revised once production data accumulates, but a revision is itself a deliberate change documented in this file rather than a silent constant change.
|
|
172
|
+
|
|
153
173
|
## Corpus-level evidence report (Phase 4)
|
|
154
174
|
|
|
155
175
|
Phase 4 ships as `wiki_admin action: "evidence-report"`. The handler calls `buildEvidenceReport` (`src/evidence-report.ts`) which aggregates the four telemetry sources earlier phases populate into a single `EvidenceReport` and renders it to Markdown. Pass `write: true` to also persist the rendered report to `wiki/evidence-report.md` (a system page, so the regeneration does not tick the write counter).
|
package/package.json
CHANGED