Skip to content

feat(eval): kb.effectiveness — does surfaced knowledge change outcomes? honest per-artifact impact #426

Description

@plind-junior

vouch can measure retrieval qualityeval/recall.py scores recall over a labeled query set (#226), and the embeddings evals check semantic fidelity. what it cannot answer is the question an operator actually cares about: is this kb helping, and which specific claims earn their keep? a claim can be perfectly retrievable and still be dead weight, or actively misleading. today nothing correlates "artifact X was surfaced into a session" with what happened in that session, so a reviewer deciding what to expire is flying blind.

this proposes a read-only, measurement-only effectiveness signal: per approved artifact, the association between it being in a session's context pack and a coarse session outcome, reported with a confidence interval and a deliberately conservative verdict.

proposed surface

vouch health effectiveness [--window 90d] [--min-samples N] [--format text|json]
# same surface as kb.effectiveness over mcp/jsonl
  • reads two things already on disk: which artifacts were surfaced (context-pack composition, recordable from the read path into state.db), and a per-session outcome signal derived from the append-only audit log (audit.read_events) — e.g. a session that ended with confirm/cite activity vs. one that ended in contradict/reject.
  • computes, per artifact: surfaced-with-good-outcome vs. surfaced-with-bad-outcome, an associational lift, and a 95% Wilson confidence interval.
  • verdict is gated by statistical power: useful / harmful only when the interval clears baseline and the sample meets --min-samples; otherwise unverified / insufficient. an untrustworthy number never renders as a confident verdict.
  • output ranks artifacts by earned value so a reviewer can see which approved claims to promote, re-cite, or expire.

a src/vouch/eval/effectiveness.py module composes metrics.compute + audit.read_events + the context-pack surfacing log. the surfacing log is a new derived table in index_db.SCHEMA (a cache, rebuildable — the yaml stays source of truth), added to index_db.reset.

review gate & scope

nothing here writes or edits knowledge and it never mutates trust or lifecycle — it reads the audit log and a derived cache and reports. it explicitly does not auto-expire or auto-approve on a bad verdict; the human at the gate decides. the outcome signal is derived from events that already exist (the audit stream is authoritative), so there's no new authoritative state. if exposed as kb.effectiveness, it touches the four registration sites (server.py, jsonl_server.py, capabilities.py, cli.py) with a test at tests/test_effectiveness.py.

acceptance criteria

  • vouch health effectiveness runs read-only; writes no artifacts, no audit events, no proposals.
  • per-artifact lift is computed from surfaced-in-context vs. session outcome over the --window.
  • each verdict carries a 95% Wilson interval; useful/harmful are withheld until the interval clears baseline and --min-samples is met (else unverified/insufficient).
  • the context-pack surfacing table is added to index_db.SCHEMA and cleared in index_db.reset.
  • --format json is a documented, stable schema.
  • tests/test_effectiveness.py covers the insufficient-sample path, a clear-signal path with a fixed clock, and the read-only invariant.
  • make check green.

related: #226 (recall-quality eval — this is the outcome layer above it), #318 (synthesis faithfulness eval), #101 / #164 (metrics / stats).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions