wire: snake-case — one wire convention before the wire ossifies #126

Closed
opened 2026-07-26 22:03:38 +00:00 by ben · 1 comment
Owner

Parent

Standards debt (docs/CODING-STANDARDS.md: wire fields snake_case). Filed from Ben's rulings 2026-07-26 after the review sweep of 6596977..9e946b7: integration-last was deliberate seam-first sequencing — now build the integration layer; and pay all standards debt now.

What to build

The split wire ends: the camelCase JSON tags in the backup, founding, member, rescue, update and monitor packages flip to snake_case, matching the packages that already comply (breakglass, clan, enroll, join, protocol). TS-side fixtures and parsers that mirror those frames follow in the same change. This lands before any real transport ships, while nothing external consumes the wire and no deployed state persists old-tag frames.

Acceptance criteria

  • Given every JSON tag in the Go modules, then one convention (snake_case) holds — a sweep finds zero camelCase wire fields.
  • Given the TS fixtures/parsers that mirror those frames, they match the new tags and all suites stay green.
  • Given persisted-state stores (resume blobs, ledgers), their round-trip tests pass on the new tags.

Blocked by

None — can start immediately.

Task manifest

task: standards:wire-snake-case
implements_flow: none
implements_edge: "none — wide mechanical refactor (single-pass; wire has no external consumers yet)"
wireframe: "none; the seam contract IS the design"
interface: "one snake_case convention across every JSON-tagged wire type in the Go modules + mirrored TS fixtures"
seam: "existing marshal/round-trip tests green on the new tags; a convention check preventing regression"
acceptance: "see Acceptance criteria above"
depends_on: []
out_of_scope: [protocol semantics, new endpoints]
needs_human_decision: []
## Parent Standards debt (docs/CODING-STANDARDS.md: wire fields snake_case). Filed from Ben's rulings 2026-07-26 after the review sweep of `6596977..9e946b7`: integration-last was deliberate seam-first sequencing — now build the integration layer; and pay all standards debt now. ## What to build The split wire ends: the camelCase JSON tags in the backup, founding, member, rescue, update and monitor packages flip to snake_case, matching the packages that already comply (breakglass, clan, enroll, join, protocol). TS-side fixtures and parsers that mirror those frames follow in the same change. This lands before any real transport ships, while nothing external consumes the wire and no deployed state persists old-tag frames. ## Acceptance criteria - [ ] Given every JSON tag in the Go modules, then one convention (snake_case) holds — a sweep finds zero camelCase wire fields. - [ ] Given the TS fixtures/parsers that mirror those frames, they match the new tags and all suites stay green. - [ ] Given persisted-state stores (resume blobs, ledgers), their round-trip tests pass on the new tags. ## Blocked by None — can start immediately. ## Task manifest ```yaml task: standards:wire-snake-case implements_flow: none implements_edge: "none — wide mechanical refactor (single-pass; wire has no external consumers yet)" wireframe: "none; the seam contract IS the design" interface: "one snake_case convention across every JSON-tagged wire type in the Go modules + mirrored TS fixtures" seam: "existing marshal/round-trip tests green on the new tags; a convention check preventing regression" acceptance: "see Acceptance criteria above" depends_on: [] out_of_scope: [protocol semantics, new endpoints] needs_human_decision: [] ```
Author
Owner

Done in 35d9477 (on main). One snake_case wire convention, CI-enforced.

  • 269 camelCase JSON tags in 55 production .go files flipped to snake_case — backup, founding, member, rescue, update, monitor, plus the stragglers the body list missed (brandkit, breakglass, catalogue, fleetstate, provision). Only the tag name before the comma changed; ,omitempty and every Go type/identifier untouched. Verified no Go code references a tag name as a string literal, so persisted-state (resume blobs, ledgers) round-trips hold.
  • New AST convention guard internal/wireconvention/convention_test.go walks the whole tree and fails on any camelCase wire tag — this test IS the acceptance sweep and the regression fence. Scoped to production (non-_test) files: the sole surviving camelCase tag, oneOf in brandkit/validate_test.go, is a JSON Schema keyword decoded from an external document (not our wire) and must stay.
  • TS unchanged: the wire has no external consumers, dashboard/app component state is camelCase by the standard (the snake_case↔camelCase split lives at the yet-unbuilt lib/api transport boundary), and no TS fixture/parser reads raw wire keys (no JSON.parse, no snake_case wire reads) — nothing to flip, suites unaffected.

Acceptance: every clause met — sweep finds zero camelCase wire fields (guard green); no TS wire-key fixtures/parsers exist to update and TS suites stay green; Go marshal/round-trip tests pass on the new tags.

Verify: go build/vet/test ./... green on both modules, gofmt clean, wireconvention test green. golangci-lint/pnpm not in the sandbox — CI (nix develop -c scripts/seam-smoke.sh) runs them. STATUS.md updated (header + milestone log).

Done in `35d9477` (on `main`). **One snake_case wire convention, CI-enforced.** - **269 camelCase JSON tags in 55 production `.go` files flipped to snake_case** — backup, founding, member, rescue, update, monitor, plus the stragglers the body list missed (brandkit, breakglass, catalogue, fleetstate, provision). Only the tag name before the comma changed; `,omitempty` and every Go type/identifier untouched. Verified no Go code references a tag name as a string literal, so persisted-state (resume blobs, ledgers) round-trips hold. - **New AST convention guard** `internal/wireconvention/convention_test.go` walks the whole tree and fails on any camelCase wire tag — this test IS the acceptance sweep and the regression fence. Scoped to production (non-`_test`) files: the sole surviving camelCase tag, `oneOf` in `brandkit/validate_test.go`, is a JSON **Schema** keyword decoded from an external document (not our wire) and must stay. - **TS unchanged**: the wire has no external consumers, dashboard/app component state is camelCase by the standard (the snake_case↔camelCase split lives at the yet-unbuilt `lib/api` transport boundary), and no TS fixture/parser reads raw wire keys (no `JSON.parse`, no snake_case wire reads) — nothing to flip, suites unaffected. **Acceptance:** every clause met — sweep finds zero camelCase wire fields (guard green); no TS wire-key fixtures/parsers exist to update and TS suites stay green; Go marshal/round-trip tests pass on the new tags. **Verify:** `go build/vet/test ./...` green on both modules, `gofmt` clean, `wireconvention` test green. `golangci-lint`/`pnpm` not in the sandbox — CI (`nix develop -c scripts/seam-smoke.sh`) runs them. STATUS.md updated (header + milestone log).
ben closed this issue 2026-07-27 11:10:21 +00:00
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.

Reference
Matou/idss#126
No description provided.