feat: live guardrail for restated figures (opencode plugin) #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
contextsession 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 viapluginsinopencode.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.