Pre-push drift gate is fail-open on TRANSPORT: a sandbox worker with no factory network can push a vendored-path edit (design call) #1965
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#1965
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 #1964 (factory drift on main: gate 9 was authored into vendored
.sandcastle/files by a sandbox worker and pushed without the seam stage catching it pre-push).The gap (CONFIRMED)
.sandcastle/git-hooks/pre-pushgate 1 (the #932 drift gate) is fail-open by design. At line ~85 it emitsDRIFT_BLOCKonly whencheck-harness-drift.shexits non-zero and its output contains a^DRIFT:orcheck-harness-drift: FAILEDline:A sandbox worker whose factory fetch cannot reach
git.matou.nzgetscheck-harness-drift.shexit 3 (TRANSPORT) — drift was never read, so the output has neither marker — and the push falls through. So the pre-push gate can never block a sandbox-authored vendored edit when the sandbox has no factory network. Theseamstage onmainis then the only real gate — which is exactly how #1963's gate-9 edit landed drift ontomain(see #1964).Confirmed by reading the shipped hook on
f2dde647; the specific #1963 worker log was not in #1964's evidence, so the "this is what happened to #1963" attribution stays inferred, but the gate behaviour itself is confirmed from the code.Why this needs a design call (not a two-way fix)
The fail-open posture is deliberate (the hook comments say so). Flipping gate 1 to fail-closed on a TRANSPORT error would block every push from any workdir that cannot reach the factory — a fleet-wide wedge whenever
git.matou.nzis unreachable or a sandbox is offline by policy. That is a real tradeoff, not an obvious bug. Options a session/human should weigh:.sandcastle/git-hooks/pre-pushis a factory-vendored protected path (#445 / ADR 0180): any change lands upstream inMatou/dev-factoryfirst, then re-vendors here — it cannot be edited in this repo.Ruled by agent under ADR 0174 while working #1964 — filing the follow-up rather than folding a protected-path machinery change into the drift-clearing ticket. Veto anytime.
Close-report — the drift gate now fails CLOSED on an unverified vendored-file push
Ruled by agent under ADR 0174 — veto anytime. This was the "design call" the ticket asked for; recorded as design DDR
docs/adr/0287-design-the-drift-gate-fails-closed-on-an-unverified-vendored-edit.md.The ruling (among the ticket's three options)
Option 2, realised at the pre-push gate itself: once the gate's cheap local pre-filter confirms a
FACTORY_MANIFESTpath is in the push,check-harness-drift.shmust return a CLEAN verdict (exit 0) for the push to proceed. Every non-zero blocks — confirmed drift → the existing#932message; a TRANSPORT fault (exit 3) or any other non-zero without a drift marker → a newVERIFY_BLOCK/#1965message naming the unverified edit.Not option 1 (sandbox-detection), and the "fleet-wide wedge" fear does not apply. The gate runs the network drift check only when the pushed range touches a vendored path — so the fail-closed path is unreachable for an ordinary push and for
run-swarm.sh's reconcile push (both return before the check runs and stay fail-open). The case (a vendored-file edit that cannot be verified) is the scope; an actor test is redundant, and it would leave a host/human vendored edit during an outage equally unverified. This honours the principlecheck-harness-drift.shis already built around and cites (GOTCHAS #30 — a guard that could not reach the code it guards must never be mistaken for a clean result; it already retries a blip before exiting 3, so only a sustained outage lands here). Option 3 (make theseamred block the land) is a larger, different-subsystem change and forfeits the "last revertible moment" this gate exists for.What landed
Matou/dev-factory@1aba93c(direct push tomain, the #1940/#1943/#1964 precedent):git-hooks/pre-push— the gate's tail now requires exit 0 and emitsDRIFT_BLOCKvsVERIFY_BLOCK;tests/prepush-drift-gate-test.shupdated.Matou/idss@99e74ea8: re-vendored (FACTORY_REF 78db030 → 1aba93c,git-hooks/pre-push+tests/prepush-drift-gate-test.shbyte-identical from the pin,check-harness-drift.sh→ OK), design DDR 0287, and STATUS.md.Proof (TDD, offline)
tests/prepush-drift-gate-test.shdrives realgit pushes to a local bare remote so git invokes the hook with genuine stdin:2a7f031..17560c6), case 4 failed.prepush-drift-gate-test: PASS.#1965message); case 4b added (a TRANSPORT exit-3 fault blocks); case 1b added (an ordinary push stays fail-open under a transport fault — the reconcile rail / an offline workdir is untouched).commit-msg-gate-test.sh9/0,gate-lib-test.sh34,check-harness-drift-test.sh14.Notes
FACTORY_REFbump, proven by an existing offline test. It is a tightening of an integrity gate, not a security-posture widening — not on ADR 0174's one-way-door list;.sandcastle/is protected (#445), a session's standing.prompt.mdagainst the pinned skeleton (prompt.mdis rendered, never hand-edited).FACTORY_REF, so blast radius is contained.