Repository navigation
fix(auth)!: a boot outside development mode retires what the development seed issued - #36311
objectstack-fleet[bot] wants to merge 9 commits into
Conversation
…e development mode Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
…d changeset Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
…v-seed-retire-at-boot
📓 Docs Drift CheckThis PR changes 1 package(s): 44 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 11 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 21 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin d99e5f698cc7ae90329218ff51b4e99e8a3ff2cf && git checkout d99e5f698cc7ae90329218ff51b4e99e8a3ff2cf
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d c1e7347cc1f83830d9bfe3e49957d2d97755c7db && git checkout -B drift-repro 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d && git merge --no-ff c1e7347cc1f83830d9bfe3e49957d2d97755c7db
node scripts/docs-audit/affected-docs.mjs --json 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d
|
…ment instead of naming it a follow-up Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
…sued credentials end Claude-Session: https://claude.ai/code/session_01FEkQ5kt9AD1TPLy7Y9oa9D Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D Final head: The rounds after
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — REWORK · head c1e7347This record is not the full verdict. One further item has gone to the seat, and the PR waits on the seat's answer as well as on the items below. No code change is asked for here. To fix (body)
A body edit re-runs the PR-body guards. Tell me when they are green, and I will read the body alone. The further item is the seat's. Checked and holding
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — REWORK (held, handover) · head c1e7347This is the closing record of this L1 for #36311. The seat has gone into handover, so this PR takes no further round here. Review passes to the successor at this head. Open at this head:
Unchanged from 7075271079: the DELIBERATE CORRECTION's two sentences are true at this head, and they are confirmed by a same-head, at-tier L2 PASS, not by an L1 ACCEPT. The battery, the suites and the ablations stand for this head, as that record says. |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — correction to 7075389349 · head c1e7347Item 2 of that record is wrong. The three body items of REWORK 7075271079 were already fixed in the body before it was posted, and I re-read the body just now to confirm.
The head is unchanged. So at c1e7347 the one open item is the seat-held security item (item 1), and it stays REWORK for the successor. |
|
Superseded by #36699. That PR carries this branch's commits up to Generated by Claude Code |
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Superseded · 2026-11-23T13:17Z: this pull is superseded by #36699, which carries its commits (from |
… on a hosted tenant kernel instead of 404 (objectstack-ai#36690) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8HLrJyMR9mKwcN7row9NW91)_ Fixes objectstack-ai#36506 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 用户看到的变化:在托管云环境里,删除个人视图、删除或重命名记录附件,从“找不到”变为正常完成;自部署环境不变。 - 为什么:这三个操作原先只挂在自部署才有的网络入口上,托管租户没有这个入口,请求落空。 - 坏了会怎样:托管环境里这三个操作回到“找不到”或“未实现”;不会越权,身份和成员校验比自部署更严。 - 需要你做什么:合并即可;云端无需改代码,下次把云端依赖的平台版本升到包含本修复的版本后生效。 ## What changes Root cause: `DELETE /api/v1/personal-views/:id` (plugin-auth) and `DELETE` / `PATCH /api/v1/attachments/:id` (service-storage) were mounted only on the kernel's `http.server`. A hosted tenant kernel owns no socket, registers no `http.server`, and runs `AuthPlugin` with `registerRoutes: false`. The host's `createHonoApp` catch-all hands every unclaimed `/api/v1/*` request to `HttpDispatcher.dispatch()`, which had no domain for either prefix and answered `404 ROUTE_NOT_FOUND`. The cloud host's storage bridge covers only `/api/v1/storage`, so it never reached them either. The fix applies ruling A on objectstack-ai#22438 to these two members of the class, the same shape objectstack-ai#36539 gave the comment doors: - **Spec.** `IPersonalViewDoorsService.handlePersonalViewDoor(request): Promise<Response>` types a new `personal-views` slot. `IAttachmentDoorsService.handleAttachmentDoor` is implemented by the existing `file-attachments` service beside `IFileAttachmentService`. Both members are optional. - **One body, two faces.** `createDoorTableMember(routes, mount)` (new export of `@objectstack/plugin-hono-server`) runs the plugin's own registrar on a private `HonoHttpServer` that never listens, built on first request. So the caller resolution, every refusal and every answer are the self-hosted mount's own bytes. The self-hosted mounts are unchanged and no path is mounted twice. - `AuthPlugin.init()` registers `personal-views` whatever `registerRoutes` says; `mountPersonalViewDoor` and the member share one `personalViewDoorDeps()`. - `StorageServicePlugin` hands `FileAttachmentService` an `attachmentDoors` member over `mountAttachmentRemovalDoor`. - **Runtime.** A shared bridge (`domains/own-door-bridge.ts`) and two domains, `/personal-views` and `/attachments`, claim exactly the door shapes and forward the transport's request, body unread and re-addressed to the wire path, to the member on the REQUEST kernel's slot (`getRequestKernelService`, never the host's scoped fallback). Any other shape under those prefixes keeps `404 ROUTE_NOT_FOUND`. No slot, or no member: a typed `501 NOT_IMPLEMENTED` naming the package that registers it. A member throw or a consumed body: a sanitised `500`, logged. No auth-gate or membership exemption is added, so on the dispatcher the doors are stricter than the self-hosted mount, never looser. - **Ledgers.** Three `server-only` rows in `route-ledger.ts` (census 153 → 156); a new `own-row-doors-session` row in the authz conformance matrix; `check-route-envelope.mjs` audits the three new domain files. - **Dependencies.** `@objectstack/plugin-auth` and `@objectstack/service-storage` now depend on `@objectstack/plugin-hono-server` at runtime (no manifest cycle; `check:workspace-manifest-cycles` green). - **Surface widening** (hence `Clause-②: yes`): two new contract interfaces, a new typed slot name (`personal-views` is now taken, so a composition registering its own service under that name beside `AuthPlugin` fails to boot with a duplicate-service error), two new exports from plugin-hono-server, and two new dispatcher domains. No cloud code change and no cloud deploy is needed. Hosted gets the fix when cloud's objectstack pin moves past this PR, as with objectstack-ai#36469. ## Tests - `packages/runtime/src/domains/own-door-bridge.test.ts` (27): `describe.each` over both families. Forwarding with the transport's own request and body unread; exact claim and misses; the environment-scoped spelling; 501 for an empty slot, a throwing lookup and a missing member; per-request reads; request kernel only (the host kernel's member is never used); member throw 500; consumed body 500; both preamble gates (membership 403, owed-step gate) with a member control. - `packages/plugins/plugin-hono-server/src/door-table-member.test.ts` (4): byte parity against a `HonoHttpServer` mount; unmatched 404 without building the table; built once; the matcher. - `packages/plugins/plugin-auth/src/personal-view-door-member.test.ts` (3): `AuthPlugin.init` with `registerRoutes: false` registers the slot once; an anonymous request is byte-equal to the self-hosted mount's 401; a non-door request is 404 `ENDPOINT_NOT_FOUND`. - `packages/services/service-storage/src/attachment-removal-routes.integration.test.ts`: a new describe with no `http.server` (no routes mounted; the uploader renames then removes, 200 each; another member 403; anonymous 401 on both doors; a GET 404). - `packages/qa/http-conformance/src/hono-own-row-doors.conformance.test.ts` (7), the wire half: `createHonoApp` over a kernel with no `http.server`, the real `AuthPlugin` composed with `registerRoutes: false`, the real `StorageServicePlugin`, platform objects, security and sharing, and real better-auth sessions signed in through the same transport. No door answers a route miss; the owner removes their own personal view (200, row gone); another member 404 `RECORD_NOT_FOUND` and anonymous 401 (row stays); the uploader renames then removes their own attachment (200 each, store follows); anonymous 401 on both attachment doors; the refusals are byte-identical to the self-hosted mount over a real socket; a kernel without service-storage answers 501 naming it. The subject packages resolve from source (`vitest.config.ts` aliases). - Dogfood, real composed stack, through `HttpDispatcher` alone (`hosted-dispatcher.testkit.ts`): `personal-view-row-scope` gains a `[hosted]` describe (owner removal 200, another user 404 `RECORD_NOT_FOUND`, anonymous 401); `member-attachment-baseline` gains a `[hosted]` case (other member 403, anonymous 401, rename 200 trimmed, removal 200 and the row is gone). ## Acceptance notes - Red before the fix, each through `scripts/ablation-replace.mjs` with the restore proved (`blob == HEAD`, `git diff HEAD` empty): - the two domain registrations deleted from `http-dispatcher.ts`: `own-door-bridge.test.ts` 21 of 27 red (the 6 that stay green are the miss and gate cases, which hold without the domain); - `ctx.registerService('personal-views', …)` deleted: the plugin-auth member test 3 of 3 red; - the `attachmentDoors:` dep renamed away: the storage integration file 3 red, 17 green (the new describe's door cases). - The wire-half file, 7 tests: the two dispatcher domain registrations deleted and runtime `dist` rebuilt: 7 of 7 red, each answering the pre-fix `404 ROUTE_NOT_FOUND` (restored, rebuilt, green again); `registerService('personal-views', …)` deleted: 4 red (every personal-view case and the parity case); `attachmentDoors:` renamed away: 4 red (every attachment case and the parity case). - Overlap: `objectstack-ai#36311` conflicts in `auth-plugin.ts`, but `origin/main × objectstack-ai#36311` already has that one hunk (an import line). `HEAD × objectstack-ai#36311` has the same single hunk, so it is not added by this branch. `objectstack-ai#35129` and `objectstack-ai#34223` merge cleanly. ## Verification - Typecheck green: spec, runtime, plugin-auth, service-storage, plugin-hono-server, dogfood. - Full suites green: http-conformance 22 files / 305 tests; runtime 641 files / 11872 tests; plugin-auth 294 / 6268; service-storage 88 / 1729; plugin-hono-server 44 / 585. - Dogfood: `personal-view-row-scope` + `member-attachment-baseline` 37 / 37. - `dispatch-gates --ran`: 137 derived, 136 run green, 1 NOT MEASURED (`check:dual-build-cjs-loads`, exit 3, needs every package's `dist/`; left to CI). `check:undeclared-dep-imports` caught plugin-auth listing plugin-hono-server as a dev dependency only; fixed and green. - eslint on the 31 changed source files, with `--no-inline-config` as `pnpm lint` runs it, green (the whole-tree `pnpm lint` is left to CI); `check-nul-bytes` OK. <details><summary>Gate reconciliation</summary> ``` Run reconciliation — 137 derived, 136 run, 1 NOT-MEASURED, 0 UNRUN. NOT-MEASURED · DERIVED (1): - pnpm check:dual-build-cjs-loads [recorded exit 3 — PREREQUISITE NOT MET] ✓ dispatch-gates --ran: 137 derived famil(ies) accounted for — 136 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3). ``` </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. https://claude.ai/code/session_01JQwxbXs1Hrj1qNTkGdJbK1 --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…ent seed issued (objectstack-ai#36699) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8Nxmrq3P2eHj4WzMaPKLjA1)_ Fixes objectstack-ai#35184 Supersedes objectstack-ai#36311: this branch carries that PR's commits (head `c1e7347cc1`, merged onto current `main`) and adds one hardening commit. The card thread can push only its own branch, so the takeover lands here. Clause-②: no (narrowing) Metadata-protocol: none Skills-docs: none — no skill states what a boot outside development mode does to a seeded account's credentials. `skills/**` names the development seed only as `os dev --seed-admin` (`skills/objectstack-platform/references/operations.md`); checked at `origin/main`. ## 维护者速读 - 用户能看到什么变化:不在开发模式的服务器每次启动、开始接请求之前,会结束开发种子建的管理员和演示账号在开发期拿到的会话、API key 和令牌,包括这些账号以别人身份开的会话;只针对仍是种子密码的这些账号,运维改过密码的账号和管理员自建的账号不受影响,开发模式下什么都不变。 - 为什么做:开发种子凭据加固的第三项(objectstack-ai#34717 裁决里留作跟进的那一项):离开开发模式后,开发种子签发的东西不再继续起作用。 - 出错会怎样:拿开发库直接上生产的部署,这些账号的旧会话和 key 会失效,需要运维改密后重新登录、重新发 key;结束不干净时服务器拒绝启动并说明是哪些账号。 - 要你做什么:收窄类改动,L1/L2 之后由你合并。 ## What changes **The rule (ruling item 3 on objectstack-ai#34717, the card's text): when a deployment leaves development mode, nothing the development seed issued keeps acting for an account that carries the development seed stamp.** Development mode is `NODE_ENV=development` (`isDevelopmentMode`, the predicate the objectstack-ai#34717 refusals use). No switch. From objectstack-ai#36311 (unchanged, see that PR for the full account): - `dev-seed-credential-retirement.ts` (new), `retireDevSeedCredentials`: outside development mode, one indexed read for stamped accounts, the in-force filter (`isDevSeedCredentialInForce`), then per account the revocation `os user set-password` uses (`revokeSessionsAndApiKeys`: sessions tombstoned, keys revoked, authorized apps, device sign-ins, linked sign-in accounts, registered OAuth apps, SCIM credentials), outstanding reset tokens (`endOutstandingResetTokens`), and sessions in a host `secondaryStorage` (read back). - Wiring: one `kernel:ready` hook in `auth-plugin.ts`, independent of `registerRoutes`; it settles before `kernel:listening` opens the socket. - Fail closed: anything that does not land fails the boot with one sentence naming the accounts and the remedy. - Docs (`content/docs/deployment/self-hosting.mdx`), changeset (`patch`, `!`, BREAKING section, ADR-0087 `not-required`), census shard regenerated. New in this PR: - **The sessions a seed account opened acting as another account are retired too** (`retireSessionsOpenedAs`), tombstoned exactly as the account's own (same reason, counted in `sessions`, same fail-closed rule). A further security item is with the owner seat. - `forced-reset-revocation.ts`: `isLiveSession` is exported for reuse (no behaviour change). - Docs and changeset name the new item; the self-hosting sentence about `os user set-password` now says what that command ends (the account's own sessions, keys and grants) instead of "the same credentials". - Census shard regenerated on current `main` (`node scripts/tenant-audit-census.mjs --write`). **Read first (by risk):** 1. `packages/plugins/plugin-auth/src/dev-seed-credential-retirement.ts`: `retireDevSeedCredentials` and `retireSessionsOpenedAs`. 2. `packages/plugins/plugin-auth/src/auth-plugin.ts`, the `kernel:ready` hook: it runs on every boot outside development. 3. `packages/plugins/plugin-auth/src/dev-seed-credential-retirement.test.ts`, cases 1–3. **Two-minute check:** `pnpm --filter @objectstack/plugin-auth exec vitest run src/dev-seed-credential-retirement.test.ts` shows 6 cases green. ## Why objectstack-ai#35184 (p1): credentials the development seed issued kept acting after the deployment left development mode. ## Verification Branch `claude/project-thread-grxa1f`, head `fb3c2cc478`, on `origin/main` `115d38788e`. - **Red first.** The new assertion was added to case 1 before the fix and run at the merged head (`035b1fdfe`): case 1 red, 5 others green. After the fix: 6/6 green. Removing the new call is that same red. - **Suites** (under `scripts/pm/os-verify-lock.sh`): `dev-seed-credential-retirement`, `dev-seed-credential-production`, `dev-seed-credential` (3 files, 26 passed) on the port before the fix; then `dev-seed-credential-retirement`, `api-key-restore-guard`, `forced-reset-revoke-reason-vocabulary`, `scim-deactivation-reconcile-user`, `session-tombstone`, `admin-impersonate-endpoint` (6 files, 128 passed) after it. `pnpm --filter @objectstack/plugin-auth build && … typecheck`: exit 0, `check:test-typecheck` OK. - **Derived gates:** `node scripts/pm/dispatch-gates.mjs --commands` derived 110, all run: 104 exit 0; `check-empty-changeset` exit 1 by design (the DELIBERATE CORRECTION below); `check-tenant-audit-census` and its self-test exit 1 on the first pass (shard drift from the new write site), regenerated, both re-run exit 0; NOT MEASURED (exit 3, prerequisite): `check-plugin-teardown-shape --self-test` (needs an unshallow clone), `check:skill-examples`, `check:dual-build-cjs-loads` (need packages built). CI carries those three. - **Overlap:** see Acceptance notes. - **Dogfood battery:** not run locally for this round; CI's Dogfood Regression Gate reads it. objectstack-ai#36311's battery (484 files passed, 0 failed) was on the code before the new commit. ## Acceptance notes - **Which accounts.** The in-force reading from objectstack-ai#36311 stands: an account whose password was set since the seed holds a credential the seed did not issue and is untouched; retiring on the bare column would end operator-era credentials at every restart. - **Revoke reason.** `admin_password_reset`, as in objectstack-ai#36311; a dedicated reason is follow-up objectstack-ai#36313. - **`.changeset/dev-seed-credential-production-refusal.md`** (unreleased, from objectstack-ai#34717) is corrected: see `## DELIBERATE CORRECTION`. - **Test file weight.** The six two-boot cases read about 11.4 s of test time locally (case 1 gained one sign-in and one request); objectstack-ai#36311 read 9.98 s. Over the 10 s file line; splitting the file would duplicate its two-boot harness, so it is kept as one and declared here. - **Overlap** (`overlap-check.mjs` at this head, objectstack-ai#36311 excluded): `.changeset/dev-seed-credential-production-refusal.md` conflicts with objectstack-ai#35129; the generated census shard conflicts with objectstack-ai#34738 (whoever lands second regenerates it). `auth-plugin.ts` with objectstack-ai#36690 merges cleanly. - The production-readiness page is not edited; the card names the self-hosting checklist. ## DELIBERATE CORRECTION This PR rewrites two lines in a pending release note it did not add: `.changeset/dev-seed-credential-production-refusal.md`, in the note's last paragraph. That paragraph's label and its last sentence named the boot-time retirement as a follow-up. This PR ships it, so left unchanged the note would publish two false lines. `check-empty-changeset` stays red by design; the dispatching seat confirms by its own record. 1. The paragraph's bold label - Before: "**Not ended at boot:**" - After: "**Ended by `os user set-password`, and at boot:**" 2. The paragraph's last sentence - Before: "Ending them at boot is follow-up objectstack-ai#35184." - After: "In the same release, a boot outside development mode also retires them: see the note "a boot outside development mode retires what the development seed issued" (objectstack-ai#36699)." ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No spec change.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` is read from CI's Lint job, not run locally. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: n/a. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxbX8ecPYZVemPRBFSrY --------- Co-authored-by: Claude <noreply@anthropic.com>
…t it does not run (objectstack-ai#36708) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ83ouv8C9ThpkfsQ5SAfyzjU)_ Fixes objectstack-ai#36647 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:应用用编译产物上线时,如果它带的代码插件没有跑起来,启动日志会逐个点名这些插件并说清怎么补上;以前一声不吭。 - 为什么做:BrightRule 评估里知识库、向量检索和条款索引三个插件全部没装上,后面检索为空、钩子找不到服务,没有任何提示,排查很难。 - 出错会怎样:只多一条警告,不加载、不拒绝、不改变任何插件,启动照常;改动可以直接撤回。 - 要你做什么:无(走的是已有裁决「产物只带元数据,插件由宿主装配」这条路,没有替你选「把插件塞进产物」)。 ## What changes - **`packages/runtime/src/artifact-declared-plugins.ts`** (new): `warnUnmountedDeclaredPlugins` judges each entry of the app's `plugins` by name against the kernel's own plugin table and warns **once**, naming every listed plugin the kernel does not run, with the remedy: boot from `objectstack.config.ts`, or from a host config that loads the artifact and lists the plugins in its own `plugins`, or package them (`os plugin build` → `os plugin install`). Structured fields `{ appId, plugins }`. A host that assembles the app's plugins itself hears nothing about the ones it runs. A bundle entry (no `init`) also counts as running under the `plugin.app.ID` name a host wraps it into. A package-specifier string is never judged: the name its plugin registers under is not in the specifier, so nothing is said that the table could contradict. - **`AppPlugin.start()`**: makes that call when the plugin was composed with `securityMetadataRegistrar: 'artifact-door'`, the existing declaration that its bundle IS the artifact the artifact door reads. Only `createStandaloneStack` (the door every artifact boot goes through: `createDefaultHostConfig` for `OS_ARTIFACT_URL` and for cloud's composed boot, `os start` on a built app) and the `os dev` host-config artifact door make it. A config boot (the CLI's `new AppPlugin(config)` wrap, default registrar) is never judged, because its host materializes the stack's `plugins` under names a descriptor cannot predict. Read in `start()`: the kernel refuses `use()` once bootstrap has begun, so the table is final. No option, export or artifact field is added. - **`content/docs/deployment/self-hosting.mdx`**: one row in the artifact-pinned boot table saying an artifact boot runs without the app's code plugins, that the boot names them, and what to do. - Changeset: `@objectstack/runtime` patch. Level is `warn`: a capability is absent and its next caller finds out, which AGENTS.md "Degradation log levels" grades functional, not durability. ## Why: the route, and why it is not a fork The card offers "carry them" or "refuse them, loudly" and leaves the pick to the maintainer. Two existing rulings already make it: - **objectstack-ai#15219, maintainer ruling A (2026-09-04, 「同意」)**: `plugins` / `devPlugins` are artifact **envelope** keys, "runtime ASSEMBLY instructions, not metadata … An artifact carries metadata; a host assembles plugins" (`packages/spec/src/stack.zod.ts`, the envelope-key docblock). - **ADR-0025 (Accepted)** §3.10: an L2 code plugin (real npm deps + host APIs) ships as a signed `.osplugin` with permission consent; the environment artifact is the L0/L1 declarative channel. `cwdConfigJoinsBoot` (`packages/cli/src/utils/artifact-precedence.ts`) already says it: a host config's "own compiled output cannot carry that code". "Carry them" would put app code and its dependencies into the environment artifact, against both. So this PR takes the other half of the card's own Expected: the drop stays, the silence goes. Making `os build` fail on a stack with `plugins` was not done: the same build feeds config boots that do mount them (`os start` / `os dev` over the config's own output), so a refusal there would break working apps; that would be a narrowing and is not this card's call. ## Tests `packages/cli/test/build-artifact-code-plugins-boot.test.ts` (new, 2 tests): a real `os build` (the `Compile` command in process) of a config listing two live plugin instances, then a real boot of the artifact it wrote through `createStandaloneStack` (reached through `@objectstack/runtime`'s `exports`, so `dist/`). - PREMISE: `objectstack.json` holds both plugins as descriptors with no `init`; - the boot runs neither (`kernel.hasPlugin` false for both) and warns exactly once with `{ appId, plugins: [vector, indexer] }`. `packages/runtime/src/artifact-declared-plugins.test.ts` (new, 9 tests): real kernel boots of `createStandaloneStack` over an artifact file on disk carrying two plugin descriptors exactly as `os build` writes them. - neither mounted → exactly one warning, `{ appId, plugins: [vector, indexer] }`, both names and the remedy in the line (CONTROL: `kernel.hasPlugin` is false for both); - CONTROL: host mounts one → the warning names only the other; - CONTROL: host mounts both → silent; - CONTROL: artifact lists no plugins → silent; - CONTROL: config door (`new AppPlugin(config)`, default registrar) with an unmounted descriptor → silent; - four unit cases of `findUnmountedDeclaredPlugins` (order and dedupe, wrapped bundle alias, live instance, strings / unnamed / non-array never named). **Ablation**: with the door's call switched off (the pre-fix behaviour), the runtime file goes red (2 failed | 7 passed) and, with the runtime rebuilt, the cli pin goes red on the boot test (1 failed | 1 passed, the premise test stays green). Restored and rebuilt: 9/9 and 2/2. ## Acceptance notes - `objectstack-ai/cloud` `apps/objectos-ee/deploy/artifact-pinned-boot.md`, "What this mode does and does not mount", says "The app's own plugins, flows and triggers come from the artifact". For plugins that has not been true on this tree; the doc fix is the cloud repo's (carrier: cloud). - Not touched: the build summary's `Runtime: N plugins` count. It counts what the stack lists, which is true; a build-time note that the artifact does not carry them would print on every build of every app with plugins, including the ones served from their config. Left as a possible follow-up for the maintainer. ## Verification At head `a5af61eea5` (heavy runs under `scripts/pm/os-verify-lock.sh`): - `pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/artifact-declared-plugins.test.ts` → 9/9 passed. - `pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 test/build-artifact-code-plugins-boot.test.ts` → 2/2 passed (runtime rebuilt first). - Neighbours: runtime `src/app-plugin*.test.ts src/standalone-stack*.test.ts src/default-host*.test.ts` → 41 files, 564 tests passed. - `pnpm --filter @objectstack/runtime typecheck`, `pnpm --filter @objectstack/cli typecheck` → exit 0; eslint `--no-inline-config` on every touched source → exit 0; cli `test/vitest-tiers-partition.test.ts` → 22/22. - `node scripts/pm/overlap-check.mjs` → clean (shares `self-hosting.mdx` with objectstack-ai#36311 and objectstack-ai#35129, both merge cleanly). - Derived gate families (`node scripts/pm/dispatch-gates.mjs --commands`, 100 commands) at `3676b4f987`: 97 exit 0; `pnpm check:test-source-alias` exit 1 (the new cli pin reached two lazy loads inside a clocked window), fixed at `a5af61eea5` by two module-top side-effect imports and re-run there: exit 0; `pnpm --filter @objectstack/spec run check:skill-examples` and `pnpm check:dual-build-cjs-loads` exit 3, PREREQUISITE NOT MET (they read built output of packages this change does not build): NOT MEASURED locally, CI runs them. CI at `3676b4f987` was red on the same test-source-alias gate only. ## Two-minute check `OS_ARTIFACT_URL=file://$PWD/dist/objectstack.json os start` on an app whose config lists `plugins: [new SomePlugin()]`: the boot log carries one `[AppPlugin] app '…' lists 1 plugin(s) that are not running on this kernel: '…'` line. `os start` from the same app's config prints no such line. --- _Generated by [Claude Code](https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP <!-- signed: repo:objectstack#1 · os-warren · session_01JQwxba17kw1B3myaWtd4wP --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…te the admission order the audience gate reads (objectstack-ai#36724) Fixes objectstack-ai#36355 repo:objectstack#7 · os-alice · session_011y7As6FyXmJyGyHNKXUkV7 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:自托管运维者在启动日志里那条「无人能登录」报错,以及自托管部署文档,对邀请恢复路径的描述更准确;行为不变。 - 为什么做:上一轮受众策略调整后,文案仍说「邀请先于策略判断」,与代码实际顺序不符,属于其后续文字修正。 - 出错会怎样:只是文字,最坏是说法仍不够精确;可直接撤回,不影响任何准入结果。 - 要你做什么:无 ## What changes Prose only, no logic, no condition, no test change. - `packages/plugins/plugin-auth/src/boot-sign-in-reachability.ts` (N1): the module docblock no longer says `decideAudienceAdmission` short-circuits on `hasPendingInvitation` before the posture switch. It now states the order the function has at main: the posture's own rule is read first (`isAdmittedByPostureRule`: `open`, and an on-allowlist `email_domain` address), then the invitation branch (which admits under `invite_only` and for an off-allowlist address). The `no_sign_in_account_at_boot` message gets the same correction: the verdict-level claim "that ONE creation is admitted under EVERY audience posture" is kept (its pin stays green), and the mechanism now says which branch admits it under which posture. The line-62 rider rule is untouched: the no-mail-transport rider stays scoped to `invite_only`, and nothing states the verification forcing for every non-`invite_only` posture. - `content/docs/deployment/self-hosting.mdx` (N3): "Under `open` every address is admitted by the posture, invitation or not" gains the half-clause the objectstack-ai#36312 changeset states: except a social-provider sign-in whose address the provider did not verify while email verification is in force, refused `403 SELF_REGISTRATION_CLOSED` (`admissionRestsOnAddress` reads `open` as resting on the address exactly while `resolveEmailVerificationRequirement('open', …)` is true). - Same page, the recovery paragraph's "The invitation carve-out admits that one creation under every posture" carried the same imprecision as N1; the module docblock says that page and the message "must keep agreeing", so it is reworded the same way in this PR (same file, inside the claimed surface). - `.changeset/36355-auth-boot-reachability-admission-order.md`: `patch` for `@objectstack/plugin-auth`. The message string ships in `dist` (`files: ["dist", "README.md", "CHANGELOG.md"]`). ## Tests No test changes. No test pins the reworded sentence verbatim: the "under EVERY audience posture" text appears only in a `describe`/`it` title, and the pins under it assert the admission verdict for every posture, which this PR does not move. Every `toContain` pin on the message still holds. Read first: `boot-sign-in-reachability.ts` message hunk (around the "That ONE creation" line), the risk being a `toContain` pin that spans a reworded line; then the docblock bullet; then the doc paragraph. ## Acceptance notes - Verdict-level claims are unchanged in both files; only the mechanism sentences move. - `check:skill-examples`, `check:dual-build-cjs-loads` exited 3 locally (PREREQUISITE NOT MET: they read built output of packages outside this diff's closure) and `check-plugin-teardown-shape --self-test` exited 3 on a shallow checkout. NOT MEASURED locally; CI runs them on a full build. ## Verification Two-minute check: `pnpm --filter @objectstack/plugin-auth exec vitest run src/boot-sign-in-reachability.test.ts` — expect 51 passed. <details><summary>Local readings at d1105b6</summary> - `pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/boot-sign-in-reachability.test.ts`: Test Files 1 passed (1), Tests 51 passed (51). - Under the verify lock, `pnpm --filter @objectstack/plugin-auth build && … typecheck && … test`: VERDICT command-exit 0; Test Files 293 passed (293), Tests 6265 passed, 10 skipped (6275). - `dispatch-gates --commands` derived 91 families; all run, 88 exit 0, 3 exit 3 (NOT MEASURED, above); `--ran` reconciliation: 91 accounted, 88 run, 3 NOT-MEASURED. - `check-nul-bytes`: OK. `overlap-check`: VERDICT clean exit 0 (main, objectstack-ai#36311, objectstack-ai#35129 merge cleanly). </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011y7As6FyXmJyGyHNKXUkV7 Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
Fixes #35184
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill states what a boot outside development mode does to a seeded account's credentials.
skills/**names the development seed only asos dev --seed-admin(skills/objectstack-platform/references/operations.md) andstack.signIn()for tests, andskills/objectstack-platform/evals/config-plugins-ops.jsonsays production creates no demo account, which stays true; checked atorigin/main.维护者速读
What changes
The rule (ruling item 3 on #34717, the card's text): when a deployment leaves development mode, nothing the development seed issued keeps acting for an account that carries the development seed stamp. Development mode is
NODE_ENV=development, read through the same predicate the refusals of #34717 use (isDevelopmentMode). There is no switch, flag or opt-out key.dev-seed-credential-retirement.ts(new),retireDevSeedCredentials. Outside development mode it reads the stamped accounts (one indexed read onsys_user.dev_seed_credential; a database with none costs that one read), keeps those whose seed credential is still in force (isDevSeedCredentialInForce: the stored hash is still the one the seed stored), and for each one retires:os user set-passworduses (revokeSessionsAndApiKeys): every live session (tombstoned in place, ADR-0069 D4), every admissible API key (revoked: true), every app authorized to it and its device sign-ins (read through better-auth's own adapter and plugin registry, as the administrator's forced reset reads them), every linked sign-in account, every OAuth application it registered (disabled) and every SCIM credential it minted (revoked). Sessions and keys carry the existing reasonadmin_password_reset, so a retired key is restored only by a platform administrator;endOutstandingResetTokens);secondaryStoragethat holds the sessions of record (nosys_sessionrow exists then), its sessions there, through better-auth'sdeleteUserSessions, read back after (the vendor logs and does not throw a cache delete that fails). This is the store the CLI command cannot reach (fix(auth)!: a server outside development mode refuses a development seed credential #34717's accepted limit); the server process can.auth-plugin.ts). Onekernel:readyhook, registered independently ofregisterRoutes.kernel:readysettles beforekernel:listeningopens the socket, so no request is served on a retired credential.os user set-password EMAILfirst). This follows the sibling refusals, which answer503on a failed read and refuse a password whose stamp cannot be read, rather than accept unchecked: a server that cannot retire a seed credential does not serve while it may still act. An engine with no read surface (mock mode) or a user table that was never created holds no stamped account.session.create.beforerefusal) and mint no key (the key door requires an interactive session) before the next, so the next boot finds nothing to end.sys_verification(each only opens a session, which is refused for such an account); one-time tokens (they hand over a session, which is retired); the single sign-on providers it registered and its second factor (every reset keeps them).content/docs/deployment/self-hosting.mdxstates the rule in timeless wording and drops the release-note phrasing that named this card (round-0 nit N4 on fix(auth)!: a server outside development mode refuses a development seed credential #34717)..changeset/35184-dev-seed-retire-at-boot.md:patchon@objectstack/plugin-auth,!with a BREAKING section (FROM / TO / not moved / the fix), ADR-0087not-required (no-migration-prescription), whichcheck-adr-0087-registrationasked for.docs/audits/2026-08-tenant-audit-write-call-sites.counts/plugins/plugin-auth.mdregenerated withnode scripts/tenant-audit-census.mjs --write(one new write call site, the reset-token delete adapter).Read first (by risk):
packages/plugins/plugin-auth/src/dev-seed-credential-retirement.ts,retireDevSeedCredentials: which accounts are read, the in-force filter, and the fail-closed throw.packages/plugins/plugin-auth/src/auth-plugin.ts, the newkernel:readyhook: it runs on every boot outside development, including test and staging hosts.packages/plugins/plugin-auth/src/dev-seed-credential-retirement.test.ts, the second case (development boot) and the third (accounts whose password was set since the seed): they pin the boundary of the rule.Two-minute check:
pnpm --filter @objectstack/plugin-auth exec vitest run src/dev-seed-credential-retirement.test.tsshows 6 cases green.Tests
packages/plugins/plugin-auth/src/dev-seed-credential-retirement.test.ts(6; a realObjectKernel+ ObjectQL on a SQLite FILE +AuthPluginwith onedemoStaffentry and the admin plugin +SecurityPlugin). The first boot runs in development: the seed's admin, a demo account and an administrator-created control account (no stamp) are each issued a session, an API key (written asPOST /keyswrites it) and a reset link. The server stops and boots again over the same file:API_KEY_REVOKEDat the key-admission seam, their reset links are gone, each session row carriesadmin_password_reset; the control account's session, key and link are untouched; the stamp stays;setOperatorPasswordand the demo account re-passworded by the write/admin/set-user-passwordmakes (stamp stale) before the boot: both untouched, and a key minted after the operator's reset is admitted;sys_api_keywrites: the boot fails, naming the account andos user set-password;secondaryStorageshared by both boots (the OIDC provider off, as it refuses that store): the seed accounts' sessions there are ended, the control's is kept.Acceptance notes
dev_seed_credentialcolumn, or a stamp still in force. The code's own vocabulary ("still on the seed password is the stored hash still has this digest; any password change stops it matching") and the card's "an operator-set credential is untouched" decide it: an administrator's set-user-password leaves the column but makes it stale, and retiring on the column would end that operator-era account's sessions and keys at every restart, which also breaks idempotence. So the rule retires accounts whose seed credential is in force. Consequence, recorded: a seed-era session on an account whose password was changed in development by a door that did not revoke it (/change-passwordwithoutrevokeOtherSessions, or the administrator's set-user-password with its switch off) is left; the card's own words do not reach it.admin_password_reset, the reason the operator's reset records. A dedicated reason would add an option tosys_api_key.revoked_reason(aplatform-objectsselect, outside this card's file surface); follow-up plugin-auth: boot-time dev-seed retirement records revocations as admin_password_reset; add a dev_seed_retired reason (after #36311) #36313, see## Revoke reasonbelow..changeset/dev-seed-credential-production-refusal.md(unreleased, from fix(auth)!: a server outside development mode refuses a development seed credential #34717) is corrected in this PR, release text only: see## DELIBERATE CORRECTIONbelow.content/docs/deployment/production-readiness.mdx) is not edited; the card names the self-hosting checklist, which now states the rule.DELIBERATE CORRECTION
This PR rewrites two lines in a pending release note it did not add:
.changeset/dev-seed-credential-production-refusal.md, in the note's last paragraph. That paragraph's label and its last sentence named the boot-time retirement as something this release does not do (a follow-up). This PR ships the retirement, so left unchanged the note would publish two false lines.check-empty-changesetstays red by design; the dispatching seat confirms by its own record.os user set-password, and at boot:"Revoke reason
Retired sessions and API keys carry the existing revoke reason
admin_password_reset, so an audit reader sees that reason, not "development seed retired". Seat 4's call (2026-11-22T05:36Z): keep it here, with no schema change in this PR. A dedicateddev_seed_retiredvalue (select value, locales, field descriptions) is follow-up #36313.Verification
Tree
objectstack-ai/objectstack, branchclaude/issue-35184-dev-seed-retire-at-boot, final head9461451a9d(a merge oforigin/mainatc30ce97cd7, three commits touchingui/, docs and oneplatform-objectspage file only). Sessionsession_01FEkQ5kt9AD1TPLy7Y9oa9D.Suites (under scripts/pm/os-verify-lock.sh)
pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2(the whole package) on8395b41853: 292 files passed; 6195 passed, 10 skipped. Every later commit touches the new test file, the changeset, the census shard, or is the merge oforigin/main(no plugin-auth path).9461451a9d:dev-seed-credential-retirement,dev-seed-credential-production,dev-seed-credential,first-session-membership-ordering: 4 files, 46 passed; thenpnpm --filter @objectstack/plugin-auth typecheck: exit 0,check:test-typecheckOK (the new test file adds no debt).pnpm --filter @objectstack/plugin-auth build(needed by the package's examples typecheck): exit 0.Ablation (each wiring point red, then restored)
On
6d4477f415, againstdev-seed-credential-retirement.test.ts(6 cases), one leg per wiring point throughscripts/ablation-replace.mjs; after every leg the blob equals HEAD andgit diff HEADis empty. The subject is this package'ssrc/, imported directly by the test, so no rebuild sits between mutation and run.kernel:readycall skipped: 4 red (retires, idempotent tombstones, fail-closed, secondary storage);Control: 6 of 6 green on the same tree.
Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon9461451a9d: 110 families, all run on that head except as named.--ranwith every exit code recorded: 110 derived, 107 run, 2 NOT MEASURED, 1 UNRUN.check-adr-0087-registration,check-tenant-audit-census(after the shard was regenerated),check:test-source-alias(after the module-top@objectstack/core/egressimport it asked for),check:durability-log-level,check:startup-registry-verdict,check:engine-double-contract,check:nul-bytes,check:doc-authoring,check:cross-package-test-inputs,check:merge-driver.check:skill-examples(needs@objectstack/clientandclient-reactbuilt) andcheck:dual-build-cjs-loads(needs every package built). Neither reads this diff's files; CI runs both inLint & Repo Gates.check:type-check-debt. Its one local run overlapped an ablation leg that hadauth-plugin.tsmutated, so that reading is discarded; CI runs it inLint & Repo Gates.Dogfood battery
pnpm --filter @objectstack/dogfood teston9461451a9d, afterpnpm --filter '@objectstack/dogfood^...' build: lock VERDICT command-exit 0; 487 files, 484 passed, 3 skipped; 4175 tests, 4107 passed, 68 skipped, 0 failed.Session
session_01FEkQ5kt9AD1TPLy7Y9oa9D· signedrepo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D.🤖 Generated with Claude Code