Repository navigation
fix: scope reward-hacking markers to execution surfaces (#46) - #49
Merged
Merged
Conversation
Spec artifacts for FR-071: the reward-hacking check scans execution surfaces only, so prose and read-only queries that mention a marker are not blocked. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reward-hacking check substring-matched the whole argument object, so writing or searching about --no-verify or .skip( was blocked like using them. FR-071 scans execution surfaces only: bash in full; read-only builtins not at all; other tools every non-content key, never oldString, and content/newString unless the call is target-less or every target is a prose document. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #46. Part of unbound-force/dewey#153.
Summary
The reward-hacking check substring-matched the entire argument JSON of every tool call, so a mention of a marker was treated as a use: writing a Markdown note that says "never commit with
--no-verify", or running thegreptool for.skip(, was blocked likegit commit --no-verify. Knowledge-curation sessions worked around this withblockRewardHacking: falsein project config, which disables the guard for every agent in the repo.FR-071 (new,
openspec/changes/scope-reward-hacking-check/) scans execution surfaces only, via a purerewardHackingScanArgshelper insrc/tool-guard.ts:bashread,glob,grep,webfetch,websearcholdString;content/newStringunless the call has no file target or every target is a prose document (.md,.mdx,.markdown,.txt,.rst,.adoc)Path-named keys (
filePath,path,file,filename,target) are read whole, so extensionless targets (Makefile,.husky/pre-commit) count as non-prose. The marker set, block reason, andblockedCheckare unchanged.Still blocked:
git commit --no-verifyvia bash, addingit.skip(to a test, writing--no-verifyinto a script, hook, or workflow, custom tools passing--no-verifyunder any non-content key.Now allowed: prose and notes that quote markers, read-only queries for markers, and edits that remove a
.skip((previously blocked becauseoldStringwas scanned).Residuals (documented in design.md)
grep -- "--no-verify"still blocks (no shell parsing); use thegreptool.apply_patchpatchTextand nested edit arrays stay scanned in full (fail closed).contentpayload with no path-named target is now unscanned, the same residual class FR-064 accepted for the trace check.content(Dewey'sstore_learningusesinformation) stay scanned; that's feat: configurable trace-check exemptions for knowledge-store MCP tools #47's scope.Verification
bun test: 384 pass, 0 failnode --test test/*.test.ts: 384 pass, 0 fail (Node 26)XDG_CONFIG_HOME. With a global~/.config/opencode/supervisor/config.jsonset tomode: "repair-only", 8 pre-existing hook-layer tests fail on unmodifiedmaintoo, because those tests don't isolate the global config tier.Not done (repo process)
/uf.review-council: required before PR submission by AGENTS.md; it runs only inside OpenCode, so this PR is a draft until it has run.🤖 Generated with Claude Code