Repository navigation
feat(verifier): six check kinds for tasks that must be retrieved, computed or proved - #324
Open
Wings-Of-Disaster wants to merge 1 commit into
Open
Wings-Of-Disaster wants to merge 1 commit into
Wings-Of-Disaster wants to merge 1 commit into
Conversation
The ten existing kinds grade a workspace and an answer string. That is enough for a task whose artefact is a file, and not enough for the three things an agentic run most needs to be able to ask of a task: was the check written by someone other than its author, was the value actually queried rather than asserted, and was the source actually read. hidden_python -- a python check the proposer never saw. A proposer that writes its own check script writes the task around it, which is an open-book exam. Grading against a script held back restores the distinction between a task that was solved and one that was authored to be solvable. Shares the shell/python execution path: the two existing kinds pass `kind` straight through as the interpreter, so this adds one name to the tuple and derives the interpreter, leaving both unchanged. answer_one_of -- the answer must equal one of an exact set. answer_contains is too loose for a multiple-valued question: "the answer is 42" and "the answer is not 42" both contain 42. answer_number -- the answer is one unambiguous finite number within a tolerance, with an optional required unit. Comparing numbers as strings fails 3.0 against 3, and a number with the wrong unit is a wrong answer that reads as a right one. The regex rejects "about 5", "5 or 6" and "5m" unless the unit was asked for. sql_query -- the verifier runs the query itself and compares rows. A task that asks for a count and accepts the model's stated count is a task about handwriting. Ordered and unordered comparison are both supported, and the failure message shows the row counts and the first three rows of each side, because "did not match" is not actionable. web_receipt -- every url the answer cites must appear in what the search tools actually served to this episode. This is the check that makes a citation mean something, and it only works because the receipts are written by the world when it answers, not by the policy when it claims. A policy that invents a url has nothing to match against. Receipts arrive on CheckContext, so the kind is testable with fabricated ones and needs no world. lean -- compile the submitted proof with `lake env lean` and let the compiler be the verdict. Lean decides what is true, and the same file that proves a theorem here proves it for anyone; a regex over `:= by ring` would be a guess. The check also refuses the escape hatches, since a proof that compiles by `sorry` or by `native_decide` proves nothing. Two existing lines changed, both to generalise one branch. For the kinds that already existed the derived interpreter equals the kind, so behaviour is unchanged.
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.
PR type
PR information
Add six check kinds to
twinkle_agentic.verifier.result_check, expanding_KINDSfrom 10 to 16.The new checks support held-out validation, exact and numeric answers, verifier-executed SQL, retrieval receipts, and compiler-checked Lean proofs.
Scope: 2 files, +639/−2 lines, 51 new tests. The implementation introduces no new imports and can be reviewed and merged independently of world or profile changes.
Why this is needed
The existing ten kinds grade a workspace and an answer string. Agentic tasks also need checks that can establish whether:
They also need precise answer matching and a compiler verdict for proof tasks. The six additions cover these cases.
New check kinds
hidden_pythonanswer_one_ofanswer_number3and3.0, while detecting incorrect units.sql_queryweb_receiptleanlake env leanand rejects disallowed proof shortcuts.Implementation and compatibility
Reuse the existing Python execution path
hidden_pythonshares the existing shell/Python execution path. The dispatch change selects the interpreter explicitly:For the existing
shellandpythonkinds,interpreter == kind, preserving their behavior. These two lines are the only modification to existing code; the remaining implementation is additive.Consume retrieval receipts without a world dependency
web_receiptreceives receipts throughCheckContext. It does not import or depend on a particular world implementation, and its tests supply fabricated receipts.In production, this check relies on receipts recorded by the retrieval provider when it serves a result. Policy-authored claims are not evidence of retrieval. A failed fetch records no URL and therefore cannot satisfy a citation check.
This establishes that a cited URL was served during the episode; it does not, by itself, establish that the source supports the answer.
Compile Lean proofs and reject disallowed shortcuts
The
leankind runslake env leanand also refusessorryandnative_decide. Compilation alone is insufficient under this check's rules: a submitted proof must pass both the compiler and the shortcut restrictions.Actionable failure messages
Failures explain what needs to change rather than returning only “did not match.”
sql_queryanswer_numberweb_receiptThese messages help a proposer respond to rejected checks and make evaluation logs easier to diagnose.
Verification
The following results are reported for the PR and the clean upstream baseline. No training results are included; this change is evaluated through verifier tests.
pre-commit run --all-files pytest tests/twinkle_agentic tests/processor tests/utils tests/docs \ tests/server/static tests/cli tests/advantage tests/metricmain, same test selectionFive files matching
test_async_rl_*or namedtest_vllm_sampler_tq_generation.pywere deselected. They fail collection identically on cleanmainwithModuleNotFoundError: No module named 'transfer_queue'. The reported results cover the stated selection, not the entire repository test suite.Scope and dependencies
result_check.pyintroduces no new imports. Tests use upstream'sLocalEnvand fabricated receipts, so neither the implementation nor its tests require the world or profile additions.The PR can be reviewed and merged on its own. Deployment still needs to supply the resources used by a selected check, including retrieval receipts for
web_receiptand the Lean toolchain forlean.