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(deployment): correct the seed-tenancy repair's trigger after #9380
The page landed hours before this fix and describes the boot hook as firing on
"every boot of a kernel that has no environment id". That was the gate's
INTENT and never its behaviour: the standalone stack stamps 'proj_local', so no
self-hosted boot ever ran the repair. With the gate now declared rather than
deduced, the honest statement is "every SERVING boot" — and the one-shot
`os migrate` / `os meta` boots are explicitly out, which is what keeps
`os migrate duplicates` safe to run before a restart.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NTKPDRoynY8i3HmdSFUxFj
Copy file name to clipboardExpand all lines: content/docs/deployment/seed-tenancy-repair.mdx
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ Two triggers, not one. Both call the same repair with the same guards.
66
66
67
67
| Trigger | Where | When it fires |
68
68
| :--- | :--- | :--- |
69
-
|`kernel:ready` boot hook |`@objectstack/metadata-protocol`| Every boot of a kernel that has no environment id — that is, an ordinary self-hosted server. Per-environment (cloud) kernels do not provision these tables locally and are skipped. |
69
+
|`kernel:ready` boot hook |`@objectstack/metadata-protocol`| Every **serving**boot of a self-hosted kernel — `os dev`, `os serve`, `os start`. Per-environment (cloud) kernels do not own these tables locally and are skipped, and so are the one-shot `os migrate` / `os meta` boots (see below). |
70
70
| First-organization handoff |`@objectstack/runtime`| After any successful `create` on `sys_organization`. On a fresh install this is the **first admin sign-up**. |
71
71
72
72
The second trigger is the one most operators will meet first, and it is not a
@@ -77,6 +77,15 @@ the ruling they are not the platform's to renumber. `sys_organization` gaining
77
77
its first row is exactly the event that makes the answer derivable, so the
78
78
repair runs there too.
79
79
80
+
<Callouttype="info"title="One-shot CLI commands never trigger it">
81
+
`os migrate *` and `os meta *` boot the same stack, but they declare
82
+
themselves out of this repair (`runPlatformMigrations: false`) — so a dry-run
83
+
report cannot destroy the evidence it was run to collect. Only a boot that
84
+
STARTS THE SERVER repairs. Before #9380 no self-hosted boot ran the repair at
85
+
all: the hook was gated on the kernel having no environment id, and the
86
+
standalone stack stamps `proj_local` on every boot, so the gate never opened.
87
+
</Callout>
88
+
80
89
<Callouttype="info"title="It runs on every boot, but is a no-op after the first success">
81
90
The repair is idempotent. Once the rows carry an organization and the
82
91
`__global__` counter is gone, the detection probe finds nothing and every later
@@ -257,12 +266,14 @@ The live condition is the only forward-looking line in the report, and it is the
257
266
perishable one. On a deployment you have not yet restarted since discovering the
258
267
problem, run the report first.
259
268
260
-
`os migrate duplicates` writes nothing: it boots read-only, issues `SELECT`s
261
-
only, and emits JSON to stdout for you to archive.
269
+
`os migrate duplicates` writes nothing: it boots read-only, declares itself out
270
+
of the boot repair, issues `SELECT`s only, and emits JSON to stdout for you to
271
+
archive.
262
272
263
273
<Callouttype="warn"title="This is easy to lose by accident">
264
-
The repair fires at `kernel:ready`. Restarting the server to "have a look" is
265
-
enough to consume the evidence.
274
+
The repair fires at `kernel:ready` on a serving boot. Restarting the server to
275
+
"have a look" is enough to consume the evidence — running `os migrate
0 commit comments