Skip to content

docs(spec): ban-user and unban-user no longer described as needing the admin plugin - #34119

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-8kt12l
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-8kt12l

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #34008

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:三处 spec 描述(authFamilies.admin、features.admin、plugins.admin)和 actions 文档示例不再说「停用/恢复、解锁、重设密码需要 admin 插件」,按实测列出真正依赖插件的操作;引用文档随之重新生成。
  • 为什么改:停用/恢复、解锁、重设密码这四个接口是平台自带的,不装 admin 插件也能用;旧说法会让 AI 和开发者给这些按钮错误地加上 admin 门控。
  • 风险与回滚:只改文字,没有任何 schema 接受或拒绝的结果变化;回滚即还原本 PR。
  • 先看:packages/spec/src/api/discovery.zod.ts、content/docs/protocol/objectui/actions.mdx、packages/spec/src/api/auth-endpoints.zod.ts。
  • 两分钟验证:git grep -n "update-user, ban-user" -- packages/spec/src content/docs 应无结果。
  • 需要你做的:无,席位落地。

What changes

  • AuthFamiliesSchema.admin describe (packages/spec/src/api/discovery.zod.ts): the example family member ban-user is replaced by impersonate-user, and one sentence says ban-user and unban-user are not in the family: they are ObjectStack mounts, served whatever the flag says. Still one paragraph.
  • features.admin describe (packages/spec/src/api/auth-endpoints.zod.ts): creating and impersonating users are the operations that need the plugin; banning, unbanning, unlocking and setting a password answer without it, and the describe says the console still shows its unlock and set-password actions only when the flag is true.
  • plugins.admin describe and JSDoc (packages/spec/src/system/auth-config.zod.ts): the JSDoc lists the endpoints that need the plugin (create-user, which answers 501 without it, impersonate-user / stop-impersonating, set-role, remove-user, GET list-users, list-user-sessions, revoke-user-session(s)) apart from the four ObjectStack mounts served without it (ban-user, unban-user, unlock-user, set-user-password), described as mounts rather than the plugin's routes, with no claim about how they write. "better-auth enforces this internally" is replaced: the ObjectStack mounts, create-user, remove-user and the rebuilt impersonate-user run the ADR-0068 gate, the vendor routes keep better-auth's legacy user.role check, and stop-impersonating is neither: better-auth admits it on the impersonated session with the signed admin_session cookie impersonate-user set (read from better-auth/dist/plugins/admin/routes.mjs 1.7.12, which also declares list-users as GET). "assign global platform roles" is gone. The describe follows the same split.
  • content/docs/protocol/objectui/actions.mdx: the requiresFeature: admin worked example gates impersonate_user (/api/v1/auth/admin/impersonate-user) in place of ban_user. The second example (disable_oauth_application) is unchanged.
  • Regenerated: content/docs/references/api/{discovery,protocol,auth-endpoints}.mdx, content/docs/references/system/auth-config.mdx (check:generated --fix, which named only check:docs stale).
  • .changeset/34008-ban-without-admin-plugin-prose.md: patch on @objectstack/spec.

Why

The measurement, on origin/main at 27c2f1ea. A throwaway probe (the pending-sso-users.test.ts harness, one platform admin, deleted after the run, not committed) fired each door with plugins.admin off and on:

door off on
features.admin false true
/admin/unlock-user 200 200
/admin/set-user-password 200 200
/admin/ban-user 200 200
/admin/unban-user 200 200
/admin/set-role 404 200
/admin/create-user 501 NOT_IMPLEMENTED 200
/admin/impersonate-user 404 200

