chore: remove deprecated verify_raw / verify instance verification surface - #140
Draft
mikesklar wants to merge 1 commit into
Draft
chore: remove deprecated verify_raw / verify instance verification surface#140mikesklar wants to merge 1 commit into
mikesklar wants to merge 1 commit into
Conversation
…rface verify_raw (and verify, which was a thin inspect.getsource wrapper over it) POSTed caller-supplied source to the instance runner's /execute_verifier_function and used the long-deprecated (before, after, final_answer) DatabaseSnapshot signature. The sanctioned path is the bundle-based verifier API (/v1/verifiers/check + /v1/verifiers/execute) via @Verifier / TaskVerifier.remote(env), or fleet.tasks.verifier_from_string() for a code string. Removes: Environment.verify/verify_raw (sync+async), InstanceClient.verify/verify_raw (sync+async), ValidatorType, ExecuteFunctionRequest/ExecuteFunctionResponse, and the now-dead fleet/verifiers/parse.py. Ports examples to verifier_from_string. Note: the runner-side POST /execute_verifier_function endpoint is NOT removed — it is still the live execution surface used by grading and the verifier API. Co-Authored-By: Claude <noreply@anthropic.com>
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
Removes the deprecated
verify_raw/verifyinstance-verification surface.verify_rawPOSTed caller-supplied source code to the instance runner's/execute_verifier_functionendpoint and used the long-deprecated(before, after, final_answer) -> intDatabaseSnapshotsignature.verifywas a thininspect.getsourcewrapper over it. The sanctioned replacement is the bundle-based verifier API (/v1/verifiers/check+/v1/verifiers/execute) via@verifier/TaskVerifier.remote(env), orfleet.tasks.verifier_from_string()for a raw code string.This is a deliberate breaking removal, not a deprecation — no shims, no raising stubs.
ValidatorTypeandExecuteFunctionResponsewere public exports infleet.instance.__all__; both are gone.Note: the runner-side
POST /execute_verifier_functionendpoint itself is NOT removed — it remains the live execution surface used by grading and the verifier API.Files changed
fleet/_async/instance/client.py— deletedverify(),verify_raw(), theValidatorTypealias; dropped now-unused imports (inspect,Callable,fleet.verifiers.DatabaseSnapshot,fleet.verifiers.parse.{convert_verifier_string,extract_function_name},ExecuteFunctionRequest,ExecuteFunctionResponse).fleet/instance/client.py— sync mirror of the above (hand-edited to match; see Note on generation below).fleet/_async/instance/__init__.py/fleet/instance/__init__.py— removedValidatorTypeandExecuteFunctionResponsefrom imports and__all__.fleet/_async/client.py/fleet/client.py— deletedAsyncEnv.verify/verify_raw(and syncEnv.verify/verify_raw) delegating methods; dropped theValidatorTypeandExecuteFunctionResponseimports.fleet/instance/models.py— deleted theExecuteFunctionRequestandExecuteFunctionResponsepydantic models (no other importers).fleet/verifiers/parse.py— deleted. Its only importers were the two instance clients above; confirmed dead via repo-wide grep.examples/json_tasks_example.py— ported offawait env.verify_raw(...)tofleet._async.tasks.verifier_from_string(...).remote_with_response(env); removed the now-unnecessary localextract_function_namehelper.examples/gemini_example.py— same treatment for the sync path (fleet.tasks.verifier_from_string(...).remote_with_response(env)); removed the localextract_function_namehelper and the now-unusedreimport.Migration
Before:
After:
verifier.remote(env)is also available if you just want the numeric score back instead of the fullVerifiersExecuteResponse.verify_rawis also the SDK's in-container code doorAuditing the live callers turned up a use case the verifier API does not cover, so this deserves an explicit call before merge.
verify_rawPOSTs to the instance runner (https://<instance>.<region>.orchestrator.fleetai.com/api/v1/env/execute_verifier_function), so the code runs inside the instance container. The sanctioned replacement —/v1/verifiers/check+/v1/verifiers/executevia@verifier/verifier_from_string(...)— runs the bundle in an orchestrator warm-pool executor pod, not in the instance. For "grade the final state", those are equivalent and the verifier API is strictly better. For "execute this Python inside the instance", they are not.Two of the downstream callers depend on the in-container behaviour, and both are actively maintained:
verify_rawfortheseus-dataminersrc/dataminer/tasks/verify_fleet.py:123,128verify_raw->/execute_verifier_function->localhost:9000". Materializes a submission into/app/workspace/submissionin-container, then calls the on-box verifier.theseus-harvey-labscripts/build_task.py:179env.verify_raw(...)from inside a generated verifier to run upstreamevaluation/scoring.pyextraction in-instance (needs pandoc/pandas/pdfplumber, which the executor pod does not have).The other two callers are low-risk:
theseus-env-toolsfli/src/fli/commands/upgrade.py:215(a sanity-check verifier run — a cleanverifier_from_string(...)swap) andfleet-ai/env-qafullHarness.py:1417(last touched 2025-07-25, effectively dead).This does not block the removal — the runner endpoint itself is untouched, so the in-container door remains fully available; callers just have to hit it directly instead of through a convenience method:
So the options are: (a) merge as-is and let those two repos inline the ~5-line POST, or (b) keep an explicitly-named in-container escape hatch (e.g.
instance.execute_in_container(code, name)) so the capability keeps a supported SDK surface while the misleadingverify_rawname and the dead(before, after, final_answer)signature still go away. This PR implements (a).Runtime-usage evidence (and an observability gap)
Asked whether anything still calls this in prod. Findings:
execute_verifier_function(sampled 24h windows on 2026-07-26→27 and 07-27→28). This is a null result, not proof of zero usage.verify_rawtargets the per-instance subdomain, which is served by the env pod's runner — not by any Logfire-instrumented service. Control:POST /v1/verifiers/executeis captured onorchestrator-public-apiat thousands of spans/day, so the modern path is well instrumented and heavily used./ecs/web-proxy, 7d): 0 hits — also not the serving path. Control:/resources(another instance-level route) is likewise 0 there, while the group is otherwise live, so instance-level traffic never traverses web-proxy."POST /"over 7d was also empty), so the runner's request log is not captured either.Net: runner-endpoint invocations are currently unobservable in our telemetry. Worth fixing independently of this PR — it means we cannot empirically retire any instance-runner endpoint, only reason about it statically.
Known downstream callers (NOT updated in this PR)
fleet-ai/env-qa—fullHarness.py:1417fleet-ai/theseus-env-tools—fli/src/fli/commands/upgrade.py:215fleet-ai/theseus-dataminer—src/dataminer/tasks/verify_fleet.py,tasks/upstream_footprint/verify_registered_task.pyfleet-ai/theseus-harvey-lab—scripts/build_task.pyTest plan
python -c "import fleet; import fleet.client; import fleet._async.client; import fleet.instance; import fleet._async.instance; import fleet.tasks; import fleet.verifiers"succeedspython -m compileall -q fleet examplessucceedspython -m pytest tests/ -q— 741 passed, 11 skipped, 5 failed (same 5 pre-existing failures intests/track/test_mcp_install.pyon baselinemain, unrelated to this change)git diff --statreviewed — only files listed above changed, no unrelated churnNote on sync generation: the sync tree is normally regenerated from
fleet/_async/viamake unasync. Running it in this sandbox produced large unrelated diffs across ~15 files (fleet/judge.py,fleet/models.py,fleet/tasks.py,fleet/resources/sqlite.py, etc.) — confirmed via a clean-checkout run that this drift pre-exists onmainand is unrelated to this change (likely anunasynctool/config version mismatch). Those files were reverted and the sync mirrors (fleet/client.py,fleet/instance/client.py,fleet/instance/__init__.py) were hand-edited to exactly mirror the async edits instead.🤖 Created via sandbox session