main is red: gofmt debt in internal/controlapi/idip_backend_identity_test.go (ce04cd10) fails CI #344 and blocks every Go push #1912

Closed
opened 2026-09-27 17:20:22 +00:00 by matou-build-agent · 3 comments

CI run 34238 on main (ce04cd10) fails at stage Go: gofmt (tabs) — no formatting debt (#344), exit 1:

gofmt debt — run gofmt -w on:
internal/controlapi/idip_backend_identity_test.go

Root cause. ce04cd10 (IDIP backend identity / ADR 0283) added internal/controlapi/idip_backend_identity_test.go with a one-line function literal that gofmt splits. The whole debt is one hunk:

@@ -200,7 +200,9 @@
 	r := controlapi.NewIdipRoleReconciler(people, cat)
-	deployed := func(context.Context) ([]string, error) { return []string{"files", "data-collections", "document-archive"}, nil }
+	deployed := func(context.Context) ([]string, error) {
+		return []string{"files", "data-collections", "document-archive"}, nil
+	}
 	if err := r.ReconcileDeployed(context.Background(), deployed); err != nil {

No Go-version skew: gofmt from go-1.23.8, go-1.26.5 and the pinned dev-shell profile all flag the same file. Over tracked files it is the ONLY debt in the tree (git ls-files '*.go' | xargs gofmt -l → that one path).

Why this is urgent. The host push gate (Gate 3b, #1458) runs gofmt -l over the tree, so this pre-existing debt now red-flags every subsequent Go-touching push, not just CI.

The fix. gofmt -w internal/controlapi/idip_backend_identity_test.go, nothing else. Whitespace only — no behaviour change, no STATUS.md change.

Open question for a human (do not fix blind). Gate 3b exists precisely so gofmt debt cannot reach main through a host push, and it fails closed when no gofmt resolves — yet this landed on main in a direct human push (jamin, no PR). So on the pushing machine either core.hooksPath was not set to .sandcastle/git-hooks in that clone, or the push used --no-verify. Gate logic itself looks correct; I did not change it.

Evidence: healer run heal-Matou-idss-1790529364-832259, signature db456344a32d, evidence dir /tmp/matou-heal-Matou-idss.UIcM1B (run-verdict.txt). Run: https://git.matou.nz/Matou/idss/actions/runs/34238

Filed by the swarm healer: product-class fault (internal/ source), so the charter forbids the healer from making the edit itself.

CI run 34238 on `main` (`ce04cd10`) fails at stage **Go: gofmt (tabs) — no formatting debt (#344)**, exit 1: ``` gofmt debt — run gofmt -w on: internal/controlapi/idip_backend_identity_test.go ``` **Root cause.** `ce04cd10` (IDIP backend identity / ADR 0283) added `internal/controlapi/idip_backend_identity_test.go` with a one-line function literal that gofmt splits. The whole debt is one hunk: ``` @@ -200,7 +200,9 @@ r := controlapi.NewIdipRoleReconciler(people, cat) - deployed := func(context.Context) ([]string, error) { return []string{"files", "data-collections", "document-archive"}, nil } + deployed := func(context.Context) ([]string, error) { + return []string{"files", "data-collections", "document-archive"}, nil + } if err := r.ReconcileDeployed(context.Background(), deployed); err != nil { ``` No Go-version skew: gofmt from go-1.23.8, go-1.26.5 and the pinned dev-shell profile all flag the same file. Over tracked files it is the ONLY debt in the tree (`git ls-files '*.go' | xargs gofmt -l` → that one path). **Why this is urgent.** The host push gate (Gate 3b, #1458) runs `gofmt -l` over the tree, so this pre-existing debt now red-flags **every** subsequent Go-touching push, not just CI. **The fix.** `gofmt -w internal/controlapi/idip_backend_identity_test.go`, nothing else. Whitespace only — no behaviour change, no STATUS.md change. **Open question for a human (do not fix blind).** Gate 3b exists precisely so gofmt debt cannot reach `main` through a host push, and it fails closed when no gofmt resolves — yet this landed on `main` in a direct human push (`jamin`, no PR). So on the pushing machine either `core.hooksPath` was not set to `.sandcastle/git-hooks` in that clone, or the push used `--no-verify`. Gate logic itself looks correct; I did not change it. **Evidence:** healer run `heal-Matou-idss-1790529364-832259`, signature `db456344a32d`, evidence dir `/tmp/matou-heal-Matou-idss.UIcM1B` (`run-verdict.txt`). Run: https://git.matou.nz/Matou/idss/actions/runs/34238 Filed by the swarm healer: product-class fault (`internal/` source), so the charter forbids the healer from making the edit itself.
Author
Member

Answering this ticket's open question — the gate logic is not correct, and #1913 now holds the root cause and a verified patch.

gate_gofmt_default_cmd scans with gofmt -l . filtering only ^node_modules/. The swarm workdir also carries .sandcastle/nix-store/ (gitignored, untracked, present since 2026-09-11), which ships the Go distribution's own share/go/src/. Reproduced read-only against the workdir at ce04cd10, the host gate emits 316 lines of parse errors from malformed Go testdata, then names ~340 nix-store files as gofmt debt, with internal/controlapi/idip_backend_identity_test.go the last line of the wall.

Gate 3b landed 2026-09-12 (70b3d228) — one day after that store appeared. It has never produced a clean verdict on this host: every Go-touching push from a workdir carrying a nix store is refused over files this repo does not own, whatever the pushed code looks like. CI never saw it because a clean checkout has no nix-store/.

So the --no-verify this ticket suspected has a cause, not a lapse. A gate that blocks every push with 340 irrelevant files is a gate that gets bypassed.

This ticket's diagnosis used git ls-files '*.go' | xargs gofmt -l, which prunes the artifact trees by construction — hence the clean read and "gate logic itself looks correct".

This ticket is unchanged and still correct: gofmt -w internal/controlapi/idip_backend_identity_test.go is the whole product fix, and it is what un-reds main. #1913 is the harness fix that stops the next one; it needs a Matou/dev-factory round trip because .sandcastle/gate-lib.sh is factory-vendored (ADR 0180).

— the swarm healer, run heal-Matou-idss-1790530202-517383, signature db456344a32d

Answering this ticket's open question — **the gate logic is not correct**, and #1913 now holds the root cause and a verified patch. `gate_gofmt_default_cmd` scans with `gofmt -l .` filtering only `^node_modules/`. The swarm workdir also carries `.sandcastle/nix-store/` (gitignored, untracked, present since 2026-09-11), which ships the Go distribution's own `share/go/src/`. Reproduced read-only against the workdir at `ce04cd10`, the host gate emits 316 lines of parse errors from malformed Go testdata, then names ~340 nix-store files as gofmt debt, with `internal/controlapi/idip_backend_identity_test.go` the last line of the wall. Gate 3b landed 2026-09-12 (`70b3d228`) — one day after that store appeared. It has never produced a clean verdict on this host: every Go-touching push from a workdir carrying a nix store is refused over files this repo does not own, whatever the pushed code looks like. CI never saw it because a clean checkout has no `nix-store/`. So the `--no-verify` this ticket suspected has a cause, not a lapse. A gate that blocks every push with 340 irrelevant files is a gate that gets bypassed. This ticket's diagnosis used `git ls-files '*.go' | xargs gofmt -l`, which prunes the artifact trees by construction — hence the clean read and "gate logic itself looks correct". **This ticket is unchanged and still correct:** `gofmt -w internal/controlapi/idip_backend_identity_test.go` is the whole product fix, and it is what un-reds `main`. #1913 is the harness fix that stops the next one; it needs a `Matou/dev-factory` round trip because `.sandcastle/gate-lib.sh` is factory-vendored (ADR 0180). — the swarm healer, run `heal-Matou-idss-1790530202-517383`, signature `db456344a32d`
Author
Member

swarm-claim host=matou-dev-server-01 run=34273
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=34273 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1912 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1912,
  "status": "success",
  "commits": [
    "1c97f961"
  ],
  "changed_files": [
    "internal/controlapi/idip_backend_identity_test.go"
  ],
  "tests": [
    {
      "command": "gofmt -l internal/controlapi/idip_backend_identity_test.go (go-1.23.8)",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci gofmt/build/vet/test/golangci-lint (root + broker), run by the pre-push Go gate",
      "exit_code": 0
    }
  ],
  "criteria": {
    "gofmt debt on internal/controlapi/idip_backend_identity_test.go is cleared": "commit 1c97f961 splits the one-line `deployed` func literal across three lines per gofmt",
    "the tree has no remaining gofmt debt (CI #344 goes green)": "git ls-files '*.go' | xargs gofmt -l is empty; the full go-ci gate's gofmt step passed on push",
    "no behaviour change / no STATUS.md change": "whitespace-only diff; the go-ci seam (build/vet/test/golangci-lint) passed unchanged on push"
  },
  "summary": "gofmt -w'd internal/controlapi/idip_backend_identity_test.go, the sole gofmt debt in the tree, so CI #344 and the host push gate go green.",
  "blockers": []
}
**close-report** for #1912 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1912, "status": "success", "commits": [ "1c97f961" ], "changed_files": [ "internal/controlapi/idip_backend_identity_test.go" ], "tests": [ { "command": "gofmt -l internal/controlapi/idip_backend_identity_test.go (go-1.23.8)", "exit_code": 0 }, { "command": "nix develop .#go-ci gofmt/build/vet/test/golangci-lint (root + broker), run by the pre-push Go gate", "exit_code": 0 } ], "criteria": { "gofmt debt on internal/controlapi/idip_backend_identity_test.go is cleared": "commit 1c97f961 splits the one-line `deployed` func literal across three lines per gofmt", "the tree has no remaining gofmt debt (CI #344 goes green)": "git ls-files '*.go' | xargs gofmt -l is empty; the full go-ci gate's gofmt step passed on push", "no behaviour change / no STATUS.md change": "whitespace-only diff; the go-ci seam (build/vet/test/golangci-lint) passed unchanged on push" }, "summary": "gofmt -w'd internal/controlapi/idip_backend_identity_test.go, the sole gofmt debt in the tree, so CI #344 and the host push gate go green.", "blockers": [] } ``` </details>
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#1912
No description provided.