You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(adr): ADR-0120 D4 amendment — the duplicate pre-flight is per index class (#11387)
D4 decides that `os migrate plan` gains a duplicate pre-flight probe per
affected index. That was written for the declared class — the `recreate_index`
drift ops the reconciler can see — and it is true there. It cannot reach the
three `kernel:ready` runtime index tightenings in `packages/metadata-protocol`,
which are invisible to the drift differ by construction.
The maintainer's 2026-08-22 ruling on #8725 routes that class to
`os migrate duplicates` instead, explicitly leaving `os migrate plan`'s drift
contract untouched. PR #11031 shipped that behaviour; this records the split in
D4's text, where the three migration modules' doc comments already point.
Documentation only: no behaviour, gate or test changes.
Governed surface (docs/adr/**) — draft PR, maintainer merges by hand.
Claude-Session: https://claude.ai/code/session_019siH5jDmk5hrayvfyojUqR
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/adr/0120-unique-scope-vocabulary-and-null-safe-tenant-uniqueness.md
+41-1Lines changed: 41 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ the per-organization meaning **NULL-safe**:
35
35
| D1 | Scope is said, not inferred |`unique: 'global' \| 'organization'` on **both** spellings; bare `true` on a *declared index* is deprecated (17.x warn → protocol 18 reject) |
| D3 | Per-organization unique survives NULL | organization key part materializes as `COALESCE(organization_id, '__global__')` — fixes #5030 for field-level and new `'organization'` indexes alike; ships in 17.x |
38
-
| D4 | Tightening migrates through ceremony |`recreate_index` drift + duplicate pre-flight in `os migrate plan`; auto-apply only on a clean probe |
38
+
| D4 | Tightening migrates through ceremony |`recreate_index` drift + duplicate pre-flight, routed **per index class** — declared/differ-visible through `os migrate plan`, runtime-managed/differ-excluded through `os migrate duplicates` (2026-08-22 amendment); auto-apply only on a clean probe |
39
39
| D5 | Authoring gates carry the contract | new lint rule for unscoped declared uniques (authoring-time checkable, no tenancy guessing); R10 rewritten in the new vocabulary |
40
40
| D6 | Written surfaces tell one truth | the five #3696 surfaces, the pin tests, and the false single-tenant claim in `UniqueScopeSchema` are updated in the same wave |
41
41
| D7 | Staged over 17.x → 18 | additive in 17.x, rejection + conversion at protocol 18 |
@@ -353,6 +353,46 @@ with pre-existing duplicate NULL-row data — data the old index wrongly admitte
353
353
No constraint-*relaxing* rebuild exists under this ADR by construction; the migration
354
354
planner asserts that invariant.
355
355
356
+
> **Amendment (2026-08-22, [#8725](https://github.com/objectstack-ai/objectstack/issues/8725) / [#11032](https://github.com/objectstack-ai/objectstack/issues/11032)) — the duplicate pre-flight is per index CLASS: `os migrate plan` for the declared, differ-visible indexes; `os migrate duplicates` for the runtime-managed ones the differ excludes by construction.**
357
+
>
358
+
> The sentence above — "`os migrate plan` gains a **duplicate pre-flight probe** per affected
359
+
> index" — was written for the **declared** class, the `recreate_index` drift ops the
360
+
> reconciler can see, and it is true there: `os migrate plan` reports a blocked tightening of
361
+
> a declared organization-unique index in full, quoting the offending group and its row count.
362
+
>
363
+
> It cannot reach a second class. Three `kernel:ready` migrations in
364
+
> `packages/metadata-protocol` tighten an index at runtime —
0 commit comments