push mode: worker never pushes main; HOST lands after verify (#193) — rebased #245

Merged
ben merged 1 commit from land/issue-193 into main 2026-10-16 15:57:52 +00:00
Owner

closes #193

Supersedes PR #229 (same commit, rebased onto main after #232 landed — a force-update of agent/issue-193 was not permitted from the interactive session, so the rebased work lives on land/issue-193).

#193 — push mode: the worker never pushes main; the HOST lands after verify

Rebase notes (2026-10-16, Ben's Claude Code session): policy-lib.sh keeps #222's credential-free parenthetical over this PR's token-URL fallback; tests/policy-lib-test.sh carries both assertion sets; .sandcastle/prompt.md + the idss cutover fixture re-rendered from the resolved source; STATUS.md keeps the #230 single-header shape. The PR's 8 named tests + onboard-lib-test.sh green, full offline suite 0 failures.

See PR #229 for the original description and the close-report on #193.

🤖 Generated with Claude Code

closes #193 Supersedes PR #229 (same commit, rebased onto `main` after #232 landed — a force-update of `agent/issue-193` was not permitted from the interactive session, so the rebased work lives on `land/issue-193`). ## #193 — push mode: the worker never pushes `main`; the HOST lands after verify Rebase notes (2026-10-16, Ben's Claude Code session): `policy-lib.sh` keeps #222's credential-free parenthetical over this PR's token-URL fallback; `tests/policy-lib-test.sh` carries both assertion sets; `.sandcastle/prompt.md` + the idss cutover fixture re-rendered from the resolved source; `STATUS.md` keeps the #230 single-header shape. The PR's 8 named tests + `onboard-lib-test.sh` green, full offline suite 0 failures. See PR #229 for the original description and the close-report on #193. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sandcastle: #193 — push mode: worker never pushes main; HOST lands after verify
All checks were successful
ci / test (push) Successful in 5m13s
ci / static (push) Successful in 2m15s
ci / test (pull_request) Successful in 5m33s
ci / static (pull_request) Successful in 2m28s
0d638e1163
The push-mode landing guidance (policy_landing_guidance, rendered into every
consumer's prompt via {{LANDING_RULES}}) no longer tells the worker to
`git push origin HEAD:refs/heads/main` from the sandbox. The worker pushes its
per-run worker branch (HEAD:refs/heads/$(git rev-parse --abbrev-ref HEAD), the
sandcastle/worker/<run> branch it is on); the HOST promotes it to main only
after the post-run verify gates (worker-birth + the protected-path boundary).
The gates that were cosmetic while the worker pushed main itself now genuinely
gate. The in-sandbox rebase + the #217 re-test ladder are gone (a worker branch
has no main conflict; the host owns the rebase-rescue ladder #207).

Key decisions / files:
- policy-lib.sh: rewrite the "landing": "push" branch (worker branch, never main).
- verify-lib.sh: PP_ENFORCE defaults ON (rollback now keeps a breach off main);
  verify_protected_paths raises VERIFY_PP_VIOLATION.
- landing-lib.sh: new landing_pp_breach_guard — the land seam never pushes a
  flagged protected-path breach to main (parks a rescue, reds the run).
- close-report.sh: push-mode gate 1 verifies reachability from the worker-branch
  head pre-land (origin/<wb>); a commit on neither the worker branch nor main is
  a safe refusal, never a false close.
- Prompts re-rendered: .sandcastle/*prompt.md (per-repo layer) +
  onboarding/tests/fixtures/idss-prompts/prompt.md; cutover re-proven byte-identical.
- Tests: policy-lib, prompt-render, worker-conflict-retest (re-anchored),
  verify-lib (PP default-on + VERIFY_PP_VIOLATION), landing-lib (breach->rescue),
  run-swarm-landing (verify-before-push ordering), close-report (WB worker-branch
  gate 1). Full offline suite green.

Deferred (not formal ACs): explicit HOST post-land "reachable from main" check;
a pinned-host-test land gate (LANDING_TEST_CMD unset across consumers -> would
fail-closed-park every run). dev-factory STAYS LANDING=pr until the coordinated
re-vendor carries this into the running .sandcastle copy (reverting sooner would
restore the old worker-pushes-main behaviour the vendored copy still has).

Out of scope: reviewer agent #197, server-side branch protection #194, healer
push path #203.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ben merged commit 0d638e1163 into main 2026-10-16 15:57:52 +00:00
Sign in to join this conversation.
No reviewers
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
Matou/dev-factory!245
No description provided.