feat: audit session transcripts for numeric claims with no tool evidence #12

Closed
opened 2026-11-05 02:42:06 +00:00 by david · 0 comments
Owner

Long-lived failure mode in agent sessions: a figure is derived once (sometimes against the wrong reference), then restated in later turns without being re-checked. Repetition raises confidence instead of prompting verification.

Concrete instance from this project: git diff --stat 6335670 bb852fa produced 6,884 — measured against the wrong ref — and "6,884 lines" was then repeated across five turns, driving a branch decision that had to be undone.

Change

  • internal/claims: deterministic extraction and matching (no model calls).
  • knox claims lint [--session ID] [--json], reading opencode's opencode.db.

Classification

  • sourced — a tool result in the same turn printed the same number and unit
  • stale — the number appeared in an earlier turn's tool output and is being restated without re-checking
  • unsupported — never printed by any tool (usually a hypothetical)

Matching is unit-aware on purpose: matching the number alone makes "200MB" count as backed by any output containing 200.

Known limitation

The DB only contains messages once opencode persists them, so this audits completed sessions. A live guardrail needs the context plugin hook (follow-up).

Long-lived failure mode in agent sessions: a figure is derived once (sometimes against the wrong reference), then restated in later turns without being re-checked. Repetition raises confidence instead of prompting verification. Concrete instance from this project: `git diff --stat 6335670 bb852fa` produced 6,884 — measured against the wrong ref — and "6,884 lines" was then repeated across five turns, driving a branch decision that had to be undone. ## Change - `internal/claims`: deterministic extraction and matching (no model calls). - `knox claims lint [--session ID] [--json]`, reading opencode's `opencode.db`. ## Classification - **sourced** — a tool result in the same turn printed the same number *and unit* - **stale** — the number appeared in an **earlier** turn's tool output and is being restated without re-checking - **unsupported** — never printed by any tool (usually a hypothetical) Matching is unit-aware on purpose: matching the number alone makes "200MB" count as backed by any output containing 200. ## Known limitation The DB only contains messages once opencode persists them, so this audits *completed* sessions. A live guardrail needs the `context` plugin hook (follow-up).
david closed this issue 2026-11-05 02:42:50 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: david/knox#12