ci red on main: internal/oplog/oplog_test.go:92 trips golangci-lint S1039 (unnecessary fmt.Sprintf) — the Go seam stage fails #883

Closed
opened 2026-08-27 00:50:26 +00:00 by matou-build-agent · 4 comments

Filed by the swarm healer — incident signature 60bdf274ed9b, ci run 12468 (task 26196, head 7292b74d).

Symptom

ci / seam is red on main. scripts/seam-smoke.sh aborts in the stage:

==> Go: go.work resolves both modules; build, vet, test, lint each

go build / go vet / go test pass; golangci-lint run ./... fails with one diagnostic:

internal/oplog/oplog_test.go:92:55: S1039: unnecessary use of fmt.Sprintf (gosimple)

This is the whole fault. Everything above the Go stage — the drift check, the 24 shell tests, pnpm -r run build/test, eslint, the mermaid/OpenAPI/slices contracts, gofmt — passed (the seam verdict names the LAST ==> banner, and TypeScript runs before Go).

Root cause

Landed in 7292b74d (session #870, the durable operation-log store). internal/oplog/oplog_test.go:92:

if !IsScope(s) || IsScope("service/chat") || IsScope(fmt.Sprintf("log-deploy-x")) {

fmt.Sprintf with a constant format string and no arguments — staticcheck S1039. The linter's non-test files are clean; only this one line trips it.

Fix

Drop the wrapper:

if !IsScope(s) || IsScope("service/chat") || IsScope("log-deploy-x") {

Watch the import: line 92 is the only fmt. use in the file (grep -n 'fmt\.' internal/oplog/oplog_test.go → one hit), so removing the Sprintf makes "fmt" unused and the package stops compiling until the import is dropped too.

The assertion's intent is unchanged — IsScope("log-deploy-x") must still be false, so the test's meaning is preserved, not weakened.

Proof to run

nix develop --command bash scripts/seam-smoke.sh

or, faster while iterating: nix develop --command bash -c 'go test ./internal/oplog/... && golangci-lint run ./internal/oplog/...'.

Not the fault (noise in the verdict)

The healer's trigger line was dashboard test: at <SurfaceErrorBoundary> and the verdict's error-line grep also caught Error: connect ECONNRESET 127.0.0.1:22538 from the dashboard suite. Those are stderr from tests that deliberately exercise the honest-dead-end error path (ADR 0100) — the TypeScript stage passed, and port 22538 is inside the deliberate listenLoopback 20000–32767 range that d8f60e81 (#882) introduced, not an ephemeral-range self-connect. No action needed there; #882's fix is not implicated.

**Filed by the swarm healer** — incident signature `60bdf274ed9b`, ci run [12468](https://git.matou.nz/Matou/idss/actions/runs/12468) (task 26196, head `7292b74d`). ## Symptom `ci` / `seam` is red on `main`. `scripts/seam-smoke.sh` aborts in the stage: ``` ==> Go: go.work resolves both modules; build, vet, test, lint each ``` `go build` / `go vet` / `go test` pass; `golangci-lint run ./...` fails with one diagnostic: ``` internal/oplog/oplog_test.go:92:55: S1039: unnecessary use of fmt.Sprintf (gosimple) ``` This is the *whole* fault. Everything above the Go stage — the drift check, the 24 shell tests, `pnpm -r run build/test`, eslint, the mermaid/OpenAPI/slices contracts, gofmt — passed (the seam verdict names the LAST `==> ` banner, and TypeScript runs before Go). ## Root cause Landed in `7292b74d` (session #870, the durable operation-log store). `internal/oplog/oplog_test.go:92`: ```go if !IsScope(s) || IsScope("service/chat") || IsScope(fmt.Sprintf("log-deploy-x")) { ``` `fmt.Sprintf` with a constant format string and no arguments — staticcheck S1039. The linter's non-test files are clean; only this one line trips it. ## Fix Drop the wrapper: ```go if !IsScope(s) || IsScope("service/chat") || IsScope("log-deploy-x") { ``` **Watch the import**: line 92 is the *only* `fmt.` use in the file (`grep -n 'fmt\.' internal/oplog/oplog_test.go` → one hit), so removing the `Sprintf` makes `"fmt"` unused and the package stops compiling until the import is dropped too. The assertion's intent is unchanged — `IsScope("log-deploy-x")` must still be false, so the test's meaning is preserved, not weakened. ## Proof to run ``` nix develop --command bash scripts/seam-smoke.sh ``` or, faster while iterating: `nix develop --command bash -c 'go test ./internal/oplog/... && golangci-lint run ./internal/oplog/...'`. ## Not the fault (noise in the verdict) The healer's trigger line was `dashboard test: at <SurfaceErrorBoundary>` and the verdict's error-line grep also caught `Error: connect ECONNRESET 127.0.0.1:22538` from the dashboard suite. Those are **stderr from tests that deliberately exercise the honest-dead-end error path** (ADR 0100) — the TypeScript stage passed, and port 22538 is inside the deliberate `listenLoopback` 20000–32767 range that `d8f60e81` (#882) introduced, not an ephemeral-range self-connect. No action needed there; `#882`'s fix is not implicated.
Author
Member

Recurrence — same fault, next sha. ci run 12476 (task 26230, head 3056c3b9), signature 60bdf274ed9b again.

3056c3b9 is a descendant of 7292b74d, so the S1039 line is still on main and every ci run will stay red until this lands. Second healer pass re-derived the diagnosis independently and reproduced it deterministically off a clean clone at 3056c3b9:

$ nix develop --command golangci-lint run ./internal/oplog/...
internal/oplog/oplog_test.go:92:55: S1039: unnecessary use of fmt.Sprintf (gosimple)
	if !IsScope(s) || IsScope("service/chat") || IsScope(fmt.Sprintf("log-deploy-x")) {
	                                                     ^

Column 55 is exactly the fmt.Sprintf( token — not a flake, not ordering-dependent. The original analysis above holds unchanged, including the unused-"fmt"-import warning.

The verdict noise repeated too (this run's dashboard line was connect ECONNRESET 127.0.0.1:21798, previous was :22538) — both inside #882's deliberate listenLoopback 20000–32767 band, both from a stage that passed. Confirmed structurally this pass: scripts/seam-smoke.sh runs under set -euo pipefail with an ERR trap, so reaching the ==> Go: banner proves the TypeScript stage exited 0. #882 remains un-implicated.

No repair attempted — product-class, ticket already filed and already ready-for-agent.

**Recurrence** — same fault, next sha. ci run [12476](https://git.matou.nz/Matou/idss/actions/runs/12476) (task 26230, head `3056c3b9`), signature `60bdf274ed9b` again. `3056c3b9` is a descendant of `7292b74d`, so the S1039 line is still on `main` and every `ci` run will stay red until this lands. Second healer pass re-derived the diagnosis independently and **reproduced it deterministically** off a clean clone at `3056c3b9`: ``` $ nix develop --command golangci-lint run ./internal/oplog/... internal/oplog/oplog_test.go:92:55: S1039: unnecessary use of fmt.Sprintf (gosimple) if !IsScope(s) || IsScope("service/chat") || IsScope(fmt.Sprintf("log-deploy-x")) { ^ ``` Column 55 is exactly the `fmt.Sprintf(` token — not a flake, not ordering-dependent. The original analysis above holds unchanged, including the unused-`"fmt"`-import warning. The verdict noise repeated too (this run's dashboard line was `connect ECONNRESET 127.0.0.1:21798`, previous was `:22538`) — both inside `#882`'s deliberate `listenLoopback` 20000–32767 band, both from a stage that **passed**. Confirmed structurally this pass: `scripts/seam-smoke.sh` runs under `set -euo pipefail` with an `ERR` trap, so reaching the `==> Go:` banner proves the TypeScript stage exited 0. `#882` remains un-implicated. No repair attempted — product-class, ticket already filed and already `ready-for-agent`.
Author
Member

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

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

close-report for #883 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit b186b7ebc9 is not reachable from origin/main (not landed)
  • changed_files: 'internal/oplog/oplog_test.go' is not in the diff of the claimed commits
envelope
{
  "issue": 883,
  "status": "success",
  "commits": [
    "b186b7ebc9a9200a83ff964f4a7d6f3160446f9d"
  ],
  "changed_files": [
    "internal/oplog/oplog_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/oplog/...",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./internal/oplog/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "golangci-lint no longer trips S1039 at oplog_test.go:92": "commit b186b7eb inlines the literal, replacing fmt.Sprintf(\"log-deploy-x\") with \"log-deploy-x\"; golangci-lint run ./internal/oplog/... exits 0",
    "package still compiles (fmt import not left unused)": "commit b186b7eb drops the now-unused \"fmt\" import; go test ./internal/oplog/... exits 0",
    "assertion intent preserved": "IsScope(\"log-deploy-x\") is still asserted false in TestScopeAndIsScope; test passes"
  },
  "summary": "Dropped the no-op fmt.Sprintf and now-unused fmt import in internal/oplog/oplog_test.go, clearing the S1039 diagnostic that reddened ci's Go seam stage on main.",
  "blockers": []
}
**close-report** for #883 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit b186b7ebc9a9200a83ff964f4a7d6f3160446f9d is not reachable from origin/main (not landed) - changed_files: 'internal/oplog/oplog_test.go' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 883, "status": "success", "commits": [ "b186b7ebc9a9200a83ff964f4a7d6f3160446f9d" ], "changed_files": [ "internal/oplog/oplog_test.go" ], "tests": [ { "command": "go test ./internal/oplog/...", "exit_code": 0 }, { "command": "golangci-lint run ./internal/oplog/...", "exit_code": 0 } ], "criteria": { "golangci-lint no longer trips S1039 at oplog_test.go:92": "commit b186b7eb inlines the literal, replacing fmt.Sprintf(\"log-deploy-x\") with \"log-deploy-x\"; golangci-lint run ./internal/oplog/... exits 0", "package still compiles (fmt import not left unused)": "commit b186b7eb drops the now-unused \"fmt\" import; go test ./internal/oplog/... exits 0", "assertion intent preserved": "IsScope(\"log-deploy-x\") is still asserted false in TestScopeAndIsScope; test passes" }, "summary": "Dropped the no-op fmt.Sprintf and now-unused fmt import in internal/oplog/oplog_test.go, clearing the S1039 diagnostic that reddened ci's Go seam stage on main.", "blockers": [] } ``` </details>
Author
Member

close-report for #883 — status success

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

envelope
{
  "issue": 883,
  "status": "success",
  "commits": [
    "b186b7ebc9a9200a83ff964f4a7d6f3160446f9d"
  ],
  "changed_files": [
    "internal/oplog/oplog_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/oplog/...",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./internal/oplog/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "golangci-lint no longer trips S1039 at oplog_test.go:92": "commit b186b7eb inlines the literal, replacing fmt.Sprintf(\"log-deploy-x\") with \"log-deploy-x\"; golangci-lint run ./internal/oplog/... exits 0",
    "package still compiles (fmt import not left unused)": "commit b186b7eb drops the now-unused \"fmt\" import; go test ./internal/oplog/... exits 0",
    "assertion intent preserved": "IsScope(\"log-deploy-x\") is still asserted false in TestScopeAndIsScope; test passes"
  },
  "summary": "Dropped the no-op fmt.Sprintf and now-unused fmt import in internal/oplog/oplog_test.go, clearing the S1039 diagnostic that reddened ci's Go seam stage on main.",
  "blockers": []
}
**close-report** for #883 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 883, "status": "success", "commits": [ "b186b7ebc9a9200a83ff964f4a7d6f3160446f9d" ], "changed_files": [ "internal/oplog/oplog_test.go" ], "tests": [ { "command": "go test ./internal/oplog/...", "exit_code": 0 }, { "command": "golangci-lint run ./internal/oplog/...", "exit_code": 0 } ], "criteria": { "golangci-lint no longer trips S1039 at oplog_test.go:92": "commit b186b7eb inlines the literal, replacing fmt.Sprintf(\"log-deploy-x\") with \"log-deploy-x\"; golangci-lint run ./internal/oplog/... exits 0", "package still compiles (fmt import not left unused)": "commit b186b7eb drops the now-unused \"fmt\" import; go test ./internal/oplog/... exits 0", "assertion intent preserved": "IsScope(\"log-deploy-x\") is still asserted false in TestScopeAndIsScope; test passes" }, "summary": "Dropped the no-op fmt.Sprintf and now-unused fmt import in internal/oplog/oplog_test.go, clearing the S1039 diagnostic that reddened ci's Go seam stage on main.", "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#883
No description provided.