Slice 2 — New-issue write path: implementer + reviewer lanes #3

Open
opened 2026-07-08 02:53:05 +08:00 by weiwen · 0 comments
Owner

Parent

weiwen/sandcastle#1

What to build

The new-issue write path: extend the orchestrator's execute phase so a ready-for-agent issue is carried end-to-end into a human-reviewable PR. Builds directly on the walking skeleton (#2) — no changes to the shared flake, image, or loadConfig; this slice adds two lanes and two prompts.

  • Genericize the implement and review prompts (drop --repo from all tea calls; push URL built from https://${FORGEJO_USER}:${FORGEJO_TOKEN}@{{FORGE_HOST}}/{{REPO}}.git with {{FORGE_HOST}}/{{REPO}} injected from resolved config; just fmt/just check → bare fmt/check). The review prompt retains the cwd-relative @.sandcastle/CODING_STANDARDS.md include.
  • Orchestrator execute phase for new-issue items: implementer (model models.implementer, high iteration budget) → reviewer (model models.reviewer), plus the pr-review recovery lane (a PR left at in-review because its inline reviewer crashed is re-picked and re-reviewed).
  • Bundle both prompts + the pr-index in the sandbox packages/prompt args as needed by these lanes. Concurrency honours maxConcurrency; pipelines run under Promise.allSettled so one failure doesn't cancel the others.

The label/crash-safety invariants from the PRD apply: the implementer opens the PR labelled in-review and relabels the issue ready-for-agentin-review last; the reviewer promotes the PR in-reviewready-for-human as its terminal step and never touches the issue label.

Acceptance criteria

  • Running nix run .#sandcastle against a ready-for-agent issue on nibble produces: a sandcastle/issue-{id} branch with commits, an open PR labelled in-review, and the issue relabeled in-review.
  • The reviewer promotes that PR to ready-for-human in the same run (issue label untouched).
  • check (cargo fmt --check && clippy && test) passes inside the sandbox before the PR is opened.
  • A PR left at in-review (no reviewer completion) is re-picked by the planner and promoted to ready-for-human on a subsequent run (recovery lane).
  • The implement and review prompts contain no hardcoded repo slug or forge URL; the review prompt applies nibble's .sandcastle/CODING_STANDARDS.md.
  • No regression: the planner lane and loadConfig test from #2 still pass.

Blocked by

## Parent weiwen/sandcastle#1 ## What to build The new-issue write path: extend the orchestrator's execute phase so a `ready-for-agent` issue is carried end-to-end into a human-reviewable PR. Builds directly on the walking skeleton (#2) — no changes to the shared flake, image, or `loadConfig`; this slice adds two lanes and two prompts. - Genericize the **implement** and **review** prompts (drop `--repo` from all `tea` calls; push URL built from `https://${FORGEJO_USER}:${FORGEJO_TOKEN}@{{FORGE_HOST}}/{{REPO}}.git` with `{{FORGE_HOST}}`/`{{REPO}}` injected from resolved config; `just fmt`/`just check` → bare `fmt`/`check`). The review prompt retains the cwd-relative `@.sandcastle/CODING_STANDARDS.md` include. - Orchestrator execute phase for new-issue items: implementer (model `models.implementer`, high iteration budget) → reviewer (model `models.reviewer`), plus the pr-review recovery lane (a PR left at `in-review` because its inline reviewer crashed is re-picked and re-reviewed). - Bundle both prompts + the pr-index in the sandbox packages/prompt args as needed by these lanes. Concurrency honours `maxConcurrency`; pipelines run under `Promise.allSettled` so one failure doesn't cancel the others. The label/crash-safety invariants from the PRD apply: the implementer opens the PR labelled `in-review` and relabels the issue `ready-for-agent` → `in-review` **last**; the reviewer promotes the PR `in-review` → `ready-for-human` as its terminal step and never touches the issue label. ## Acceptance criteria - [ ] Running `nix run .#sandcastle` against a `ready-for-agent` issue on `nibble` produces: a `sandcastle/issue-{id}` branch with commits, an open PR labelled `in-review`, and the issue relabeled `in-review`. - [ ] The reviewer promotes that PR to `ready-for-human` in the same run (issue label untouched). - [ ] `check` (`cargo fmt --check && clippy && test`) passes inside the sandbox before the PR is opened. - [ ] A PR left at `in-review` (no reviewer completion) is re-picked by the planner and promoted to `ready-for-human` on a subsequent run (recovery lane). - [ ] The implement and review prompts contain no hardcoded repo slug or forge URL; the review prompt applies `nibble`'s `.sandcastle/CODING_STANDARDS.md`. - [ ] No regression: the planner lane and `loadConfig` test from #2 still pass. ## Blocked by - weiwen/sandcastle#2
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
weiwen/sandcastle#3
No description provided.