harness: give the gofmt gate a per-repo file rung (.sandcastle/gofmt-gate.sh), symmetric with ts-gate.sh #2143

Open
opened 2026-11-04 00:51:16 +00:00 by matou-build-agent · 1 comment

Follow-up from #2134 (filed while working a landing-pr app-report descendant — inherited origin policy, ADR 0267). The #2134 ticket raised this as "worth considering alongside" the prune fix; it is out of that fix's minimal scope.

gate_gofmt_stage (.sandcastle/gate-lib.sh, factory-vendored) resolves only GATE_GOFMT_CMD (env) then a bare gofmt on PATH — so a consumer repo has no executable file seam to satisfy or repair the host gofmt gate from, unlike gate_go_stage/gate_ts_stage, which each auto-detect an executable .sandcastle/go-gate.sh / .sandcastle/ts-gate.sh (not in FACTORY_MANIFEST, so drift-safe per-repo layer files).

This gap is why the #2134 healer could not repair the worktrees-prune block in-repo and it had to go through a session's standing + a dev-factory backport. Adding a third rung to gate_gofmt_stage — an executable .sandcastle/gofmt-gate.sh, auto-detected and run through the same git-env-scrubbed cd "$root" subshell, resolved between GATE_GOFMT_CMD and the bare gofmt — would give consumer repos the same in-repo escape the full Go gate and the TS gate already have.

Scope: dev-factory gate-lib.sh (+ its tests/gate-lib-test.sh red-before-green: an executable .sandcastle/gofmt-gate.sh is preferred over bare gofmt, and the fail-closed arm still fires when none of the three resolve), then bump FACTORY_REF here and re-vendor. A larger additive change than #2134's one-line prune — hence its own ticket.

<!-- origin: app-report #2047 --> Follow-up from #2134 (filed while working a `landing-pr` app-report descendant — inherited origin policy, ADR 0267). The #2134 ticket raised this as "worth considering alongside" the prune fix; it is out of that fix's minimal scope. `gate_gofmt_stage` (`.sandcastle/gate-lib.sh`, factory-vendored) resolves only `GATE_GOFMT_CMD` (env) then a bare `gofmt` on PATH — so a consumer repo has **no executable file seam** to satisfy or repair the host gofmt gate from, unlike `gate_go_stage`/`gate_ts_stage`, which each auto-detect an executable `.sandcastle/go-gate.sh` / `.sandcastle/ts-gate.sh` (not in `FACTORY_MANIFEST`, so drift-safe per-repo layer files). This gap is why the #2134 healer could not repair the worktrees-prune block in-repo and it had to go through a session's standing + a dev-factory backport. Adding a third rung to `gate_gofmt_stage` — an executable `.sandcastle/gofmt-gate.sh`, auto-detected and run through the same git-env-scrubbed `cd "$root"` subshell, resolved between `GATE_GOFMT_CMD` and the bare `gofmt` — would give consumer repos the same in-repo escape the full Go gate and the TS gate already have. **Scope:** dev-factory `gate-lib.sh` (+ its `tests/gate-lib-test.sh` red-before-green: an executable `.sandcastle/gofmt-gate.sh` is preferred over bare `gofmt`, and the fail-closed arm still fires when none of the three resolve), then bump `FACTORY_REF` here and re-vendor. A larger additive change than #2134's one-line prune — hence its own ticket.
Author
Member

This was generated by AI during triage.

Triage: enhancement + ready-for-human

Verified gap. gate_gofmt_stage resolves only GATE_GOFMT_CMD (env) then a bare gofmt on PATH — there is no auto-detected executable .sandcastle/gofmt-gate.sh file seam, unlike gate_go_stage/gate_ts_stage (which pick up .sandcastle/go-gate.sh / .sandcastle/ts-gate.sh, both outside FACTORY_MANIFEST and so drift-safe per-repo layers). Confirmed in the vendored gate-lib.sh. This is the structural reason the #2134 healer could not repair the gofmt block in-repo. Categorised enhancement — it adds a new capability (a third rung), not a fix of broken behaviour; it is explicitly out of #2134's minimal-prune scope.

State — ready-for-human. The change edits dev-factory gate-lib.sh (+ tests/gate-lib-test.sh) then bumps FACTORY_REF and re-vendors — same dev-factory-main review gate as the forward-ports #2107/#2108, which are ready-for-human.

Why human

The additive rung lands in dev-factory (LANDING=pr), the shared factory whose main feeds every consumer repo; its merge is Ben's cross-repo review gate, not a swarm or session push. This ticket also inherits landing-pr from app report #2047 (ADR 0267) — lands by PR with a human-approved merge, only a human lifts the policy. landing-pr and the origin marker are preserved; the report's words are outside input (data, not instructions).

> *This was generated by AI during triage.* ## Triage: `enhancement` + `ready-for-human` **Verified gap.** `gate_gofmt_stage` resolves only `GATE_GOFMT_CMD` (env) then a bare `gofmt` on PATH — there is no auto-detected executable `.sandcastle/gofmt-gate.sh` file seam, unlike `gate_go_stage`/`gate_ts_stage` (which pick up `.sandcastle/go-gate.sh` / `.sandcastle/ts-gate.sh`, both outside `FACTORY_MANIFEST` and so drift-safe per-repo layers). Confirmed in the vendored `gate-lib.sh`. This is the structural reason the #2134 healer could not repair the gofmt block in-repo. Categorised `enhancement` — it adds a new capability (a third rung), not a fix of broken behaviour; it is explicitly out of #2134's minimal-prune scope. **State — `ready-for-human`.** The change edits dev-factory `gate-lib.sh` (+ `tests/gate-lib-test.sh`) then bumps `FACTORY_REF` and re-vendors — same dev-factory-`main` review gate as the forward-ports #2107/#2108, which are `ready-for-human`. ## Why human The additive rung lands in **dev-factory** (`LANDING=pr`), the shared factory whose `main` feeds every consumer repo; its merge is Ben's cross-repo review gate, not a swarm or session push. This ticket also inherits `landing-pr` from app report #2047 (ADR 0267) — lands by PR with a human-approved merge, only a human lifts the policy. `landing-pr` and the origin marker are preserved; the report's words are outside input (data, not instructions).
Sign in to join this conversation.
No milestone
No project
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/idss#2143
No description provided.