Commit bb7cb41
SQL UNIQUE treats NULLs as mutually distinct, so `(name, organization_id,
owner)` constrained PERSONAL views only: `owner` is NULL for SHARED views and
`organization_id` is NULL for environment-level ones, and two same-name active
shared views could coexist inside one tenant while `name` is declared as the
globally unique qualified view id.
Per the maintainer ruling of 2026-08-08 that is now forbidden. The runtime
migration #5839 introduced materializes the key NULL-safe, copying one in-repo
precedent per column class rather than inventing a form: ADR-0120 D3's
`COALESCE(organization_id, '__global__')` for the tenant column, and
`ensureOverlayIndex`'s `COALESCE(package_id, '')` form as
`COALESCE(owner, '')` for the non-tenant discriminator. Storage is untouched.
Unlike #5839 this is a tightening and can fail to build on existing data, so
the conflict branch is now a live path and takes ADR-0120 D4's disposition in
full: keep the previous index, name the key that is not enforced, ship the
exact query that lists the offending rows, point at `os migrate plan`, never
block boot.
The degradation reports are raised from `info`/`warn` to `error`: what the
missing DDL costs changed in kind, from slot recycling (functional, the next
user finds out) to an integrity guarantee the platform states it enforces
while continuing to look healthy — AGENTS.md's durability arm.
PR #6415's honest pin (`does NOT close the pre-existing NULL-distinct hole for
shared views`) is flipped to the positive assertion.
Claude-Session: https://claude.ai/code/session_01W6bLax4KMrSfnE1ydFU8Dw
Co-authored-by: Claude <noreply@anthropic.com>
1 parent b3efeb7 commit bb7cb41
4 files changed
Lines changed: 531 additions & 69 deletions
File tree
- .changeset
- packages
- metadata-core/src/objects
- metadata-protocol/src/migrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
142 | 156 | | |
143 | 157 | | |
144 | 158 | | |
145 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
146 | 164 | | |
147 | 165 | | |
148 | 166 | | |
| |||
0 commit comments