Source reading:

  • packages/plugins/plugin-auth/src/auth-plugin.ts: POST {basePath}/admin/ban-user and /admin/unban-user are raw Hono mounts with no admin-plugin condition. Without the plugin, getBanWriter writes through the data engine (isAdminPluginMounted() false) and the session refusal enforces the ban. pending-sso-users.test.ts pins this ("a row banned while the admin plugin was on stays refused after the plugin is turned off", the ban / unban cases with the plugin off, and a CONTROL with it on).
  • sys_user.ban_user / unban_user carry no requiresFeature, and PUBLIC_AUTH_FEATURES.admin.gatedInputs (packages/spec/src/kernel/public-auth-features.ts) books neither, with a note saying why.
  • Routes that still answer 404 when features.admin is false: the better-auth vendor routes with no ObjectStack mount: list-users, set-role, update-user, list-user-sessions, revoke-user-session(s), stop-impersonating, and impersonate-user (replaced on the admin plugin's own endpoints record by admin-impersonate-endpoint.ts, so it exists only with the plugin). The dogfood pin discovery-auth-families.dogfood.test.ts reads GET /auth/admin/list-users as 404 with the plugin off and not 404 with it on. sys_user.impersonate_user declares requiresFeature: 'admin', which is why it is the docs example now.
  • ObjectStack mounts such as create-user stay mounted without the plugin but answer 501 NOT_IMPLEMENTED; the describe's family list does not name them, so this PR does not touch that wording.

Tests

  • pnpm --filter @objectstack/spec test at 6fe7a568: Test Files 843 passed (843), Tests 26966 passed | 1 todo. Lock VERDICT command-exit 0.
  • No test edit was forced. No test pins the old wording (git grep of the three old phrases outside packages/spec/src, references and CHANGELOGs finds only the two out-of-scope copies listed below).
  • No ablation: prose only.

Acceptance notes

  • Out of the card's paths, two copies of a related phrase, not changed here:
    • packages/plugins/plugin-auth/src/auth-manager-plugin-list.ts:312, a code comment "Platform admin: ban/unban, set-password, impersonate, set-role." beside the admin plugin's registration. With the plugin on, the vendor's ban hook still enforces, so it is loose rather than false. domain:server.
    • docs/qa/platform-checklist/areas/identity-auth.json item identity-auth.admin-lifecycle-operations title lists ban/unban among "admin user-lifecycle operations"; it makes no plugin claim. domain:devx.
  • content/docs/releases/v18/18-5.mdx and packages/spec/CHANGELOG.md keep their historical wording (release-owned).
  • content/docs/permissions/authentication.mdx already says ban / unban answer without plugins.admin; unchanged.
  • No skills/** file teaches the old rule (git grep -n "ban-user\|ban_user\|unban" -- skills is empty), so no skills follow-up.
  • The console's sys_user.unlock_user and sys_user.set_user_password declare requiresFeature: 'admin' (packages/platform-objects/src/identity/sys-user.object.ts) and PUBLIC_AUTH_FEATURES.admin.gatedInputs books both, while their doors answer 200 with the plugin off (probe above). On a deployment without the admin plugin the two buttons are hidden though the doors work: the same shape the ban / unban buttons had before PR fix(platform-objects): offer Ban / Unban without the better-auth admin plugin #33989. Not changed here (platform-objects + kernel feature table); for the seat to file. The features.admin describe states the current console behaviour as it is.
  • File surface: the claim names discovery.zod.ts and content/docs/**; the delta also asks for other packages/spec/** copies, which added auth-endpoints.zod.ts and auth-config.zod.ts.

Verification

Derived gates at 6fe7a56: 104 derived, 103 run green, 1 NOT MEASURED
  • node scripts/pm/dispatch-gates.mjs --ran on the final record: "104 derived famil(ies) accounted for — 103 run, 1 NOT-MEASURED".
  • NOT MEASURED: pnpm check:dual-build-cjs-loads exit 3, PREREQUISITE NOT MET (reads every package's dist/; this container built only the spec, lint and client-react closures). CI runs it.
  • Every derived gate ran once at 6fe7a568, with NODE_OPTIONS=--max-old-space-size=4096 exported for the whole run, and all 103 exited 0 on that first run. Earlier heads needed reruns: at 97b9f14c, spec check:generated ran its check:test-typecheck tsc out of heap without that flag; at 36887238, check-plugin-teardown-shape.mjs --self-test needed its pinned fixture commit fetched into the shallow clone.
  • Record: project share spec-seat2/34008-gates-ran-r3.txt.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmNsjxB7oSL12vpVvW6

…e admin plugin

The ban and unban doors are ObjectStack mounts served with the better-auth
admin plugin off as well as on. AuthFamiliesSchema.admin, the features.admin
flag and the plugins.admin config described them as part of the admin
plugin's surface. The actions guide's requiresFeature example now gates
impersonate_user, which still 404s without the plugin.

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

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

3 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 173 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 fa1fb6f4e0b162f768c340ea781ccba65c61c1f7 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 9d8e381b1c634aa3f815714bee7705033e2413da — the merge of head 5ec1a172638303071ad68d399d21e0f3b2c9ed07 into base fa1fb6f4e0b162f768c340ea781ccba65c61c1f7, 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 9d8e381b1c634aa3f815714bee7705033e2413da && git checkout 9d8e381b1c634aa3f815714bee7705033e2413da
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin fa1fb6f4e0b162f768c340ea781ccba65c61c1f7 5ec1a172638303071ad68d399d21e0f3b2c9ed07 && git checkout -B drift-repro fa1fb6f4e0b162f768c340ea781ccba65c61c1f7 && git merge --no-ff 5ec1a172638303071ad68d399d21e0f3b2c9ed07

node scripts/docs-audit/affected-docs.mjs --json fa1fb6f4e0b162f768c340ea781ccba65c61c1f7

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 3688723 · 2026-11-15T19:50Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 36887238745b5f9f82fed30f0cd27c29b8c07c79
Local-runs: none
Scope: packages/spec/src/api/discovery.zod.ts, packages/spec/src/api/auth-endpoints.zod.ts, packages/spec/src/system/auth-config.zod.ts + none

PR #34119 for card #34008. Read: the card body and its four comments (os-dev-report 6900296801 included), the PR body and file list (9 files, +37 / -19), the net diff from merge-base 27c2f1ea to the head, and the head's check-runs. No file in the diff implements or enforces the three hits; the code they describe (plugin-auth route mounting, the admin plugin wiring, the features.admin and authFamilies producers) is outside the diff and was read on origin/main, not reviewed. The changeset was read for ② only; it and the five content/docs/** files are the lane seat's ACCEPT at TIER_DEFAULT.

Gate verdicts on this head (45 check-runs): 14 completed success (Check Changeset, Spec property liveness, Flag docs affected by code changes, Check Documentation Links, Check PR Size, PR-body guards, Governed Surface Queue Guard, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Dogfood Regression Gate, the two shard planners, Auto Label, filter), 9 skipped (opt-in, schedule or queue-only jobs), none failed. IN PROGRESS at the time of this record, 22 runs: Test Core 1/8 to 8/8, Build Core, Build Docs, Build UI Deps, Live E2E UI, Type Check (workspace, consumer gates, source gates, debt ledger), Lint (ESLint; CI, release and engine gates; docs and code guards; repo and tooling gates; scoped query-options erasure; scoped slot lookup and corpus). This verdict does not stand in for any of them: it judges the contract, and the merge still waits on those runs.

① Derived judgments

  • Accept sets: none moves. Right. All three hits hunks change only a .describe() string literal or a JSDoc block. AuthFamiliesSchema.admin stays z.boolean(), AuthFeaturesConfigSchema.admin stays z.boolean().optional(), AuthPluginConfigSchema.admin stays z.boolean().optional(). No key, type, default, optionality or refinement is touched.
  • Public surface: the published change is description text only, which reaches the generated JSON-schema descriptions and four regenerated reference pages. Right, and the diff carries those four pages.
  • The docs example swap (ban_user to impersonate_user under requiresFeature: admin) is right against the tree: sys_user.impersonate_user declares requiresFeature: 'admin' on main, ban_user / unban_user declare none, and PUBLIC_AUTH_FEATURES.admin.gatedInputs books create_user, unlock_user, set_user_password, impersonate_user and not the ban pair.
  • The dev's judgment that no test or skills follow-up is owed is right: prose only, and the report's skills/ grep is empty.

② Semver level

  • patch on @objectstack/spec matches what the diff publishes: description text, no accept or refuse outcome changed. The changeset says so in its last sentence.
  • Clause-②: no is right on the PR body, the changeset and the claim: no consumer has to change anything.
  • Metadata-protocol: none is right: no protocol shape, key or version moves; authFamilies keeps its shape.
  • The changeset's three bullets match the three hunks. Its second bullet ("banning and unbanning no longer appear among the operations that need the plugin") is accurate to the describe.

③ Boundary flags

  • Deviation, file surface: the claim names discovery.zod.ts (AuthFamiliesSchema.admin describe only) and content/docs/**; the diff also edits auth-endpoints.zod.ts and auth-config.zod.ts. Answered, accepted. Both carry the same stale sentence the card is about, both edits are describe/JSDoc only, both are published-schema files and so are reviewed here at tier, and the changeset names them. Leaving them would have left features.admin and plugins.admin contradicting the corrected discovery text. The claim's File surface line was not amended to name them; the seat should note that on the card, it is not a contract defect.
  • Deviation, no skills follow-up: answered, accepted (empty grep, see ①).
  • Out of scope, packages/plugins/plugin-auth/src/auth-manager-plugin-list.ts:312 comment "Platform admin: ban/unban, set-password, impersonate, set-role.": answered. Read on main; it is an internal code comment beside the plugin registration, loose and not published. Not owed by this PR. It belongs with the follow-up in S1.
  • Out of scope, docs/qa/platform-checklist/areas/identity-auth.json item title: answered. It makes no plugin claim; nothing owed.
  • Gates: the report's one NOT MEASURED gate (check:dual-build-cjs-loads) and its two first-run reds are left to CI; the matching CI runs are among those in progress above.
  • Nothing escalated to the maintainer.

④ Design judgment

Route by route on origin/main, with features.admin false (better-auth admin plugin not mounted):

  • Plain 404 (vendor routes that exist only on the plugin): list-users, set-role, update-user, get-user, list-user-sessions, revoke-user-session, revoke-user-sessions, stop-impersonating, and impersonate-user. impersonate-user is not a raw mount: admin-impersonate-endpoint.ts replaces it on the admin plugin's own endpoints record inside if (enabled.admin) (auth-manager-plugin-list.ts), so it exists only with the plugin and is admin-gated.
  • Always mounted and working (raw mounts in auth-plugin.ts, platform-admin gated): ban-user, unban-user (engine ban writer when isAdminPluginMounted() is false), unlock-user, set-user-manager, set-user-password, add-sso-user, import-sso-users.
  • Always mounted, refusing without the plugin: create-user and import-users answer 501 NOT_IMPLEMENTED; remove-user and has-permission run their own gate and then hand to the vendor.

packages/spec/src/api/discovery.zod.ts: holds. Every example member of the family (list-users, set-role, update-user, impersonate-user) is a vendor route that 404s with the flag false. "ban-user and unban-user are not in the family: they are ObjectStack mounts, served whatever this says" is true. "Same value as features.admin ... read from the same source" is unchanged and still true (readAuthFamilies reads the auth service's public config). No route misclassified.

packages/spec/src/api/auth-endpoints.zod.ts: holds as a statement about the console. "The console shows those actions only when it is true" matches the four booked gatedInputs exactly, and "Banning and unbanning do not need it and are offered either way" matches the ungated ban pair. See S1 for what the sentence implies about unlock-user and set-user-password at the server.

packages/spec/src/system/auth-config.zod.ts: the ban sentences are true. The rest is where the text can be broken; see S1 and N1.

features.admin, plugins.admin and authFamilies.admin now agree with each other on ban and unban, and with content/docs/permissions/authentication.mdx on main.

S1 (should-fix) — set-user-password is still classified as an admin-plugin operation, and the new wording sharpens that. auth-config.zod.ts now reads "Enable platform admin operations (set-password, impersonate, set-role; ban/unban are served without it)", its JSDoc keeps "Enable better-auth's admin plugin so platform admins can set a user's password" and keeps POST /admin/set-user-password first in "Endpoints exposed under the auth route". On main that route is a raw mount registered unconditionally (auth-plugin.ts, the same block as ban-user), and its handler (runAdminSetUserPassword in admin-user-endpoints.ts) reads no admin-plugin API: it uses the core internalAdapter, the password hasher and the data engine, with no NOT_IMPLEMENTED arm of the kind create-user has. So, as read, it is served with the plugin off, like ban-user. Naming ban/unban as the routes served without the plugin, beside a list that still holds set-password, tells a reader the opposite. The same applies, more weakly, to "unlocking" and "setting their passwords" in the features.admin describe (unlock-user is also an unconditional mount with no plugin dependency), though that sentence is true of what the console shows. This is not a must-fix: the claim predates this PR, the card's scope is ban and unban, every sentence the PR adds is true, and the console does gate Set Password on the flag, so "enable ... operations" is true at the product level. Not driven live here (read-only), so the fix should start with a measurement: set-user-password and unlock-user with plugins.admin off. Either reword in this PR (say the plugin turns the console's Create / Unlock / Set Password / Impersonate actions on, and that the vendor routes are the ones that 404), or file a card carrying that measurement; the auth-manager-plugin-list.ts:312 comment, the sys-user.object.ts block header ("buttons that 404") and the "requires plugins.admin" heading in authentication.mdx go with it.

N1 (nit) — auth-config.zod.ts JSDoc, untouched lines: "Only callers whose user has a platform admin role (default: admin) can hit these endpoints; better-auth enforces this internally" is not true of impersonate-user, create-user or remove-user, which ObjectStack authorizes on the ADR-0068 platform-admin gate; and "assign global platform roles" names set-role, which on main still authorizes on the legacy role scalar and refuses ADR-0068 platform admins. Pre-existing, outside the card; fold into the S1 follow-up.

N2 (nit) — the discovery describe says the family's routes answer 404 and names ban/unban as the exception. Other ObjectStack /admin/* mounts (unlock-user, set-user-password, create-user with its 501) are also not in the family. The text does not claim otherwise, and the "…" covers the vendor list; no change needed.

Security: no hits path is under skills/**. No sentence this diff adds promises that an auth route is mounted, gated or refused differently from the live tree: the added sentences say ban-user and unban-user are served with the plugin off, which is what main does, and that impersonate-user belongs to the 404 family, which is what main does. Nothing in the diff changes who may call any route; every route named stays platform-admin gated. The one place the published text still under-states what is served (set-user-password, S1) errs toward telling a reader a route is absent when it is present and gated, so it opens nothing.

No must-fix.

Implemented-by: claude/project-thread-8kt12l
Reviewed-by: fable subagent of session_01ADHkmQjrEpxMVxEiDUJHqC

VERDICT: PASS

…admin plugin either

Measured with plugins.admin off: unlock-user and set-user-password answer
200 like ban-user and unban-user; create-user answers 501, set-role and
impersonate-user 404. The plugins.admin describe and JSDoc and the
features.admin describe now list what needs the plugin from those
readings. The JSDoc no longer says better-auth enforces the admin check on
every route: ObjectStack mounts, create-user, remove-user and the rebuilt
impersonate-user run the ADR-0068 gate; only vendor routes keep the
legacy-role check.

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

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 97b9f14 · 2026-11-15T20:33Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 97b9f14c9d8392439a2202160308a128521d0063
Local-runs: none
Scope: packages/spec/src/api/discovery.zod.ts, packages/spec/src/api/auth-endpoints.zod.ts, packages/spec/src/system/auth-config.zod.ts + none

Round 2, a delta review. It continues the round-1 record on head 36887238 (PR comment 6900367724) and replaces it for this head. PR #34119, card #34008.

Read: the delta 36887238..97b9f14c, the net diff against main, the rewritten PR body, the card's new comment (claim 6900380818), and the head's check-runs. The delta is ONE commit by the dev, parent 36887238; the head carries no merge of main and the merge-base is still 27c2f1ea. It touches 5 files (+27 / -21): two hits (auth-endpoints.zod.ts, auth-config.zod.ts), their two regenerated reference pages and the changeset. discovery.zod.ts is unchanged since round 1. The dev's probe table in the PR body is not in the tree and was not used: every sentence below was checked by reading origin/main.

Gate verdicts on this head (72 check-runs): 57 success, 12 skipped, 1 in progress (a second Check Changeset run; the first succeeded), and 2 FAILED: Test Core (7/8) and its roll-up Test Core. The failing test is @objectstack/scenarios test/runner/run-date.test.ts, "run on 2028-03-31", Error: Test timed out in 5000ms (it ran 5727 ms); 33 of that package's 34 files passed. The delta touches nothing under packages/qa, and a describe string cannot move that test, so by reading this is a timing failure and not this diff. That is a reading, not a gate verdict: the gate is red on this head, this record does not stand in for it, and the PR does not land until that job is rerun green.

① Derived judgments

  • Accept sets: none moves. Right. The delta changes two .describe() string literals and one JSDoc block. AuthFeaturesConfigSchema.admin and AuthPluginConfigSchema.admin are still z.boolean().optional().
  • Public surface: description text only, with the two matching reference pages regenerated. Right.

② Semver level

  • patch on @objectstack/spec still matches. Clause-②: no and Metadata-protocol: none are still right on the PR body and the changeset.
  • The changeset was rewritten with the delta and matches it: the title and lead now name ban, unban, unlock and set-password, and the features.admin and plugins.admin bullets say what the two describes now say. Its last sentence ("Nothing a schema accepts or refuses changes") holds.

③ Boundary flags

  • File surface: answered. The claim was re-issued (card comment 6900380818) and now names all three schema files, describe/JSDoc only. The round-1 note is closed.
  • Scope beyond the card: the card names ban and unban; the delta also corrects unlock and set-password. Answered, accepted: it is the fix S1 asked for, in the same sentences, and the changeset names it.
  • The two out-of-scope notes stand as answered in round 1. auth-manager-plugin-list.ts:312 and the sys-user.object.ts block header ("buttons that 404") and the "requires plugins.admin" heading in authentication.mdx still carry the old view of unlock and set-password; they are outside this diff and owed to a follow-up card, not to this PR.
  • The dev's fix report is in the card thread, not on GitHub, and was not an input here.
  • Nothing escalated to the maintainer.

④ Design judgment

packages/spec/src/api/discovery.zod.ts: unchanged; the round-1 judgment holds.

packages/spec/src/api/auth-endpoints.zod.ts: holds. "Creating and impersonating users is available" with the plugin: create-user answers 501 NOT_IMPLEMENTED when authApi.createUser is absent, and impersonate-user exists only on the admin plugin's own endpoints record. "Banning, unbanning, unlocking and setting a password answer without it": all four are raw mounts in auth-plugin.ts registered with no plugin condition; unlock-user calls AuthManager.unlockUser (data engine), set-user-password uses the core internalAdapter and password hasher, and neither reads an admin-plugin API. "The console still shows its unlock and set-password actions only when it is true" matches PUBLIC_AUTH_FEATURES.admin.gatedInputs (create_user, unlock_user, set_user_password, impersonate_user) and the four requiresFeature: 'admin' declarations on sys_user.

packages/spec/src/system/auth-config.zod.ts: the split is right route by route. Needs the plugin: create-user (501 without), impersonate-user, stop-impersonating, set-role, list-users, list-user-sessions, revoke-user-session(s) (vendor routes, absent without the plugin), and remove-user (an ObjectStack mount that runs the gate and then hands to the vendor route). Served either way: ban-user, unban-user, unlock-user, set-user-password. The describe follows the same split. One new sentence does not hold; see S2.

The three descriptions now agree with each other and with the tree on which operations the plugin turns on.

S1 — CLOSED. set-user-password and unlock-user are no longer described as needing the plugin in either file, and the features.admin describe keeps the true console statement apart from the server one. Closed on the tree reading above, not on the probe numbers.

N1 — CLOSED in part. "Assign global platform roles" is gone and "better-auth enforces this internally" is replaced by a sentence that names which doors run the ADR-0068 gate and which keep the vendor's role-scalar check. That replacement is right for every route it names, and wrong for one it covers without naming: S2.

S2 (should-fix) — new in this delta. The JSDoc now says "Every one of these doors is platform-admin gated", then sorts them into two groups: the ObjectStack mounts, create-user, remove-user and impersonate-user on the ADR-0068 gate, and "the vendor routes left as better-auth ships them (set-role, list-users, …)" on the legacy user.role check. POST /admin/stop-impersonating is in the endpoint list six lines above and fits neither group. On main it is a vendor route left as shipped, it is carried by the IMPERSONATED user's session, and it is authorized by the signed admin_session cookie alone, with no admin check of the caller (auth-manager-request-routing.ts at the #8243 block, impersonation-bearer-rotation.ts, and admin-impersonate-endpoint.ts, which classifies it as "the EXIT from an impersonation ... carried by the impersonated session"). So the sentence promises a gate the route does not run. Not a must-fix: the route is not open (the cookie is minted only by the gated impersonate door), nothing a consumer builds changes, and it is JSDoc, not the published describe. Fix by excepting it in that sentence, for example: stop-impersonating is the exit from an impersonation, carried by the impersonated session and authorized by its admin_session cookie.

N2 (nit) — unchanged from round 1; no change needed.

N3 (nit) — auth-config.zod.ts JSDoc lists POST /admin/list-users; on main the route is GET (vendor-admin-refusal-envelope.ts, and the dogfood pin reads GET /auth/admin/list-users). An untouched line; fix it with S2.

N4 (nit) — the tree pins ban and unban with the plugin off (pending-sso-users.test.ts). Nothing committed pins unlock-user or set-user-password with it off; the dev's probe was thrown away. The prose is right today by reading, with no test to turn red if it stops being right. Worth a line on the follow-up card.

N5 (nit) — "ObjectStack mounts that write through the platform" is loose: with the plugin on, ban-user writes through better-auth's internalAdapter, and set-user-password does in both states. "Served with the plugin off as well as on" is the true part and is enough.

Security: no hits path is under skills/**. The delta's sentences about which routes are mounted and which are served without the plugin match the live tree. One sentence promises gating the tree does not have: S2, stop-impersonating described as platform-admin gated. It over-states a check on an exit route that is still held by a signed credential, so it opens nothing. No other sentence says a route is mounted, gated or refused differently from main.

No must-fix.

Implemented-by: claude/project-thread-8kt12l
Reviewed-by: fable subagent of session_01ADHkmQjrEpxMVxEiDUJHqC

VERDICT: PASS

…ion and GET list-users

stop-impersonating is neither ADR-0068 gated nor role-checked: better-auth
admits it on the impersonated session with the signed admin_session cookie.
list-users is a GET route. The four ObjectStack mounts are described as
mounts rather than the plugin's routes, without claiming how they write.

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

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 6fe7a56 · 2026-11-15T21:08Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6fe7a568ec6ccf34c15bfbbada8d2b6496993a3e
Local-runs: probe — downloaded the public better-auth@1.7.12 npm tarball into the reviewer's scratch space and read dist/plugins/admin/routes.mjs from it, because the repo's node_modules is not installed and the S2 sentence had to be checked against the vendor version the lockfile resolves. Nothing was built, run or re-run.
Scope: packages/spec/src/api/discovery.zod.ts, packages/spec/src/api/auth-endpoints.zod.ts, packages/spec/src/system/auth-config.zod.ts + none

Round 3, a delta review. It continues the round-2 record on head 97b9f14c (PR comment 6900983847) and replaces it for this head. PR #34119, card #34008.

Read: the delta 97b9f14c..6fe7a568, the PR body (r3), the card (no new comment since 6900380818), and the head's check-runs. The delta is ONE commit by the dev, parent 97b9f14c; no merge of main, merge-base still 27c2f1ea. It touches exactly two files (+13 / -10): the plugins.admin JSDoc in packages/spec/src/system/auth-config.zod.ts and one sentence of the changeset. The dev's claim that nothing else changed is true. No .describe() string moved, so no reference page needed regenerating and none changed.

Gate verdicts on this head (71 check-runs): 57 success, 12 skipped, none failed, 2 IN PROGRESS: Test Core (8/8) and a second Check Changeset run (the first succeeded). Test Core (7/8), red on the round-2 head with a timeout in @objectstack/scenarios run-date.test.ts, is success on this head, so its log was not read against #34081. The Test Core roll-up has not reported yet. This verdict does not stand in for the runs still in progress.

① Derived judgments

  • Accept sets: none moves. Right. The delta is JSDoc comment text only; AuthPluginConfigSchema.admin is still z.boolean().optional() and its describe string is byte-identical to round 2.
  • Public surface: nothing published through the schema changes in this round; the JSDoc reaches the package's type declarations only. Right.

② Semver level

  • patch on @objectstack/spec, Clause-②: no and Metadata-protocol: none all still match.
  • The one changed changeset sentence now ends "the vendor routes keep better-auth's legacy-role check, and stop-impersonating is admitted on the impersonated session with its signed admin_session cookie". It matches the JSDoc and the vendor code.

③ Boundary flags

  • No new dev flag or deviation in this round. The file surface is inside the re-issued claim (card comment 6900380818).
  • Still owed to a follow-up card, outside this diff, unchanged from round 2: the stale view of unlock and set-password in auth-manager-plugin-list.ts:312, the sys-user.object.ts block header and the "requires plugins.admin" heading in authentication.mdx, plus N4 below.
  • Nothing escalated to the maintainer.

④ Design judgment

packages/spec/src/api/discovery.zod.ts and packages/spec/src/api/auth-endpoints.zod.ts: unchanged in this round; the round-1 and round-2 judgments hold.

packages/spec/src/system/auth-config.zod.ts: holds. Checked against better-auth@1.7.12, the one version pnpm-lock.yaml resolves at this head (and pins through its override), and against origin/main:

  • stop-impersonating: the vendor endpoint carries no adminMiddleware and no role check. It reads the caller's session, refuses unless session.impersonatedBy is set, reads the signed admin_session cookie, and requires that cookie's session to belong to the impersonating user. "better-auth admits it on the impersonated session together with the signed admin_session cookie that impersonate-user set" is exactly that. "Neither" is right: it is not an ObjectStack mount and does not check user.role. On main ObjectStack leaves the route as shipped and only carries the same credential in for bearer clients (auth-manager-request-routing.ts), which the sentence does not contradict.
  • GET /admin/list-users: the vendor declares method: "GET". Every other method in the list is right too: list-user-sessions, set-role, remove-user, impersonate-user, stop-impersonating, revoke-user-session(s) and create-user are all POST.
  • "As ObjectStack mounts rather than the plugin's own routes": true of all four. The vendor does declare ban-user, unban-user and set-user-password, and the raw mounts on main shadow them; unlock-user has no vendor route at all.
  • The gate sentence is otherwise as judged in round 2 and is right for every route it names.

S2 — CLOSED. "Every one of these doors is platform-admin gated" is gone, and stop-impersonating is named apart with its real admission.

N3 — CLOSED. list-users is GET.

N5 — CLOSED. The loose "write through the platform" is replaced by a true statement.

N2 (nit) — unchanged; no change needed.

N4 (nit) — unchanged and still open: nothing committed pins unlock-user or set-user-password with the plugin off. For the follow-up card, not this PR.

Nothing new to grade in this round.

Security: no hits path is under skills/**. After this round no sentence in the three files says an auth route is mounted, gated or refused differently from what origin/main and better-auth@1.7.12 do. The one over-statement found in round 2 is corrected.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-8kt12l
Reviewed-by: fable subagent of session_01ADHkmQjrEpxMVxEiDUJHqC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (maintainer-limited fable quota, 2026-11-15T23:20Z) · head 5ec1a17

Merge-of-main review: origin/main ea6de74 merged into the reviewed head 6fe7a56 (r3 PASS 6901417063) under the K ≥ 15 landing rule. Per the card thread: no conflicts, the regen produced 0 changes, and the PR diff (merge-base..6fe7a56 vs origin/main..5ec1a17) is byte-identical (sha256 a1d905662859be8a; 9 files, +52/−25).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 5ec1a17 · 2026-11-15T23:23Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 5ec1a172638303071ad68d399d21e0f3b2c9ed07
Local-runs: none
Scope: packages/spec/src/api/auth-endpoints.zod.ts, packages/spec/src/api/discovery.zod.ts, packages/spec/src/system/auth-config.zod.ts + none in the diff (the other six paths are the changeset, one hand-written docs page and four generated reference pages); cited code read, not reviewed: packages/plugins/plugin-auth/src/auth-plugin.ts, packages/plugins/plugin-auth/src/admin-impersonate-endpoint.ts, packages/platform-objects/src/identity/sys-user.object.ts, packages/spec/src/kernel/public-auth-features.ts

Read at 2026-11-15T23:51Z. Merge delta review of this head against PASS 6901417063 at 6fe7a56; claim: comment 6903112431; lane request 6903091199 on mailbox #33873. Independence: implemented in an os-steve project thread, dispatched by domain:spec#2 (os-steve); reviewed by os-tesla.

PR #34119, card #34008. This record is complete for this head and replaces 6901417063 for it. Read: the PR body, the card and its thread, the three earlier records, git diff between the refs named below, the cited code at this head, and this head's check-runs. Nothing was built or run.

What the head is. 5ec1a172 is a merge commit with parents 6fe7a568 (the head of PASS 6901417063) and ea6de745 (main). Its merge base with main is ea6de745.

Net-change equivalence, verified per path. git diff 27c2f1ea 6fe7a568 and git diff ea6de745 5ec1a172 both report 9 files, +52 / -25, and for each of the nine paths the two diffs carry the same hunks line for line (compared with the index and hunk-position lines left out). The lane's claim that the PR's diff did not move is true.

What main brought in (27c2f1ea..ea6de745, 180 files). None of the PR's nine paths. Nothing under packages/spec/src; in packages/spec only CHANGELOG.md. Nothing under content/docs/references, content/docs/protocol, content/docs/permissions or packages/platform-objects/src/identity. No change to the better-auth version the lockfile resolves. In packages/plugins/plugin-auth main changed how several doors word and log an unclassified internal failure, and added tests for that; no admin route was added, removed or moved between "served without the admin plugin" and "needs it", and no requiresFeature line changed anywhere in the delta. Main also added QA checklist items that state ban and unban the way this PR does. Nothing main brought in makes a sentence of this PR false.

① Derived judgments

  • Accept sets: none moves. The three schema files change .describe() strings and one JSDoc block; AuthFamiliesSchema.admin is still z.boolean(), features.admin and plugins.admin still z.boolean().optional().
  • Public surface: three description strings, republished in four generated reference pages. The reference diff at this head carries only the three new strings, on auth-endpoints.mdx, auth-config.mdx, discovery.mdx and protocol.mdx; main changed no reference page, so the lane's "regen produced 0 changes" is consistent with the tree.
  • Clause-②: no and Metadata-protocol: none are right: nothing a schema accepts or refuses changes, and no metadata key changes meaning.

② Semver level

  • patch on @objectstack/spec is right for description-only text. The changeset is present at this head and unchanged by the merge; main consumed and added other changesets, not this one.
  • The changeset's three bullets match the three describes as they stand at this head.
  • CI on this head, 45 check-runs at the time of reading: 16 success, 9 skipped, 0 failed, 20 IN PROGRESS. In progress: Test Core (1/8) to (8/8), Build Core, Build Docs, Build UI Deps, Live E2E UI, Lint · ESLint, Lint · CI, release & engine gates, Lint · repo & tooling gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus, Type Check · workspace, Type Check · consumer gates, Type Check · debt ledger. ⛔ This PASS is a verdict on the contract and the merge delta only. It does not stand in for the 20 runs still in progress: the seat waits for them to finish green before landing.
  • CI completed before posting: 68 check-runs, 58 success, 10 skipped, 0 failed, none in progress.
  • The PR body's test and gate numbers were taken at 6fe7a568; nothing was re-run for the merge head except by CI, above.

③ Boundary flags

  • File surface: inside the widened claim (card comment 6900380818). The merge added no path to the PR's diff.
  • Out of this diff and still owed to a follow-up card, unchanged from the earlier rounds: the code comment in auth-manager-plugin-list.ts beside the admin plugin's registration, the block header in sys-user.object.ts, the "requires plugins.admin" heading in content/docs/permissions/authentication.mdx, and the console gap the PR body names (the unlock and set-password actions are hidden when the flag is false although their routes are served). Main did not touch any of them.
  • Nothing escalated to the maintainer.

④ Design judgment

Independent reading at this head, since the three earlier records came from the implementing lane's own reviewer. The card asks for two texts to stop saying ban and unban need the admin plugin, with a changeset for the spec describe. The PR does that and, under the widened claim, corrects the same statement in two more spec descriptions.

packages/spec/src/api/discovery.zod.ts: holds. The route families the describe names as absent when the flag is false are the ones the tree treats as the vendor's admin routes, and impersonate-user belongs to that group. Ban and unban are registered by ObjectStack with no admin-plugin condition, as the describe says.

packages/spec/src/api/auth-endpoints.zod.ts: holds. The server half and the console half are kept apart and both are true at this head: sys_user.create_user, impersonate_user, unlock_user and set_user_password declare requiresFeature: 'admin'; ban_user and unban_user do not; PUBLIC_AUTH_FEATURES.admin.gatedInputs books the same four and not the ban pair.

packages/spec/src/system/auth-config.zod.ts: holds. The split between the endpoints that need the plugin and the four served without it matches the registrations in auth-plugin.ts at this head, including the 501 NOT_IMPLEMENTED answer the JSDoc gives for create-user. The sentence about which routes run the ADR-0068 platform-admin gate matches the code for every route it names that ObjectStack mounts. The statements about better-auth's own routes were checked by the earlier record against the vendor package; the vendor version is unchanged by the merge, so that check carries.

content/docs/protocol/objectui/actions.mdx (prose face, read for agreement): the example now mirrors a real action. sys_user.impersonate_user has the same type, target and requiresFeature at this head.

Earlier findings, by id: S1 closed in round 2; S2, N3 and N5 closed in round 3; N1 closed across rounds 2 and 3. Re-read at this head, the closing text is still in place, byte for byte.

N2 (nit) — carried, no change needed. The discovery describe names ban and unban as outside the 404 family; other ObjectStack mounts under admin/* are outside it too. The describe does not say they are in it, so it is incomplete, not false.

N4 (nit) — carried, for the follow-up card. Committed tests pin ban and unban with the plugin off; nothing committed pins unlock-user or set-user-password with it off, so that half of the prose has no test to turn red.

Security: no path of the diff is under skills/**, and the diff changes no code. At this head no sentence in the three schema files or the docs example says an auth route is served, gated or refused differently from what the tree does. The record keeps to that rule layer.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-8kt12l
Reviewed-by: session_01L9qibxTeW8xHnxoHxWNHWW

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC

ACCEPT · PR #34119 (#34008) · head 5ec1a172638303071ad68d399d21e0f3b2c9ed07 · 2026-11-15T23:53Z

席位核对

  • 形态: 9 files (+52 / −25):

    • three .describe() / JSDoc strings in auth-endpoints.zod.ts, discovery.zod.ts and auth-config.zod.ts, saying that ban / unban need the admin plugin;
    • the four generated reference pages that republish those strings;
    • one hand-written docs page;
    • a changeset (@objectstack/spec patch).

    The head is a merge of origin/main ea6de745 into the reviewed 6fe7a568, made under the K ≥ 15 landing rule. check-governed-merges.mjs --pr 34119: NOT governed (0 of 9 paths), ≤ 3000 lines.

  • 前提实测: the card thread merged with os-regen-merge.sh. There were no conflicts and the regen produced 0 changes. The per-path PR diff is identical to the reviewed head's (review#2 re-derived this per hunk).

  • 契约复审: CONTRACT_REVIEW_TIER:

    • r1 6900367724 and r2 6900983847 both PASS with should-fix items, closed by r3 6901417063 PASS (clean) @6fe7a568.
    • Merge-delta r4 PASS 6903471924 @ this head, by review#2 (handoff 6903085930, because the maintainer limited fable quota). No must-fix and no should-fix.
  • 门禁 check-runs: this head, 68 runs: 58 success, 10 skipped, 0 failed, 0 in progress.

  • 接受的偏差: none new.

  • 范围外去向:

  • 落地条款: ready + auto-merge now, under the maintainer's standing orders 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z) and 「你应该使用 pm-dispatch 技能审核和落地pr」 (2026-11-07T16:59Z). K = 10 first-parent commits on main past PRBASE fa1fb6f4 (this head's Test Core Affected-set diff base), < 15.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 23:53
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 41ff7c3 Nov 16, 2026
69 checks passed
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/s tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants