Skip to content

feat(tier3): expose Harbor's Runta and Mosaic backends - #183

Merged
rng1995 merged 9 commits into
mainfrom
naren/tier3-harbor-cloud-sandboxes
Oct 16, 2026
Merged

rng1995 merged 9 commits into
mainfrom
naren/tier3-harbor-cloud-sandboxes

Conversation

@rng1995

@rng1995 rng1995 commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #83 (Harbor 0.24.0). The base is feat/christopherk/issue-79-harbor-upgrade; retarget to main after #83 merges.

Summary

This PR exposes two of Harbor 0.24's managed backends, --env-mode runta and --env-mode mosaic. Both build the task's own Dockerfile (Runta inside its runtime, Mosaic as a snapshot), so they run SkillEvaluator's evaluator-staged images unchanged.

flowchart LR
    OP["Operator host environment"] --> AL["Per-backend allowlist<br/>also blocks skill runtime_env"]
    AL --> H["harbor run --env runta / mosaic<br/>empty SE-owned directory, anchored config paths"]
    H --> RT["Runta runtime<br/>builds the task Dockerfile"]
    H --> MO["Mosaic snapshot + VM<br/>one VM per trial"]
    SKILL["Skill evals/config.yml"] -. cannot set .-> AL
Loading

Credentials (host environment only)

Backend Forwarded to Harbor, and never settable by a skill
Runta RUNTA_TOKEN, RUNTA_CONFIG (a file, default ~/.config/runta/config.toml), RUNTA_ENDPOINT
Mosaic MOSAIC_API_TOKEN, MOSAIC_API_URL, MOSAIC_CONFIG (default ~/.config/mosaic-sandbox/config.json, where mos login saves the token), the SDK's legacy MAR_API_TOKEN, MAR_ENDPOINT and MAR_CONFIG, MOSAIC_RETRIES, MOSAIC_REGISTRY_USERNAME and MOSAIC_REGISTRY_PASSWORD

These names were read from the runta-sdk 0.2.1 and mosaic-sandbox 0.14.7 sources.

  • Relative config paths are anchored to the operator's directory, because Harbor runs from an evaluator-owned one.
  • A configured config file must exist.
  • A Mosaic token found only in E2B_API_KEY is rejected, because that variable never reaches Mosaic.
  • Credential-shaped kwargs stay rejected: Runta's token, and Mosaic's secrets, which would inject provider secrets into the agent's sandbox.

Reserved kwargs

  • Runta mode. mode=direct runs commands in Runta's base runtime and ignores the task image. Harbor's automatic selection uses the task's Dockerfile or Compose definition.
  • Mosaic volume, persist and enable_ssh. These would let state or access outlive one isolated trial.
  • Mosaic build_args and build_target. These could skip or alter evaluator-staged Dockerfile layers.

Staging and docs

  • Mosaic runs one VM per trial, so Compose tasks are rejected before Harbor starts.
  • Harbor reuses Mosaic snapshots by task and build context and never deletes them. The docs ask for an account only trusted operators can write to, and say to delete old harbor-* snapshots.
  • Missing-extra messages use SkillEvaluator's pinned install hint instead of Harbor's unpinned commands and its harbor[cloud] line.
  • Other docs changes: table rows and mode counts of 26/25. The CHANGELOG is updated.

Prime and Smol are not included

Both stay unexposed, with the reason documented.

  • Prime cannot build Dockerfile-only tasks, which is how SkillEvaluator stages most tasks.
  • Smol requires a published [environment].docker_image, which SkillEvaluator rejects because it bypasses the evaluator-staged image.

Exposing either needs Compose-only staging or a trusted image-publishing step, validated live. For that work, the SDK docs list these credentials:

  • Prime: PRIME_API_KEY, or ~/.prime/config.json.
  • Smol: SMOL_CLOUD_TOKEN for cloud targets; SMOLVM_BOOT_BINARY and SMOLVM_LIB_DIR for local microVMs.

Review

All findings from the review on this PR are fixed in d245d41; each thread has a reply:

  • P1: a skill could redirect the operator's Mosaic token through a legacy endpoint name.
  • P2s: config-path anchoring and existence; doctor checking a different environment than Harbor receives; snapshot reuse and retention, which is documented rather than forced to rebuild.
  • P3s: the CHANGELOG count; the Prime wording; Mosaic Compose tasks; the install hint.

