feat(arenabench): a Stop-hook oracle — deterministic probes, judge fallback, bounded - #3304
Open
macanderson wants to merge 1 commit into
Open
feat(arenabench): a Stop-hook oracle — deterministic probes, judge fallback, bounded#3304macanderson wants to merge 1 commit into
macanderson wants to merge 1 commit into
Conversation
…llback, bounded The verify_done successor, out-of-process. verify_done was deleted by the tool purge (#3244) and #3234 recorded the consequence: a no-test-command turn has no live done-signal. This lands the replacement where #3246's analysis says it belongs — the async shell-hook plane, not a new built-in (the surface is pinned at twelve) and not a revived pipeline stage (it cost more than it gained). Three rungs, weakest evidence last: 1. Deterministic flip. A configured test command, or probes persisted from an earlier round, are RUN by the hook. Exit 0 allows; a failure denies with the output tail. Unspoofable by prose — the same posture as verify_done without the shadow-worktree machinery. 2. Judge-derived probes. With no configured oracle, ONE judge call must return runnable probe commands rather than an opinion; the probes are then run exactly like rung 1, so the judge creates the oracle and running it decides. The derived probes persist, so the revision round re-runs the SAME probe — that is the fail->pass flip. Only a probe-less judgement falls back to prose, and an unreachable or unparseable judge ALLOWS. 3. Approach-diversity steering. The second consecutive deny appends a step-back-and-try-a-different-approach instruction — sequential best-of-N against the 1-in-3 prior, as advice inside the deny reason rather than machinery, because MAX_STOP_CONSULTS already bounds the loop. Every failure path is fail-open: a broken oracle must never hold a correct turn hostage. Why the warrant is gone: the old pipeline decided up front whether a change deserved proof and waived far more often than it authored. Here nothing decides eligibility — every completion is probed, and the only 'waiver' is a judge that could derive no probe. Tests: 7, covering both flip directions, cross-round probe persistence with no second judge call, the steering threshold, fail-open on an unreachable judge, and the engine's decision vocabulary. Requires PR #3302 (bounded Stop consultations) — with the once-per-turn latch the deny is issued but the revision is never re-checked. Refs #3234, #3246, #3244
Contributor
There was a problem hiding this comment.
Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Reviewer's GuideIntroduce a new out-of-process Stop hook oracle that deterministically runs configured or judge-derived test probes to decide allow/deny, with persistent state and fail-open behavior, plus tests covering the decision logic and engine contract. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
What
arenabench/hooks/oracle_stop_hook.py— theverify_donesuccessor, as an out-of-process Stop hook, plus 7 tests over its decision core.Why here, and not as a tool or a pipeline stage
verify_donewas deleted with the rest by feat!: reduce the built-in tool surface to 12 tools (subagents, tasks, state, environment) #3244.HookBuscannot host (sync closures, cannot await) and the subprocess plane can (10-minute ceiling, own process, any language).The three rungs
STELLA_ORACLE_TEST_COMMAND, or probes persisted from an earlier round, are run by the hook. Exit 0 allows; failure denies with the output tail. Unspoofable by prose — verify_done's posture without the shadow-worktree machinery.MAX_STOP_CONSULTSalready bounds the loop.Why there is no warrant
The old pipeline decided up front whether a change deserved proof, and that predicate is where the waivers came from. Here nothing decides eligibility: every completion is probed, and the only "waiver" is a judge that could derive no probe — which is a stated outcome, not a silent skip.
Fail-open, everywhere
A broken oracle must never hold a correct turn hostage: no key, no judge, no parse, no network →
allow. An internal error exits non-zero, which the engine surfaces as a diagnostic and never a block (user_hooks.rs's documented Stop posture).Tests
uv run pytest tests/test_oracle_stop_hook.py -q→ 7 passed;ruff checkclean on both new files. Covered: both flip directions, cross-round probe persistence with the judge asserted not to be called again, the steering threshold, fail-open on an unreachable judge, probe-less verdicts in both directions, and the engine's decision vocabulary.Depends on
#3302 (the Stop gate's bounded consultation counter). With the once-per-turn latch this hook can deny but its re-check never happens — the flip is unobservable. Land #3302 first.
Not yet wired
No match TOML sets
STELLA_ORACLE_*or installs the hook into a task container yet — that is the next slice, deliberately separate so this can be reviewed on its logic. Filing the wiring issue alongside.Refs #3234, #3246, #3244
Summary by Sourcery
Introduce a Stop-hook oracle script that verifies task completions via deterministic probes with a judge-based fallback and fail-open behavior, persisting state across rounds to support bounded, repeatable verification.
New Features:
Enhancements:
Tests: