Skip to content

Commit d55d9ae

Browse files
committed
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
1 parent 537452e commit d55d9ae

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

content/docs/deployment/seed-tenancy-repair.mdx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Two triggers, not one. Both call the same repair with the same guards.
6666

6767
| Trigger | Where | When it fires |
6868
| :--- | :--- | :--- |
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). |
7070
| First-organization handoff | `@objectstack/runtime` | After any successful `create` on `sys_organization`. On a fresh install this is the **first admin sign-up**. |
7171

7272
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
7777
its first row is exactly the event that makes the answer derivable, so the
7878
repair runs there too.
7979

80+
<Callout type="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+
8089
<Callout type="info" title="It runs on every boot, but is a no-op after the first success">
8190
The repair is idempotent. Once the rows carry an organization and the
8291
`__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
257266
perishable one. On a deployment you have not yet restarted since discovering the
258267
problem, run the report first.
259268

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.
262272

263273
<Callout type="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
276+
duplicates` is not.
266277
</Callout>
267278

268279
---

0 commit comments

Comments
 (0)