Verification

  • Full suite at d245d41 (Python 3.12): 11,311 passed with 21 skipped. The original commit passed 11,289 tests on both Python 3.12 and 3.13.
  • Real SDKs: harbor[runta,mosaic]==0.24.0 (runta-sdk 0.2.1, mosaic-sandbox 0.14.7) installs under SkillEvaluator's locked dependencies without conflicts, and Harbor's Runta and Mosaic modules import. With them installed:
    • without credentials, skillevaluator doctor --env-mode runta fails closed with "Runta requires RUNTA_TOKEN or RUNTA_CONFIG.";
    • --env-mode mosaic fails closed with "Mosaic requires an API credential … Run mos login";
    • reserved kwargs such as persist are rejected;
    • the allowlist covers the SDK's legacy names;
    • a Mosaic token found only in E2B_API_KEY is rejected.
  • Tests:
    • skill runtime_env rejection for every Runta and Mosaic credential, endpoint and config name;
    • config-path anchoring and existence;
    • no cross-backend credential leakage;
    • the E2B-only token;
    • Mosaic Compose rejection;
    • the missing-extra message;
    • reserved and credential-shaped kwargs.
  • Lint: Ruff check, Ruff format and git diff --check are clean.

Not exercised against real Runta or Mosaic accounts, because no credentials were available. A live run needs:

  • RUNTA_TOKEN or a RUNTA_CONFIG file;
  • MOSAIC_API_TOKEN or a mos login session.

Then run skillevaluator doctor --env-mode runta|mosaic and one generated-dataset run on each.

All commits carry DCO sign-offs.

🤖 Generated with Claude Code

Add --env-mode runta and --env-mode mosaic. Both backends build the
task's own Dockerfile, so they run SkillEvaluator's evaluator-staged
images unchanged. Their credentials come only from the host environment:
RUNTA_TOKEN or RUNTA_CONFIG, and MOSAIC_API_TOKEN (or mos login) plus
MOSAIC_REGISTRY_USERNAME/PASSWORD for private base images.

Reserve kwargs that bypass the task image or let state and access
outlive one isolated trial: Runta's mode (direct mode ignores the task
image), and Mosaic's volume, persist, enable_ssh, build_args, and
build_target. Credential-shaped kwargs such as Runta's token and
Mosaic's secrets stay rejected.

Prime and Smol stay unexposed. Prime cannot build a Dockerfile-only
task and Smol requires a published image, while SkillEvaluator builds
every task from its staged Dockerfile and rejects task-authored images.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995 and others added 3 commits October 5, 2026 15:08
Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The runta-sdk README documents RUNTA_ENDPOINT, and the Mosaic docs
document MOSAIC_API_URL and MOSAIC_RETRIES. Forward these non-secret
client settings to the Harbor process for their own backend only, so an
operator's non-default endpoint survives the filtered environment.
Also note that a RUNTA_CONFIG file must use an absolute path, because
Harbor runs from an evaluator-owned directory.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 marked this pull request as ready for review October 6, 2026 10:44

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thorough review of Runta and Mosaic at 45a1a7025: 1 P1, 3 P2 and 4 P3 findings. I installed the real SDKs (runta-sdk 0.2.1, mosaic-sandbox 0.14.7) against SkillEvaluator's lock and read their sources. The reserved kwargs, the rejection of credential-shaped kwargs, the network policy and the absence of direct-mode Runta all check out. Inline comments follow; fixes will be pushed to this branch.

Comment thread docs/agents-and-sandboxes.mdx Resolved
Comment thread CHANGELOG.md Resolved
Comment thread docs/agents-and-sandboxes.mdx Resolved
Address the #183 review:
- Forward Mosaic's MOSAIC_CONFIG and the SDK's legacy MAR_API_TOKEN,
  MAR_ENDPOINT and MAR_CONFIG names. The backend allowlist also decides
  which names a skill's harbor.runtime_env may not set, so a skill could
  previously point MAR_ENDPOINT or MOSAIC_CONFIG at its own endpoint and
  receive the operator's Mosaic token.
- Anchor relative RUNTA_CONFIG, MOSAIC_CONFIG and MAR_CONFIG paths
  against the operator's directory, since Harbor runs from an
  evaluator-owned one, and require a configured file to exist.
