seam CI red on main: the App report wire's userAgent tag breaks the repo-wide snake_case wire lint (#126) — rename to user_agent on both sides #1820

Closed
opened 2026-09-24 13:37:41 +00:00 by matou-build-agent · 3 comments

CI (seam, the shared whole-tree Go gate) is red on main at 59de2aa4. This blocks every sandbox Go push, not just this arc.

The fault

scripts/seam-smoke.sh stage "Go: go.work resolves both modules; build, vet, test, lint each" → go test ./...:

--- FAIL: TestWireTags_AreSnakeCase (0.36s)
FAIL	git.matou.nz/Matou/idss/internal/wireconvention	0.361s

Two production wire types declare a camelCase JSON tag with no wireconvention:external marker — the only two unmarked camelCase tags in the tree (every other camelCase tag in internal/coaclient, control-plane/cmd/control-plane/*health.go, internal/vm, internal/clientconfig, agent/internal/meshup, cmd/rehearsal-coa carries the marker; spikes/ is skipped):

  • internal/brokerclient/reports.go:30 — UserAgent string json:"userAgent"``
  • broker/internal/broker/http_reports.go:68 — UserAgent string json:"userAgent"``

The guard is right and the code is wrong: this is our own control-plane → broker wire (DDR 0276), not an external vocabulary, so wireconvention:external is not the answer. The repo convention is one snake_case wire (#126, docs/CODING-STANDARDS.md).

How it got in

The tag landed in 2c1818b2 (brokerclient, 12:52 UTC) and again in 1823218e (broker handler, 13:13 UTC) — host pushes, which do not pass through the sandbox push gate that runs this lint.

The fix (rename to user_agent)

The wire is not ossified yet — POST /v1/reports has never been deployed (#1819 still holds the broker's tracker identity + deploy), so no live sender or receiver reads userAgent. Renaming now is free; after #1819 it is a breaking change. Do it in ONE commit, both sides together:

  1. internal/brokerclient/reports.go — json:"user_agent".
  2. broker/internal/broker/http_reports.go — json:"user_agent".
  3. internal/brokerclient/reports_test.go — the pinned map, the forbidden-field message, the raw["userAgent"] read (TestClient_ReportIssueWirePayloadIsExactlyPinned).
  4. broker/internal/broker/http_reports_test.go — the goodReport fixture.
  5. internal/controlapi/reports_test.go:35 — the body-cannot-forge fixture (the control plane ignores this field, but keep the fixture honest about the wire).
  6. broker/README.md:26 — the POST /v1/reports body row.
  7. docs/adr/0276-…md:36 — the "what travels" table row: a one-line amendment noting the wire name is user_agent (the field is unchanged; only its wire spelling). Same row in docs/superpowers/plans/2026-09-21-report-an-issue-button.md if that plan is still the working contract.

community, title, description, tab, revision are already single lowercase words — userAgent is the only violation.

Acceptance criteria

  • go test ./internal/wireconvention/ passes.
  • go test ./... and cd broker && go test ./... pass; golangci-lint run ./... clean in both modules.
  • No new wireconvention:external marker was added to either reports file.
  • broker/README.md and DDR 0276 name user_agent.
  • bash scripts/seam-smoke.sh reaches the end green (or at least past the Go stages).

Landing note

The change touches broker/**, a deployed-service tree — but nothing is deployed yet, so deploy-pending is redundant here; #1819 will ship it. Worth confirming that read before landing.


Filed by the swarm healer. Heal run heal-Matou-idss-1790256711-2292828; evidence /tmp/matou-heal-Matou-idss.EXxJ5z (run-verdict.txt). Failing run: https://git.matou.nz/Matou/idss/actions/runs/31808

CI (`seam`, the shared whole-tree Go gate) is **red on main** at `59de2aa4`. This blocks every sandbox Go push, not just this arc. ## The fault `scripts/seam-smoke.sh` stage *"Go: go.work resolves both modules; build, vet, test, lint each"* → `go test ./...`: ``` --- FAIL: TestWireTags_AreSnakeCase (0.36s) FAIL git.matou.nz/Matou/idss/internal/wireconvention 0.361s ``` Two production wire types declare a **camelCase** JSON tag with no `wireconvention:external` marker — the only two unmarked camelCase tags in the tree (every other camelCase tag in `internal/coaclient`, `control-plane/cmd/control-plane/*health.go`, `internal/vm`, `internal/clientconfig`, `agent/internal/meshup`, `cmd/rehearsal-coa` carries the marker; `spikes/` is skipped): - `internal/brokerclient/reports.go:30` — `UserAgent string `json:"userAgent"`` - `broker/internal/broker/http_reports.go:68` — `UserAgent string `json:"userAgent"`` The guard is right and the code is wrong: this is **our own** control-plane → broker wire (DDR 0276), not an external vocabulary, so `wireconvention:external` is not the answer. The repo convention is one snake_case wire (#126, `docs/CODING-STANDARDS.md`). ## How it got in The tag landed in `2c1818b2` (brokerclient, 12:52 UTC) and again in `1823218e` (broker handler, 13:13 UTC) — host pushes, which do not pass through the sandbox push gate that runs this lint. ## The fix (rename to `user_agent`) **The wire is not ossified yet** — `POST /v1/reports` has never been deployed (#1819 still holds the broker's tracker identity + deploy), so no live sender or receiver reads `userAgent`. Renaming now is free; after #1819 it is a breaking change. Do it in ONE commit, both sides together: 1. `internal/brokerclient/reports.go` — `json:"user_agent"`. 2. `broker/internal/broker/http_reports.go` — `json:"user_agent"`. 3. `internal/brokerclient/reports_test.go` — the `pinned` map, the forbidden-field message, the `raw["userAgent"]` read (`TestClient_ReportIssueWirePayloadIsExactlyPinned`). 4. `broker/internal/broker/http_reports_test.go` — the `goodReport` fixture. 5. `internal/controlapi/reports_test.go:35` — the body-cannot-forge fixture (the control plane ignores this field, but keep the fixture honest about the wire). 6. `broker/README.md:26` — the `POST /v1/reports` body row. 7. `docs/adr/0276-…md:36` — the "what travels" table row: a one-line amendment noting the wire name is `user_agent` (the field is unchanged; only its wire spelling). Same row in `docs/superpowers/plans/2026-09-21-report-an-issue-button.md` if that plan is still the working contract. `community`, `title`, `description`, `tab`, `revision` are already single lowercase words — `userAgent` is the only violation. ## Acceptance criteria - `go test ./internal/wireconvention/` passes. - `go test ./...` and `cd broker && go test ./...` pass; `golangci-lint run ./...` clean in both modules. - No new `wireconvention:external` marker was added to either reports file. - `broker/README.md` and DDR 0276 name `user_agent`. - `bash scripts/seam-smoke.sh` reaches the end green (or at least past the Go stages). ## Landing note The change touches `broker/**`, a deployed-service tree — but nothing is deployed yet, so `deploy-pending` is redundant here; #1819 will ship it. Worth confirming that read before landing. --- Filed by the swarm healer. Heal run `heal-Matou-idss-1790256711-2292828`; evidence `/tmp/matou-heal-Matou-idss.EXxJ5z` (`run-verdict.txt`). Failing run: https://git.matou.nz/Matou/idss/actions/runs/31808
Author
Member

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

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

Fixed in b3980f75 (landed on main).

The primary fault — the camelCase userAgent wire tag — is renamed to user_agent on both sides (control plane + broker), tests, broker/README.md, DDR 0276 and the working plan. No wireconvention:external marker added (this is our own wire).

Scope note (ruled under ADR 0174 — veto anytime). Fixing the tag alone did NOT get the seam green: the root go test failure was masking a latent broker lint failure that the seam hits the instant the test passes — broker/internal/forgejo/issues.go had three revive exported-comment violations (colon after the identifier), from host push b26e1e3e, the same gate-bypass class this ticket is about. The acceptance clause "golangci-lint run ./... clean in both modules" and "seam past the Go stages" cannot hold without also fixing these. I reworded the three doc comments. This is a two-way door (trivial doc-comment rewording, revertible, proven by golangci-lint), so I ruled it rather than splitting a ticket that would have left main red.

Verified: go test ./... and cd broker && go test ./... pass; golangci-lint run ./... clean in both modules; all Go seam stages green.

Fixed in b3980f75 (landed on main). The primary fault — the camelCase `userAgent` wire tag — is renamed to `user_agent` on both sides (control plane + broker), tests, `broker/README.md`, DDR 0276 and the working plan. No `wireconvention:external` marker added (this is our own wire). **Scope note (ruled under ADR 0174 — veto anytime).** Fixing the tag alone did NOT get the seam green: the root `go test` failure was masking a *latent* broker lint failure that the seam hits the instant the test passes — `broker/internal/forgejo/issues.go` had three `revive` `exported`-comment violations (colon after the identifier), from host push `b26e1e3e`, the same gate-bypass class this ticket is about. The acceptance clause "golangci-lint run ./... clean in both modules" and "seam past the Go stages" cannot hold without also fixing these. I reworded the three doc comments. This is a two-way door (trivial doc-comment rewording, revertible, proven by `golangci-lint`), so I ruled it rather than splitting a ticket that would have left main red. Verified: `go test ./...` and `cd broker && go test ./...` pass; `golangci-lint run ./...` clean in both modules; all Go seam stages green.
Author
Member

close-report for #1820 — status success

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

envelope
{
  "issue": 1820,
  "status": "success",
  "commits": [
    "b3980f75"
  ],
  "changed_files": [
    "internal/brokerclient/reports.go",
    "broker/internal/broker/http_reports.go",
    "internal/brokerclient/reports_test.go",
    "broker/internal/broker/http_reports_test.go",
    "internal/controlapi/reports_test.go",
    "broker/README.md",
    "docs/adr/0276-design-an-app-report-rides-the-broker.md",
    "docs/superpowers/plans/2026-09-21-report-an-issue-button.md",
    "broker/internal/forgejo/issues.go"
  ],
  "tests": [
    {
      "command": "nix develop -c go test ./internal/wireconvention/",
      "exit_code": 0
    },
    {
      "command": "nix develop -c go test ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop -c bash -c 'cd broker && go test ./...'",
      "exit_code": 0
    },
    {
      "command": "nix develop -c golangci-lint run ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop -c bash -c 'cd broker && golangci-lint run ./...'",
      "exit_code": 0
    }
  ],
  "criteria": {
    "go test ./internal/wireconvention/ passes": "TestWireTags_AreSnakeCase green after renaming userAgent->user_agent (reports.go, http_reports.go)",
    "go test ./... and cd broker && go test ./... pass; golangci-lint clean in both modules": "all four commands exit 0 (see tests[]); broker revive fix in issues.go clears the last lint error",
    "No new wireconvention:external marker on either reports file": "renamed the json tag to user_agent; no marker added — verified by diff of reports.go/http_reports.go",
    "broker/README.md and DDR 0276 name user_agent": "broker/README.md:26 body row and DDR 0276:36 what-travels row amended to name the wire spelling user_agent",
    "bash scripts/seam-smoke.sh reaches the end green (or at least past the Go stages)": "all Go seam stages (root build/vet/test/lint, dev-tag build/vet, broker build/vet/test/lint) run green"
  },
  "summary": "Renamed the App report wire's userAgent tag to snake_case user_agent on both sides (DDR 0276), unblocking the whole-tree wire lint and the seam.",
  "blockers": []
}
**close-report** for #1820 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1820, "status": "success", "commits": [ "b3980f75" ], "changed_files": [ "internal/brokerclient/reports.go", "broker/internal/broker/http_reports.go", "internal/brokerclient/reports_test.go", "broker/internal/broker/http_reports_test.go", "internal/controlapi/reports_test.go", "broker/README.md", "docs/adr/0276-design-an-app-report-rides-the-broker.md", "docs/superpowers/plans/2026-09-21-report-an-issue-button.md", "broker/internal/forgejo/issues.go" ], "tests": [ { "command": "nix develop -c go test ./internal/wireconvention/", "exit_code": 0 }, { "command": "nix develop -c go test ./...", "exit_code": 0 }, { "command": "nix develop -c bash -c 'cd broker && go test ./...'", "exit_code": 0 }, { "command": "nix develop -c golangci-lint run ./...", "exit_code": 0 }, { "command": "nix develop -c bash -c 'cd broker && golangci-lint run ./...'", "exit_code": 0 } ], "criteria": { "go test ./internal/wireconvention/ passes": "TestWireTags_AreSnakeCase green after renaming userAgent->user_agent (reports.go, http_reports.go)", "go test ./... and cd broker && go test ./... pass; golangci-lint clean in both modules": "all four commands exit 0 (see tests[]); broker revive fix in issues.go clears the last lint error", "No new wireconvention:external marker on either reports file": "renamed the json tag to user_agent; no marker added — verified by diff of reports.go/http_reports.go", "broker/README.md and DDR 0276 name user_agent": "broker/README.md:26 body row and DDR 0276:36 what-travels row amended to name the wire spelling user_agent", "bash scripts/seam-smoke.sh reaches the end green (or at least past the Go stages)": "all Go seam stages (root build/vet/test/lint, dev-tag build/vet, broker build/vet/test/lint) run green" }, "summary": "Renamed the App report wire's userAgent tag to snake_case user_agent on both sides (DDR 0276), unblocking the whole-tree wire lint and the seam.", "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#1820
No description provided.