test: lock Go↔TS DNS-rule parity via shared fixture (fixes drift)#13
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) andweb/src/lib/domains.ts(web). They had already diverged: the Go CLI emitted only the apex A record — no recommendedwwwCNAME and no required/optional flag — while the web emitted both. A tenant following the CLI's output would never set upwww.testdata/dns-instructions.json(host + options → expected records), asserted by both suites (structural fields only; human-readable notes may differ).wwwCNAME;DNSRecordgainsOptional; CLIdnsnow shows aNEEDEDcolumn.internal/mappings/dns_parity_test.goandweb/src/lib/domains.parity.test.ts.Audited as bona fide (not a no-op)
Mutation-tested both sides: flipping the
wwwrecord'soptionalmakes 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