The configuration chooses the experiment

Both modes select the same task revision and restricted-v1 policy. The agent implementation and provider interface differ.

Taskterminal-bench/db-wal-recovery
Task revisionsha256:07e9193513bfce038b9f9d84962ecc85683eee0a642d14ee6fb7104b086ddab4
Agent classharbor_adapter:NanoPyCodeAgent
Modeldeepseek/deepseek-flash
CredentialsANTHROPIC_API_KEY
Model endpointhttps://api.deepseek.com/anthropic
Network policyrestricted-v1 / api.deepseek.com

Run the phases in this order

Keep the same Bash session so HARBOR_CONFIG and HARBOR_RUN remain set. The preparation and preflight job names have suffixes so the real run can create fresh output directories.

  1. Check the host

    Enter this checkout, confirm that uv and the Docker daemon are available, then install the benchmark project’s locked dependencies. Python 3.13 or later is required.

    Bash / host
    cd /mnt/ubuntu/home/omarchy_data/nanoPyCodeAgent-work-20261108
    uv --version
    docker info
    uv sync --project benchmarks/harbor --locked
    Change the cd path if your checkout is elsewhere. --locked requires an up-to-date lockfile without rewriting it. The Docker daemon must be accessible to this user; this phase does not call a model.
  2. Set credentials and select the agent

    Read the API key without putting it in the command text. Select a config and create a timestamped run name.

    Bash / host
    printf 'DeepSeek API key: '
    read -r -s ANTHROPIC_API_KEY
    printf '\n'
    export ANTHROPIC_API_KEY
    export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
    unset ANTHROPIC_MODEL
    export HARBOR_CONFIG="benchmarks/harbor/configs/restricted-wal.json"
    export HARBOR_RUN="wal-nano-$(date -u +%Y%m%dT%H%M%SZ)-$$"

    ANTHROPIC_BASE_URL must match the allowlisted inference host. The model comes from agents[].model_name; unsetting ANTHROPIC_MODEL prevents an inherited override.

    Credentials stay in the environment. The page never asks for, stores, or sends your key.
  3. Prepare the recorded inputs

    Build and record the run inputs. For Nano, build the local wheel and compare its Python files with the recorded source snapshot. For Pi, verify and snapshot the pinned distribution and public model config.

    Bash / host
    uv run --project benchmarks/harbor python -m harbor_adapter run \
      --config "$HARBOR_CONFIG" \
      --job-name "${HARBOR_RUN}-prepare" \
      --prepare-only
    --prepare-only does not start containers, call the model, or execute the official verifier. This phase is optional but useful when checking adaptation work.
  4. Check installation and isolation

    Exercise setup in a task container: install the agent, run a registered dependency profile if present, and verify the positive, negative, and allowed-host network controls.

    Bash / host
    uv run --project benchmarks/harbor python -m harbor_adapter run \
      --config "$HARBOR_CONFIG" \
      --job-name "${HARBOR_RUN}-preflight" \
      --install-only
    --install-only performs no model work or official tests. WAL has no registered verifier dependency profile: report not_configured, not passed. A full run repeats setup in a fresh container.
  5. Run the agent and official verifier

    Create a fresh trial, install the selected agent, deliver the task, restrict model-phase networking, wait for the agent boundary, then run the official verifier.

    Bash / host
    uv run --project benchmarks/harbor python -m harbor_adapter run \
      --config "$HARBOR_CONFIG" \
      --job-name "$HARBOR_RUN"
    This command calls the model. It does not resume the prepare-only or install-only trial. Only verifier timeouts may retry: at most three total attempts on the same submitted output, with the original per-attempt deadline.
    Inside this phase: Harbor, the agent, and the official verifier

    The full-run command starts one complete Harbor trial. The host orchestrates the run; the task container holds the inputs and agent; the official test script checks the submitted files after the agent boundary is confirmed.

    Host orchestrationAgent work in the task containerOfficial tests and host accounting
    1. Host

      Start Harbor with the recorded inputs

      The repository wrapper sets PYTHONPATH to jobs/<name>-input/source, then starts Harbor using the normalized, recorded config. Harbor uses that config to schedule the selected task and adapter.

      Start the standard workflow · Bash / host
      uv run --project benchmarks/harbor python -m harbor_adapter run \
        --config "$HARBOR_CONFIG" \
        --job-name "$HARBOR_RUN"

      Run this from the repository root after selecting the config and credentials above. The wrapper records inputs and launches Harbor; this is the supported full-run entry point and calls the model after setup passes. Use a fresh HARBOR_RUN.

      __main__.py:342__main__.py:255
      Build the recorded Nano wheel · Bash / host · wrapper-generated
      uv build --wheel --out-dir "jobs/${HARBOR_RUN}-input/dist"

      The wrapper runs this only for Nano, then compares every Python file in the wheel against the recorded source snapshot. Pi instead snapshots and verifies its pinned distribution. This build is already included in the full-run command.

      __main__.py:255
      Hand off to Harbor · Bash / host · core generated command
      PYTHONPATH="jobs/${HARBOR_RUN}-input/source" \
        harbor run --config "jobs/${HARBOR_RUN}-input/config.json" --yes \
        > "jobs/${HARBOR_RUN}-input/harbor.log" 2>&1

      The wrapper supplies an absolute PYTHONPATH and the Python environment’s executable directory in PATH. This relative-path form assumes the repository root. The config has already been normalized and recorded; stdout and stderr go to harbor.log. This is the internal launch inside the full run, not another command to run afterward.

      __main__.py:310
      __main__.py:310
    2. Host dispatches work into the task container

      Create the environment, install the agent, and pass preflight

      Harbor creates the task environment with the supplied /app/main.db and /app/main.db-wal. The adapter installs system dependencies and the selected agent, runs a registered dependency profile if one exists, and checks the network controls before model work.

      Setup or isolation-preflight failure stops this path before any model call. WAL has no registered verifier dependency profile, so that field stays not_configured even when agent installation and network preflight pass.

      Run this stage on its own · Bash / host
      uv run --project benchmarks/harbor python -m harbor_adapter run \
        --config "$HARBOR_CONFIG" \
        --job-name "${HARBOR_RUN}-preflight" \
        --install-only

      Use the config, credentials, and run name set above, with a fresh preflight job name. This creates a separate trial, installs the selected agent, runs setup checks, then exits before model work or official tests. The full run repeats setup in a new environment.

      Create the environment · Bash / host · generated command shape
      docker compose <generated-compose-options> build
      docker compose <generated-compose-options> down --remove-orphans
      docker compose <generated-compose-options> up --detach --wait

      Harbor 0.21.0 generates the Compose options: --project-name, --project-directory, and repeated -f paths for the task, runtime, egress sidecar, and hardening overlays. The angle-bracket text is a runtime placeholder. build runs only when a prebuilt task image is not selected; down removes stale containers before up starts the task and sidecars. Harbor also prepares the egress sidecar image. The task image supplies the database files; these commands do not replace that image or its inputs.

      adapter.py:120
      Install system dependencies · Bash / task container / root · APT path
      export DEBIAN_FRONTEND=noninteractive
      apt-get update
      apt-get -o Acquire::ForceHash=sha256 --print-uris \
        -y --download-only install curl bash git python3 ca-certificates
      apt-get -y --download-only install curl bash git python3 ca-certificates
      apt-get install -y curl bash git python3 ca-certificates

      Nano and Pi share these dependencies. Between the index plan and download, the adapter restores only cached packages matching the current index filename, size, and SHA256, then verifies and saves newly downloaded packages before installation. These shell lines show the package commands; the cache transfers and validation remain in AptCache.install(). Other package managers use Harbor’s dependency installer.

      adapter.py:214bootstrap.py:84
      Install Nano · Bash / task container / agent user
      set -euo pipefail
      if ! command -v uv >/dev/null 2>&1; then
        curl -LsSf https://astral.sh/uv/0.9.11/install.sh | sh
      fi
      export PATH="$HOME/.local/bin:$PATH"
      uv tool install --force /tmp/<recorded-wheel-filename>.whl
      nanoPyCodeAgent --version

      For this repository workflow, the adapter uploads the wheel built from the recorded working tree to /tmp before running this command. Replace the wheel placeholder with that recorded filename when reading the invocation. Pi uses the next path instead of installing Nano.

      adapter.py:194
      Install and check Pi · Bash / task container
      chmod 755 /opt/harbor-pi/pi
      /opt/harbor-pi/pi --version
      mkdir -p /tmp/harbor-pi-agent
      # The adapter uploads models.json before this command.
      PI_CODING_AGENT_DIR=/tmp/harbor-pi-agent \
        DEEPSEEK_API_KEY=preflight-only \
        /opt/harbor-pi/pi --offline --list-models deepseek-flash

      First, the host checks the pinned distribution hash and uploads it to /opt/harbor-pi. chmod runs as root; version, directory, and model-list checks run as the agent user. The adapter uploads the public models.json and runs a process-supervision probe using true. It checks the installed version and requires the requested provider/model in the listing; diagnostics or a missing model fail setup. preflight-only is a dummy key for local registration checks, with no inference request.

      pi.py:103
      Check isolation · Python / host · core calls inside integrity_preflight()
      before = await self._probe("https://example.com/")
      await self.set_network_policy(self.integrity_policy.network())
      after = await self._probe("https://example.com/")
      allowed = await self._probe("https://api.deepseek.com/")
      await self._network_snapshot("network-preflight")

      For the WAL config, the first example.com probe must be reachable, the second must be blocked after applying restricted-v1, and api.deepseek.com must remain reachable. A DNS resolution failure cannot prove HTTPS blocking. The source checks these results and records the external network policy and rules; any failure stops setup.

      integrity_environment.py:239
      Probe HTTPS · Bash / task container / root · generated command shape
      python3 -I -c '<embedded _PROBE Python source>' https://example.com/
      python3 -I -c '<embedded _PROBE Python source>' https://api.deepseek.com/

      Each _probe() executes the embedded Python program with its URL in the task container. The placeholder represents the actual _PROBE source, which uses urllib without a proxy or redirects and returns JSON with reachable and error types. An HTTP error response still proves reachability. These probes do not invoke a model.

      integrity_environment.py:210
      adapter.py:120integrity_environment.py:239
    3. Adapter on host → agent CLI in the container

      Translate the task into the selected agent’s native command

      The adapter receives instruction, environment, and context from Harbor. Nano receives the instruction through stdin; Pi receives it as a quoted argument in print/JSON mode. The adapter forwards model settings and credentials, selects log paths, and wraps execution with process supervision under restricted-v1.

      The calls below show the core interface. The real code also supplies budgets, environment variables, shell quoting, supervision, and log handling. You do not type these container commands yourself.

      Start Nano · Bash / task container / agent user · core generated command
      set -euo pipefail
      export PATH="$HOME/.local/bin:$PATH"
      printf "%s" "$instruction" | nanoPyCodeAgent --max-turns 50 \
        --trajectory /logs/agent/trajectory.json \
        2>&1 | tee /logs/agent/nanopycodeagent.txt

      For the shown Nano config, --max-turns defaults to 50. The adapter forwards ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL, and ANTHROPIC_MODEL in the environment. Here $instruction simplifies the real temporary-variable transfer and already includes the shared integrity rules. Configured flags and process supervision are applied by the adapter.

      adapter.py:278adapter.py:303
      Start Pi · Bash / task container / agent user · core generated command
      set -euo pipefail
      /opt/harbor-pi/pi --print --mode json --offline \
        --provider deepseek --model deepseek-flash --thinking high \
        --session-dir /logs/agent/pi/sessions -- "$instruction" \
        </dev/null 2>/logs/agent/pi-stderr.txt | \
        python3 -I -u -c '<embedded event_filter source>' | \
        tee /logs/agent/pi.txt

      The shown pinned Pi config selects --thinking high. PI_CODING_AGENT_DIR=/tmp/harbor-pi-agent and DEEPSEEK_API_KEY are supplied through the execution environment. The embedded event filter drops only message_update streaming deltas; the retained events are written to pi.txt and native sessions to pi/sessions. The adapter also checks settled/stop status after the process finishes.

      pi.py:138
      adapter.py:278pi.py:138
    4. Agent tools in /app ↔ model API

      Repeat the model and tool exchange

      The agent sends the task and accumulated observations to the model. The model selects a tool action; the agent executes it and returns the result for the next exchange. This continues until the agent finishes or reaches its execution limits.

      In the recorded WAL example, those actions inspect bytes with xxd, decode the XOR-encoded WAL in Python, query SQLite, and write /app/recovered.json. The adapter contains no prewritten solution to this task.

      Model selects an actionAgent executes the toolOutput returns to the modelNext exchange
      Request a model reply · Python / Nano process in the task container · reduced excerpt
      with client.messages.stream(
          model=model,
          max_tokens=max_tokens,
          system=system,
          tools=TOOLS,
          messages=messages,
      ) as stream:
          for event in stream:
              ...  # Emit streaming events; see the full source.
          message = stream.get_final_message()

      This is an SDK call inside the agent, with no separate shell command for each model turn. The full source also enforces wall-clock limits, records streaming events and usage, and handles failures. Pi uses its own native model loop.

      agent.py:692
      Execute tools and return observations · Python / Nano process · reduced excerpt
      result = _run_one_tool(
          block, emitter, model_call_id,
          input_error=input_errors.get(block.id),
          remaining_seconds=remaining,
      )
      results.append(result)
      messages.append({"role": "user", "content": results})

      The first two lines of logic run for each tool_use block; the final append happens after the tool results are collected. _run_one_tool() dispatches read/write/edit/bash. It returns content, tool_use_id, and is_error for the next model exchange. The full loop validates inputs, checks budgets and stop reasons, and rejects incomplete responses before running tools.

      agent.py:384agent.py:858
      A command selected by the model · Bash / recorded Pi task container
      cd /app && xxd main.db-wal | head -80

      This is the actual WAL-byte inspection from the recorded Pi run, not a fixed adapter setup command: call_01_ET_wRCY0ozJkp4bzDx92qsQ9904, 2026-11-04T15:22:21.635Z. The next exchanges decoded the WAL, queried SQLite, and wrote recovered.json. Read every original command and its output in the linked task replay; this guide does not execute them.

      Open the complete recorded tool calls

      cli.py:92agent.py:992integrity.py:82
    5. Process supervisor and verifier boundary

      Confirm how the agent ended

      The supervisor records execution status in /logs/agent/process-supervision.json. Before grading, check_agent_quiescence() accepts a completed record or confirmed stopped processes after cancellation/error. A missing or invalid boundary raises an error rather than silently grading the submission.

      On successful completion, the supervisor can leave an intentional background service running for tasks that require one. It does not unconditionally kill every process. Timeout and cancellation paths must confirm cleanup.

      Run under supervision · Bash / task container / agent user · generated command shape
      python3 -I -c '<embedded _agent_runner.py source>' run \
        /tmp/nanopy-agent-<uuid>.json \
        /logs/agent/process-supervision.json \
        '<generated agent shell command>'

      The adapter embeds _agent_runner.py through python3 -I -c rather than assuming that file exists in the container. The final argument is the single, shell-quoted Nano or Pi command from the preceding step. Nano uses /tmp/nanopy-agent-<uuid>.json; Pi uses /tmp/harbor-pi-<uuid>.json. Angle brackets stand for generated source, paths, and command text. The supervisor starts bash -c in a new session and writes the execution record.

      adapter.py:303pi.py:138_agent_runner.py:83
      Cancel after timeout or interruption · Bash / task container / root · generated command shape
      python3 -I -c '<embedded _agent_runner.py source>' cancel \
        /tmp/nanopy-agent-<same-uuid>.json \
        /logs/agent/process-supervision.json

      This is the cleanup path, not the next command after a normal completion. Use the same control path as the run invocation, including Pi’s different prefix. The supervisor stops descendants on cancellation and confirms the result; the host rejects unconfirmed cleanup. A successful run may intentionally leave a service running.

      adapter.py:303_agent_runner.py:127
      Inspect the retained boundary · Bash / host · read-only
      python3 -m json.tool \
        "jobs/${HARBOR_RUN}/<trial>/agent/process-supervision.json"

      After logs are collected, replace <trial> with the actual Harbor trial directory. The verifier checks this record with check_agent_quiescence(); merely printing it does not establish a valid boundary. A completed record needs an integer return_code; cancelled/error_stopped needs processes_stopped=true. Missing or invalid records raise an error.

      verifier.py:31
      _agent_runner.py:83verifier.py:31
    6. Official task verifier

      Check the submitted files, with timeout-only recovery

      RetryingVerifier.verify() checks the agent boundary, calls prepare_verification(), then delegates to Harbor’s original verification flow and the task’s original test script. For the current shared-verifier path, network evidence is recorded before the task’s native network is restored for official dependencies. Tasks already using separate verifiers retain that mode.

      For WAL, the official tests inspect the recovered JSON and repaired WAL. The agent’s final chat answer does not replace those file checks. Only verifier timeouts may retry under the standard policy: at most three total attempts with the same agent submission and the original per-attempt deadline. The agent is not run again.

      Check the boundary and prepare verification · Python / host · core lifecycle calls
      check_agent_quiescence(
          self.trial_paths.agent_dir,
          required=self._require_agent_quiescence,
      )
      await self.environment.prepare_verification()

      RetryingVerifier performs these calls before delegating to Harbor. In the current shared environment, prepare_verification() records network evidence, clears stale canonical reward files, and restores the task’s original network policy for official dependencies. The full method also validates the outer timeout and installs the retry wrapper. These are lifecycle excerpts, not a standalone verifier entry point.

      verifier.py:146integrity_environment.py:323
      Run the original official script · Bash / verifier environment · Harbor-generated
      chmod +x /tests/test.sh
      (/tests/test.sh) > /logs/verifier/test-stdout.txt 2>&1

      For this Linux WAL task, Harbor uploads the original tests to /tests and marks test.sh executable as root. The second line runs as the effective verifier user; under the standard integration it is intercepted by the timeout runner shown next. Preserve the script and test inputs. Its own dependency and pytest commands remain those supplied by the task; this page does not substitute a hand-written test.

      verifier.py:146_verifier_runner.py:134
      Apply timeout-only attempts · Bash / verifier environment · generated command shape
      python3 -c '<embedded _verifier_runner.py source>' \
        '(/tests/test.sh) > /logs/verifier/test-stdout.txt 2>&1' \
        <task-timeout-seconds> 3 0 0 /logs/verifier \
        /tmp/nanopy-verifier-<uuid>.pid

      The arguments are the embedded runner, original shell command, original per-attempt timeout in seconds, at most 3 attempts, dependency-error retry flag 0, collection-error retry flag 0, log directory, and generated control path. Only timeouts may retry under this standard config. Each attempt uses the same agent output; logs remain under attempts/ and retry-summary.json. This invocation wraps the official script rather than adding another independent verification run.

      verifier.py:74_verifier_runner.py:134
      verifier.py:146integrity_environment.py:323_verifier_runner.py:134
    7. Host after Harbor finishes

      Collect raw results, then freeze and review the evidence

      Harbor retains rewards, test output, trajectories, and exceptions. The wrapper writes summary.json; after a completed restricted run it freezes output hashes and creates the candidate audit.

      Raw reward and integrity-reviewed effective score remain separate. Pending reviews have no effective score. Setup and verifier errors remain unscored, while a valid score of zero can still be a completed benchmark result.

      Summarize and automatically freeze/scan · Python / host · reduced wrapper excerpt
      summary = summarize(job_dir, install_only=config.install_only)
      summary["harbor_exit_code"] = code
      (record / "summary.json").write_text(json.dumps(summary, indent=2) + "\n")
      # After a completed restricted run with job result.json:
      audit = audit_job(job_dir, record / "audit")

      These calls already run after Harbor exits. The summary is written in a finally block; automatic audit runs only for a completed restricted full run with job result.json, not prepare-only or install-only. The wrapper then adds the audit accounting to summary.json. Existing native rewards and errors are retained.

      __main__.py:325audit.py:178
      Read the retained results · Bash / host
      python3 -m json.tool "jobs/${HARBOR_RUN}-input/summary.json"
      python3 -m json.tool "jobs/${HARBOR_RUN}-input/audit/audit.json"

      The summary reports raw rewards, setup/verifier status, and attempts. audit.json contains candidate findings and review accounting. No eligible reviewed score is published while reviews remain pending; violations stay in the denominator as effective zeroes.

      __main__.py:325audit.py:178
      Run the freeze/scan explicitly · Bash / host · optional post-run inspection
      uv run --project benchmarks/harbor python -m harbor_adapter audit \
        --job-dir "jobs/$HARBOR_RUN" \
        --output-dir "jobs/${HARBOR_RUN}-input/audit"

      The full restricted run normally does this automatically. This separate command uses the completed job as evidence and writes the audit outside that frozen directory. It does not call the model or rerun the official verifier; candidate flags still require evidence review.

      audit.py:178
      Record an evidence-bound review · Bash / host · after preparing review.json
      uv run --project benchmarks/harbor python -m harbor_adapter audit \
        --job-dir "jobs/$HARBOR_RUN" \
        --output-dir "jobs/${HARBOR_RUN}-input/audit" \
        --review /path/to/review.json

      First inspect the frozen evidence and create review.json with the actual trial ids and evidence paths bound to freeze.json’s SHA256. Replace /path/to/review.json with that file. The command validates the binding and retains the reviewed revision under its review hash; it does not invent a verdict or overwrite native rewards.

      audit.py:178
      __main__.py:310audit.py:178
  6. Read results and the audit

    Read the wrapper’s summary and the automatic freeze/audit produced after a completed restricted run.

    Bash / host
    python3 -m json.tool "jobs/${HARBOR_RUN}-input/summary.json"
    python3 -m json.tool "jobs/${HARBOR_RUN}-input/audit/audit.json"
    A score of zero can be a completed, valid result. Setup and verifier exceptions remain unscored. A candidate scan does not assign an integrity-cleared score.