- Reject a Mosaic token found only in E2B_API_KEY, which doctor accepted
  but which never reaches Harbor's Mosaic backend.
- Reject Docker Compose tasks for Mosaic while staging; Harbor's Mosaic
  backend runs one VM and would fail every trial.
- Keep Harbor's missing-extra diagnosis but drop its unpinned install
  commands and its harbor[cloud] hint, which does not include mosaic.
- Document Mosaic snapshot reuse and retention, correct the CHANGELOG
  backend count, and state the Prime rationale precisely.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Base automatically changed from feat/christopherk/issue-79-harbor-upgrade to main October 6, 2026 17:14
rng1995 and others added 4 commits October 8, 2026 23:42
Resolve the docs conflicts from the v0.5.0 docs refresh. Keep main's full
list of selectable env-modes, its not-selectable list and its reserved
constructor options, and add this branch's backends to the selectable
list and mode counts.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in main through 3d91107, including #182 (Kata), #188 (model
defaults), #193 (Docker agent bootstrap), and #77 (publication evidence).
Kata, Runta, and Mosaic are all exposed: 26 Harbor-native backends plus
local, 27 modes in total. cua-cloud, opensandbox, hf-sandbox, podman,
prime, and smol stay disabled.

Conflicts:
- src/skillevaluator/tier3_environments.py: the registry-only comment
  lists the six backends that remain unexposed.
- src/skillevaluator/tier3/harbor/runner.py: took main's Sequence import
  and staged_task_paths.extend(task_paths) for the #77 runtime-binding
  check. The Mosaic staging check from this branch stays after it.
- docs/cli-reference.mdx, docs/tier3-live-evaluation.mdx,
  docs/agents-and-sandboxes.mdx: 27 modes / 26 Harbor-native backends,
  with kata, runta, and mosaic listed. The disabled list is the six
  above. Kept main's Kata kwarg notes, and kept both main's Podman
  rationale and this branch's Prime/Smol rationale.
- tests/test_harbor_environment_contract.py: kept main's Kata tests and
  this branch's Runta/Mosaic tests.
- tests/test_harbor_local_mode.py: the unexposed-backend set is the six
  above.
- tests/test_oss_packaging.py: 27 environments, 26 native, and matching
  doc counts.
- CHANGELOG.md (auto-merged into the released 0.5.0 section): restored
  0.5.0 to main's text. Moved the Runta/Mosaic entry to Unreleased/Added,
  and folded the backend count into main's Unreleased/Changed Kata entry
  (24th-26th backends, six still disabled).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Main (#182) and this branch each added a module-level
_staged_task_environment_error() to runner.py, in different places, so
the merge auto-resolved them into two definitions. The later one handles
only Mosaic and shadowed the earlier one, so Kata tasks with Compose
sidecars were no longer rejected while staging
(test_kata_rejects_compose_sidecars_before_harbor_starts failed).

There is now one function. Mosaic rejects any Compose task, Kata rejects
Compose sidecars, and other modes pass. eval-datasets.mdx now says
docker-compose.yaml is unsupported with Mosaic as well as Kata.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
@rng1995
rng1995 enabled auto-merge October 16, 2026 18:46
@rng1995
rng1995 disabled auto-merge October 16, 2026 19:13
@rng1995
rng1995 enabled auto-merge October 16, 2026 19:13
@rng1995
rng1995 merged commit f738ca7 into main Oct 16, 2026
17 checks passed
@rng1995
rng1995 deleted the naren/tier3-harbor-cloud-sandboxes branch October 16, 2026 19:15
rng1995 added a commit that referenced this pull request Oct 19, 2026
Sync with main at 6068b3a: #124 (one versioned five-dimension overall-score
policy, custom-only ranking and compare), #183 (Runta and Mosaic), #140
(GKE mode, Vertex AI routing for Claude Code, MCP declaration validation),
#179 (performance dashboard) and the commits between them.

Conflicts and resolutions:
- CHANGELOG.md: main's Added entries (dashboard, GKE, Vertex AI, MCP
  validation) next to the PR's under Unreleased; main's Fixed entries
  were already present. One Added, Changed and Fixed heading each.
