Skip to content

fix(plugin-auth)!: Setup → Authentication's switches show what the deployment runs when nothing is saved - #38180

Merged
os-zhuang merged 8 commits into
mainfrom
claude/issue-38098-runtime-declared-defaults
Nov 28, 2026
Merged

os-zhuang merged 8 commits into
mainfrom
claude/issue-38098-runtime-declared-defaults

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #38098

Clause-②: yes (narrowing) — narrowed: with nothing stored, SettingsService.get('auth', …) and GET /api/settings/auth answer email_password_enabled, signup_enabled and require_email_verification with the deployment's declaration (still source: 'default') where they answered the manifest default, so a published response's value changes for an existing reader on any deployment whose own configuration differs from the manifest default for one of those keys; on a cloud-managed runtime whose deployment declares emailAndPassword.enabled: false, a save of email_password_enabled: true with nothing stored answers 400 SETTINGS_VALIDATION and saves nothing in the batch, where it saved a row that was not applied; a save that sets one of these keys to its manifest default where the declaration differs now asks the key's write predicates. Widened: SettingsService.registerDeclaredDefault and the type SettingsDeclaredDefault (service-settings); AuthManager.resolveDisableSignUp (public method); a save that sets one of these keys to the declaration with nothing stored is no change and asks no predicate; on a deployment that declares emailAndPassword.enabled: false with nothing stored, the ten auth keys visible only while email_password_enabled !== false (signup_enabled, require_email_verification, password_min_length, password_max_length, password_reject_breached, password_require_complexity, password_min_classes, password_history_count, password_expiry_days, mfa_required) are hidden, so a save of one of them is no longer judged for required, options or bounds (for example password_min_length: 2 is now stored where it was refused 400 SETTINGS_VALIDATION), as under a stored email_password_enabled: false; a save that turns email_password_enabled on re-judges them. The live-status banner drops its declared-off, nothing-saved statement (declaredOffLabel / declaredOffText copy removed) and the cloud-managed statement is always a warning.
Metadata-protocol: none
Skills-docs: none — no skill under skills/** teaches the auth settings page, these switches or the settings cascade's bottom rung; content/docs/protocol/kernel/config-resolution.mdx states the declared default in this change.

维护者速读

  • 管理员在 设置 → 认证 里、没保存过值时,邮箱/密码登录、自助注册、邮箱验证三个开关显示部署实际在跑的状态,不再显示清单默认值;托管环境同样如此。
  • 属于托管云环境的统一登录工作,接着上一轮的提示横幅(那轮只加了一条说明,开关本身仍显示「开」)把开关本身改对。
  • 出错时管理员会在没保存值的情况下看到开关显示错误的状态,或托管环境里打开邮箱/密码登录的保存被拒;已保存的值不受影响,可直接撤回本改动。
  • 改动了设置决策记录(ADR-0007)的一条级联规则,需要你批准合并。

What changes

The seam (service-settings). SettingsService.registerDeclaredDefault(namespace, key, provider) lets the package that owns a running config state what a key takes while nothing is stored and no OS_* override is in force. One private reader, defaultOf, answers the bottom rung of the cascade from the provider, else the manifest default, and every site that read the manifest default now reads it: the cascade walk (get, getMany, getNamespace, so GET /api/settings/:namespace and the write-predicate change test), the value a cleared key falls back to in validatePatch, and the type an OS_* value is coerced to. Asked on each use, never recorded (the startup-registry rule). undefined/null means nothing declared; a throwing provider is said once at warn and the manifest default answers (functional degradation, nothing persisted is lost). A provider that answers a promise is refused the same way (the contract is synchronous; the cascade reads it inline). The answer is not judged against the specifier's type or options: it is the running system's own value. A key or namespace with no provider resolves byte-for-byte as before.

What source reads. Kept as 'default'. The published enum (ResolvedSettingValueSchema.source in packages/spec) is env | global | tenant | user | default and admits no distinct value, and the seat ruled no spec shape change. The reading for existing consumers: source: 'default' meant "nothing stored, the manifest default"; it now means "nothing stored, the deployment's default" — still nothing stored, and a clear still returns to it. The consumers that branch on it keep their behaviour: bindAuthSettings applies only non-default sources (isExplicit), so a declared default is never re-applied (the running config already holds it); the restore-on-clear pass (authSettingsFromStore) is unchanged; the console renders values[key].value. ADR-0007 §Resolution rung 4 is amended in this PR (status line + amendment note), per Prime Directive 13. The spec's own account of the rung (settings-manifest.zod.ts file header and the SpecifierScope comment, sys-setting.object.ts header) now reads the same, and content/docs/references/system/settings-manifest.mdx is regenerated (check:generated --fix); comments only, no schema moves.

The declarations (plugin-auth, auth-settings-declared-defaults.ts). Re-measured on base 0e361201 first (reverse-verification run below, before the fix): all three differ.

key manifest default declared default (what runs with nothing stored) measured on base
email_password_enabled true emailAndPassword.enabled !== false declared false → resolved {true, default} while getPublicConfig().emailPassword.enabled is false
signup_enabled true !AuthManager.resolveDisableSignUp(declared.disableSignUp) (forced off under SSO-only / cloud-managed, then OS_DISABLE_SIGNUP, then the declaration) declared disableSignUp: true → resolved {true, default} while disableSignUp runs true
require_email_verification false resolveEmailVerificationRequirement(posture in force, declared) declared true → resolved {false, default} while verification runs true

AuthManager.resolveDisableSignUp is the formula getPublicConfig() already used, extracted so the declaration and the public config cannot disagree. Registered in bindAuthSettings next to the sign-in floor; a settings surface without the method is skipped like the surface's other optional methods.

The banner (#38094), reduced. With the declaration as the value, the declared-off/nothing-saved case and the managed/nothing-saved case agree with what runs and state nothing. Left: a value stored on that a cloud-managed runtime does not apply (now always warning), and any other disagreement (warning). The declaredOffLabel / declaredOffText copy is removed from all 11 locales.

The managed save of true (#38028). With nothing stored on a managed runtime that declared email and password off, the key now resolves false, so a save of true is a change, reaches the email_password_enabled save door and is refused 400 SETTINGS_VALIDATION (invalid_value, constraint: { cloudManaged: true, declaredEmailPassword: false }). The settings pass's not-applied hold stays for rows stored before the door existed.

Read first (by risk):

  1. packages/services/service-settings/src/settings-service.ts — defaultOf and its three call sites (resolveKeyFromRows, validatePatch, effectiveEnvOverride).
  2. packages/plugins/plugin-auth/src/auth-settings-declared-defaults.ts — the three formulas.
  3. packages/plugins/plugin-auth/src/sign-in-method-floor.test.ts — the managed describe, whose first case changed meaning (save of on with nothing stored: was stored-and-not-applied, now refused).

Tests

  • New service-settings/src/settings-declared-default.test.ts (7): declared value read as source: 'default' through get / getNamespace / the cascade chain, asked on each read; CONTROL key and namespace with no provider; stored value wins and a clear returns to the declaration; OS_* wins; a write predicate sees the declaration as current (manifest default is a change; re-saving the declaration is not); undefined and a throwing provider leave the manifest default (said once); unknown namespace / key refused.
  • plugin-auth/src/auth-settings-live-status.test.ts (real AuthPlugin, real SettingsService, real GET /api/settings/:namespace): declared off, nothing stored → { value: false, source: 'default' } through SettingsService.get and the route, no banner; CONTROL declared on → true, no banner; stored value wins both ways and a clear returns to the declaration; managed: nothing stored reads off with no banner, a row stored on before boot is not applied and is stated as a warning (en, zh-CN); signup_enabled declared off / SSO-only / CONTROL; require_email_verification declared on / email_domain posture / CONTROL.
  • Rework round (contract review S1 and N5): settings-declared-default.test.ts adds a promise-answering provider (manifest default, said once), a patch clear that takes the declaration for the visibility map (a required key behind it is not judged; CONTROL without provider refuses SETTINGS_VALIDATION / required), and an OS_* value read as the declaration's type where the manifest declares no default. auth-settings-live-status.test.ts adds signup_enabled under OS_DISABLE_SIGNUP and cloud-managed, and the hidden-key accept set: declared off with nothing stored, password_min_length: 2 is stored, a later save of email_password_enabled: true re-judges and refuses it; CONTROL declared on refuses the same save.
  • plugin-auth/src/sign-in-method-floor.test.ts, managed describe: new first case pins the managed save of true with nothing stored refused (envelope SETTINGS_VALIDATION + field invalid_value + constraint, and 400 + SETTINGS_VALIDATION through the real PUT route); the two cases that needed a stored on now seed the row before boot; the Google case now also carries the email_password_enabled refusal.

Acceptance notes

  • Other auth.* keys whose deployment declaration can differ from the manifest default (password_min_length, password_max_length, membership_policy, mfa_required, session and lockout windows, rate limits; the rows of AUTH_SETTING_RESTORE) still read the manifest default with nothing stored, and a signup_enabled stored on under SSO-only or cloud-managed shows on while sign-up is forced off, with no statement (unchanged here). Both are carried by follow-up card Settings: other auth keys still show the manifest default, not the deployment declaration, when nothing is stored #38184.
  • The served manifest still carries each specifier's manifest default; the console's default hint reads the cascade chain's default entry, which the declaration now answers, so hint and value agree.
  • Open nits from the contract review, not taken here: the OS_* coercion type follows the declaration (identical for the three boolean keys); SettingsDeclaredDefault takes no context (an optional argument can be added later without breaking); the differs banner sentence says "the saved setting", inexact only where the seam is missing or a provider throws with nothing stored.
  • No changeset for @objectstack/spec or @objectstack/platform-objects: their change is comments only, both sit in the fixed release group, and no gate asks for one.
  • Self-hosted, declared off, nothing stored: a save of email_password_enabled: false is now no change and asks no predicate (before, the sign-in floor judged it as turning off). It stores the value that already runs.

Verification

Reverse verification on base

Fix committed; packages/services/service-settings/src/settings-service.ts restored from base 0e361201 with git restore --source (unstaged), the three test files run, then restored with git restore --source=HEAD --staged --worktree (git status --porcelain empty):

  • settings-declared-default.test.ts: 7 failed of 7 (registerDeclaredDefault is not a function — the seam does not exist on base).
  • auth-settings-live-status.test.ts + sign-in-method-floor.test.ts: 7 failed, 65 passed. Failures at the declared-value assertions (expected value false, received true for email and password and sign-up; expected true, received false for verification), after each case's running-config assertion passed; the managed save case and the Google case fail because the save of true is not refused. Every CONTROL case passed on base.
Local runs at final head 35da5d7 (after the rework round and a merge of origin/main)
  • Dependency closure rebuilt (pnpm --filter '@objectstack/dogfood^...' build), then pnpm --filter @objectstack/service-settings typecheck && test: Test Files 79 passed (79), Tests 1545 passed (1545); pnpm --filter @objectstack/plugin-auth typecheck && test (tsc, the examples project, check:test-typecheck): Test Files 296 passed (296), Tests 6310 passed, 10 skipped (6320). Lock verdict command-exit 0 for the chain.
  • Dogfood battery at 35da5d7b (pnpm --filter @objectstack/dogfood test under the verify lock): Test Files 491 passed, 3 skipped (494); Tests 4148 passed, 68 skipped (4216); lock verdict command-exit 0.
  • Derived gate families (node scripts/pm/dispatch-gates.mjs --commands, 127): --ran reconciliation 127 derived, 124 run with exit 0, 3 NOT MEASURED (exit 3, prerequisite): node scripts/check-plugin-teardown-shape.mjs --self-test (pinned fixture needs an unshallowed clone), pnpm check:dual-build-cjs-loads and pnpm --filter @objectstack/spec run check:skill-examples (read built output of packages outside the closure built here). pnpm --filter @objectstack/spec check:generated: 14 of 14 artifacts current after --fix regenerated the settings manifest reference page. Families CI runs are read from this PR's check-runs, not re-run here.

Two-minute check: pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/auth-settings-live-status.test.ts — 11 passed; the first case shows email_password_enabled read as { value: false, source: 'default' } with no banner.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK

…ottom rung of the cascade

plugin-auth states the declaration for email_password_enabled, signup_enabled
and require_email_verification; the live-status banner keeps only the cases
a resolved value cannot say.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
…e auth settings page

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 4 package(s): @objectstack/platform-objects, @objectstack/plugin-auth, @objectstack/service-settings, @objectstack/spec, touching 25 documentable anchor(s). ⚠️ 3 changed file(s) yielded no anchor (packages/platform-objects/src/system/sys-setting.object.ts, packages/plugins/plugin-auth/src/sign-in-method-floor.ts, packages/spec/src/system/settings-manifest.zod.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

15 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/data-modeling/drivers.mdx (via SettingsService (symbol, a top-level class))
  • content/docs/deployment/cli.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/deployment/self-hosting.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/deployment/tenancy-modes.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/kernel/cluster.mdx (via SettingsService (symbol, a top-level class))
  • content/docs/kernel/contracts/auth-service.mdx (via AuthManager (symbol, a top-level class))
  • content/docs/kernel/services-checklist.mdx (via AuthManager (symbol, a top-level class), AuthPlugin (symbol, a top-level class))
  • content/docs/permissions/authentication.mdx (via AuthManager (symbol, a top-level class), AuthPlugin (symbol, a top-level class))
  • content/docs/permissions/record-view-auditing.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/permissions/sso.mdx (via AuthPlugin (symbol, a top-level class), getPublicConfig (symbol, a method of class AuthManager))
  • content/docs/plugins/index.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/plugins/packages.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/protocol/kernel/config-resolution.mdx (via SettingsService (symbol, a top-level class), registerDeclaredDefault (symbol, a method of class SettingsService; a method of interface DeclaredDefaultHost; a method of interface SettingsReadSurface))
  • content/docs/protocol/kernel/index.mdx (via SettingsService (symbol, a top-level class))
  • content/docs/upgrading.mdx (via AuthPlugin (symbol, a top-level class))

⛔ 8 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-3.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/releases/v17/17-5.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/releases/v17/17-6.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/releases/v18/18-0.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/releases/v18/18-1.mdx (via AuthPlugin (symbol, a top-level class))
  • content/docs/releases/v18/18-2.mdx (via AuthManager (symbol, a top-level class), AuthPlugin (symbol, a top-level class))
  • content/docs/releases/v18/18-3.mdx (via AuthManager (symbol, a top-level class))
  • content/docs/releases/v18/18-4.mdx (via AuthManager (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 3 changed file(s) yielded no anchor (packages/platform-objects/src/system/sys-setting.object.ts, packages/plugins/plugin-auth/src/sign-in-method-floor.ts, packages/spec/src/system/settings-manifest.zod.ts) — pages documenting those are invisible to this run
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 183 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 4f7aa88a1cd376afbcfcfb51e80c2cce4300586a → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 7db865082df7d5a25cb11862aab382348adf4c02 — the merge of head 35da5d7b3efcf5a01262b9b854833e6c2796acb4 into base 4f7aa88a1cd376afbcfcfb51e80c2cce4300586a, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7db865082df7d5a25cb11862aab382348adf4c02 && git checkout 7db865082df7d5a25cb11862aab382348adf4c02
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4f7aa88a1cd376afbcfcfb51e80c2cce4300586a 35da5d7b3efcf5a01262b9b854833e6c2796acb4 && git checkout -B drift-repro 4f7aa88a1cd376afbcfcfb51e80c2cce4300586a && git merge --no-ff 35da5d7b3efcf5a01262b9b854833e6c2796acb4

node scripts/docs-audit/affected-docs.mjs --json 4f7aa88a1cd376afbcfcfb51e80c2cce4300586a

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 4f7aa88a1cd376afbcfcfb51e80c2cce4300586a → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 3d64e99f21b8a80748cbe5e5fdae13b72c56e3a7
Local-runs: none
Scope: docs/adr/0007-settings-manifest-and-kv-store.md, packages/services/service-settings/src/settings-service.ts, packages/services/service-settings/src/settings-service.types.ts, packages/services/service-settings/src/index.ts, packages/services/service-settings/src/settings-declared-default.test.ts, packages/plugins/plugin-auth/src/auth-settings-declared-defaults.ts, packages/plugins/plugin-auth/src/auth-manager.ts, packages/plugins/plugin-auth/src/auth-plugin.ts, packages/plugins/plugin-auth/src/auth-settings-live-status.ts, packages/plugins/plugin-auth/src/sign-in-method-floor.ts, packages/plugins/plugin-auth/src/auth-settings-live-status.test.ts, packages/plugins/plugin-auth/src/sign-in-method-floor.test.ts + read, not reviewed: packages/spec/src/system/settings-manifest.zod.ts, packages/spec/src/system/settings-client.zod.ts, packages/platform-objects/src/system/sys-setting.object.ts, packages/services/service-settings/src/manifests/auth.manifest.ts, packages/plugins/plugin-auth/src/auth-settings-declared.ts, ui/apps/console/src/pages/settings/SettingsField.tsx, scripts/pm/check-governed-merges.mjs, scripts/check-adr-0087-registration.mjs, content/docs/protocol/kernel/config-resolution.mdx, .changeset/auth-switches-read-declaration.md, .changeset/settings-declared-default.md, AGENTS.md
Security-touching: yes
Rule-change-verified: none

First record on this head. Faces: the governed rule text docs/adr/0007-* (the one reviewFace hit) and the declared narrowing. Read: card #38098 with triage 7232887955, claim 7233770569, claim note 7234902939 and dev report 7234889808; the PR body and its 15-file net diff against merge base 581ae76a; the check-runs on the head. The tree was read in a detached worktree; nothing was built or run.

① Derived judgments

  • Clause-②: yes (narrowing) on the PR body and the plugin-auth changeset: RIGHT. A reader of GET /api/settings/auth or SettingsService.get('auth', …) gets a different value for three keys with nothing stored, and a save that was accepted is now refused 400.
  • Clause-②: yes (widening) on the service-settings changeset: RIGHT. registerDeclaredDefault and the type SettingsDeclaredDefault are added; a namespace with no provider resolves as before (defaultOf falls through to reg.defaults.get(key)).
  • Metadata-protocol: none on both: RIGHT. No spec key, accepted value or manifest shape changes; a manifest author who registers no provider sees no change in what default does.
  • source: 'default' kept for a declared value: RIGHT, without a spec shape change.
    • Every in-repo branch on the value reads it as "nothing stored and no OS_*", not as "equals the manifest default": about thirty sites in packages/** (isExplicit in bindAuthSettings, email, sms, storage, knowledge, organization locale and currency, membership policy) and two in the console (SettingsField.tsx:349, firstRunChecklistLogic.ts:509). None changes behaviour.
    • The console's "default: X" hint reads the chain's default entry (SettingsField.tsx:228), which defaultOf now answers, so the hint and the value agree. No console file reads spec.default.
    • The spec's own prose still says the old rung. See S2.
  • AuthManager.resolveDisableSignUp public: RIGHT, named as a widening.
  • The removed declaredOffLabel / declaredOffText copy: not a published surface. auth-settings-live-status.ts is not exported from the package index.
  • One derived change is not named on either declaration line. See S1.

② Semver level

  • @objectstack/plugin-auth patch and @objectstack/service-settings patch: RIGHT. With Metadata-protocol: none the level is patch, breaking or widening (AGENTS.md, changeset rule). Both packages sit in the fixed group.
  • The narrowing owes, and the plugin-auth changeset carries: the ! in the title, the BREAKING banner naming the affected reader, and one ADR-0087 marker, not-required (no-migration-prescription). The disposition fits: no stored row is read differently and nothing exists for migrate meta to rewrite. The category is refused only under Metadata-protocol: narrowed, which this is not.
  • No FROM/TO mapping is owed: nothing an author writes is removed or renamed.
  • Skills-docs: none: RIGHT. No file under skills/** names the settings cascade, SettingsService or these switches.

③ Boundary flags

  • Check-runs on this head, read at 2026-11-28T05:59Z: 53 runs, 30 success, 15 skipped, none failed, 8 still running (Test Core 1, 2, 3, 5, 6, 7, 9 of 10, and Type Check · workspace).
    • Success includes Check Changeset, Dogfood Regression Gate, Governed Surface Queue Guard, Build Docs and Type Check · source gates.
    • This record was read while CI was running. A closing read of the finished runs is owed before any landing step.
  • The PR is a draft, mergeable: true, blocked.
  • Tier: the PR is Tier H. docs/adr/** is governed, the ADR hunk replaces a line and rewrites the status line (not an add-only note), the diff carries package paths, and the body reads Clause-②: yes, so the low-risk arm does not apply. It lands only after an authorized APPROVED review by an account in GOVERNED_APPROVERS. This record does not land it.
  • Dev open question (keep the ADR amendment here or split it): the seat ruled A in 7234902939. Agreed: Prime Directive 13 asks for the amended status line with the behaviour change, and a split leaves the code contradicting the ADR until it lands.
  • Claim surface: widened by claim note 7234902939 to the ADR and config-resolution.mdx. The diff stays inside it.
  • Dogfood battery: reported at 3d64e99f, this head, exit 0. The Dogfood Regression Gate check on this head is green.
  • Dev out-of-scope finding, carrier none: the other auth.* keys with a deployment declaration (password_min_length, password_max_length, membership_policy, mfa_required, session and lockout windows, rate limits) still resolve the manifest default with nothing stored. Inferred, not measured. It needs a card; the seat files it.
  • Security-touching: yes: the diff changes what the auth settings page reads, and which save of a sign-in method is refused.
  • SQL push-down: nothing to report. The diff adds no read.

④ Design judgment

ADR-0007 amendment against its first consumer:

  • The status line carries the amendment with date and card; rung 4 and a dated note under §Resolution state the same rule the code implements. Prime Directive 13 is met.
  • The first consumer is in the diff (auth-settings-declared-defaults.ts), and settings-service.ts cites "ADR-0007 §Resolution, rung 4, as amended".

The seam (settings-service.ts):

  • reg.defaults had three readers on base; all three now go through defaultOf: the cascade walk (line 2712), the cleared-key fallback in validatePatch (3627) and the OS_* coercion (1647). No other file in service-settings reads a manifest default for a registered key. Export, reset and getMany all pass through the cascade walk.
  • The provider is asked on each use and nothing is cached. undefined and null fall through; a throw is said once per key at warn and the manifest default answers. A stored row and OS_* still win.
  • registerDeclaredDefault refuses an unknown namespace or key; the map is separate from the manifest registry, so a manifest re-registration keeps the provider.

The three formulas against the running config (auth-manager.ts, read):

  • email_password_enabled: declared.emailAndPassword?.enabled !== false, the expression getPublicConfig() uses.
  • signup_enabled: !resolveDisableSignUp(declared.disableSignUp). getPublicConfig() now calls the same method, which keeps the base expression: forced off under SSO-only or cloud-managed, then OS_AUTH_SIGNUP_ENABLED / OS_DISABLE_SIGNUP, then the declaration, then on.
  • require_email_verification: resolveEmailVerificationRequirement(posture in force, declared), the resolver getPublicConfig() and the wiring use.
  • The formulas read the declaration captured in init(), not the running config. That is right: the bottom rung is also what a clear returns to and what the console shows as the default beside a stored value.
  • The providers are synchronous and read no setting, so a read cannot recurse into the service.

The saves:

  • Managed, declared off, nothing stored, save of true: now a change, reaches signInMethodFloorPredicate, refused 400 with constraint: { cloudManaged: true, declaredEmailPassword: false }. Pinned through setMany and the real PUT. Before, it stored a row that was not applied; the refusal is the honest answer. The settings pass still holds a row stored before the door.
  • Self-hosted, declared off, nothing stored, save of false: no change, no predicate. Before, the floor judged it as turning off a method that was already off. The row is stored and applied, with the same value that runs.
  • Self-hosted, declared off, save of true: a change; the floor passes it because email and password is on after it.

The banner:

  • Nothing stored now agrees with what runs on both self-hosted and managed, so nothing is stated. A value stored on that a managed runtime holds off stays, as warning. Any other disagreement stays, as warning, so a failed registration or a thrown provider is still flagged.
  • declaredOff copy: removed from all 11 locales; no reference is left in packages/**, ui/** or the cloud repo.

S1 (should-fix): open.

  • On a deployment that declares emailAndPassword.enabled: false with nothing stored, validatePatch builds its value map from get, so email_password_enabled now reads false there. Ten auth keys are visible only while it is not false (auth.manifest.ts: signup_enabled, require_email_verification, password_min_length, password_max_length, password_reject_breached, password_require_complexity, password_min_classes, password_history_count, password_expiry_days, mfa_required). A hidden specifier is not validated, so a save of one of them is no longer judged for required, options or its bounds, where on base it was. Example: password_min_length: 2 was refused (min: 6) and is now stored and applied.
  • This is the behaviour a stored false already has, and saving email_password_enabled: true re-judges the gated keys (it is their visible dependency). It is a change to an accept set, and neither Clause-②: line names it.
  • Fix: name it on the declaration line of the PR body and of the plugin-auth changeset. A test pinning it is welcome and not required.

S2 (should-fix): open.

  • The published spec still states the old rung. packages/spec/src/system/settings-manifest.zod.ts:29 reads "4. manifest specifier.default", and the SpecifierScope comment at line 165 reads "falling back to default (declared on the specifier)". The generated page content/docs/references/system/settings-manifest.mdx:26 repeats the first. packages/platform-objects/src/system/sys-setting.object.ts:28 reads "manifest specifier.default (source='default')".
  • After this PR the ADR and config-resolution.mdx say one thing and the spec's own account says another. The seat's ruling was no spec shape change; these are comments, and no schema moves.
  • Fix: amend the three comments to the ADR's wording and regenerate the reference page, in this PR.

Nits, none with an effect on correctness or the contract:

  • N1 (open). defaultOf returns whatever the provider answers: no check against the specifier's type or options, and a provider that returns a promise would be served as the value.
  • N2 (open). The OS_* coercion type follows the provider's answer, so a provider whose type differs from the manifest default changes how the same env string is read. The three auth keys are boolean on both sides.
  • N3 (open). SettingsDeclaredDefault takes no context, so a later registrant cannot answer per organization. An optional argument can be added later without breaking.
  • N4 (open). differsText says "the saved setting". Where the provider is missing or throws and nothing is stored, the banner is still raised and the sentence is then inexact.
  • N5 (open). No case pins signup_enabled under OS_CLOUD_MANAGED or OS_DISABLE_SIGNUP (SSO-only is pinned and shares the formula), and the validatePatch clear and the OS_* coercion sites are covered only through get.
  • N6 (open). A signup_enabled stored on under SSO-only or cloud-managed shows on while sign-up is forced off, with no statement. Unchanged by this PR; a follow-up card.

No must-fix. Two should-fix, S1 and S2, open on this head.

Implemented-by: claude/issue-38098-runtime-declared-defaults
Reviewed-by: session_01Q4EjjQkY5yXZrN9BEA3rEK

VERDICT: PASS

… sign-up holds; refuse a promise from a declared default

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 35da5d7b3efcf5a01262b9b854833e6c2796acb4
Local-runs: none
Scope: docs/adr/0007-settings-manifest-and-kv-store.md, packages/spec/src/system/settings-manifest.zod.ts, packages/platform-objects/src/system/sys-setting.object.ts, packages/services/service-settings/src/settings-service.ts, packages/services/service-settings/src/settings-service.types.ts, packages/services/service-settings/src/index.ts, packages/services/service-settings/src/settings-declared-default.test.ts, packages/plugins/plugin-auth/src/auth-settings-declared-defaults.ts, packages/plugins/plugin-auth/src/auth-manager.ts, packages/plugins/plugin-auth/src/auth-plugin.ts, packages/plugins/plugin-auth/src/auth-settings-live-status.ts, packages/plugins/plugin-auth/src/sign-in-method-floor.ts, packages/plugins/plugin-auth/src/auth-settings-live-status.test.ts, packages/plugins/plugin-auth/src/sign-in-method-floor.test.ts + read, not reviewed: content/docs/references/system/settings-manifest.mdx, content/docs/protocol/kernel/config-resolution.mdx, .changeset/auth-switches-read-declaration.md, .changeset/settings-declared-default.md, packages/services/service-settings/src/manifests/auth.manifest.ts, AGENTS.md
Security-touching: yes
Rule-change-verified: none

Delta record by the reviewer of record 7235028565 (PASS at 3d64e99f, S1 and S2 open). Read: dev rework report 7235897389, the re-patched PR body, the net diff against merge base 4f7aa88a, the delta from 3d64e99f on the PR's own paths, and the check-runs on this head. The tree was read in a detached worktree; nothing was built or run. The merge of origin/main brought no change to the PR's own hunks in settings-service.ts: reg.defaults still has one reader, defaultOf, and the same three call sites.

① Derived judgments

  • Unchanged from 7235028565, with one addition: the hidden-key accept set is now named on the Clause-②: line of the PR body and of the plugin-auth changeset, under Widened, with the ten keys and the password_min_length: 2 example. RIGHT.
  • The PR's file list now holds packages/spec/src/system/settings-manifest.zod.ts, a published-schema path. The two hunks are comments (the module header's rung 4 and the SpecifierScope description); no schema, key, enum or accepted value moves. No further Clause-②: arm is owed, and Metadata-protocol: none stays RIGHT.

② Semver level

  • Unchanged from 7235028565: @objectstack/plugin-auth patch with the ! title, the BREAKING banner and the marker not-required (no-migration-prescription); @objectstack/service-settings patch.
  • No changeset for @objectstack/spec or @objectstack/platform-objects: accepted. Both edits are comments, both packages sit in the fixed release group, and Check Changeset passed on this head with no entry for them.

③ Boundary flags

  • Check-runs on this head, read at 2026-11-28T07:24Z: 74 runs, 61 success, 12 skipped, none failed, 1 still running.
    • The one running is a second Check Changeset run, started 07:23Z by the PR body edit. The first Check Changeset run on this head finished green at 06:15Z.
    • Success includes all ten Test Core shards, Type Check · source gates (red on 35b33541 on the stale reference page), Type Check · workspace, Type Check UI, Dogfood Regression Gate and Governed Surface Queue Guard.
    • The seat reads the second Check Changeset run's conclusion before any landing step.
  • The PR is a draft, mergeable: true.
  • Tier: unchanged, Tier H. The spec path adds a schema face at the same tier, CONTRACT_REVIEW_TIER; packages/spec/** and packages/platform-objects/** are not governed surfaces. Landing still waits for an authorized APPROVED review by an account in GOVERNED_APPROVERS.
  • Dogfood battery: reported at 35da5d7b, this head, exit 0.
  • Out-of-scope findings: the other auth.* keys and N6 are carried by Settings: other auth keys still show the manifest default, not the deployment declaration, when nothing is stored #38184, open. N2, N3 and N4 are recorded in the PR body's Acceptance notes with no card.
  • Security-touching: yes, as before. SQL push-down: nothing to report.

④ Design judgment

Findings of record 7235028565, at this head:

S1 (should-fix): closed.

  • Both declaration lines name the change. auth-settings-live-status.test.ts pins it: declared off with nothing stored, password_min_length: 2 is stored; turning email_password_enabled on is then refused at password_min_length; the declared-on CONTROL refuses the same save.

S2 (should-fix): closed.

  • settings-manifest.zod.ts rung 4 and the SpecifierScope comment, and sys-setting.object.ts rung 5, now read "what the running deployment declares for the key, else the manifest specifier.default". The regenerated content/docs/references/system/settings-manifest.mdx matches. No statement of the old rung is left under packages/spec/src, packages/platform-objects/src or content/docs/references.

The spec file as a schema-face hit: the two comment hunks agree with ADR-0007 rung 4 as amended and with defaultOf. Nothing else in the file changed.

The rework's code change, defaultOf: a provider that answers a thenable is now treated as a throw, said once, and the manifest default answers. It agrees with the type's amended comment ("Answered synchronously").

Nits, none with an effect on correctness or the contract:

No must-fix, no should-fix.

Implemented-by: claude/issue-38098-runtime-declared-defaults
Reviewed-by: session_01Q4EjjQkY5yXZrN9BEA3rEK

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

维护者速读

  • 设置 → 认证 里的三个开关(邮箱/密码登录、允许注册、要求验证邮箱),在没保存值时改为显示部署实际生效的值,不再显示清单默认值;托管环境下保存「开」而宿主强制关时会被拒绝。
  • 会改变已有读取方看到的值(收窄类),并修订了 ADR-0007 的第 4 级默认值说明。
  • 要你做什么:需要 os-zhuang 批准(改了 ADR,属治理路径)。

席位核对 — ACCEPT · repo:objectstack#6 · head 35da5d7b3efcf5a01262b9b854833e6c2796acb4

  • Shape: draft → main, Fixes #38098, title carries !.
  • Premise: all three auth keys re-measured on base by the dev (report 7234889808): each resolved the manifest default with nothing stored while the running config followed the deployment's declaration.
  • Change: service-settings registerDeclaredDefault with one private reader defaultOf at the three base readers of the manifest default (cascade, validatePatch clear, OS_* coercion); provider asked per use, throw or promise → manifest default with one warn. plugin-auth registers the three declarations with formulas identical to getPublicConfig() (resolveDisableSignUp extracted). source stays 'default' (read everywhere as "nothing stored"). fix(plugin-auth): Setup > Authentication says when email and password sign-in runs other than its switch shows #38094's banner reduced to the managed stored-on hold and generic disagreement. ADR-0007 rung 4 amended with status line; spec / platform-objects comments and the generated reference page follow it.
  • Declarations: plugin-auth Clause-②: yes (narrowing) (values change for existing readers; managed save of true with nothing stored now refused 400; hidden-key accept set named), service-settings yes (widening), Metadata-protocol: none, both patch.
  • Contract review: PASS 7235028565 (S1, S2 open) → delta PASS 7235931632 at this head, both closed; N2–N4 accepted in the body's Acceptance notes.
  • Seat rulings: option B (claim 7233770569); ADR amendment kept in this PR (claim note 7234902939).
  • Tests: service-settings 79 files / 1545; plugin-auth 296 files / 6310 (+10 skipped); new pins with CONTROLs; reverse check on base failed the declared-value cases. Dogfood battery at this head exit 0.
  • Gates: check-runs at head 62 success, 12 skipped, 0 failed (the second Check Changeset run after the body edit is green); mergeable clean.
  • Follow-ups: Settings: other auth keys still show the manifest default, not the deployment declaration, when nothing is stored #38184 (other auth keys with declarations; stored-on signup under forced-off shows no statement).
  • Landing: --handoff (narrowing, Tier H via docs/adr/0007-*).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Review requested: this narrowing PR (Clause-②: yes (narrowing), Tier H via docs/adr/0007-*) lands by an authorized APPROVED review or an enqueue by an approver.

Records at head 35da5d7b3efcf5a01262b9b854833e6c2796acb4:

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 28, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 28, 2026 08:12
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit f8dcd3e Nov 28, 2026
80 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-38098-runtime-declared-defaults branch November 28, 2026 08:56
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Merged; clearing pm:awaiting-merge.

@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings: auth switches show the manifest default, not the deployment declaration that runs, when nothing is stored

3 participants