Which work actually happens?

PhaseRecord inputsContainer setupModel callsOfficial tests
--prepare-onlyYesNoNoNo
--install-onlyYesYesNoNo
Full runYesYesYesYes

Follow the command through the source

Select a node to see the real function, file, and a source excerpt. Line numbers and links are pinned to the snapshot shown below.

Source inspector

The project entry point

argparse registers run, audit, --config, --job-name, --prepare-only, and --install-only. main() dispatches to run(args). The pyproject declares the harbor_adapter package.

After reading the code, use your browser’s Back button to return to your reading position; Forward reopens the source view.

benchmarks/harbor/src/harbor_adapter/__main__.py:342
def main() -> int:
    parser = argparse.ArgumentParser(description=__doc__)
    commands = parser.add_subparsers(dest="command", required=True)
    benchmark = commands.add_parser("run", help="Record the working tree and run the standard Harbor workflow")
    benchmark.add_argument("--config", type=Path, required=True)
    benchmark.add_argument("--job-name")
    benchmark.add_argument("--cache-dir", type=Path, default=default_cache_dir())
    benchmark.add_argument("--prepare-only", action="store_true", help="Build and record inputs without starting containers or calling the model")
    benchmark.add_argument("--install-only", action="store_true", help="Run setup and dependency preflight without calling the model or verifier")
    benchmark.add_argument("--legacy-open-network", action="store_true", help="Explicitly reproduce an earlier protocol without integrity enforcement")
    audit = commands.add_parser("audit", help="Freeze completed outputs and produce evidence-bound integrity accounting")
    audit.add_argument("--job-dir", type=Path, required=True)
    audit.add_argument("--output-dir", type=Path, required=True)
    audit.add_argument("--review", type=Path, help="Reviewed verdicts bound to this output freeze")
    cache = commands.add_parser("import-apt", help="Import a manifest and its sibling packages/ directory")
    cache.add_argument("manifest", type=Path)
    cache.add_argument("--cache-dir", type=Path, default=default_cache_dir())
    retained = commands.add_parser("verify-retained", help="Run an authorized verifier batch on an unchanged retained solution, without model calls")

