Skip to content

Commit d634fe5

Browse files
committed
wip: changeset and docs for #25158
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YD4v2ErCfZk8sfaZe8AYVu
1 parent 68cb61c commit d634fe5

3 files changed

Lines changed: 32 additions & 7 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
fix(cli)!: a production `os serve` whose `@objectstack/plugin-auth` fails to load is refused, naming the load error, instead of booting with no organization object
6+
7+
Clause-②: yes (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) A boot-time refusal in `os serve`: no key of any metadata schema is removed, renamed or re-shaped, so there is nothing for `objectstack migrate meta` to rewrite and no tombstone. No export, type, flag or error code is removed or renamed. The remedy is a deployment one (repair the install), stated below. The other categories are closed on facts: the package publishes (not unpublished); no ADR-0087 id covers this boot (not registered or already-registered); and nothing exported is removed or narrowed (not runtime-interface-only, type-surface-only or runtime-export-retired). -->
11+
12+
**BREAKING** boot-refusal narrowing (ADR-0131 D9), the third composition beside the two the previous change refused. It changes which production boots start, not what a metadata author can write, so it ships as `patch` with this banner.
13+
14+
- FROM: a production `os serve` or `os start` (no `--dev`) whose stack enables the `auth` tier and resolves an auth secret, but whose `@objectstack/plugin-auth` fails to load — a missing install (silently) or a broken one (one `⚠ AuthPlugin failed to load: …` warning) — booted with no `AuthPlugin`. It composed no organization object, so every row the boot wrote landed with no organization: stored ownerless on an 18.0.0-born store (nullable columns, MongoDB), refused at NOT NULL on a fresh SQL table.
15+
- TO: that boot is refused before any plugin starts, with or without `--server`, and the database is never opened. The refusal names the load error. The same holds when the AuthPlugin construction itself throws before it is mounted.
16+
17+
**Unchanged:** `os dev` and `--dev` (a development boot keeps the warning and boots without auth); the cloud runtime's host kernel (`ObjectOSEnvironmentPlugin`), whose auth is each project's; a production boot with no auth secret or with no auth at all, which is still refused by the existing refusals; and an embedded kernel, which never runs this command.
18+
19+
**The remedy.** Repair the install the error names: `@objectstack/plugin-auth` is a dependency of `@objectstack/cli`, so reinstall the deployment's dependencies (e.g. `npm ci` or `pnpm install --frozen-lockfile`). Running kernel-only (`--no-server`) does not avoid the refusal.

‎content/docs/deployment/cli.mdx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,9 @@ The `auth` tier requires `OS_AUTH_SECRET` in production: without it the boot
402402
is refused before any plugin starts, with or without `--server`, because a boot
403403
with no `AuthPlugin` has no organization and every row it wrote would have no
404404
owner. A production boot whose tiers leave `auth` out (`--preset minimal`
405-
included) is refused the same way unless the stack mounts `AuthPlugin` itself.
405+
included) is refused the same way unless the stack mounts `AuthPlugin` itself,
406+
and so is one whose `@objectstack/plugin-auth` fails to load (a missing or broken
407+
install): the refusal names the load error instead of booting without auth.
406408
In `--dev` mode the CLI falls back to an insecure local secret, so login works
407409
out of the box. (The cloud runtime's host kernel, where auth is each project's,
408410
only warns.) To take full control, set `tiers` on the stack config:

‎content/docs/upgrading.mdx‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,18 +417,22 @@ one it is refused: `✖ FATAL: tenancy posture 'group' is walled, but this deplo
417417
refused before any plugin starts, so set the secret before you start such a
418418
deployment on 18.0. A production boot whose stack mounts no auth at all (the
419419
`auth` tier off and no `AuthPlugin` of its own) is refused the same way: enable
420-
auth and set the secret. Either boot has no organization, so every row it wrote
421-
would have no owner.
422-
423-
`--no-server` does not avoid either refusal: a kernel-only boot runs the same
420+
auth and set the secret. So is a production boot that has the secret but whose
421+
`@objectstack/plugin-auth` fails to load (a missing or broken install), `os start`
422+
included: earlier 18 releases booted it without auth, silently or with one
423+
`⚠ AuthPlugin failed to load` warning, and the refusal now names the load error —
424+
reinstall the deployment's dependencies. Each of these boots has no
425+
organization, so every row it wrote would have no owner.
426+
427+
`--no-server` does not avoid any of these refusals: a kernel-only boot runs the same
424428
seed and would write the same ownerless rows. Earlier 18 releases let a
425429
`--no-server` boot through, and their refusal text offered `--no-server` as a
426430
remedy; it is not one. The same holds for a migrate-and-exit job
427431
(`OS_MIGRATE_AND_EXIT=1`): give it `OS_AUTH_SECRET` too. A development boot
428432
(`os dev`, `--dev`) and an embedded kernel are not affected, and neither is the
429433
cloud runtime's host kernel, whose auth is each project's. `os start` is not
430-
affected: it generates an auth secret on its first run and persists it to
431-
`<home>/auth-secret`.
434+
affected by the missing-secret refusal: it generates an auth secret on its first
435+
run and persists it to `<home>/auth-secret`.
432436

433437
What the plan lists, how a blocked row is resolved, and every flag are in the
434438
command's reference:

0 commit comments

Comments
 (0)