Skip to content

Add Harbor mode: run SIA self-improvement on external benchmarks#21

Open
prannayHexo wants to merge 1 commit into
mainfrom
harbor-mode
Open

Add Harbor mode: run SIA self-improvement on external benchmarks#21
prannayHexo wants to merge 1 commit into
mainfrom
harbor-mode

Conversation

@prannayHexo

Copy link
Copy Markdown
Collaborator

Supersedes #20 (closed; could not be reopened after a force-push). Same change, with reference_harbor_agent.py restyled to the terse/no-comment house rules.

What

Opt-in Harbor mode: SIA self-improves against external benchmarks from the Harbor registry (Terminal-Bench, SWE-Bench, AIME, …), scored by Harbor's own verifiers. Each generation's target_agent.py runs inside each task's Docker container; per-task rewards + trajectories feed the existing feedback loop.

How

  • sia/harbor_agent.pySIATargetAgent(BaseAgent): uploads the agent into each container, runs it (--working_dir / --instruction_file / --log_dir), downloads the trajectory, verifier scores.
  • sia/harbor_runner.py — drives the harbor CLI as a subprocess; parses result.jsonresults.json + per-task trajectories.
  • sia/tasks/_shared/reference_harbor_agent.py — in-container reference template.
  • Wiring: flags in cli.py, snapshot-safe injected prompt block in prompts.py (base prompts untouched), harbor task-files + venv skip in run_setup.py, routing in orchestrator.py.

Usage

uv tool install harbor && harbor auth login
pip install 'sia-agent[claude,harbor]'
sia run --harbor_dataset terminal-bench-sample@2.0 --max_gen 3 --run_id 1

Validation

Four full --max_gen 2 runs (hello-world, log-summary, the real harbor download registry path, and a CWE fix-code-vulnerability task), each adversarially verified on disk — all scored a verifier-adjudicated 1.0 with the correct in-container contract. Regression: 124 passed / 0 failed, ruff clean, golden prompt snapshots intact.

See docs/harbor.md.

Opt-in via --harbor_dataset / --harbor_task_dir. Each generation's target_agent.py
is run inside the benchmark's Docker containers and scored by Harbor's native
verifiers; per-task rewards + trajectories feed the existing feedback loop. Local
behavior and the golden-master prompts are unchanged (Harbor text is injected only
when the flag is set).

- sia/harbor_agent.py: BaseAgent adapter that runs the generated agent in-container
- sia/harbor_runner.py: drives the harbor CLI, folds results into results.json + trajectories
- sia/tasks/_shared/reference_harbor_agent.py: in-container reference template
- cli/prompts/run_setup/layout/orchestrator: flags, prompt injection, routing
- docs/harbor.md, README, pyproject [harbor] extra, tests
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