Source file SHA256 62c9117099748a36d9706c2fee30e125c5f839d4c9bcdee79a38e1223cb76b75

More code paths

A command you do not type yourself

The adapter methods run on the host and dispatch shell commands through environment into the task container. You do not type the command below. It simplifies the core invocation; temporary variables, supervision, quoting, and log filtering are in the linked source.

printf "%s" "$instruction" | nanoPyCodeAgent \
  --max-turns 50 \
  --trajectory /logs/agent/trajectory.json
Harbor instruction → stdin → nanoPyCodeAgent → native tools in /app → artifacts and trajectory

The model proposes shell actions such as xxd or Python recovery code during the task. Those actions are produced by the agent; you do not hard-code a WAL solution into the Harbor adapter.

How the adaptation was developed

The integrations already exist. The history below shows when each layer was added; this HTML adds documentation, not a new runtime adapter.

  1. 2026-08-234c4e37c

    feat: add harbor benchmark adapter

    Introduce NanoPyCodeAgent(BaseInstalledAgent), install/run hooks, the local benchmark project, and adapter tests.

  2. 2026-09-039335009

    feat(benchmark): collect Harbor ATIF trajectories

    Add ATIF trajectory export and populate Harbor usage/context metrics from the recorded run.

  3. 2026-10-046e4cc23

    feat(harbor): standardize benchmark setup and verifier retries

    Introduce the standard Python entry point, recorded wheel/source inputs, verified setup, dependency preflight, and timeout-aware verifier wrapping.

  4. 2026-10-24d6ed70a

    feat(benchmarks): support pinned pi agent baselines

    Add PiCodeAgent as a subclass reusing setup, with a hash-pinned distribution, public provider config, native execution, and Pi-specific tests.

  5. 2026-10-2929db8d7

    fix(benchmarks): stop pi tools before verifier execution

    Supervise Pi processes and require a confirmed agent boundary before verification, including cancellation and detached tools.

  6. 2026-11-03d986045

    feat(benchmarks): enforce shared evaluation integrity policy

    Introduce one shared integrity policy, restricted Docker environment, preflight controls, common run decorator, and frozen-output audit.

  7. 2026-11-051b6e3dc

    fix(benchmarks): preserve long native events in streamed output

    Collect long native event output in chunks without dropping oversized lines, with streaming regression tests.

