Repository navigation
fix(plugin-auth): the dev admin seed stops storing the host's time zone and currency - #39302
Conversation
…ne and currency The development admin seed wrote localization.timezone from the host's zone and localization.currency from the host's POSIX locale as tenant rows, so the first-run checklist read the host's values as set and offered nothing from the browser. Both seeds, their pins and the QA checklist step that named the seeded row are removed (ruling record 7359875657). The creation-time currency path is unchanged. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbFgiyGToVRBFwedwF
…no currency The composed currency suite pinned the retired dev-seed half (a zh_CN host stores CNY). It now pins the ruled behaviour: the seeded admin's workspace keeps no currency whatever the host locale. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbFgiyGToVRBFwedwF
…o edited currency suites check:test-source-alias judges edited test files: both reach the dynamic import of @objectstack/core/egress through the source under test. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbFgiyGToVRBFwedwF
📓 Docs Drift CheckThis PR changes 2 package(s): 10 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 26 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 2b660f9d9b9ec919e677ba67ba1b8d8d9123d6cc && git checkout 2b660f9d9b9ec919e677ba67ba1b8d8d9123d6cc
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f80864150e572949519a6e861322181f5f36ee48 0dbb73543d84b11ce70ae638dfce3397060abbc4 && git checkout -B drift-repro f80864150e572949519a6e861322181f5f36ee48 && git merge --no-ff 0dbb73543d84b11ce70ae638dfce3397060abbc4
node scripts/docs-audit/affected-docs.mjs --json f80864150e572949519a6e861322181f5f36ee48
|
…t; stale seed prose reworded Case 7 now asserts the seeded admin's workspace resolves timezone from the default with no localization write, so a returning zone seed goes red. Three comments that still described the removed seed are reworded (service-settings localization manifest, demo-staff suite header, showcase .env reason line; the USD pin stays). Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbFgiyGToVRBFwedwF
…mo-staff suite Its header edit put it under check:test-source-alias, which requires the module-top import for an edited test file reaching that dynamic import. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbFgiyGToVRBFwedwF
|
repo:objectstack@os-bill · os-bill · session_01Utp6CbFgiyGToVRBFwedwF 席位核对ACCEPT at 2026-12-03T10:51Z · head
|
|
repo:objectstack@os-bill · os-bill · session_01Utp6CbFgiyGToVRBFwedwF Re-queue · 2026-12-03T11:42Z · head |
Refs #39043 (half A: dev seeds)
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Implements ruling record 7359875657 (the time zone and currency question) on the plugin-auth side.
packages/plugins/plugin-auth/src/auth-plugin.ts: the development admin seed no longer callsseedDevWorkspaceTimezone(deleted) orseedDevWorkspaceCurrency. A short comment at the old call site records that the seed writes no localization setting and cites the ruling record.packages/plugins/plugin-auth/src/organization-default-currency.ts:hostLocaleFromEnvandseedDevWorkspaceCurrencyare deleted, and the header's dev-seed bullet now says the seed writes no currency. The creation-time path (seedCreatedOrganizationCurrency,withOrganizationDefaultCurrency,creatorLocaleForNewOrganization,seedOrganizationCurrency) is not touched. None of the removed symbols was exported from the package entry.dev-admin-seed-workspace-timezone.test.tsis deleted, and thehostLocaleFromEnvcases are removed fromorganization-default-currency.test.ts.organization-created-default-currency.test.ts(outside the dispatched file list, see Acceptance notes): its "the dev seed, from the host locale" block pinned the retired seed (a zh_CN host stores CNY) and went red. Cases 7 to 9 are replaced by one case 7 that pins the ruled behaviour: on a dev boot withLANG=zh_CN.UTF-8, the seeded admin exists and the Default Organization'scurrencyreads{ value: null, source: 'default' }, with nolocalization.currencywrite.import '@objectstack/core/egress'thatcheck:test-source-aliasrequires for an edited test file whose source reaches that dynamic import.docs/qa/platform-checklist/areas/platform-core.json, itemplatform-core.settings-hub-roundtrip: steps[1] (the "UTC in these containers" step), steps[2], steps[5] and acceptance[0].clause no longer say a dev-seeded boot starts with a tenant zone. The item moves to revision 10 and gets a history row. No clause is loosened.@objectstack/plugin-authpatch changeset.Tests
The ruling's named premise, measured on a real composition (ObjectKernel, ObjectQL on in-memory SQLite, AuthPlugin, SecurityPlugin, SettingsServicePlugin,
NODE_ENV=development,TZ=Asia/Shanghai,LANG=en_US.UTF-8). The probe reused the deleted suite's harness as a scratch copy and was not committed:timezone={"value":"UTC","source":"default"},currency={"value":null,"source":"default"}, nolocalizationrow insys_setting, and nolocalizationwrite through the settings door. 1 passed.c7478b37source:timezone={"value":"Asia/Shanghai","source":"tenant"}andcurrency={"value":"USD","source":"tenant"}. 1 failed.plugin-auth suite, typecheck and the ablation of the rewritten pin
pnpm --filter @objectstack/plugin-auth build && … typecheck && … exec vitest run --maxWorkers=2at 093d5b4: typecheck green (check:test-typecheck: OK). Vitest gaveTest Files 1 failed | 296 passed (297). The one failure was case 7 oforganization-created-default-currency.test.ts, fixed in 5ca0e22.vitest run src/organization-created-default-currency.test.ts src/organization-default-currency.test.tsgivesTest Files 2 passed (2),Tests 21 passed (21), andcheck:test-typecheck: OK.c7478b37versions ofauth-plugin.tsandorganization-default-currency.tsrestored to the tree only, the same file givesTests 1 failed | 9 passed (10)on case 7 (expected … to match object { value: null, source: 'default' }). Both files were then restored from HEAD andgit statuswas clean.Local gate families (dispatch-gates --commands, 83 derived)
dispatch-gates --ran: 83 derived, 83 run, 0 unrun.pnpm check:query-options-erasurehit a local 200 s timeout once, then exited 0 on a rerun (ratchet holds … none new).pnpm check:test-source-aliasexited 1 at 5ca0e22 on the two edited currency suites (the egress import above). At c183c16 it exits 0 (check-test-source-alias OK).pnpm check:dual-build-cjs-loadsexited 3 (Run pnpm build first … nothing was measured; only the plugin-auth closure is built here).node scripts/check-plugin-teardown-shape.mjs --self-testexited 3 because its pinned fixture commit cannot be reached from this shallow clone.Acceptance notes
organization-created-default-currency.test.ts. The ruling says the seeds' pins go with them, and this file held the currency seed's composed pins. Its dev-seed block is therefore rewritten here rather than left red.packages/services/service-settings/src/manifests/localization.manifest.ts: a comment says "the dev seed does the same from the host's POSIX locale".packages/plugins/plugin-auth/src/demo-staff-provisioning.test.ts: its header names the deleted suite as its composition precedent.examples/app-showcase/.env: its comment contrasts the pinned currency with one "derived from this host's locale". TheOS_LOCALIZATION_CURRENCY=USDpin is still needed and still works.timezonesource: 'tenant'from a checked-in 18.x fixture database, not from a fresh boot. The showcase pins its home currency in the environment.Verification
Read first:
auth-plugin.tsat the old call site inmaybeSeedDevAdmin(the only behaviour change), then case 7 oforganization-created-default-currency.test.ts.Two-minute check:
pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/organization-created-default-currency.test.tsshould report 10 passed.Generated by Claude Code