Skip to content

feat: [no-ticket] harbor - transfer targets (per-target executor-model override at finalize)#38

Open
shehabyasser-scale wants to merge 1 commit into
harbor-10-crash-visibilityfrom
harbor-11-transfer-targets
Open

feat: [no-ticket] harbor - transfer targets (per-target executor-model override at finalize)#38
shehabyasser-scale wants to merge 1 commit into
harbor-10-crash-visibilityfrom
harbor-11-transfer-targets

Conversation

@shehabyasser-scale

@shehabyasser-scale shehabyasser-scale commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

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

VerificationTarget gains an optional model: 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:

targets:
  - split: test
    reward_key: reward            # home executor
  - split: test
    reward_key: reward_opus       # transfer probe
    model: anthropic/claude-opus-4-8

A champion with a baked-in model coupling then ships reward_opus: 0.0 with the crash cause in target_errors (#37), instead of the coupling surfacing one substrate away, weeks later, in a manual probe.

Design notes

  • The baseline is scored under the same override, so score_baseline comparisons stay like-for-like per target.
  • Plumbing rides task_params["harbor_model_override"] (an existing per-eval passthrough): TargetSpec (build.yaml) → compiler → _TargetCfg (serve.json) → VerificationTargetengine.evaluate_admin(model=...)HarborRunner -m. Mode A ignores the key; the shared run_constraints are copied, never mutated.
  • Selection is untouched: the override applies to finalize targets only, so the optimizer's incentives during the run are unchanged; portability is measured, not optimized against (that would be its own experiment).

Tests

  • Engine: override rides task_params without mutating shared constraints; no-override passes constraints through unchanged.
  • Runner: -m honors the override over the configured model.
  • Verifier: the override reaches BOTH the champion and baseline evals.
  • Build: TargetSpec.model round-trips through the compiler into serve.json and validates.
  • Full affected suites green (153 passed after widening 11 strict-signature test fakes of 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=0 crashing on an executor that rejects it) surface at finalize rather than weeks later in a manual probe.

  • TargetSpec.model / _TargetCfg.model / VerificationTarget.model thread the override from build.yaml through the compiler into serve.json and on to the verifier.
  • engine.evaluate_admin(model=...) creates a shallow model_copy of run_constraints with task_params[\"harbor_model_override\"] set without mutating the shared object; HarborRunner._build_command reads that key and passes it to harbor run -m, taking precedence over the task's configured model.
  • The baseline is scored under the same override so the champion-vs-baseline comparison stays like-for-like; selection is untouched (override applies only at finalize).

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

Filename Overview
vero/src/vero/evaluation/engine.py Adds model param to evaluate_admin; uses Pydantic model_copy to build a per-call task_params dict without mutating the shared run_constraints. Immutability verified by tests.
vero/src/vero/harbor/runner.py Reads harbor_model_override from task_params with fallback to configured model; injects -m flag correctly. Magic string duplicated with engine.py (P2 noted).
vero/src/vero/harbor/verifier.py Passes target.model to both the champion eval and the baseline eval, keeping the comparison like-for-like. Logic is correct and tested.
vero/src/vero/harbor/build/config.py Adds 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).
vero/src/vero/harbor/build/compiler.py One-line addition passes t.model through into the compiled serve.json targets dict. Correct.
vero/src/vero/harbor/serve.py Adds model field to _TargetCfg; model_dump() round-trip into VerificationTarget(**...) 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
Loading
%%{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 override
Loading

Reviews (2): Last reviewed commit: "feat(harbor): transfer targets: per-targ..." | Re-trigger Greptile

… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant