Skip to content

Rebuild as a general coding environment with diff-based grading#14

Draft
jdchawla29 wants to merge 2 commits into
mainfrom
v6-coding-env
Draft

Rebuild as a general coding environment with diff-based grading#14
jdchawla29 wants to merge 2 commits into
mainfrom
v6-coding-env

Conversation

@jdchawla29

@jdchawla29 jdchawla29 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Rebuilds the template as one coding environment with three task flavors on a shared repo lifecycle (coding/repo.py): task setup vaults the repo's real .git outside the workspace and hands the agent a fresh single-commit repo (working git, no history/refs/remotes to mine); grading discards the agent's .git, restores the vault, re-applies the captured diff, and brings hidden tests in after it.

  • coding-task — the original 3-branch convention ({task}_baseline/_test/_golden) as template args, graded by a test command's exit code. Runs locally (per-process clone of REPO_URL) or from a baked image. tasks.py keeps the four sample bugs.
  • sdlc-task — adds workflow: a bare mock-GitHub remote the agent pushes to plus github_* MCP tools (coding/github.py, self-contained, no hud-sdlc-lib). Deliverable is a pushed branch with a PR; graded on the PR head (tests 0.8 + structural or pr_rubric LLM-judged PR check 0.2). Sample: sentry-fix-pr.
  • SWE-bench Proswe_tasks.py fetches dataset rows + official run_script.sh/parser.py and builds the prebuilt jefzda/sweap-images into servable envs (Dockerfile.hud is the single image definition for both generic and instance builds, selected by BASE/INSTANCE_ID build args). Grading replays the official evaluator: resolved iff every fail_to_pass and pass_to_pass test passes.

In images the vault/instance assets sit under /hud (root, 700) and agent shells drop to uid 1000 via setpriv; once hud-python#496 (Workspace(shell_uid=...)) ships, UidWallWorkspace in env.py collapses to a constructor arg.

Test plan

  • Offline suite (20 tests): wiring, SWE-bench scoring criterion, mock-GitHub contract, task rows
  • Hermetic local rollouts (no Docker/network): golden ref → 1.0 and untouched baseline → 0.0 for both coding-task and sdlc-task
  • SWE-bench integration (tests/test_integration.py): NodeBB instance, golden patch → 1.0, baseline → 0.0 (amd64 emulation)
  • Platform: deployed via hud deploy, hosted golden validations for both flavors → 1.0, and a live Claude rollout on sentry-fix-pr → 1.0 (issue read via tunneled MCP tools, branch pushed, PR opened)

One env, three task flavors on a shared repo lifecycle (vault the real
.git outside the workspace, hand the agent a fresh single-commit repo,
grade the captured diff hermetically with hidden tests brought in after):

- coding-task: the 3-branch convention as template args, graded by a
  test command's exit code; runs locally or from a baked image
- sdlc-task: adds a bare mock-GitHub remote plus github_* MCP tools;
  the deliverable is a pushed branch with a pull request, graded on the
  PR head with tests plus a structural or LLM-rubric PR check
- SWE-bench Pro: swe_tasks.py fetches instances and builds their
  prebuilt images into servable envs; grading replays the official
  evaluator (fail_to_pass and pass_to_pass must all pass)

Dockerfile.hud is the single image definition for generic and instance
builds. Validation: hermetic golden/baseline rollouts for both local
flavors, gold-patch integration tests for SWE-bench instances, and both
flavors verified against the deployed platform env.
The SDK workspace now owns the privilege wall (setpriv drop, external
credentials, exec-channel file I/O), so the local UidWallWorkspace
subclass is gone. Ownership of the baked repo follows "chown what you
stage": the generic build chowns /app in the clone step, and task setup
keeps its chown -R for files root mutates per task, so workspace boot
stays O(1).
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