- docs/cli-reference.mdx: the PR's agents row (experimental Hermes) and
  main's 27-mode env row (runta and mosaic selectable).
- docs/reports.mdx, docs/tier3-live-evaluation.mdx: main's lift units and
  range sentence added to the PR's same-basis, N/A-aware lift text.
- tier3/harbor/__init__.py: Docker Codex keeps the PR's subagent-aware
  local_agents wrapper; Docker Claude Code uses main's container wrapper.
- tier3/harbor/local_agents.py: main's Vertex-aware SkillEvaluatorClaudeCode
  now also takes the PR's SetupNetworkErrorAgent mixin (every wrapper must
  rename setup network failures); the local and NVIDIA Build Claude Code
  wrappers inherit it from there; the PR's AgentSetupNetworkError and Codex
  rollout wrapper are kept.
- tier3/harbor/adapter.py: main's MCP declaration models and fail-closed
  validate_mcp_server_declarations, and the PR's strict
  plugin_mcp_servers.toml loader; every loaded file, plugin servers
  included, now passes main's MCP security policy.
- tier3/harbor/metrics.py: main's score policies, canonical dimension mean
  and overall_score_from_metrics, made N/A-aware: an N/A metric drops out
  of its dimension, a dimension with none scored drops out of the mean;
  the PR's finite_number replaces main's _finite_number.
- tier3/harbor/templates/eval.py: main's dimension-mean overall with the
  PR's N/A exclusion (_reward_overall), main's Vertex token refresh, and
  the PR's fnmatch import.
- tier3/harbor/templates/metric.py: main's metric-set and score-policy
  validation; a metric absent from the numeric-only reward.json is N/A
  (an explicit null or out-of-range value still fails); the overall is the
  dimension mean over scored dimensions; runs on older Pythons (future
  annotations, tuple isinstance).
- tier3/harbor/collector.py: main's #124 policy handling ported into the
  PR's per-arm collector: each arm records its score policy (mixed
  policies fail it), its overall follows the policy, ambiguous policies
  reconcile and conflicting ones fail both conditions before any lift;
  the paired lift uses the shared policy, needs equal metric sets, and
  equals the difference of the condition overalls when both arms scored
  the same cases and metrics; pass@k lift needs equal metric sets;
  summaries carry score_policy and the results the per-condition overall,
  metrics and policy keys; N/A metrics stay in the run's metric list.
- tier3/harbor/report_data.py: main's metric_set and score_policy keys,
  per arm key.
- tier3/harbor/progress.py, runner.py, utils/redaction.py: both sides
  (secret-name regex, GKE imports and Vertex checks next to Hermes, ya29
  redaction next to prefixed tokens).
- tier3/commands.py (compare): main's policy and metric-set checks and
  custom-only handling with the PR's N/A rows; the Overall lift compares
  the metrics both arms scored.
- tier3/result_display.py: main's policy-aware overall with N/A, main's
  custom-only Overall label with the PR's members and partial-run labels.
- evaluation/tier3_report.py: _build_agent scores each arm by the score
  policy (N/A-aware for the current policy) and keeps the PR's same-basis
  lift, sum-of-parts and integration blocks; arms under different
  policies or metric sets get no lift; partial report builders resolve
  the same policy; main's attempt-policy read and the PR's dataset source.
- uv.lock: main's lock plus the PR's regex dependency (uv lock --check).
- tests (conftest, metrics truth, collector truth, public runtime,
  installed agent bootstrap): both sides.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995 added a commit that referenced this pull request Oct 19, 2026
…uate-plugin

Main's #183 made the Runta and Mosaic backends selectable; the PR's
evaluate-plugin commands share the Tier 3 environment choices, so their
--env-mode lists gain both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
@rng1995 rng1995 mentioned this pull request Oct 20, 2026
11 tasks done
chrisknvidia pushed a commit that referenced this pull request Oct 30, 2026
* feat(tier3): expose Harbor's Runta and Mosaic backends
* feat(tier3): forward documented Runta and Mosaic SDK settings
* fix(tier3): close Runta and Mosaic credential and staging gaps
* fix(tier3): keep Kata's sidecar check alongside the Mosaic Compose check

