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#2110
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?
Split off from #2106 (which fixed the #283 stranded-close reconcile).
While fixing #2106 — the
landing_reopen_stranded_closesreconcile reading theSANDCASTLE_ATTEMPTline only out of the worker's stdout, which a worker's own| tail/| headon close-report can truncate away (run 57327 stranded #2099) — I found the SAME fragility in a second, independent consumer of that line:#574's swarm.db telemetry parse.
main.mts(theif (swarmDbRunId)block, ~L505) handsresult.stdouttorecord-run-result.sh, which pairsclose-report.sh'sSANDCASTLE_ATTEMPTmarker lines (parsed out of the combined stdout) againstresult.iterationsin order to write theattempts/spendtables. Thatresult.stdoutis the SAME worker stdout a| tail/| headon close-report can truncate — so a worker that pipes close-report truncates its attempt/spend telemetry out of swarm.db, silently.Why it was left out of #2106: #2106 is scoped to the stranded-close reconcile (losing landed-looking WORK is high-stakes — a closed issue whose commits are not on
main). The #574 path is attempts/spend ACCOUNTING — lower stakes, no work lost — so widening #2106 to it would have been scope creep. Filed here instead.The fix shape #2106 already laid down: #2106 added a host-mounted WRITABLE sink (
main.mts's run-scopedHOST_ATTEMPTS_DIRat/run/host-attempts, exported host-side asSWARM_HOST_ATTEMPTS_DIR/EXECUTE_ATTEMPTS_SINK) thatclose-report.shappends everySANDCASTLE_ATTEMPTline to, independent of its stdout piping.record-run-result.sh(run host-side by main.mts) could read that same sink instead of / in union withresult.stdout, but its pairing logic keys lines againstresult.iterationsin order with no issue number of its own, so it is not a drop-in and needs a design pass on how to pair sink lines to iterations.Vendored-file note (ADR 0180):
close-report.sh,execute-lib.sh,main.mts,run-swarm.shandrecord-run-result.share all factory-vendored, so like #2106 the fix lands via a dev-factory backport branch + re-vendor, not an in-repo edit.Ruled by agent under ADR 0174 — veto anytime.
Ruling: category
bug, stateready-for-session(notready-for-agent, notneeds-design).Why a two-way door. Hardening the #574 swarm.db telemetry parse against the worker-stdout truncation #2106 already fixed for the reconcile is not on the one-way-door list — no personal credentials, no security-posture widening, no member-facing trust accept, no data destruction, no non-routine spend. It is revertible (
git revertthe idss re-vendor commit + reset the dev-factory backport branch, exactly as #2106/#2104 were ruled) and provable by the harness's own offline suites (theexecute-lib-test.sh/record-run-resultseams, red-before-green in the #2106 shape).Why
ready-for-sessionand notready-for-agent. The whole deliverable lives in factory-vendored.sandcastle/files —close-report.sh,execute-lib.sh,main.mts,run-swarm.sh,record-run-result.sh(all inFACTORY_MANIFEST). The #445 protected-paths boundary fingerprints.sandcastle/around every worker run and rolls back + fails loud on any introduced change, so a swarm worker cannot land this at all (andlist-ready-tasks.shreads onlyready-for-agent). Like #2106/#2104 it lands via a dev-factory backport branch + re-vendor — cross-repo push standing a swarm worker lacks. Consistent with those parents.Why not
needs-design.needs-designis for a missing/proposedUX flow, wireframe or seam contract (docs/ux/flows,docs/ux/wireframes,docs/seams). The open question here — how to pair sink lines toresult.iterationswith no issue number of their own — is a harness implementation decision the standing session makes inline, not a design-tier artifact that must exist first.What proves it. The #2106 sink (
SANDCASTLE_ATTEMPT_SINK//run/host-attempts) already exists and is written byclose-report.shindependent of its stdout piping; the session unionsrecord-run-result.sh'sresult.stdoutparse with that sink (or replaces it), driven red-before-green by the harness suites, exactly as #2106's reconcile fix was. Revert on idss + the backport branch if wrong.No origin marker — this is not an app-report descendant (it split from #2106).
Close report — landed on
main(push mode)What landed:
record-run-result.sh's#574attempts/spend telemetry parse now reads theSANDCASTLE_ATTEMPTmarkers from the #2106 host sink in preference to the worker's stdout — the same fragility #2106 fixed for the #283 reconcile, here lower-stakes (accounting, no work lost) but it also silently misaligned the positional zip for every iteration after a truncated one.The design pass the ticket asked for (how to pair sink lines to iterations): the sink's append order is iteration order —
close-report.shruns once per iteration, in order, somain.mtsreads the sink into the payload as.attemptsSinkandrecord-run-result.sh's existingmarkers[i] → iterations[i]positional zip is a drop-in over it, complete where stdout was lossy. Preferred, notsort -u-unioned the way the reconcile does: that consumer needs only the SET and may reorder; this one needs the ORDER. Falls back to.stdoutwhen no sink was captured (barepnpm run sandcastle, or a best-effort sink skip ⇒ exactly pre-#2110). The#200account-fp lines stay on.stdout—close-report.shdoes not emit them to the sink.Why
main.mtsreads the sink, notrecord-run-result.sh:record-run-result.shruns afterdriveMirrorStop()has alreadyrmSync'dHOST_ATTEMPTS_DIR, so it cannot read the file itself —main.mtscaptures it into the payload before the teardown.Commits
328ec114— vendored fix + STATUS.md,FACTORY_REF edde808→e77a951, pushed tomain.backport/idss-2110e77a951cc3eaa43cebdd3b5f349eab3f0777b344(off the pinedde808, stacked on #2106) —main.mts+record-run-result.sh+ the test.Proof (red-before-green, offline, real script + real swarm-db.py):
record-run-result-test.shgroup: a worker piped close-report through| tail, so iteration 1's901marker never reached.stdout; only902's did. RED before the fix (FAIL: ... MUST be recovered from the sink); GREEN after —901recovered from the sink, both attempts recorded, and the zip correctly pairs901→iteration 1 (111 input tokens),902→iteration 2 (222), no stranded issue-NULL row..attemptsSinkgroup proves the stdout fallback (pre-#2110) still holds.record-run-result: 14 groups passed(was 12).execute-lib-test.sh/close-report-test.shgreen. Vendor drift-gate OK,FACTORY_MANIFESTno churn, clean# Source:(no token leak).Follow-up filed: #2112 — #2106's
execute-lib.shsink read is defeated in production by the samedriveMirrorStopteardown (it readsEXECUTE_ATTEMPTS_SINKaftermain.mtshasrmSync'd the dir on exit; the offline test shimspnpmso the real deletion never runs). Out of #2110's scope (the reconcile consumer) —ready-for-session.Ruled by agent under ADR 0174 — veto anytime. Revertible:
git revert 328ec114+ resetbackport/idss-2110. Provable: the vendored red-before-green suite above.