If you extend an adapter, work in this order

  1. Map the lifecycle

    Implement the Harbor adapter contract in benchmarks/harbor/src/harbor_adapter. Reuse shared install/preflight rather than creating per-job adapter copies.

  2. Map the native CLI

    Decide how instruction text, model selection, credentials, budgets, output paths, and exit status map to the agent’s own CLI. Keep native tools intact.

  3. Keep execution boundaries explicit

    Use the common integrity decorator, environment preflight, and process supervisor. Confirm cancellation before allowing grading.

  4. Export results honestly

    Populate usage from real events/ATIF, preserve errors, and add regression tests for task forwarding, partial usage, cancellation, and verifier behavior.

Tests to run while developing the integration

This is a suggested development check for adapter changes. pytest -c selects the benchmark project’s pytest configuration; the following paths select integration regression tests. Creating this HTML did not run a model, Docker task, or benchmark. These test commands are provided for the developer to execute.

Bash / development
uv run --project benchmarks/harbor pytest \
  -c benchmarks/harbor/pyproject.toml \
  benchmarks/harbor/tests/test_workflow.py \
  benchmarks/harbor/tests/test_adapter.py \
  benchmarks/harbor/tests/test_pi.py \
  benchmarks/harbor/tests/test_integrity.py \
  benchmarks/harbor/tests/test_agent_supervision.py \
  benchmarks/harbor/tests/test_verifier.py