Signed-off-by: Narendran Raghavan <[email protected]>
chrisknvidia pushed a commit that referenced this pull request Oct 30, 2026
Sync with main at 6068b3a: #124 (one versioned five-dimension overall-score
policy, custom-only ranking and compare), #183 (Runta and Mosaic), #140
(GKE mode, Vertex AI routing for Claude Code, MCP declaration validation),
#179 (performance dashboard) and the commits between them.

Conflicts and resolutions:
- CHANGELOG.md: main's Added entries (dashboard, GKE, Vertex AI, MCP
  validation) next to the PR's under Unreleased; main's Fixed entries
  were already present. One Added, Changed and Fixed heading each.
- docs/cli-reference.mdx: the PR's agents row (experimental Hermes) and
  main's 27-mode env row (runta and mosaic selectable).
- docs/reports.mdx, docs/tier3-live-evaluation.mdx: main's lift units and
  range sentence added to the PR's same-basis, N/A-aware lift text.
- tier3/harbor/__init__.py: Docker Codex keeps the PR's subagent-aware
  local_agents wrapper; Docker Claude Code uses main's container wrapper.
- tier3/harbor/local_agents.py: main's Vertex-aware SkillEvaluatorClaudeCode
  now also takes the PR's SetupNetworkErrorAgent mixin (every wrapper must
  rename setup network failures); the local and NVIDIA Build Claude Code
  wrappers inherit it from there; the PR's AgentSetupNetworkError and Codex
  rollout wrapper are kept.
- tier3/harbor/adapter.py: main's MCP declaration models and fail-closed
  validate_mcp_server_declarations, and the PR's strict
  plugin_mcp_servers.toml loader; every loaded file, plugin servers
  included, now passes main's MCP security policy.
- tier3/harbor/metrics.py: main's score policies, canonical dimension mean
  and overall_score_from_metrics, made N/A-aware: an N/A metric drops out
  of its dimension, a dimension with none scored drops out of the mean;
  the PR's finite_number replaces main's _finite_number.
- tier3/harbor/templates/eval.py: main's dimension-mean overall with the
  PR's N/A exclusion (_reward_overall), main's Vertex token refresh, and
  the PR's fnmatch import.
- tier3/harbor/templates/metric.py: main's metric-set and score-policy
  validation; a metric absent from the numeric-only reward.json is N/A
  (an explicit null or out-of-range value still fails); the overall is the
  dimension mean over scored dimensions; runs on older Pythons (future
  annotations, tuple isinstance).
- tier3/harbor/collector.py: main's #124 policy handling ported into the
  PR's per-arm collector: each arm records its score policy (mixed
  policies fail it), its overall follows the policy, ambiguous policies
  reconcile and conflicting ones fail both conditions before any lift;
  the paired lift uses the shared policy, needs equal metric sets, and
  equals the difference of the condition overalls when both arms scored
  the same cases and metrics; pass@k lift needs equal metric sets;
  summaries carry score_policy and the results the per-condition overall,
  metrics and policy keys; N/A metrics stay in the run's metric list.
- tier3/harbor/report_data.py: main's metric_set and score_policy keys,
  per arm key.
- tier3/harbor/progress.py, runner.py, utils/redaction.py: both sides
  (secret-name regex, GKE imports and Vertex checks next to Hermes, ya29
  redaction next to prefixed tokens).
- tier3/commands.py (compare): main's policy and metric-set checks and
  custom-only handling with the PR's N/A rows; the Overall lift compares
  the metrics both arms scored.
- tier3/result_display.py: main's policy-aware overall with N/A, main's
  custom-only Overall label with the PR's members and partial-run labels.
- evaluation/tier3_report.py: _build_agent scores each arm by the score
  policy (N/A-aware for the current policy) and keeps the PR's same-basis
  lift, sum-of-parts and integration blocks; arms under different
  policies or metric sets get no lift; partial report builders resolve
  the same policy; main's attempt-policy read and the PR's dataset source.
- uv.lock: main's lock plus the PR's regex dependency (uv lock --check).
- tests (conftest, metrics truth, collector truth, public runtime,
  installed agent bootstrap): both sides.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
chrisknvidia pushed a commit that referenced this pull request Oct 30, 2026
…uate-plugin

Main's #183 made the Runta and Mosaic backends selectable; the PR's
evaluate-plugin commands share the Tier 3 environment choices, so their
--env-mode lists gain both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
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