feat(domains): what actually happens to a name, and the two verbs a client cannot compose (T46) - #23
Merged
Merged
Conversation
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.
Closes T46. T44 built a DNS server, T45 made a machine send it a name, and this is where a person can
ask what actually happened to one.
Three methods
removecarries no site:site_domains_domainisUNIQUE— the index its own migration calls "theone that decides ownership" — so a name belongs to exactly one site.
The two verbs add no capability, and exist anyway
site.updatealready replaces a site's whole domain list. A client could compose an addition fromit — read the list, append, send it back — which is business logic in a client, forbidden outright by
CLAUDE.md, and a read-modify-write that silently drops whatever another client added in between.They are thin over the same
sites::update, so the TLD check, the hosts queueing and the front-endre-render keep exactly one implementation between them.
Two refusals, and the second is the interesting one. A site's last domain is refused because "at
least one" is the invariant
0001_initial.sqlrecords as this layer's to uphold, SQLite having nodeferred constraint to express it with. A site's primary is refused because promoting another name
in its place would change what the site is — its canonical URL, and from phase 5 the name on its
certificate — under a verb that says "remove a domain".
site.updatereorders, and the head of thelist it is given is the primary; that is where changing a primary belongs.
Four facts and no verdict
http://blog.testfailing has four independent causes that look identical from a browser. The reportgives each its own field: which site declares the name, whether the managed hosts block holds a line
for it, whether its TLD is wired so names under it are answered by pattern, what this daemon's own
server answers when asked over its socket, and what the operating system actually resolves it to.
Plus one sentence naming the first thing that is wrong.
Collapsing them into one boolean is exactly what
DnsStatus::wildcardshad to stop doing in T45: ahosts line with no server, a server with no resolver, and a resolver wired to a TLD this name is not
on are three faults with three fixes.
The sentence says what is wrong and never what to do. Repair is T47's, and
mix doctorshouldrender this report rather than recompute it — a second implementation of the four facts is a second
answer to one question.
A name nothing declares is answered rather than refused. Somebody asking why
foo.testdoes notwork when they never declared it is owed exactly that, and the other three facts still hold an answer.
The instrument
getaddrinfo, and nevernslookup— T45 measured thatnslookupbypasses the Name Resolution PolicyTable and answers NXDOMAIN for a name
getaddrinforesolves at the same moment, so a diagnostic builtwith it would send every correctly wired Windows user looking for a fault that is not there.
The OS cache is included on purpose, which is the opposite of what T45's own test needed: that one
defeated the cache because it was asking whether a mechanism works. This asks what the user's
browser sees right now, and the cached answer is that answer.
One recorded cost.
spawn_blockingcannot be cancelled, so the bound on a lookup stops the daemonwaiting and does not stop the lookup: a hung resolver holds one blocked thread per domain asked
about until it gives up. Written into the function rather than hidden behind the timeout, because a
timeout that reads like a cancellation is how a thread leak becomes invisible.
Testing
Every negative assertion carries a control taken with the same instrument at the same moment — T45's
D14. The suites assert that a name under
.testdoes not resolve on a machine nothing wired,which is what every machine running them is; without proving
localhostresolves in the same run,that would be a claim about
getaddrinforather than about the machine. Four of the six measurementrounds behind T45 were void for exactly that.
No elevation anywhere: all four facts are reads.
Design:
docs/superpowers/specs/2026-08-24-t46-domain-rpc-design.md