Know where the evidence lands

Replace <name> with HARBOR_RUN and <trial> with the trial directory actually created by Harbor. Do not assume that the task name alone is the full trial id.

Host pathWhat to inspect
jobs/<name>-input/config.jsonNormalized Harbor config with injected adapter and protocol settings.
jobs/<name>-input/manifest.jsonWorking-tree source hashes, Git revision, wheel hash for Nano, or pinned Pi distribution/model-config metadata.
jobs/<name>-input/source/Recorded Python adapter source; Nano’s source snapshot is also stored here.
jobs/<name>-input/harbor.logController output from harbor run.
jobs/<name>-input/summary.jsonPer-trial rewards, exception classification, bootstrap/preflight status, and verifier attempt records.
jobs/<name>/<trial>/agent/bootstrap.jsonSetup progress. WAL verifier dependencies are explicitly not_configured.
jobs/<name>/<trial>/agent/Nano: nanopycodeagent.txt and trajectory.json. Pi: pi.txt and pi/sessions/.
jobs/<name>/<trial>/verifier/Official test output, native reward, retry summary, and retained attempt logs; CTRF when the task emits it.
jobs/<name>-input/audit/freeze.json and candidate audit.json. Reviewed audit versions are written under their review hash.
jobs/<name>/.integrity/<trial>/Host-only network and process evidence, including collected agent output; inspect as private run data.

