Repository navigation
Add fail-closed goal verifier to completion resolution - #281
Open
raymondginger2018-sudo wants to merge 2 commits into
Open
raymondginger2018-sudo wants to merge 2 commits into
raymondginger2018-sudo wants to merge 2 commits into
Conversation
GoalRuntimeRouter.configure_completion_verifier registers an async verdict
callback; GoalRuntime.resolve_completion awaits it and feeds the outcome
into request(verified=...). Rejection raises GoalRuntimeError('...keep
working.'). Exceptions or empty evidence fail closed (goal not completed).
Dormant by default — no verifier configured means exactly the old flow.
…ort-inert GoalRuntime pulled goal_verifier in at module import; now only resolve_completion / _confirm_completion / _build_completion_request import it when the gate actually runs, so processes that merely import goal_runtime (tools registry, test collection) keep main's import footprint.
This branch has not been deployed
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.
Summary
Closes the goal-completion verify loop: a registered async verifier decides whether a goal request may complete, and rejections keep the agent working instead of falsely completing. Borrowed from harness-style goal verification. Dormant unless a verifier is configured — with none registered, behavior is exactly as before.
Changes
core/agent_runtime/goal_verifier.py:GoalRuntimeRouter.configure_completion_verifierregistration surface plus verdict normalization helpers.core/agent_runtime/goal_runtime.py:resolve_completion(...)awaits the registered verifier (handles both coroutine and sync verdicts), then feeds the outcome intorequest(verified=...).GoalRuntimeError("...keep working.")so the turn continues.core/harness/tools/goal.py: pass the verifier outcome through the goal tool response.tests/test_goal_completion_verifier.py(approval, rejection, exception, empty-evidence, no-verifier paths).Tests
tests/test_goal_completion_verifier.py+tests/test_goal_runtime.py— 19 passedpre-commit run --all-files(ruff 0.15.21) — passedNotes