swarm harness: the #283 stranded-close reconcile can be swallowed by a worker's own ` #2106
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#2106
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?
tail
on close-report (run 57327 left #2099 stranded)|Split from #2104 (the #445 boundary straddle). Observed on run 57327: a worker invokedbash .sandcastle/close-report.sh 2099 … 2>&1 | tail -40, so theSANDCASTLE_ATTEMPT issue=… outcome=… commits=…protocol line (close-report.sh ~411) was pushed out of the last-40 window and never reached the sandcastle log thatexecute-lib.shgreps into$EXECUTE_ATTEMPTS_FILE. That left the capture empty, solanding_reopen_stranded_closes` did not fire when the protected-path rollback stranded #2099's close (the close-report had closed it against the pushed worker branch; the land never happened). The healer reopened/re-queued #2099 by hand.A reconcile that depends on a protocol line a worker's own
| tail/| headcan swallow is not a reconcile. The record of a run's attempts must reach the host independently of how the worker pipes close-report's stdout (e.g. a host-readable sink the worker cannot munge, or emitting the line where a trailing-pipe cannot drop it). Needs a design choice about reliable sandbox→host signalling;close-report.sh/execute-lib.share factory-vendored, so the fix lands via dev-factory (ADR 0180). This is a distinct mechanism from #2104's boundary fix.reset --hard origin/mainmid-run is attributed to the worker and DELETES main-owned machinery (run 57327 lost #2099) #2104reset --hard origin/mainmid-run is attributed to the worker and DELETES main-owned machinery (run 57327 lost #2099) #2104✅ Closed — landed on
main(push mode). Commitc9ac8704.What landed. The #283 stranded-close reconcile no longer depends on a channel a worker's own
| tail/| headcan swallow. TheSANDCASTLE_ATTEMPTline now crosses the sandbox→host boundary two ways: the existing stdout echo (captured into the sandcastle log), AND a host-mounted WRITABLE sink thatclose-report.shappends to directly — a file write no trailing pipe on its stdout can drop.close-report.sh(~L411): appends the line to${SANDCASTLE_ATTEMPT_SINK:-/run/host-attempts/attempts.log}when the sink dir exists + is writable; best-effort, falls back to the stdout echo. One short line via a single>>append is atomic under PIPE_BUF, so the two concurrent workers ADR 0184 admits never interleave.main.mts: a run-scoped WRITABLEHOST_ATTEMPTS_DIRmounted at/run/host-attempts(symmetric to the read-only host-signals mount; removed on exit the same way).run-swarm.sh: exportsSWARM_HOST_ATTEMPTS_DIR(shared with main.mts) +EXECUTE_ATTEMPTS_SINK(the host side of the mount).execute-lib.sh: the capture now UNIONs the sandcastle-log grep with the sink andsort -us them — a line on both channels dedupes to one row; a run with no sink wired degrades to the old log grep exactly as before.Why this is the robust shape and not "emit the line last". Moving the protocol line to close-report's last line defeats
| tailbut not| head(and vice-versa); the ticket named both. Only a channel independent of the worker's stdout piping — the sink — actually satisfies "the record must reach the host independently of how the worker pipes close-report's stdout". That was the design choice the ticket asked for.Proof (red-before-green, vendored offline suites).
execute-lib-test.sh1d — a tail-swallowed attempt line (absent from the log) recovered from the sink; 1e — a line on both channels deduped. (18 groups pass.)close-report-test.shT1b — the line lands in the sink file, stdout echo retained. (139 checks pass.)landing-lib-test.sh(121),run-swarm-landing-test.sh(13),run-swarm-stages-test.sh(13),close-report-lib-test.sh(77) all green. Pre-push ts-gate (eslint over the tree) green.Factory-vendored path (ADR 0180). All touched files are vendored. Fix landed on dev-factory cheap-backport branch
backport/idss-2106(SHAedde808, off the current pin06f6576), then re-vendored here:.sandcastle/FACTORY_REF06f6576→edde808, the 6 files updated byte-identical,FACTORY_MANIFESTno churn,check-harness-drift.shOK inline. (The "~533 behind main" advisory is the standing #1684 job, unchanged.)Follow-ups filed (out of scope here).
record-run-result.shvia main.mts, pairingSANDCASTLE_ATTEMPTlines out ofresult.stdout) has the SAME stdout fragility, but it is attempts/spend accounting (no landed work lost), lower-stakes, so not folded in.backport/idss-2106onto dev-factorymainas a reviewed PR (dev-factory isLANDING=pr).Ruled by agent under ADR 0174 — veto anytime. Revertible:
git revert c9ac8704+ reset the backport branch. Provable: the vendored red-before-green suites above.