feat: [no-ticket] harbor - transfer targets (per-target executor-model override at finalize)#38
Open
shehabyasser-scale wants to merge 1 commit into
Open
Conversation
… finalize Home-model evals cannot see model-specific couplings the optimizer bakes in. Measured live in the wave-1 transfer matrix: three of five champions independently hardcoded temperature=0 (a variance trick on their home model, gpt-4.1-mini) and scored 0/72 on claude-opus-4-8, which rejects it, while looking healthy on every eval the optimization loop ever ran. The portability failure was invisible until a separate, manual, after-the-fact probe. VerificationTarget gains `model`: a target with an executor override scores the selected commit under a model it was NOT optimized on, in the same finalize battery as its home-model reward. The baseline is scored under the same override so the comparison stays like-for-like. Plumbing: build.yaml TargetSpec -> compiler -> serve.json _TargetCfg -> VerificationTarget -> engine.evaluate_admin(model=...) -> task_params ["harbor_model_override"] -> HarborRunner -m flag. The override rides task_params, so Mode A ignores it and the runner needs no new state; the shared run_constraints are copied, never mutated. Test fakes of evaluate_admin widened to accept the new kwarg (a strict signature turned the new call into a retried TypeError, flooring rewards, which is itself a nice demonstration of the floor's fail-safe). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
256ffbf to
de76acf
Compare
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.
Stacked on #37. Together they are the response to the wave-1 transfer-matrix finding: three of five champions independently hardcoded
temperature=0(a variance-reduction trick on their home model) and scored 0/72 on claude-opus-4-8, which rejects that parameter, while looking healthy on every eval the optimization loop ever ran. #37 makes such a crash legible after the fact; this PR makes it measurable DURING every run.What it does
VerificationTargetgains an optionalmodel: a finalize target with an executor override scores the selected commit under a model it was not optimized on, alongside its home-model reward in the same reward.json:A champion with a baked-in model coupling then ships
reward_opus: 0.0with the crash cause intarget_errors(#37), instead of the coupling surfacing one substrate away, weeks later, in a manual probe.Design notes
score_baselinecomparisons stay like-for-like per target.task_params["harbor_model_override"](an existing per-eval passthrough):TargetSpec(build.yaml) → compiler →_TargetCfg(serve.json) →VerificationTarget→engine.evaluate_admin(model=...)→HarborRunner-m. Mode A ignores the key; the sharedrun_constraintsare copied, never mutated.Tests
task_paramswithout mutating shared constraints; no-override passes constraints through unchanged.-mhonors the override over the configured model.TargetSpec.modelround-trips through the compiler into serve.json and validates.evaluate_admin).🤖 Generated with Claude Code
Greptile Summary
This PR adds per-target executor-model overrides to the Harbor verifier's finalize phase, enabling "transfer probes" — scoring the selected champion under a model it was not optimized on, so model-specific couplings (e.g. hardcoded
temperature=0crashing on an executor that rejects it) surface at finalize rather than weeks later in a manual probe.TargetSpec.model/_TargetCfg.model/VerificationTarget.modelthread the override frombuild.yamlthrough the compiler intoserve.jsonand on to the verifier.engine.evaluate_admin(model=...)creates a shallowmodel_copyofrun_constraintswithtask_params[\"harbor_model_override\"]set without mutating the shared object;HarborRunner._build_commandreads that key and passes it toharbor run -m, taking precedence over the task's configured model.Confidence Score: 5/5
Safe to merge — the override only activates at finalize, selection incentives are unchanged, shared run_constraints are never mutated, and the baseline receives the same override keeping comparisons like-for-like.
The core data flow is simple and well-tested: four targeted tests cover the engine immutability guarantee, the runner precedence logic, the verifier both-sides override, and the compile-to-serve.json round-trip. No existing eval paths are modified; the change is purely additive and opt-in via a nullable field.
vero/src/vero/harbor/build/config.py — TargetSpec.model is accepted by Mode A without a load-time guard, which could silently produce a do-nothing transfer-probe column for Mode A tasks.
Important Files Changed
modelparam toevaluate_admin; uses Pydanticmodel_copyto build a per-calltask_paramsdict without mutating the sharedrun_constraints. Immutability verified by tests.harbor_model_overridefromtask_paramswith fallback to configured model; injects-mflag correctly. Magic string duplicated withengine.py(P2 noted).target.modelto both the champion eval and the baseline eval, keeping the comparison like-for-like. Logic is correct and tested.TargetSpec.model; shared by Mode A and Mode B, but Mode A silently ignores it. No load-time guard to catch Mode A misconfiguration (P2 noted).t.modelthrough into the compiled serve.json targets dict. Correct.modelfield to_TargetCfg;model_dump()round-trip intoVerificationTarget(**...)correctly propagates the field to the verifier.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant BC as build.yaml (TargetSpec.model) participant Compiler participant SJ as serve.json (_TargetCfg.model) participant V as Verifier participant EE as EvaluationEngine participant HR as HarborRunner BC->>Compiler: compile_task() Compiler->>SJ: writes model field per target SJ->>V: "load_serve_config to VerificationTarget(model=...)" V->>EE: "evaluate_admin(model=...)" Note over EE: model_copy(run_constraints)<br/>+ task_params[harbor_model_override] EE->>HR: evaluate(params with harbor_model_override) HR->>HR: task_params[harbor_model_override] or c.model HR-->>HR: harbor run -m override-model Note over V: baseline scored under same override%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant BC as build.yaml (TargetSpec.model) participant Compiler participant SJ as serve.json (_TargetCfg.model) participant V as Verifier participant EE as EvaluationEngine participant HR as HarborRunner BC->>Compiler: compile_task() Compiler->>SJ: writes model field per target SJ->>V: "load_serve_config to VerificationTarget(model=...)" V->>EE: "evaluate_admin(model=...)" Note over EE: model_copy(run_constraints)<br/>+ task_params[harbor_model_override] EE->>HR: evaluate(params with harbor_model_override) HR->>HR: task_params[harbor_model_override] or c.model HR-->>HR: harbor run -m override-model Note over V: baseline scored under same overrideReviews (2): Last reviewed commit: "feat(harbor): transfer targets: per-targ..." | Re-trigger Greptile