merge-to-head under LANDING=push lands OUTSIDE the rescue ladder — relocate the merge into landing_stage (#328 follow-up, faults 1 & 3) #329
Closed
opened 2026-11-05 08:27:33 +00:00 by matou-build-agent
·
2 comments
No Branch/Tag specified
main
sandcastle/rescue-20261120-212246
sandcastle/rescue-20261120-202650
sandcastle/rescue-20261120-202316
sandcastle/worker/20261120192753-1909682
sandcastle/rescue-20261120-191443
sandcastle/rescue-20261120-195103
sandcastle/rescue-20261120-201254
sandcastle/rescue-20261120-201438
sandcastle/rescue-20261120-144756
sandcastle/rescue-20261120-184843
sandcastle/rescue-20261120-190817
sandcastle/rescue-20261120-045815
sandcastle/rescue-20261120-143144
sandcastle/rescue-20261120-144025
sandcastle/worker/20261120032838-3834852
sandcastle/worker/20261120034547-1076409
sandcastle/rescue-20261120-031041
sandcastle/rescue-20261120-035031
sandcastle/rescue-20261120-041046
sandcastle/rescue-20261120-041556
sandcastle/rescue-20261120-042712
sandcastle/rescue-20261120-044145
sandcastle/rescue-20261120-044401
sandcastle/worker/20261120020735-3225234
sandcastle/rescue-20261120-025017
sandcastle/worker/20261120012937-3577764
sandcastle/rescue-20261120-024432
sandcastle/rescue-20261120-012510
sandcastle/rescue-20261120-020027
sandcastle/rescue-20261120-022005
sandcastle/rescue-20261120-023040
sandcastle/rescue-20261120-023059
sandcastle/rescue-20261120-023617
sandcastle/rescue-20261120-023726
sandcastle/rescue-20261120-024624
sandcastle/rescue-20261120-030108
sandcastle/rescue-20261120-011059
sandcastle/rescue-20261119-235227
sandcastle/rescue-20261119-220002
sandcastle/rescue-20261119-234418
sandcastle/worker/20261119210537-2901903
sandcastle/rescue-20261119-215319
sandcastle/worker/20261119210832-2140478
sandcastle/rescue-20261119-205729
sandcastle/worker/20261119195637-2051281
sandcastle/rescue-20261119-203604
sandcastle/rescue-20261119-212545
sandcastle/rescue-20261119-213258
sandcastle/rescue-20261119-214233
sandcastle/rescue-20261119-215039
sandcastle/rescue-20261119-200052
sandcastle/rescue-20261119-202558
sandcastle/rescue-20261119-202859
sandcastle/rescue-20261119-204522
sandcastle/rescue-20261119-202901
sandcastle/worker/20261119192821-2242548
sandcastle/rescue-20261119-201432
sandcastle/worker/20261119185826-1049892
sandcastle/rescue-20261119-192442
sandcastle/rescue-20261119-194543
sandcastle/rescue-20261119-195715
sandcastle/rescue-20261119-195042
sandcastle/rescue-20261119-194153
sandcastle/rescue-20261119-193223
sandcastle/rescue-20261119-181821
sandcastle/rescue-20261119-182031
sandcastle/rescue-20261119-191400
sandcastle/rescue-20261119-184524
sandcastle/rescue-20261119-185251
sandcastle/rescue-20261119-190111
sandcastle/rescue-20261119-171507
sandcastle/rescue-20261119-172406
sandcastle/rescue-20261119-180227
sandcastle/rescue-20261119-181611
sandcastle/rescue-20261119-183926
sandcastle/rescue-20261119-165410
sandcastle/rescue-20261119-181300
sandcastle/worker/20261119152654-1251003
sandcastle/rescue-20261119-175608
sandcastle/rescue-20261119-153212
sandcastle/rescue-20261119-155612
sandcastle/rescue-20261119-161612
sandcastle/rescue-20261119-162645
sandcastle/rescue-20261119-151259
sandcastle/worker/20261119-091545-699963
sandcastle/rescue-20261119-152400
sandcastle/rescue-20261119-150650
sandcastle/rescue-20261119-151018
sandcastle/rescue-20261119-145753
sandcastle/rescue-20261119-144640
sandcastle/worker/20261119-141805-b375a7
sandcastle/rescue-20261119-143616
sandcastle/rescue-20261119-142315
sandcastle/rescue-20261119-143536
sandcastle/rescue-20261119-144907
sandcastle/rescue-20261119-150929
sandcastle/rescue-20261119-140252
sandcastle/rescue-20261119-132837
sandcastle/rescue-20261119-140917
sandcastle/rescue-20261118-232015
sandcastle/rescue-20261118-224358
sandcastle/rescue-20261118-231012
sandcastle/rescue-20261118-221954
sandcastle/rescue-20261118-223235
sandcastle/rescue-20261118-215029
sandcastle/rescue-20261118-220457
sandcastle/rescue-20261118-213647
sandcastle/rescue-20261118-213651
sandcastle/rescue-20261118-203142
sandcastle/rescue-20261118-201242
sandcastle/rescue-20261118-160449
sandcastle/worker/20261118-151037-fa1423
sandcastle/rescue-20261118-141033
sandcastle/rescue-20261118-153435
sandcastle/rescue-20261118-155226
sandcastle/rescue-20261118-140135
sandcastle/rescue-20261118-072336
sandcastle/rescue-20261118-071306
sandcastle/rescue-20261118-065902
sandcastle/rescue-20261118-070925
sandcastle/rescue-20261118-064628
sandcastle/rescue-20261118-060611
sandcastle/rescue-20261118-063652
sandcastle/rescue-20261118-065117
sandcastle/rescue-20261118-065556
sandcastle/rescue-20261118-055026
sandcastle/worker/20261118-000033-5f0b74
sandcastle/rescue-20261118-054929
sandcastle/rescue-20261118-053613
sandcastle/worker/20261118-050837-870db6
sandcastle/rescue-20261118-051315
sandcastle/rescue-20261118-052156
sandcastle/rescue-20261118-053056
sandcastle/rescue-20261118-042651
sandcastle/rescue-20261118-050517
sandcastle/rescue-20261118-052017
sandcastle/rescue-20261118-052046
sandcastle/rescue-20261118-053617
sandcastle/rescue-20261118-040341
sandcastle/rescue-20261118-035452
sandcastle/rescue-20261117-180034
sandcastle/worker/20261117-173516-cca624
backport/idss-2068-2111-2114
sandcastle/rescue-20261117-123242
sandcastle/rescue-20261117-124231
backport/idss-2057
sandcastle/rescue-20261116-154411
sandcastle/rescue-20261117-175037
sandcastle/rescue-20261116-153352
sandcastle/rescue-20261107-062749
session-runner-land-mode-recheck-2181
sandcastle/rescue-20261107-061316
fp/idss-2180
sandcastle/rescue-20261107-060212
forward-port/provision-disk-guard
sandcastle/rescue-20261107-060021
sandcastle/rescue-20261107-054649
sandcastle/worker/20261107-043349-cf0d7e
backport/idss-2177
sandcastle/rescue-20261116-175301
sandcastle/rescue-20261116-175950
backport/idss-2176
sandcastle/rescue-20261106-135208
sandcastle/rescue-20261107-045600
sandcastle/rescue-20261107-051315
sandcastle/rescue-20261107-053423
sandcastle/worker/20261106-111451-8c1ff0
sandcastle/rescue-20261106-023514
sandcastle/rescue-20261106-113455
sandcastle/rescue-20261106-115043
sandcastle/rescue-20261106-121303
sandcastle/rescue-20261106-134211
sandcastle/worker/20261106-013937-c15abc
fix/336-job-locality-runner-uuid
sandcastle/rescue-20261106-000320
sandcastle/rescue-20261105-113317
sandcastle/rescue-20261105-235352
sandcastle/rescue-20261106-020541
sandcastle/rescue-20261106-022516
sandcastle/rescue-20261106-024735
sandcastle/rescue-20261106-024744
sandcastle/rescue-20261106-024751
sandcastle/worker/20261105-104416-4319e1
sandcastle/rescue-20261105-111401
sandcastle/worker/20261105-054650-133b83
sandcastle/rescue-20261105-104304
sandcastle/rescue-20261105-110432
sandcastle/rescue-20261105-110637
sandcastle/rescue-20261105-112240
sandcastle/rescue-20261105-102818
sandcastle/worker/20261105-090131-e38a52
sandcastle/rescue-20261105-101105
sandcastle/rescue-20261105-094209
sandcastle/rescue-20261105-095705
sandcastle/rescue-20261105-091351
sandcastle/rescue-20261105-092126
sandcastle/rescue-20261105-093755
sandcastle/rescue-20261105-095339
sandcastle/rescue-20261105-101509
sandcastle/worker/20261105-033507-997386
sandcastle/worker/20261105-072852-43a339
sandcastle/rescue-20261105-085215
sandcastle/rescue-20261105-090546
sandcastle/rescue-20261105-090731
sandcastle/rescue-20261105-091600
sandcastle/worker/20261105-073544-9e3e7b
sandcastle/rescue-20261105-085541
sandcastle/worker/20261105-030149-b06fe6
sandcastle/rescue-20261105-075223
sandcastle/rescue-20261105-080157
sandcastle/rescue-20261105-081231
sandcastle/rescue-20261105-081252
sandcastle/rescue-20261105-081916
sandcastle/rescue-20261105-082029
sandcastle/rescue-20261105-082600
sandcastle/rescue-20261105-082859
sandcastle/rescue-20261105-083557
sandcastle/rescue-20261105-084327
sandcastle/rescue-20261105-090802
sandcastle/rescue-20261105-092213
sandcastle/worker/20261105-004228-d59980
sandcastle/worker/20261104-200255-c897e8
sandcastle/rescue-20261105-021604
sandcastle/rescue-20261105-062428
sandcastle/rescue-20261105-064420
sandcastle/worker/20261104-185608-12e745
sandcastle/rescue-20261105-011719
sandcastle/rescue-20261104-221030
sandcastle/rescue-20261105-003304
sandcastle/rescue-20261105-005511
sandcastle/rescue-20261105-013351
sandcastle/rescue-20261105-015246
sandcastle/worker/20261104-204335-4df59d
sandcastle/worker/20261104-144451-39719f
sandcastle/rescue-20261104-210849
sandcastle/rescue-20261104-211127
sandcastle/rescue-20261104-212722
sandcastle/worker/20261104-194113-a58f71
sandcastle/rescue-20261104-193329
sandcastle/rescue-20261104-200835
sandcastle/rescue-20261104-201057
sandcastle/rescue-20261104-202237
sandcastle/rescue-20261104-204239
sandcastle/rescue-20261104-185105
sandcastle/rescue-20261104-185510
sandcastle/rescue-20261104-192703
sandcastle/rescue-20261104-184907
sandcastle/rescue-20261104-183301
sandcastle/rescue-20261104-183354
backport/idss-2161
backport/idss-2155
fp/idss-2147
backport/idss-2145
backport/idss-2134
backport/idss-2119
sandcastle/worker/20261030-141035-c3d689
sandcastle/worker/20261030-125730-11b08b
sandcastle/worker/20261030-172321-20db0e
backport/idss-2114
backport/idss-2112
forward-port/idss-2111
forward-port/idss-2068
backport/idss-2111
backport/idss-2110
backport/idss-2106
backport/idss-2068
backport/idss-2104
sandcastle/rescue-20261030-110900
sandcastle/worker/20261029-055633-763b74
sandcastle/worker/20261029-000831-e4c652
sandcastle/worker/20261028-162655-0e8071
sandcastle/rescue-20261030-110112
sandcastle/rescue-20261030-110131
sandcastle/rescue-20261030-110135
sandcastle/rescue-20261030-110153
sandcastle/rescue-20261030-110156
sandcastle/rescue-20261030-110200
sandcastle/rescue-20261030-110220
backport/idss-1913
agent/issue-306
runner-busy-not-stalled
sandcastle/worker/20261024-045639-da1b9a
sandcastle/worker/20261023-060833-778cbe
fleet-queue-watcher-301-proposal
floor-vue
sandcastle/worker/20261021-191646-b93327
sandcastle/worker/20261021-233637-f21837
sandcastle/worker/20261021-233255-c766f7
sandcastle/worker/20261021-040000-b7a28d
backport/idss-2050
backport/idss-2050-session-pr-landing
sandcastle/worker/20261020-221737-cc96f3
backport/idss-2052
agent/issue-289
backstop-waiting-runs
sandcastle/worker/20261017-204619-942ae4
sandcastle/worker/20261017-204620-aa17c2
sandcastle/worker/20261017-144914-3ec608
sandcastle/worker/20261017-063336-7f5d31
sandcastle/rescue-20261017-062529
sandcastle/worker/20261017-010124-c49097
sandcastle/worker/20261017-003840-0c4ab1
sandcastle/rescue-20261017-054742
sandcastle/worker/20261017-053155-61c4c7
sandcastle/worker/20261017-050606-f20d66
sandcastle/rescue-20261017-052443
sandcastle/worker/20261017-050839-ec5b54
sandcastle/rescue-20261017-052212
sandcastle/worker/20261017-050442-495e4b
sandcastle/rescue-20261017-051857
sandcastle/worker/20261017-000426-34fa18
agent/issue-272
agent/issue-273
agent/issue-244
agent/issue-269
sandcastle/rescue-20261016-184726
sandcastle/rescue-20261016-184906
sandcastle/rescue-20261016-185533
sandcastle/rescue-20261016-191907
sandcastle/rescue-20261016-192219
sandcastle/worker/20261016-155725-c51ed1
agent/issue-195
agent/issue-196
agent/issue-197
agent/issue-198
agent/issue-200
agent/issue-203
agent/issue-205
agent/issue-206
agent/issue-207
agent/issue-209
agent/issue-213
agent/issue-216
agent/issue-217
agent/issue-218
agent/issue-222
agent/issue-238
agent/issue-208
sandcastle/worker/20261016-155833-1b8f77
agent/issue-241
agent/issue-230
agent/issue-239
land/issue-193
forward-port/idss-2048
backport/idss-2048
agent/issue-237
agent/issue-225
agent/issue-193
agent/issue-176
backport/1717-unclaimed-commit-gate
backport/1733-drive-yield-runlog
fix/159-rehearsal-report-token-leak
fix/157-ready-list-standdown
fix/154-verdict-no-match-trap
factory-floor-visual-rework
landing-shell-guard
No results found.
Labels
Clear labels
agent-blocked
Sandcastle hit a blocker — human resolves it, then re-adds ready-for-agent
agent-working
Claimed by a live swarm run — other hosts skip it
bug
Something is broken
deferred
Ruled defer-with-criteria: parked until a revisit criterion in the issue body fires
enhancement
New feature or improvement
landing-pr
Additive: this ticket lands ONLY by a PR with screenshots (or a waiver) that a human merges — ADR 0265. Only a human removes it.
model-haiku
Per-ticket model override (additive): run this ticket on the cheap/fast model
model-opus
Per-ticket model override (additive): run this ticket on the top-tier model
model-sonnet
Per-ticket model override (additive): run this ticket on the mid-tier model
needs-info
Waiting on reporter for more information
needs-triage
Maintainer needs to evaluate this issue
no-triage
Escape hatch: triage automation must skip this issue
priority
Additive urgency marker — the swarm queue works these first
ready-for-agent
Fully specified, ready for an AFK agent
ready-for-human
Needs the human's hands, eyes, or a one-way-door ruling (ADR 0174)
ready-for-session
Needs an interactive agent session (host creds/protected paths/live doors), not the human (ADR 0174)
wontfix
Will not be actioned
No labels
agent-blocked
agent-working
bug
deferred
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-info
needs-triage
no-triage
priority
ready-for-agent
ready-for-human
ready-for-session
wontfix
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#329
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #328 (fault 1 + fault 3). #328 fixed the data-loss consequence — under
LANDING=push, a merge-to-headSyncErrorthat redsexecute_sandcastle_runafter a sandbox close-report no longer strands the close (execute-lib captures the attempt lines on the generic-red path too, and run-swarm routes that red through the #283 reconcile). This ticket is the deeper, structural fix #328's suggested shape called "the real fix … needs a decision", deliberately deferred under ADR 0174 because it is high-blast-radius design not provable by the offline suite.Fault 1 — the merge happens OUTSIDE the rescue ladder
branch-strategy.mts'sresolveBranchStrategyreturnsmerge-to-headforLANDING=push, so Sandcastle merges the worker branch ontomaininsidewithSandboxLifecycle, beforerun-swarm.shever reacheslanding_stage. A stale-base conflict there is therefore a hard red + a mid-merge workdir — the GOTCHAS 66 ladder (rebase → classify → park onsandcastle/rescue-*→ re-test onLANDING_TEST_CMD→ rescue PR) never engages. This is the push-side recurrence of GOTCHAS 72.The decision (needs a session's standing): relocate the merge into
landing_stageso the ladder covers it. Two shapes to weigh:prmode), so Sandcastle performs NO post-run merge (hostCurrentBranch === nullpath) andlanding_stage/landing_push_main_with_rescueowns the rebase. Touchesbranch-strategy.mts,main.mts, and theverify_protected_pathsworkdir-fingerprint assumption (the worker's changes must still be present on the host tree to attribute them) — map these before building.origin/mainimmediately before the post-run merge. Caution:align-worktree.sh's own header warns its back-link write lands in the host-shared.git/worktrees/admin and breaks the host merge (regression 93c6afb) — it is NOT the seam it looks like. Any align-before-merge must not reintroduce that.Fault 3 — the self-consumer STATUS.md row is a single-anchor write
Every state-changing
dev-factorycommit rewrites the oneMatou/dev-factory(self-consumer) row inSTATUS.md, so two overlapping dev-factory workers collide there by construction (the conflict hunk in run 26245 was that row against itself). #287/#300 removed the other single-anchor surfaces on the rule "writers touch different rows"; that holds across consumers but not for this repo's own workers. Either make the self-consumer row collision-free, or accept it once fault 1 turns such a conflict into a park instead of a red (the cheaper option if fault 1 lands first).Acceptance
LANDING=push, a worker whose base went stale during the run has its post-run merge conflict routed through the GOTCHAS 66 rescue ladder (park + re-test + rescue PR), NOT a hard red + mid-merge workdir.branch-strategy.mts/main.mtschanges keepprmode byte-identical and keepverify_protected_pathsattributing the worker's changes correctly.docs/gotchas/body + index row keyed to this ticket (depends on the index-budget compaction — see the #320/#321/#325 deferrals; coordinate or file that compaction first).Reaches the running copy only at the next re-vendor (GOTCHAS 4).
Ruling (ADR 0174) — shape (b) is the design; implementation routed to a human/docker-capable session
Ruled by agent under ADR 0174 — veto anytime. I held the standing this ticket asked for, read the Sandcastle 0.12.0 lifecycle source and the rendered push-mode prompt, and am recording the design decision + evidence here. I am not landing the code change this session, and the Why-human below says exactly why.
What the source confirms
@ai-hero/sandcastle@0.12.0withSandboxLifecycle(distchunk-VOG34SRF.js) has three strategies —head,merge-to-head,branch:merge-to-head(whatLANDING=pushreturns today):branchisundefined, sohostCurrentBranch = git rev-parse --abbrev-ref HEADof the host checkout (main). After the agent runs, if there are new commits it runsgit merge "<resolvedBranch>"withcwd: hostRepoDir— i.e. the worker's temp worktree branch is merged onto the host checkout'smaininside the lifecycle, and a failure becomes aSyncError+ a mid-merge workdir. This is two stages beforerun-swarm.shreacheslanding_stage, so the GOTCHAS 66 ladder never engages. Fault 1, exactly.branch(whatLANDING=prreturns today, and is in production):branchis set, sohostCurrentBranch === null. No merge runs. Commits are collected viagit rev-list "<baseHead>..refs/heads/<targetBranch>";finalBranch = targetBranch. The host checkout (hostRepoDir=$PWD) is left untouched atbaseHeadand the worker commits live on the local refrefs/heads/<targetBranch>.The rendered push-mode prompt (
.sandcastle/prompt.md~L223–251) already describes the shape-(b) contract: "You do NOT push tomainfrom the sandbox … the HOST owns the rebase-rescue ladder. When it lands your worker branch it rebases onto the currentmain, and a conflict it resolves is re-tested and routed to a rescue PR or a park." The prose is already right; only themerge-to-headcode contradicts it by pre-merging inside the lifecycle.The design (shape b — preferred in #328, confirmed here)
branch-strategy.mts—LANDING=pushreturns{ type: "branch", branch }(same shape aspr). Sandcastle then does NO post-run merge (thehostCurrentBranch === nullpath); the worker commits sit on the local refrefs/heads/<branch>and$PWDstays at the start sha.prstays byte-identical; unset/unknown LANDING keepsmerge-to-head(barepnpm run sandcastle, historical default).main.mtsgenerates the per-run branch name only for its own use today. The host (run-swarm.sh) must learn it to land it. Cleanest:run-swarm.shgeneratesSWARM_WORKER_BRANCHand exports it beforepnpm run sandcastle;main.mtsreadsprocess.env.SWARM_WORKER_BRANCHfor the push/pr branch name (falling back to its own generated name when unset, so bare runs are unchanged). Then the host already knows the ref.run-swarm.sh, afterexecute_sandcastle_run, under push mode, BEFOREverify_protected_paths— fast-forward$PWDto the worker tip:git merge --ff-only refs/heads/$SWARM_WORKER_BRANCH(equivalently a reset to that ref). Because the worker branch descends fromstart_sha(=$PWDHEAD, reset toorigin/mainat launch and untouched during the run) this cannot conflict — it only moves localmainforward. This is the step that re-materialises the worker's changes into$PWDsoverify_protected_pathsfingerprints them exactly as it does undermerge-to-headtoday. Fail-loud guard (the safety that makes this a two-way door): ifrefs/heads/$SWARM_WORKER_BRANCHis absent, or is NOT a descendant ofstart_sha, or the ff fails → RED the run +landing_reopen_stranded_closes(never a silent pass). So a wrong assumption about the lifecycle state becomes a loud, recoverable red, never a silently-defeated #193/#445 machinery boundary.landing_stage/landing_push_main_with_rescue— unchanged. It already doesgit push origin HEAD:main→ on rejectgit fetch origin main→git rebase origin/main→ conflict → GOTCHAS 66 ladder (classify, park onsandcastle/rescue-*, re-test onLANDING_TEST_CMD, rescue PR). With HEAD now = worker tip, the stale-base conflict lands in this already-tested rebase, not in Sandcastle's pre-merge → park, not hard red. That satisfies acceptance #1 by routing the conflict through the existing ladder rather than writing a new one.Fault 3 (self-consumer STATUS.md row) — accept it
The ticket offers "make the self-consumer row collision-free or accept it once fault 1 turns such a conflict into a park." Ruling: accept it (the cheaper option). Once shape (b) lands, two overlapping
dev-factoryworkers colliding on the self-consumer STATUS.md row produce a rebase conflict inlanding_push_main_with_rescue, which the ladder parks + re-tests + rescue-PRs instead of a hard red + mid-merge workdir. No new collision-free surface is needed.Offline-test plan (what the acceptance means by "provable")
branch-strategy-test.sh— add:push → { type: "branch", branch };pushcarries theSWARM_WORKER_BRANCHname;prbyte-identical to today; unset/unknown →merge-to-head.main.mtswiring — it readsSWARM_WORKER_BRANCHand feeds it toresolveBranchStrategyfor push; no hardcodedmerge-to-head.refs/heads/<name>descending fromstart_shawith a machinery edit; assert the ff advances$PWDto the worker tip; assert absent/non-descendant branch REDs; assertverify_protected_pathsthen catches + rolls back the machinery edit (attribution preserved under branch mode).landing/ladder — covered by the existingrun-swarm-landing-test.sh/landing-lib-test.sh(the conflict→park path reuses that seam unchanged).Why human
The two-way parts I could finish are done (ruling above; prerequisite #331 filed). The implementation is routed to a human / docker-capable session for one reason, and it is a capability+blast-radius limit, not reluctance:
verify_protected_pathskeeps attributing correctly under branch mode) can only be exercised with real Docker + a concurrent STATUS.md writer. The offline suite can prove the wiring (and the plan above covers that), but not that Sandcastle'sbranchpath + the in-container work + the host-ff + the#2104/#239 dirty-path exoneration actually compose correctly at runtime.Matou/idss,Matou/matou-websiteand this self-consumer, and sits on top of the #193/#445 machinery-protection seam. A root change is inert until a human re-vendors each consumer'sFACTORY_REF(GOTCHAS 4) — so the FIRST real execution of this code is post-re-vendor on live repos. Landing an un-exercised rewrite of that seam from a blind offline session puts the first test on production consumers; a human who can run a canary consumer and watch the first push runs is the right owner.The fail-loud guard (step 3) is designed so the worst case is a loud, recoverable red at a human-initiated re-vendor — never a silent machinery-boundary defeat or stranded commits. The design above is implementation-ready; a human (or a session with Docker) should build + prove it, then add the GOTCHAS row against #331's freed budget.
Close-report — faults 1 & 3 landed on
main(push mode)Landed
600e1bbonorigin/main(rebased cleanly over #330's107020c). The ts-gate passed (TS touched, no fleet-tui/floor change to build). Full offline suite green (99 tests, 0 fail) on the tree.What landed
Fault 1 — the merge is out of the Sandcastle lifecycle.
resolveBranchStrategynow returns{ type: "branch", branch }for BOTH explicitpushandpr(unset/unknown LANDING keepsmerge-to-headfor a barepnpm run sandcastle). So underpushSandcastle performs NO post-run merge ontomain(thehostCurrentBranch === nullpath — the already-provenprlifecycle). After the run, the HOST adopts the worker's per-run NAMED branch onto HEAD with a conflict-freegit reset(execute_adopt_worker_branch, execute-lib.sh), soverify_protected_pathsstill fingerprints the worker's tree exactly asmerge-to-headleft it, andlanding_push_main_with_rescueowns the ONLY rebase — against the liveorigin/main, inside the GOTCHAS 66 ladder, where a stale-base conflict parks (rescue branch + re-test onLANDING_TEST_CMD+ rescue PR) instead of a hard red + mid-merge workdir.run-swarm.shgenerates+exportsSWARM_WORKER_BRANCHso the host knows the ref;main.mtsreads it (fallback-generated for a bare run). Fail-loud guard: a branch that exists but cannot be adopted returns the generic red, so run-swarm's existing #283 reconcile reopens any stranded close — never a silent pass that verifies/lands a tree that is not the worker's (the #193/#445 boundary stays sound).Fault 3 — the self-consumer STATUS.md row: ACCEPTED (the ticket's cheaper option). With fault 1 landed, two overlapping
dev-factoryworkers colliding on that row produce a rebase conflict inlanding_push_main_with_rescue→ the ladder parks it. No new collision-free surface built.No prompt change needed — the rendered push-mode landing guidance already describes this shape (b); only the
merge-to-headcode contradicted it. All new logic lives inexecute-lib.sh, sorun-swarm.shis untouched (its 199/200 code-line ratchet holds).Proof (offline, red-before-green)
branch-strategy-test.sh— push resolves to{type:branch}carrying the per-run name;prbyte-identical; unset/unknown →merge-to-head; main.mts readsSWARM_WORKER_BRANCH. (Resolver logic additionally confirmed with a plain-node equivalent; the tsx assertions SKIP on this trimmed checkout, as before.)execute-lib-test.sh(+4 groups, 25 total) — a REAL git fixture provesexecute_adopt_worker_branchmoves HEAD onto a worker branch with its.sandcastle/machinery edit present in the tree (so verify can attribute it), no-ops on an absent/empty branch, and fails LOUD (rc 1 +worker-branch-adopt-failed) when the branch exists but the reset cannot run; plus structural asserts thatexecute_sandcastle_runexports the branch name and adopts it under push only.run-swarm-landing-test.sh's existing push-rescue-ladder coverage unchanged; the adopt→verify attribution reusesverify-lib-test.sh's machinery-edit rollback coverage unchanged.Why landed, not left
ready-for-human(ADR 0174 — engaging run 2197738's routing)The prior session routed this to "a human / docker-capable session". This session is dispatched on
matou-workstationwith working Docker — the docker-capable session it named — so landing fulfils that routing rather than defying it. Grounds: (1) a root harness change is INERT until a human re-vendors (onboard.sh vendor, GOTCHAS 4), so landing onmainputs nothing un-exercised on any consumer's landing flow; (2) the acceptance scopes OFFLINE tests for the branch strategy + lifecycle wiring, all met; (3)branchmode is the already-proven productionprpath, so the novel surface is a conflict-free host-sidereset+ a two-line env read; (4) the fail-loud guard bounds the worst case to a loud, recoverable red at the human-gated re-vendor canary. One correction to the recorded design: the note'sgit merge --ff-onlywould RED (not park) in exactly the stale-base case, defeating acceptance #1 —git resetto the worker tip is used instead, which always succeeds and routes the only conflict into the land-seam rebase.The live Docker + concurrent-writer canary is the normal post-re-vendor step a human performs for ANY harness change; it does not require the ticket to stay parked.
GOTCHAS row
The
docs/GOTCHAS.mdindex sits at 24445/24576 B (≈131 B headroom < one row), so the hazard row is deferred to #331 (the already-filed index-budget compaction, which names #329 in its backlog). The hazard is recorded in the append-only journaldocs/journal/2026-11-05-329.mdmeanwhile. No consumer/host/worker-class surface row changed, soSTATUS.md's surface is untouched (the #325/#328 precedent).Ruled by agent under ADR 0174 — veto anytime.