feat: live guardrail for restated figures (opencode plugin) #14

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

Follow-up to #12/#13. The audit reads opencode.db, which only contains messages once opencode persists them, so it cannot see the session in progress — exactly when a figure gets restated.

The context session hook runs before every request is dispatched (including tool-driven continuations) with the assembled messages, so the same check can run live.

Change

  • knox claims check — JSON on stdin, verdicts on stdout; the plugin shells out so classification stays in the tested Go implementation.
  • plugins/claims — OpenCode server plugin, enabled via plugins in opencode.json.

Correction that makes it useful

Staleness is measured against earlier prose, not earlier tool output. During development, matching by number+unit against tool output classified the real incident as unsupported — a tool printed "6884 deletions" while the prose said "6,884 lines" — and the plugin stayed silent on its own motivating case. Comparing prose to prose catches the repetition, which is the actual failure.

The first assertion is deliberately quiet; only restatements warn.

Follow-up to #12/#13. The audit reads `opencode.db`, which only contains messages once opencode persists them, so it cannot see the session in progress — exactly when a figure gets restated. The `context` session hook runs before every request is dispatched (including tool-driven continuations) with the assembled messages, so the same check can run live. ## Change - `knox claims check` — JSON on stdin, verdicts on stdout; the plugin shells out so classification stays in the tested Go implementation. - `plugins/claims` — OpenCode server plugin, enabled via `plugins` in `opencode.json`. ## Correction that makes it useful Staleness is measured against earlier **prose**, not earlier tool output. During development, matching by number+unit against tool output classified the real incident as `unsupported` — a tool printed "6884 deletions" while the prose said "6,884 lines" — and the plugin stayed silent on its own motivating case. Comparing prose to prose catches the repetition, which is the actual failure. The first assertion is deliberately quiet; only restatements warn.
david closed this issue 2026-11-05 02:50:53 +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#14