Skip to content

test(sleep): strengthen verifier-discipline test with score/gate_action assertions#110

Open
harshitnagar22 wants to merge 2 commits into
microsoft:mainfrom
harshitnagar22:enhance/test-verifier-discipline
Open

test(sleep): strengthen verifier-discipline test with score/gate_action assertions#110
harshitnagar22 wants to merge 2 commits into
microsoft:mainfrom
harshitnagar22:enhance/test-verifier-discipline

Conversation

@harshitnagar22

Copy link
Copy Markdown

Summary

Follow-up to #94. Strengthens TestVerifierDiscipline in tests/test_sleep_engine.py with three concrete improvements:

Changes

  1. test_gate_rejects_reward_hacking_edit (enhanced) — now asserts concrete baseline_score=1.0 and candidate_score=0.0 so the rejection is verifiably score-driven, plus asserts gate_action="reject" to bring the vendored evaluate_gate() under test.

  2. test_gate_accepts_genuine_improvement (new) — paired accept case using MockImprovingBackend: an edit that genuinely improves the held-out slice. Asserts accepted=True, baseline_score=0.0, candidate_score=1.0, gate_action="accept_new_best".

  3. test_gate_rejects_subtle_reward_hack (new) — a more realistic reward-hack scenario using MockSubtleHackBackend: train improves from 0.0→1.0 (looks good!) but held-out degrades from 1.0→0.5. Gate correctly rejects, proving it catches non-obvious regressions, not just all-or-nothing collapses.

Why

Verifier discipline (only adopt edits that improve a held-out slice) is the core safety property of the sleep loop. Pinning scores + asserting gate_action turns the test from a smoke test into a real regression guard against gate regressions. The paired accept/reject cases ensure the gate works in both directions.

@harshitnagar22

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant