Skip to content

feat(v1): support Harbor's separate verifier environments#2067

Open
xeophon wants to merge 1 commit into
mainfrom
feat/harbor-separate-verifier
Open

feat(v1): support Harbor's separate verifier environments#2067
xeophon wants to merge 1 commit into
mainfrom
feat/harbor-separate-verifier

Conversation

@xeophon

@xeophon xeophon commented Jul 18, 2026

Copy link
Copy Markdown
Member

Overview

Adds Harbor v1 support for grading in a fresh verifier runtime while keeping shared-mode behavior unchanged. Separate grading uses the current rollout lifecycle: rollout-scoped servers close first, harness metrics finish on the agent runtime, and task scoring moves to an isolated runtime only after confirmed teardown.

Details

  • Resolves shared/separate mode from Harbor's validated task configuration, including fresh-copy and explicit verifier environments.
  • Derives the verifier from the resolved Docker or Prime runtime config, applying verifier image, resources, workdir, environment, and enforced public/no-network policy.
  • Runs optional pre_artifacts.sh, then transfers only declared main-service filesystem artifacts at their original paths with relative-path and exclude-pattern support.
  • Bounds transfer to 256 MiB, 10,000 regular files, and a 4 MiB manifest; rejects unsafe paths, symlinks, special files, and verifier-owned path overlap.
  • Confirms the agent runtime is absent before starting the verifier, stages packaged tests into a clean /tests, and restores artifacts into the fresh runtime.
  • Reads separate-verifier scores from numeric reward.json scalars or maps with reward.txt fallback; shared-mode reward behavior remains unchanged.
  • Fails clearly for unsupported verifier Dockerfile builds, compose/sidecar features, allowlist networking, Windows images, and multi-step tasks.

This keeps artifact handoff and runtime ownership explicit while using Verifiers' existing task, rollout, and server lifecycle interfaces.

Fixes RES-1090

Note

Add separate verifier runtime support for Harbor tasks

  • Harbor tasks can now grade agent outputs in a dedicated verifier runtime (Docker or Prime), separate from the agent runtime, configured via task.toml.
  • Artifacts are collected from the agent runtime via _collect_artifacts(), the agent sandbox is confirmed stopped, then a fresh verifier runtime is provisioned with artifacts and tests restored before scoring runs.
  • Introduces Task.scoring_runtime() as an extension point, provision_runtime() context manager in runtimes/init.py, and Runtime.stop_confirmed() / teardown_confirmed() for explicit deletion confirmation across Docker and Prime runtimes.
  • Runtime.read() now supports bounded reads with a max_bytes limit; oversized files raise SandboxError. Reward files (reward.json) are read with this bound.
  • Risk: rollouts that request a separate scoring runtime are rejected at construction if they do not own the runtime or have shared tools.

Macroscope summarized b21138c.


Note

High Risk
Changes rollout teardown/scoring order, confirmed sandbox deletion, and Harbor artifact transfer with size/path limits—mistakes could leak agent state into grading or fail scoring on valid tasks.

Overview
Harbor separate verifiers now grade in a fresh runtime after the agent phase: declared artifacts are collected and validated, the agent box is torn down with confirmed deletion (stop_confirmed on Docker/Prime), then tests and restored files run in a new verifier runtime derived from the task’s Docker/Prime policy (image, resources, workdir, public/no-network).

Rollouts gain Task.scoring_runtime(): harness scoring stays on the agent runtime; task scoring can enter a separate async context. Separate scoring is rejected for borrowed runtimes or shared tool servers.

Runtime plumbing: provision_runtime() replaces manual start/stop in agent provisioning and MCP launch; Runtime.read() accepts optional max_bytes (Docker, Prime streaming, default shell path); harness cleanup can run when stop_failed is set.

Harbor parsing uses Harbor’s validated config for shared vs separate mode, artifacts, verifier env, and explicit errors for allowlists, sidecars, and multi-step tasks; rewards read bounded reward.json (scalar or map) with reward.txt fallback. Docs note separate verifier mode and updated parity gaps.

Reviewed by Cursor Bugbot for commit b21138c. Bugbot is set up for automated code reviews on this repo. Configure here.

Fixes RES-1093

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 18, 2026

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

This PR introduces a significant new feature (separate verifier environments) with complex artifact collection, runtime lifecycle management, and scoring flow changes. An unresolved P1 comment identifies a bug where the tar archive initialization uses invalid bytes that would cause separate-mode scoring to fail.

You can customize Macroscope's approvability policy. Learn more.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 662b48db5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61beb0b5b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8c5eeb62b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 789a40d02e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7caabea43

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48ed242ed9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e83057ab44

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
@xeophon
xeophon requested a review from mikasenghaas July 19, 2026 14:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d20fa0fc8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 845cd5033b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: adff2dcc3b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
@macroscopeapp

This comment was marked as resolved.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 75e5f1ed62

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py
Comment thread verifiers/v1/rollout.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d926179f35

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py
Comment thread verifiers/v1/tasksets/harbor/taskset.py
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
@xeophon
xeophon force-pushed the feat/harbor-separate-verifier branch from fd999d1 to cccd191 Compare July 24, 2026 13:39
Comment thread verifiers/v1/tasksets/harbor/taskset.py
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cccd191309

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py
@xeophon
xeophon force-pushed the feat/harbor-separate-verifier branch from cccd191 to da81097 Compare July 24, 2026 14:52
Comment thread verifiers/v1/runtimes/base.py
Comment thread verifiers/v1/runtimes/base.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py
Comment thread verifiers/v1/tasksets/harbor/taskset.py
Comment thread verifiers/v1/tasksets/harbor/taskset.py
Comment thread verifiers/v1/rollout.py
@xeophon
xeophon force-pushed the feat/harbor-separate-verifier branch from da81097 to e5fb459 Compare July 24, 2026 15:44
Comment thread verifiers/v1/tasksets/harbor/taskset.py
Comment thread verifiers/v1/tasksets/harbor/taskset.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5fb45997e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
Comment thread verifiers/v1/tasksets/harbor/taskset.py Outdated
@xeophon
xeophon force-pushed the feat/harbor-separate-verifier branch from e5fb459 to a0f7c04 Compare July 24, 2026 16:03
Comment thread verifiers/v1/tasksets/harbor/taskset.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0f7c04b1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py
@xeophon
xeophon force-pushed the feat/harbor-separate-verifier branch from a0f7c04 to fb5b386 Compare July 24, 2026 16:24
Comment thread verifiers/v1/runtimes/docker/__init__.py
Comment thread verifiers/v1/tasksets/harbor/taskset.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb5b386b7b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/rollout.py Outdated
@xeophon
xeophon force-pushed the feat/harbor-separate-verifier branch from fb5b386 to a1e275d Compare July 24, 2026 16:36
Comment thread verifiers/v1/runtimes/docker/__init__.py

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a1e275d. Configure here.

Comment thread verifiers/v1/tasksets/harbor/taskset.py
@xeophon
xeophon force-pushed the feat/harbor-separate-verifier branch from a1e275d to b21138c Compare July 24, 2026 16:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a1e275d643

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread verifiers/v1/tasksets/harbor/taskset.py
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.

2 participants