A raw pass still needs an integrity review

Completed restricted runs automatically freeze and scan. To record a reviewed verdict, inspect the frozen evidence, create review.json bound to freeze.json’s SHA256 with actual trial ids and evidence paths, then use --review.

Bash / audit
uv run --project benchmarks/harbor python -m harbor_adapter audit \
  --job-dir "jobs/$HARBOR_RUN" \
  --output-dir "jobs/${HARBOR_RUN}-input/audit"
The review verdict is clear or violation. Pending reviews have no effective score; violations count as zero and remain in the denominator. Setup/verifier errors remain unscored. Only use the command below after creating that evidence-bound review file.
--review /path/to/review.json
Bash / reviewed audit
uv run --project benchmarks/harbor python -m harbor_adapter audit \
  --job-dir "jobs/$HARBOR_RUN" \
  --output-dir "jobs/${HARBOR_RUN}-input/audit" \
  --review /path/to/review.json

Read the result correctly

Exit code 0

The benchmark workflow completed. A valid task score can still be zero. It does not mean the solution passed.

No profile for WAL

Agent setup and network preflight can pass while verifier dependencies remain not_configured. Do not call that a dependency-preflight pass.

Pi is offline

Pi’s --offline flag is not network isolation. restricted-v1 is enforced by the Docker environment and external egress control.

Replaying an old run

The Pi path selects the same task and pinned agent distribution, but current adapters, live provider aliases, and service conditions do not guarantee the historical output or score.