Skip to content

test: lock Go↔TS DNS-rule parity via shared fixture (fixes drift)#13

Merged
pstaylor-patrick merged 1 commit into
mainfrom
test/dns-parity
May 24, 2026
Merged

test: lock Go↔TS DNS-rule parity via shared fixture (fixes drift)#13
pstaylor-patrick merged 1 commit into
mainfrom
test/dns-parity

Conversation

@pstaylor-patrick

Copy link
Copy Markdown
Collaborator

What this PR does

Locks the DNS-instruction rules in lockstep across Go and TypeScript — and fixes a real drift it surfaced.

The rules live in both internal/mappings (Go, used by the CLI) and web/src/lib/domains.ts (web). They had already diverged: the Go CLI emitted only the apex A record — no recommended www CNAME and no required/optional flag — while the web emitted both. A tenant following the CLI's output would never set up www.

  • Shared contract: testdata/dns-instructions.json (host + options → expected records), asserted by both suites (structural fields only; human-readable notes may differ).
  • Aligned Go to the web: apex → required A + recommended www CNAME; DNSRecord gains Optional; CLI dns now shows a NEEDED column.
  • Parity tests: internal/mappings/dns_parity_test.go and web/src/lib/domains.parity.test.ts.

Audited as bona fide (not a no-op)

Mutation-tested both sides: flipping the www record's optional makes the parity test go red in Go and in TS, and green when restored. So if the two implementations ever drift again, CI catches it.

🤖 Generated with Claude Code

The DNS-instruction rules live in both Go (internal/mappings) and TS
(web/src/lib/domains.ts) and had already drifted: the Go CLI emitted only the
apex A record — no recommended www CNAME, no required/optional flag — while the
web emitted both. A tenant following the CLI's output would not get www.

- testdata/dns-instructions.json: shared contract (host+options → records),
  asserted by BOTH suites (structural fields only; note wording may differ).
- Align Go DNSInstructions with the web: apex → required A + recommended www
  CNAME; DNSRecord gains Optional. CLI `dns` now shows a NEEDED column.
- Parity tests: internal/mappings/dns_parity_test.go + web domains.parity.test.ts.

Audited as bona fide: mutation-tested both sides (flip the www record's
optional → the parity test goes red on Go and on TS; passes when restored).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pstaylor-patrick pstaylor-patrick merged commit 0d95f10 into main May 24, 2026
4 checks passed
@pstaylor-patrick pstaylor-patrick deleted the test/dns-parity branch May 24, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant