Post-restore orphan resource sweep
The 2026-11-15 prod-2 restore minted 1,734 resource rows keyed by name (uuid-suffix names embedding pre-move row ids) while every runtime RBAC path keys row resources by id — be-id, user-allowed-resource, permitted-row-ids. The name-keyed duplicates are inert until something resolves by name, but the perf one arrived roleless and non-unique for be-id, which blocked every item update on prod-2 (join-items-exist resolves each tag through be-id and errors on More than one match). The orphans were swept by hand (see the sibling sweep item, 60 Done); this item is the structural fix so the next restore does not regrow them.
Acceptance: after any restore (prd: destination, trial or real), the restored database contains zero resource rows whose id is not the id of some row of the type named in its prefix, and every data row of every row-resourced type has its by-id resource with roles. The sweep predicate (id not in the union of row ids across the 13 row-resourced tables) is the post-restore check; one statement deletes violations. Verification belongs in the restore path itself (or a post-restore check verb), not in operator memory — the recipe note on the sweep item documents the manual sequence this item should automate away.
- Slot
- 7186
- Status
- 60 Done
- Tags
- mvp, prod, compiler, corrupt
- Contributors
- Donnie, Rosie, Grok
- Plans
- Plan: Post-restore orphan resource sweep