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