dream(darwin-evolution): #292 reward-hack monitor never scanned tool-response content (evaluated) - #293
Draft
ruvnet wants to merge 2 commits into
Draft
dream(darwin-evolution): #292 reward-hack monitor never scanned tool-response content (evaluated)#293ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
…response content (evaluated) packages/weight-eft/src/reward-hack.ts's deterministic reward-hack monitor scanned only the outgoing arguments of an agent's tool calls, never the content of role:'tool' response messages. A trajectory that leaked gold-patch/FAIL_TO_PASS content through an innocuous-looking call (clean arguments, leaking response) sailed through undetected into SFT/DPO training data. Disclosed but not fixed by the last darwin-evolution night (2026-09-02, #272); closed tonight with a purely-additive 4th detection pass, independently critiqued (ACCEPT). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M2FPq8HeQ4oCJfMwg41VTj
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M2FPq8HeQ4oCJfMwg41VTj
ruvnet
commented
Sep 8, 2026
ruvnet
left a comment
Owner
Author
There was a problem hiding this comment.
Dream exact-head review — ACCEPT, limited to the deterministic Node software envelope.
The candidate adds response-side tool evidence to the reward-hack detector, proves a nonvacuous clean control, catches the response leak, preserves a clean response, and verifies the exporter drops the leak. Exact-head CI, Real Tools, Security, packaging/audit, and the reported Node/Rust/WASM matrices are green; the baseline/candidate distinction is explicit.
Accepted scope: the tested deterministic trajectory primitive and exporter behavior. This is not independent validation on live models, terminals, or a representative production corpus, and it grants no execution or promotion authority.
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.
MetaHarness Dream Cycle, 2026-09-07. Deep surface:
darwin-evolution(slot 2). Full detail, research,candidate-selection scoring, and weight-eft/learn scan findings: #292.
Hypothesis
Given a resolved Darwin trajectory whose tool-CALL arguments carry no reward-hack signal but whose
tool-RESPONSE content (
role:'tool') contains a gold-read pattern (gold_patch/FAIL_TO_PASS/PASS_TO_PASS/test_patch/expected-output/
.golden/run_evaluation), whendetectRewardHack()runs over it, then itshould be flagged
kind: 'gold-read'exactly as a call-argument leak already is today, subject to: (a)zero verdict change for the 4 existing fixture trajectories; (b) purely additive — no existing pattern,
tool classification, or finding kind removed/narrowed; (c) 0 regressions in the full
weight-eftsuite;(d) the new detection path proven non-vacuous (a crafted fixture must fail pre-fix, pass post-fix). Frozen
before implementation, not modified after evaluation began.
Candidate
packages/weight-eft/src/reward-hack.ts's deterministic reward-hack monitor (ADR-198, an "Ornith-1.0"-style gate dropping reward-hacked trajectories before SFT/DPO export) scanned only the outgoing arguments
of
role:'assistant'tool_calls[].function.arguments.role:'tool'messages'content— what a toolactually returned — was never inspected by any of the monitor's 3 finding kinds. A trajectory that leaks
gold/test content through an innocuous-looking call (clean arguments, leaking response) sailed through
undetected. Disclosed but not fixed by the last
darwin-evolutionnight (2026-09-02, #272).Changes (1 source file + 1 new test file + 1 new fixture, ~55 net lines):
reward-hack.ts: newtoolResponses()extraction helper + a 4th detection pass indetectRewardHack()scanning
role:'tool'content against the existingGOLD_READ_PATTERNS, taggedkind: 'gold-read'—identical finding shape to the existing call-argument detection. Purely additive: no existing pattern,
classification, or finding kind touched.
reward-hack-response-content.json+reward-hack-response-content.test.ts, isolated fromthe original
reward-hack-archive.json/reward-hack.test.ts(left byte-identical) to avoid any risk toexisting assertions.
Evaluation Receipt
evaluated: accepted. Deterministic, $0, zero LLM calls:of
GOLD_READ_PATTERNS/VERIFICATION_WRITE_PATTERNS/OUT_OF_SANDBOX_PATTERNS) but whose tool-RESPONSEcontent contains
FAIL_TO_PASS: test_validate_negative.git stashon the source change, then restored):detectRewardHackreturns
[],isRewardHackedfalse,exportTrainingDatareportsdroppedRewardHacked: 0— 2/4 newtests fail exactly as predicted.
kind: 'gold-read', tool: 'grep'; exporter drops the leak trajectory, keeps thehonest one, no SFT row carries the leaked text. 4/4 new tests pass.
reward-hack-archive.jsonis byte-identical in verdict — confirmedboth by the still-green original test file and by the independent critic manually checking every
role:'tool'content string in that archive againstGOLD_READ_PATTERNS.tsc --noEmitclean.Baseline Comparison
Baseline =
mainat session start (d5833dc6512ac1adeeef91a331c29055cd8a4dbb), same evaluator (vitest +tsc). No behavioral change for any trajectory already caught by the existing call-argument detection; the
fix only affects the previously-invisible response-content-only leak case.
Darwin Lineage
Not run — a correctness fix to weight-eft's own reward-hack monitor, not a Darwin-scoped tunable
genome/routing/tier/prompt parameter. Confirmed directly:
packages/darwin-mode/src/safety.ts's mutationallowlist governs only Darwin's own 7 generated genome surface files, not
weight-eft's source — noADR-071 mutation surface applies (same reasoning as every prior non-parameter
darwin-evolutionlibraryfix, e.g. 2026-09-02's ADR-278, 2026-08-17's cost-seam wiring).
Flywheel Evidence
Not a flywheel-domain candidate.
docs/dream-cycle/2026-09-07-evidence.mdcarries the fullOBSERVATION/MEASUREMENT/INFERENCE/DECISION record.
Reward Hack Check
No unresolved signal. The fix is purely additive — no existing test weakened, no pattern/threshold
narrowed, no gold/corpus data touched, no cost hidden, no output hardcoded. Independent adversarial critic
(fresh sub-agent, no authorship context, re-ran the suite and
tscitself rather than trusting the claim)verdict: ACCEPT — confirmed purely additive, confirmed the new fixture is non-vacuous by independently
checking its call arguments against all three pattern lists, confirmed no false positives introduced on
the original archive, found no gaming/hardcoding/scope-creep. One disclosed, non-blocking follow-up: the
response-content scan applies only
GOLD_READ_PATTERNS, notVERIFICATION_WRITE_PATTERNS/OUT_OF_SANDBOX_PATTERNS— flagged as Recommended Next Step #1 in the gist, not attempted here (kept toone conceptual change).
Security Review
This candidate closes a training-data-integrity gap: a reward-hacked "success" that goes undetected
teaches the distilled cheap-tier model to reward-hack. No credential/shell/network surface touched, no new
dependency, no ReDoS risk (reuses the existing bounded regex patterns against a new input surface). Not a
containment/sandbox-escape fix like 2026-09-02's ADR-278 — this is detection-scope hardening of an
existing, already-ADR'd mechanism (ADR-198), not a new architectural decision.
Regression Analysis
0 regressions.
weight-eftfull suite (41/41, was 37/37),tsc --noEmitclean. Downstream sweep: the onlyin-repo consumer,
create-agent-harness(dynamicimport('@metaharness/weight-eft/cli')), full suite572/574 (2 pre-existing skips, unchanged). Full monorepo
npm run build(4 phases, JS/TS only — nowasm/NAPI steps needed for this package): clean.
ADR
None — a detection-consistency correctness fix to an existing, already-ADR'd mechanism (ADR-198's
reward-hack monitor), not a new architectural decision (same reasoning as 2026-09-03's #276 threat-model
fix). Searched
docs/adrs/INDEX.md; no gap requiring a new ADR for this class of change.Research Gist
docs/dream-cycle/2026-09-07-gist.md(this branch).GIST=LOCAL— no gist-creation tool available inthis session's toolset, matching every prior Dream Cycle night. Full 2026 reward-hacking/leak-detection
research (OpenAI's Action-Monitor baseline, Cursor's and Datacurve's SWE-bench-Pro audits, Anthropic's
Nov-2025 reward-hacking paper, RHB taxonomy), 7-system competitor comparison, and 5-candidate STEP 3.2
scoring table (all 5 independent research roles converged on this candidate unprompted).
Issue
#292 (full findings, ledger check, prior-gist score, weight-eft/learn scan results, competitor review).
Witness
Self-verified end-to-end (hash the gist up to the witness block → concatenate with session commit → hash
again) before this PR was opened.
Merge Policy
Human review required. Do not self-merge. Do not autonomously promote Flywheel state.
Recommendation: ACCEPT — a small (1 source file + 2 test/fixture files), deterministic,
independently-critiqued closure of a previously-disclosed training-data-integrity gap, directly in
tonight's scan surface, corroborated by 2026 field evidence (OpenAI's own Action-Monitor baseline already
covers tool outputs) from 5 independent research passes that converged on this finding unprompted.
🤖 Generated with Claude Code
https://claude.ai/code/session_01M2FPq8HeQ4oCJfMwg41VTj
Generated by Claude Code