Two rules the domains registry depends on hold only in Go, while the schema looks like it holds them #15

Open
opened 2026-09-21 07:18:06 +00:00 by cgalo5758 · 0 comments
Owner

What a contributor runs into

The claims table stores each claimed domain twice: once as the domain itself and once as its labels in reverse order, the column every subtree scan reads. The second column is plain text with no generated-column definition and no trigger tying it to the first, so a row written by anything other than the registry can hold a value that does not match its own domain, and every containment question asked of that row answers wrongly and silently. Placements have the same shape of gap: nothing in the schema says a served domain must fall inside the claim it hangs from.

Why it costs

Both rules read as schema rules to anyone looking at the table, so a reviewer assumes the database will catch a bad write and a second writer, a migration or a repair script can break subtree scans without any error. The registry code is then the only place the invariants exist, and nothing tells a contributor that.

Where

The domains migrations, the claims and placements tables; the registry package that writes both.

Done when

The reversed column is derived from the domain by the database rather than by the caller, containment of a placement inside its claim is constrained there too, and no writer outside the registry can produce a row that fails either rule.

Migrated from status/issues.md at b7a0e15

## What a contributor runs into The claims table stores each claimed domain twice: once as the domain itself and once as its labels in reverse order, the column every subtree scan reads. The second column is plain text with no generated-column definition and no trigger tying it to the first, so a row written by anything other than the registry can hold a value that does not match its own domain, and every containment question asked of that row answers wrongly and silently. Placements have the same shape of gap: nothing in the schema says a served domain must fall inside the claim it hangs from. ## Why it costs Both rules read as schema rules to anyone looking at the table, so a reviewer assumes the database will catch a bad write and a second writer, a migration or a repair script can break subtree scans without any error. The registry code is then the only place the invariants exist, and nothing tells a contributor that. ## Where The domains migrations, the claims and placements tables; the registry package that writes both. ## Done when The reversed column is derived from the domain by the database rather than by the caller, containment of a placement inside its claim is constrained there too, and no writer outside the registry can produce a row that fails either rule. Migrated from status/issues.md at b7a0e15
cgalo5758 added the
kind
debt
area/domains
labels 2026-09-21 07:18:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#15