Skip to content

Un-reserve the crystal namespace (phase 2 — merge after phase 1 deploys + backfill runs) - #326

Open
lopugit wants to merge 1 commit into
claude/relationship-unique-keysfrom
claude/crystal-reservation-removal
Open

Un-reserve the crystal namespace (phase 2 — merge after phase 1 deploys + backfill runs)#326
lopugit wants to merge 1 commit into
claude/relationship-unique-keysfrom
claude/crystal-reservation-removal

Conversation

@lopugit

@lopugit lopugit commented Aug 19, 2026

Copy link
Copy Markdown
Owner

⚠️ Merge ordering is load-bearing

Merge only after the phase-1 PR has deployed and every deployment DB has run its boot-time index swap (plus backfill-relationship-unique-keys on the home db). Until a DB's old kind-blind unique indexes are dropped by its ensure run, the #320 sanitizer reservation is its only squat guard — this PR deletes that guard.

Phase 2: the crystal namespace goes back to fully open

With relationship uniqueness on the server-only root uniqueKeys namespace and the six crystal-path indexes non-unique (phase 1), a data thing carrying followKey, memberKey, dmKey, inviteCode, emojiKey, friendKey, or voteKey at its crystal root enters no unique index: it's ordinary user data that can neither squat a real relationship nor be rejected. So the reservation stopgap — which the owner explicitly did not want as the permanent shape — is deleted whole:

  • RESERVED_CRYSTAL_ROOT_KEYS + the sanitizeDataCrystal rejection (registry.ts) — gone; free-form crystals reserve no names.
  • KIND_BLIND_UNIQUE_CRYSTAL_ROOT_KEYS audit constant → replaced by a KIND-BLIND HISTORY comment beside the lookup indexes (the "never add a crystal-path unique index" rule stays written down where the next index author will read it).
  • reservedCrystalRootKeys.test.ts (lockstep pin) — deleted with the lists it pinned.
  • apiTests: things-data-reserved-crystal-root (must-400) → things-data-relationship-names-open (must-save).
  • relationshipUniqueKeys.test.ts: the transition-reservation pin becomes the open-namespace pin (every mapped name + voteKey validates as plain data).
  • TESTING.md: both bug-class bullets rewritten for the final shape.

Verified live on phase-2 code

The definitive coexistence proof: a data thing claiming the exact followKey of a real user pair saves (200), and the real follow of that same pair still succeeds beside it — squatting is physically impossible, in both directions. Every relationship name (including voteKey) saves as ordinary data on create and PATCH. Full unit battery (27 suites, 0 failures), things API group 31/31, build:client clean.

Stack: #320 (reservation stopgap) → phase 1 (uniqueKeys migration) → this PR (un-reservation).

🤖 Generated with Claude Code

…leted

With relationship uniqueness on the server-only root uniqueKeys namespace
and the six crystal-path indexes non-unique (phase 1), a data thing
carrying followKey/memberKey/dmKey/inviteCode/emojiKey/friendKey/voteKey at
its crystal root enters no unique index: it is ordinary user data that can
neither squat a real relationship nor be blocked by one. This deletes
RESERVED_CRYSTAL_ROOT_KEYS, the sanitizeDataCrystal rejection, the lockstep
test, and the KIND_BLIND audit constant, replacing the apiTests entry with
the open-namespace assertion and rewriting the TESTING.md bug-class lines.

MERGE ORDERING (load-bearing): deploy phase 1 first and let every
deployment DB run its boot-time index swap (plus the
backfill-relationship-unique-keys migration on the home db) BEFORE this
merges — the reservation is the only squat guard on a DB that still has
its old kind-blind unique indexes.

Verified live on phase-2 code: a data thing claiming the EXACT followKey of
a real pair saves AND the real follow of that pair still succeeds beside it
(coexistence — the squat is physically impossible), every relationship name
saves as plain data on create and PATCH, and the full unit battery, things
API group, and client build stay green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
thingtime Ready Ready Preview Aug 19, 2026 6:36am

Request Review

lopugit added a commit that referenced this pull request Aug 19, 2026
…iqueKeys migration

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lopugit added a commit that referenced this pull request Aug 19, 2026
…iqueKeys migration

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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