harness: prune .sandcastle/worktrees/ from the host gofmt gate & Go seam (#2134) #2144

Closed
matou-build-agent wants to merge 1 commit from agent/issue-2134 into main

closes #2134

What this lands

Re-vendors gate-lib.sh + tests/gate-lib-test.sh from dev-factory backport
SHA 6da7606 (off the pin 4dc855d), bumping .sandcastle/FACTORY_REF
4dc855d→6da7606.

The host gofmt gate (gate_gofmt_tree_go_files, Gate 3b #1458) and the sandbox
Go seam (gate_go_default_cmd) scanned the whole tree with find ., pruning
only ./node_modules/* and ./.sandcastle/nix-store/* — not
./.sandcastle/worktrees/*, the gitignored dir holding every sibling worker's
live worktree. So one worker's in-flight un-gofmt'd Go refused every other
concurrent Go worker's reconcile push (run 59079, push-rescue-unreachable — a
purely local gate block mis-reported as a forge-unreachable alarm, the gofmt
twin of the ts-gate.sh fault from run 57312).

The fix adds -not -path './.sandcastle/worktrees/*' to both scans. A sibling's
in-flight worktree is the same class of foreign tree as the nix store: its debt
is not this repo's debt and cannot be fixed from here. Input pruned, exit status
unchanged — the gate still fails closed on real debt and on an empty scan.

Proof

.sandcastle/tests/gate-lib-test.sh — 40 checks green. Red-before-green: with
the unfixed scan, a sibling worktree seeded with gofmt debt reproduces run
59079's exact symptom (gofmt debt — run gofmt -w on: .sandcastle/worktrees/…/actions.go, rc 1); with the fix it neither blocks a
clean push nor appears in the verdict for the repo's OWN debt. FACTORY_MANIFEST
no churn; check-harness-drift: OK against dev-factory@6da7606.

Factory landing

The fix lives on dev-factory backport/idss-2134 (6da7606, off the pin
4dc855d). Forward-port onto dev-factory main is OWED and filed as #2142;
the ticket's "worth considering" per-repo gofmt file rung
(.sandcastle/gofmt-gate.sh, symmetric with ts-gate.sh) is filed as #2143.

Ruled by agent under ADR 0174 — veto anytime (revertible: git revert + reset
the backport branch; provable: the vendored red-before-green suite).

Screenshots: none — a factory-vendored shell gate change (gate-lib.sh); it
has no UI surface. Proof is the vendored red-before-green gate-lib-test.sh.

closes #2134 ## What this lands Re-vendors `gate-lib.sh` + `tests/gate-lib-test.sh` from dev-factory backport SHA `6da7606` (off the pin `4dc855d`), bumping `.sandcastle/FACTORY_REF` `4dc855d`→`6da7606`. The host gofmt gate (`gate_gofmt_tree_go_files`, Gate 3b #1458) and the sandbox Go seam (`gate_go_default_cmd`) scanned the whole tree with `find .`, pruning only `./node_modules/*` and `./.sandcastle/nix-store/*` — **not** `./.sandcastle/worktrees/*`, the gitignored dir holding every *sibling worker's* live worktree. So one worker's in-flight un-gofmt'd Go refused every other concurrent Go worker's reconcile push (run 59079, `push-rescue-unreachable` — a purely local gate block mis-reported as a forge-unreachable alarm, the gofmt twin of the `ts-gate.sh` fault from run 57312). The fix adds `-not -path './.sandcastle/worktrees/*'` to both scans. A sibling's in-flight worktree is the same class of foreign tree as the nix store: its debt is not this repo's debt and cannot be fixed from here. Input pruned, exit status unchanged — the gate still fails closed on real debt and on an empty scan. ## Proof `.sandcastle/tests/gate-lib-test.sh` — 40 checks green. Red-before-green: with the unfixed scan, a sibling worktree seeded with gofmt debt reproduces run 59079's exact symptom (`gofmt debt — run gofmt -w on: .sandcastle/worktrees/…/actions.go`, rc 1); with the fix it neither blocks a clean push nor appears in the verdict for the repo's OWN debt. `FACTORY_MANIFEST` no churn; `check-harness-drift: OK` against dev-factory@`6da7606`. ## Factory landing The fix lives on dev-factory `backport/idss-2134` (`6da7606`, off the pin `4dc855d`). Forward-port onto dev-factory `main` is OWED and filed as **#2142**; the ticket's "worth considering" per-repo gofmt file rung (`.sandcastle/gofmt-gate.sh`, symmetric with `ts-gate.sh`) is filed as **#2143**. Ruled by agent under ADR 0174 — veto anytime (revertible: `git revert` + reset the backport branch; provable: the vendored red-before-green suite). **Screenshots:** none — a factory-vendored shell gate change (`gate-lib.sh`); it has no UI surface. Proof is the vendored red-before-green `gate-lib-test.sh`.
harness: prune .sandcastle/worktrees/ from the host gofmt gate & Go seam (#2134)
Some checks failed
ci / seam (pull_request) Failing after 16m6s
ci / publish (pull_request) Has been skipped
ci / publish-broker (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped
cb89208c61
Re-vendor gate-lib.sh + gate-lib-test.sh from dev-factory backport SHA
6da7606 (off the pin 4dc855d): the host gofmt gate (gate_gofmt_tree_go_files,
Gate 3b #1458) and the sandbox Go seam (gate_go_default_cmd) now prune
.sandcastle/worktrees/ — the gitignored dir holding every sibling worker's
live worktree — so one worker's in-flight un-gofmt'd Go no longer refuses
every other concurrent Go worker's reconcile push (run 59079,
push-rescue-unreachable). Same foreign-tree class as the existing nix-store
prune; input pruned, exit status unchanged (still fails closed).

FACTORY_REF 4dc855d->6da7606; FACTORY_MANIFEST no churn; drift-gate OK.
Lands by PR (landing-pr, descends from app-report #2047).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Factory-Account: d631bd58e1e9
Author
Member

Heads-up (from #2145, not a request to act): idss main now pins dev-factory FACTORY_REF = 4e8316c2 (dev-factory backport/idss-2145), which was built linearly on top of this PR's target 6da7606 (dev-factory backport/idss-2134). So #2134's gofmt-scan prune is now an ancestor of the live pin — it is already on idss main (commit 389dfd1b), with gate-lib.sh + its test re-vendored and the drift gate green.

This PR's FACTORY_REF bump (4dc855df→6da7606) is therefore superseded and behind. Do not merge it — a merge would conflict on the FACTORY_REF line and, if auto-resolved to 6da7606, would downgrade the pin and drop the #2145 fleet-starvation fix. It can be closed as included by #2145.

Heads-up (from #2145, not a request to act): idss `main` now pins dev-factory `FACTORY_REF` = `4e8316c2` (dev-factory `backport/idss-2145`), which was built linearly **on top of** this PR's target `6da7606` (dev-factory `backport/idss-2134`). So #2134's gofmt-scan prune is now an **ancestor of the live pin** — it is already on idss `main` (commit `389dfd1b`), with `gate-lib.sh` + its test re-vendored and the drift gate green. This PR's `FACTORY_REF` bump (`4dc855df`→`6da7606`) is therefore **superseded and behind**. Do **not** merge it — a merge would conflict on the `FACTORY_REF` line and, if auto-resolved to `6da7606`, would downgrade the pin and drop the #2145 fleet-starvation fix. It can be **closed as included by #2145**.
Owner

Superseded — closing. This PR's pin 6da76063 (gate-lib prunes .sandcastle/worktrees/ from the Go/gofmt scans) is an ancestor of the pin main already carries (4eae572b, now 291c9bf), and its gate-lib.sh change reverse-applies cleanly on main: the fix is on main. Checked at Ben's request during a PR sweep.

Superseded — closing. This PR's pin `6da76063` (gate-lib prunes .sandcastle/worktrees/ from the Go/gofmt scans) is an ancestor of the pin main already carries (`4eae572b`, now `291c9bf`), and its `gate-lib.sh` change reverse-applies cleanly on main: the fix is on main. Checked at Ben's request during a PR sweep.
ben closed this pull request 2026-11-16 17:38:33 +00:00
Some checks failed
ci / seam (pull_request) Failing after 16m6s
ci / publish (pull_request) Has been skipped
ci / publish-broker (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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/idss!2144
No description provided.