Skip to content

docs(adr): ADR-0135 D5.2 — a cloud-managed environment keeps no local break-glass password - #33248

Merged
os-zhuang merged 2 commits into
mainfrom
claude/area-A1-33203-adr
Nov 15, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/area-A1-33203-adr

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Refs #33203

Tier H (docs/adr/**). This record lands only by the maintainer's hand or an authorized approval. It pairs with the code PR for #33203; the seat lands the two together after the maintainer's word.

维护者速读

What changes

docs/adr/0135-identity-and-access-architecture.md: one note under D5.2. On a cloud-managed environment the break-glass bullet does not apply: admin/set-user-password refuses every target and set-initial-password refuses every signed-in caller, a platform administrator included. Self-hosted deployments keep D5.2 as written. Cloud ADR-0024's own text is not amended here.

Why

Ruling 10 of objectstack-ai/cloud#4465 (hosted has no local break-glass administrator; no local password for anyone), quoted on #33181 and #33183. The code PR for #33203 implements it. Prime Directive #13: reversing a recorded decision needs the record amended.

Verification

Docs only; nothing publishes, so no changeset (skip-changeset).

Clause-②: no
Metadata-protocol: none

Human Minimum

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4d1NJYFGVi2FRztyBNo

… break-glass password (#33203)

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

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head d70a7d4 · 2026-11-14T15:17:52Z

review#3 (area-lease pilot #33059, area A1); reviewed as a pair with #33268.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d70a7d41e7c93772343c60191d5ebdede3d9ab82
Local-runs: none
Scope: docs/adr/0135-identity-and-access-architecture.md + packages/plugins/plugin-auth/src/cloud-managed.ts, packages/plugins/plugin-auth/src/admin-user-endpoints.ts, packages/plugins/plugin-auth/src/auth-plugin.ts (as changed by #33268; read only)

① Derived judgments

② Semver level

Docs only, nothing publishes; skip-changeset and Clause-②: no are right for this file on its own. The behavioural narrowing is declared on #33268.

③ Boundary flags

④ Design judgment

First consumer: #33268 (the two doors and their sentences). Execution plan: one landing pair after the maintainer's word, stated in both bodies. The amendment is the right shape: a dated note that overrides one bullet for one deployment kind, not a rewrite of D5.2. It holds against the cited code except for the wording in S1. With S1 fixed this is PASS.

Implemented-by: claude/area-A1-33203-adr
Reviewed-by: session_016WV4d1PGptBW3QRQNmy5e6

VERDICT: FAIL

S1 (wording, tied to #33268) → delta review by review#3.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head b802251 · 2026-11-14T16:15:53Z

review#3 delta.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: b802251f35f34b15711f906fecdde8e99c9b9655
Local-runs: none
Scope: docs/adr/0135-identity-and-access-architecture.md + packages/plugins/plugin-auth/src/cloud-managed.ts, packages/plugins/plugin-auth/src/auth-manager-before-hook.ts, packages/plugins/plugin-auth/src/admin-user-endpoints.ts, packages/plugins/plugin-auth/src/auth-plugin.ts (as changed by #33268 @1ae420f9; read only)

Delta review of d70a7d41..b802251f, by the reviewer of record 6879604670.

① Derived judgments

  • S1 fixed. The note now says a hosted environment "sets no local password for anyone". It names all six doors (admin/set-user-password, set-initial-password, reset-password, phone-number/reset-password, and the two request-password-reset doors). It also says a password set before is not removed by this rule and that invalidating it is the cloud's (cloud#4471). Every clause matches the code at fix(auth)!: a cloud-managed environment sets no local password for anyone, a platform administrator included #33268's head 1ae420f.
  • Self-hosted D5.2, break-glass included, still holds as written. Cloud ADR-0024 is not amended here.

② Semver level

Docs only; nothing publishes. skip-changeset and Clause-②: no are right for this file. The narrowing is declared on #33268.

③ Boundary flags

④ Design judgment

First consumer: #33268. Execution plan: one landing pair after the maintainer's word. The note is now exactly as strong as the enforced code. Holds.

Implemented-by: claude/area-A1-33203-adr
Reviewed-by: session_016WV4d1PGptBW3QRQNmy5e6

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cztR1A2CZoxSZyuoGP

ACCEPT · area A1 · Tier H · 2026-11-15T08:40Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 08:41
@objectstack-fleet
objectstack-fleet Bot requested a review from hotlong as a code owner November 15, 2026 08:41
@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 15, 2026
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 12a0f09 Nov 15, 2026
50 checks passed
@os-zhuang
os-zhuang deleted the claude/area-A1-33203-adr branch November 15, 2026 10:05
os-elon-musk pushed a commit that referenced this pull request Nov 15, 2026
Brings in #33248 (ADR-0135 D5.2 text) so the base carries the ruling this
PR implements. No conflicts.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cytdN5jRpgKX58AY4d
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…yone, a platform administrator included (objectstack-ai#33268)

<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D58H4hn7mx9bRShF3BfEhTw)_

Fixes objectstack-ai#33203

Clause-②: yes (narrowing) — narrowed: on a cloud-managed environment
only (`OS_CLOUD_MANAGED=1`), `POST /admin/set-user-password` answers
`409 RESOURCE_CONFLICT` for an `env_native` target too, where it set the
password, and `POST /set-initial-password` answers `409
RESOURCE_CONFLICT` to a signed-in platform administrator too, where it
set their first local password; `POST /reset-password` and `POST
/phone-number/reset-password` answer `409 RESOURCE_CONFLICT` to every
request, where a valid token or code set (or created) the password, and
`POST /request-password-reset` and `POST
/phone-number/request-password-reset` answer `409` too, where they
answered success and sent a link or code. Two refusal sentences are
added (`resetPassword`, `requestPasswordReset`); the two existing ones
no longer promise a local or break-glass password. The managed
`set-user-password` arm no longer reads the target's identity source, so
its `503` for an unreadable source is gone there.
Metadata-protocol: none
Skills-docs: none — no skill under `skills/**` teaches the cloud-managed
password doors; `content/docs/permissions/authentication.mdx` gains the
rule in this change.

> **Lands with the ADR amendment objectstack-ai#33248** (Tier H, ADR-0135 D5.2's
break-glass clause), after the maintainer's word on both. Owes a review.

## 维护者速读

-
改了什么:托管环境(`OS_CLOUD_MANAGED=1`)上,「管理员给用户设密码」对本地账号(`env_native`)也拒绝;「给自己设首个密码」对平台管理员也拒绝;邮件和短信「重置密码」(以及发送重置链接/验证码)对所有人拒绝。拒绝文案不再提「应急(break-glass)密码」。自托管不变。
- 为什么改:cloud#4465 裁决 10:托管上任何人都没有本地密码,也没有本地应急管理员。云端已在 cloud#4477
拒绝了密码登录和它自己的同名入口,框架这边的入口和文案要对齐。
- 风险与回滚:只影响托管环境;回滚即还原本 PR。托管上已有的本地密码不在这里作废(那是云端的工作)。
-
先看:`packages/plugins/plugin-auth/src/cloud-managed.ts`(规则说明和文案),`admin-user-endpoints.ts`、`auth-plugin.ts`
和 `auth-manager-before-hook.ts` 里的 `isCloudManaged()` 分支。
- 两分钟验证:`pnpm --filter @objectstack/plugin-auth exec vitest run
src/cloud-managed.test.ts
src/password-reset-ends-sessions.test.ts`,预期全部通过。
- 需要你做的:和 ADR 修订 objectstack-ai#33248 一起批准落地。

## What changes

- `admin-user-endpoints.ts`: on a cloud-managed environment
`admin/set-user-password` refuses every target with the managed `409`,
before reading the target's identity source. Before, it refused only
`idp_provisioned` targets and still set an `env_native` one (the
break-glass administrator among them).
- `auth-plugin.ts`: on a cloud-managed environment
`set-initial-password` refuses every signed-in caller. Before, a caller
with platform-admin standing was admitted to give themselves a local
password. A caller with no session still falls through to the body and
is answered `401` as before.
- `auth-manager-before-hook.ts` (review S1): on a cloud-managed
environment the two self-service reset doors (`/reset-password`,
`/phone-number/reset-password`), each of which creates the credential
account when the user holds none, refuse every request with the managed
`409`, ahead of the vendor's handler and before any record is read (so
the answer says nothing about any account), and so do the two doors that
send the link or code (`/request-password-reset`,
`/phone-number/request-password-reset`), so nobody is sent a link the
reset door would refuse. Asked ahead of the per-number send guard and of
the SSO-only reset judge.
- `cloud-managed.ts`: the module rule now states that every door that
sets a local password is closed to everyone on a managed environment,
and the sentences say no local password is set here for anyone, an
administrator included (review S2: a password held before is kept,
cloud#4471). Nothing in them promises break-glass or names `env_native`.
`auth-manager.ts`: the `signUpForcedOff` jsdoc no longer says
break-glass is untouched on a managed environment (review N1).
- `content/docs/permissions/authentication.mdx`: one bullet stating the
managed rule.
- The card's third item, the environment home's "set a backup password"
banner, is already hidden on a cloud-managed environment on `main`
(`RecoveryPasswordReminder.tsx`, the `cloudManaged` arm, pinned by
`RecoveryPasswordReminder.cloudManaged-13330.test.tsx`), so nothing
changes there.

Unchanged: every self-hosted deployment, SSO-only mode's rules included;
a local password a user already holds on a managed environment.

## Why

Ruling 10 of objectstack-ai/cloud#4465 (hosted has no local break-glass
administrator; no local password for anyone), the text relayed on objectstack-ai#33181
and objectstack-ai#33183. ADR-0135 D5.2 kept a local credential reachable by
population; its amendment for managed environments is objectstack-ai#33248.

## Verification

At head `7e7c8042` (branch point `origin/main` `e540baf8`):

- `@objectstack/plugin-auth` full suite: `Test Files 269 passed (269)`,
`Tests 5118 passed | 10 skipped`. `typecheck` (after building the
package, which its examples program imports): exit 0,
`check:test-typecheck: OK`.
- `cloud-managed.test.ts`: the old "env_native still answers 200" and
"platform admin still admitted" cases are now refusals (409,
`RESOURCE_CONFLICT`, the door's sentence, no credential written or
moved), plus a platform admin setting their own password through
`set-user-password`, CONTROLs for both doors on an unmanaged deployment,
and a pin that neither sentence mentions break-glass or `env_native`.
- Ablations (each source file restored to `origin/main` with the tests
at HEAD, then restored to HEAD; `git diff HEAD` empty after):
`admin-user-endpoints.ts` → 2 failed (the env_native and the self-target
refusals); `auth-plugin.ts` → 1 failed (the platform-admin refusal).
- Derived gates (`node scripts/pm/dispatch-gates.mjs --commands`, 106
families, each run with `</dev/null`): read in the review request; CI
runs the full set.

At head `1ae420f9` (review S1/S2/N1 fold):

- `@objectstack/plugin-auth` full suite: `Test Files 269 passed (269)`,
`Tests 5124 passed | 10 skipped`; `typecheck` exit 0; eslint on the
changed files exit 0. Derived gates 106: 105 exit 0, 1 NOT MEASURED
locally (teardown-shape `--self-test`, needs an unshallow clone).
- `password-reset-ends-sessions.test.ts`, new describe `[objectstack-ai#33203] a
cloud-managed environment sets no local password at the reset doors`:
the emailed link refuses a user with no credential and creates none;
refuses a platform administrator holding a password, whose password does
not move and still signs in; a token that matches nothing gets the same
409 (nothing told); the link request sends no mail; the texted code is
refused with the password unmoved and the code request sends no text; no
reset sentence mentions break-glass. Unmanaged CONTROLs are the file's
existing reset cases.
- Ablation: the managed reset block disabled (`if (false && …)`), the 5
wire cases fail; restored, they pass.

## Acceptance notes

- On a managed environment, the Profile page's password card still
offers "set password" to a user with no local credential
(`ui/apps/console/src/pages/system/ProfilePage.tsx`); the server now
refuses it for everyone there, as it already did for non-administrators.
Hiding it is a `domain:ui` follow-up, not in this PR.
- `change-password` for a credential a user already holds on a managed
environment is untouched; invalidating hosted passwords is the cloud's
(objectstack-ai/cloud#4471).

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(Not touched.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (CI).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request (the ADR text is objectstack-ai#33248, split so this does not wait on a Tier H
approval it shares anyway).
- [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. (Not touched.)
- [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. (The 维护者速读 section is
the frame's Chinese summary.)
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_016WV4d1NJYFGVi2FRztyBNo

<!-- signed: domain:server#5 · os-elon-musk ·
session_016WV4d1NJYFGVi2FRztyBNo -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants