Repository navigation
Conversation
…or verifiers At the semantic level, the first oracle trial now runs its separate verifier three times on the artifacts Harbor collected once. Each call starts a fresh verifier environment, so every call grades the same final state. Once the oracle replay agrees, the check passes when the three reward maps are equal as exact rationals, and fails with each call's rewards otherwise. Harbor's own call runs last, so the replay comparison, reward parsing and teardown checks still read a single call. Every extra call's reward goes through the same contract check, and its raw files are kept under harbor-trials/oracle/verifier-call-N/. A verifier timeout on an extra call fails the package, as it does on Harbor's own call. The check is a named SKIP when Harbor's artifact record misses a verifier input, using Harbor's regrade coverage check, which includes the implicit artifact directory. It is also a named SKIP for shared verifiers: Harbor stops the agent container right after verification, so no second call sees the same final state. Any other failed extra call is an ERROR. Refs openenv#1775
|
The docs for this pull request built successfully. A maintainer can publish a preview of this commit by adding the |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 55c49f3. Configure here.
| # A final call that fails early must not inherit these. | ||
| path.unlink(missing_ok=True) | ||
| except Exception as exc: | ||
| outcome["failure"] = type(exc).__name__ |
There was a problem hiding this comment.
Reward cleanup masks verifier timeout
Medium Severity
In verify_repeatedly, the finally block reads and unlinks reward files before the outer except records the failure. If verify() raises VerifierTimeoutError and _read_output or unlink then raises, only the cleanup exception is stored. The later scan looks for VerifierTimeoutError, so the timeout never fails runtime.startup.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 55c49f3. Configure here.
| raise NativeEvidenceError( | ||
| f"Harbor subject failed during verifier call {call} " | ||
| "(VerifierTimeoutError)" | ||
| ) |
There was a problem hiding this comment.
Later verifier error hides timeout
Medium Severity
Extra verifier calls swallow exceptions and keep going, while a VerifierTimeoutError is applied only after trial.run() returns with no exception_info. If a later call, including Harbor's own call, raises, that result is handled first and the earlier timeout is never read. A timed-out extra call can then show up as a reward failure with runtime.startup still passing.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 55c49f3. Configure here.


Summary
openenv validate <task> --sandbox hf-sandboxnow gradessemantic.verifier_determinism(#778 test 39) for Harbor tasks with a separate verifier. Onmainthis check is a SKIP for every Harbor task: "not implemented for the harbor_task binding". Closes #1775, following the design proposed there.How it works
At the semantic level, the oracle trial now runs its verifier three times. Harbor collects the agent's artifacts once, and each call uploads that same copy into a fresh verifier job. So all three calls grade the same final state. Once
runtime.episode_determinismpasses, the check passes if the three reward maps are equal as exact rationals. Otherwise it fails, andmeasuredlists each call's rewards._run_verifier, the way it already overrides other Trial internals. The two extra calls run first and Harbor's own call runs last. The trial's result comes from Harbor's own call, so the replay comparison, reward parsing and teardown checks are unchanged._reward. A malformed extra reward, including an empty file or a numeric JSON scalar, failsruntime.reward_well_formed. With--output report.json, each extra call's availablereward.jsonandreward.txtare saved underreport.artifacts/harbor-trials/oracle/verifier-call-N/, with SHA-256 hashes inharbor-evidence.json.RegradeTrial._artifact_coverage_problems. It also covers/logs/artifacts, which Harbor collects even when the task doesn't declare it. If Harbor's record does not cover a declared artifact or the implicit/logs/artifactsdirectory, the binding omits the extra calls. When episode determinism passes, the check is then a SKIP withartifact_problemsinmeasured.runtime.startupand names the verifier phase, as on Harbor's own call. If episode determinism passes, an extra-call infrastructure failure such as a verifier job failing to start givessemantic.verifier_determinisman ERROR.Shared verifiers get a named SKIP: "a shared verifier runs in the agent container, which Harbor stops after one verification". I propose the shared-verifier SKIP in #1775 because the first call can consume or change an input. A second call in the same container can then give a different reward, even for a deterministic verifier. Local Docker accepts only shared verifiers, so the check never grades there.
Each graded task adds two verifier jobs. In the live run, the three oracle verifier jobs on
cpu-basicstarted 8.7 and 9.5 seconds apart.This ties the binding to a Harbor internal.
_artifact_coverage_problemsis a private method ofRegradeTrial, and the binding calls it with the trial asself. It only readsagent_env_pathsandlogger, which the trial also has. Harbor task validation already refuses any Harbor other than 0.25.0 (parsers/harbor_toml.py).Type of Change
Alignment Checklist
Before submitting, verify:
.claude/docs/PRINCIPLES.mdand this PR aligns with our principles.claude/docs/INVARIANTS.mdand no invariants are violated/pre-submit-pr(orbash .claude/hooks/lint.shand tests) and addressed all issuesRFC Status
The RFC 008 Harbor table,
docs/source/reference/cli.mdand the completion plan now describe the check.Test Plan
test_harbor_validation.py. 17 of them fail againstmain'ssrc/. The 18th checks that a runtime-level run still makes one verifier call per trial. That already holds onmain, so it guards against a regression. They cover:{"reward":2}, an empty file or the JSON scalar0.reward_well_formedfails. Episode determinism and this check are SKIPs. The raw file is kept.runtime.startupfails and names the verifier phase._run_verifierand writes an artifact manifest. So the wrapper and Harbor's coverage check run as they do in a real trial.ValidationErrorfor a JSON scalar reward, as Harbor'sVerifierResultdoes.tests/test_validation: 2037 passed, 66 skipped.bash .claude/hooks/lint.shpasses.cpu-basic) with a private task: separate verifier, a/appdirectory artifact and a digest-pinned publicpython:3.12-slimimage. The do-nothing trial scored 0, and the oracle and its replay scored 1.semantic.verifier_determinismpassed with three{"reward": 1.0}calls. Eight labelled jobs ran: one agent job per trial, one verifier job each for the do-nothing and replay trials, and three for the oracle. Every job ended CANCELED, and cleanup was verified. Verdict WARN, the normal passing result for this binding.Claude Code Review
/alignment-reviewreport:lint.sh).check-debug.shlists existing prints inproviders/_pidns.pyand two TODOs, all outside this diff.semantic.verifier_determinismfor Harbor tasks #1775.Note
Medium Risk
Changes Harbor trial orchestration and depends on Harbor private regrade APIs; scope is limited to hf-sandbox separate-verifier semantic validation with broad new test coverage.
Overview
Harbor validation (
--sandbox hf-sandbox, semantic level) now gradessemantic.verifier_determinism(#778 test #39) instead of always SKIPing it. For tasks with a separate verifier, the first oracle trial grades the same collected artifacts three times in fresh verifier jobs; the check passes when all three reward maps match as exact rationals and still depends onruntime.episode_determinism.The binding wraps the oracle trial’s
_run_verifier: it runs Harbor’s artifact coverage check first, performs two extra verifier calls (then Harbor’s final call), records per-call rewards inOracleEvidence.verifier_rewards/harbor-evidence.json, and wires a newVerifierDeterminismGrader. Shared verifiers and local Docker get a named SKIP; incomplete artifact manifests SKIP withartifact_problems; verifier infra failures on extra calls surface as ERROR orruntime.startupFAIL. Docs (RFC 008, CLI, completion plan) are updated to match.Reviewed by Cursor Bugbot for commit 55c49f3. Bugbot is set up for automated code reviews on this repo. Configure here.