Skip to content

fix(plugin-auth)!: a self-serve social creation is admitted only with a provider-verified address under an address-based posture - #35200

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/sec1-xc39-admission-requires-verified-address
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/sec1-xc39-admission-requires-verified-address

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Clause-②: no (narrowing: a creation admitted today is refused; owes one CONTRACT_REVIEW_TIER review before the queue)
Metadata-protocol: none
Skills-docs: none — no skill under skills/** teaches the audience posture or a social-provider sign-in; content/docs/permissions/authentication.mdx and content/docs/deployment/tenancy-modes.mdx gain the rule in this change.

No-card security order (seat security#1); there is no issue to close.

维护者速读

  • 改了什么:email_domain 准入模式下,以及 open 模式在邮箱验证生效时,经社交登录(socialProviders)新建账号,只有在提供方报告邮箱已验证时才准入;否则在准入闸门处以 403 SELF_REGISTRATION_CLOSED 拒绝,与 invite_only 一致:不建账号、不发会话、不建成员关系。发给该地址的待处理邀请也不放行这种创建。
  • 为什么改:执行维护者对本单的裁决:准入建立在邮箱地址之上的模式,社交登录新建账号须由提供方验证该地址;规则按创建类别判定,之后新增的社交提供方自动覆盖,不需逐个登记。
  • 风险与回滚:BREAKING(窄化)。在 email_domain、或验证生效的 open 部署上,依赖「提供方报告未验证邮箱」也能注册的社交登录改为被拒。运营方注册的身份提供方(oidcProviders、SSO)、管理员创建、SCIM、全新安装的首个账号、部署声明关闭验证的 open 均不变。回滚即 revert 本 PR。
  • 先看:packages/plugins/plugin-auth/src/audience-posture.ts 的 decideAudienceAdmission(���表守卫之后、邀请豁免之前新增的一条判定)与 admissionRestsOnAddress;auth-manager-membership-admission.ts 向判定传入的三个输入;invitation-acceptance-verified-address.test.ts 末尾新增的顶层 describe。
  • 两分钟验证:pnpm --filter @objectstack/plugin-auth exec vitest run src/invitation-acceptance-verified-address.test.ts src/audience-posture.test.ts,预期 2 个文件、125 个用例全绿。
  • 需要你做的:无,席位落地(窄化在入队前先有一次 CONTRACT_REVIEW_TIER 审核记录)。

What changes

The rule. Under an audience posture whose admission rests on the address (email_domain always; open while email verification is in force), a self-serve creation through a social provider is admitted only when the provider verified the address. Otherwise it is refused at the admission gate with 403 SELF_REGISTRATION_CLOSED, as invite_only already refuses it: no account row, no session, no membership. The binding rule and ADR-0093 are unchanged.

  • packages/plugins/plugin-auth/src/audience-posture.ts: decideAudienceAdmission gains the rule as one predicate, after the creation-class exemptions, the bootstrap carve-out and the vocabulary guard, and before the invitation carve-out and the posture switch, so every admit after it is covered. Its input gains method, emailVerified (verified only when it is true) and declaredEmailVerification, which the decision resolves through resolveEmailVerificationRequirement, the resolver the better-auth wiring and the public config already read; absent resolves to the posture default, so under open the rule holds unless the deployment declared an explicit false. Two module-private helpers: isSocialProviderCreation (a self-serve creation whose method is oauth, which is how a social provider is told apart from an operator-registered oidcProviders entry, already classed provider) and admissionRestsOnAddress. The module doc gains the section "A social provider's word on the address", and the invitation carve-out paragraph names the exception.
  • packages/plugins/plugin-auth/src/auth-manager-membership-admission.ts: validateAudienceAdmission hands the decision the vendor's source.method, user.emailVerified and the live emailAndPassword.requireEmailVerification. Nothing else in the gate moves.
  • content/docs/permissions/authentication.mdx (OAuth callback section), content/docs/deployment/tenancy-modes.mdx (membership reconciler bullet) and content/docs/deployment/self-hosting.mdx (the email_domain invitation paragraph and "Email verification under each posture") state the rule.
  • .changeset/social-creation-needs-provider-verified-address.md: patch on @objectstack/plugin-auth, the two declaration lines, Skills-docs:, the ADR-0087 disposition and the BREAKING note with what to do.

Decisions this order left to the PR, and which way each went:

  • The off-allowlist invitation case takes the same refusal. Under email_domain, an address off the allowlist that a pending invitation is addressed to, signing in through a social provider that did not verify it, is now refused like any other unverified social creation, rather than keeping the outcome fix(plugin-auth)!: a sign-up the email_domain posture admits by an invitation is not bound before its address is verified #34969 pinned for it. Why: the invitation is matched by the very address the provider did not verify, and invite_only already refuses an unverified OAuth creation whatever invitation is addressed to it (invitationProofFor), so one rule reads the same under every posture and the refusal leaves nothing behind. Nobody is dead-ended: once the provider verifies the address the same person is admitted and accepts the invited role (pinned), and the email-and-password sign-up and the invitation mail's one-step link keep working as before. The same holds for an invitation under open with verification in force.
  • The bootstrap carve-out stays ahead of the rule, as it does under invite_only: the first account of a fresh install is admitted whatever the provider said (pinned at the decision level).
  • The refusal reuses SELF_REGISTRATION_CLOSED, the code invite_only already answers this creation with, with its own description naming the posture. No error code is added, so the ADR-0112 ledger does not move.
  • An off-allowlist address with no invitation now meets this refusal rather than EMAIL_DOMAIN_NOT_ALLOWED when the provider did not verify it, because the rule sits ahead of the posture switch; with a verified address it still meets EMAIL_DOMAIN_NOT_ALLOWED. Every non-social creation keeps its refusal codes.

Tests

All counts below are vitest's own summary lines; red was taken on the unfixed source, green and the ablation on 9f4fd3cd.

  • Red before the fix, on the real engine (AuthManager over @objectstack/driver-sql on better-sqlite3, the real /sign-in/social door): 10 of the new pins fail and every control passes (Tests 10 failed | 115 passed (125)). The red set includes the three real-engine refusal pins (email_domain on the allowlist, open with verification in force, the off-allowlist invitation case).
  • Green after the fix: Tests 125 passed (125) on the two files; 144 passed across those two plus presented-invitation.test.ts and audience-bootstrap-seam.test.ts; the whole package Test Files 285 passed (285), Tests 6014 passed | 10 skipped (6024).
  • Ablation (scripts/ablation-replace.mjs, wrap mode, with a trap restore): the predicate's first operand replaced so the rule never fires. Mutation proven on disk (anchor x1 -> x0, blob f2f2b8a4 -> 1879d950); the run reds exactly the 10 refusal pins (Tests 10 failed | 115 passed (125)) while every control stays green; restored blob equals HEAD (f2f2b8a4) and git diff HEAD is empty.

New pins, named by the rule:

  • invitation-acceptance-verified-address.test.ts, new top-level describe "under an address-based audience posture, a self-serve social creation is admitted only with a provider-verified address": refusal under email_domain on the allowlist and under open with verification in force (403 SELF_REGISTRATION_CLOSED, not signed in, and the sys_user / sys_account / sys_session / sys_member row counts unchanged); CONTROL: a provider-verified sign-in admits, signs in and binds to the default organization under both; CONTROL: open with the deployment's verification declared off admits as before.
  • Same file, the email_domain invitation describe: the off-allowlist invitation case is refused with nothing written and the invitation still pending, then the provider-verified sign-in is admitted and accepts the invited role.
  • audience-posture.test.ts, two new top-level describes: the decision matrix (only emailVerified === true counts; email_domain whatever the deployment declares; an invitation does not admit; open refused while verification is in force; CONTROL rows for open with verification off, the provider and operator classes, every other self-serve method, the bootstrap carve-out and invite_only) and the real manager's gate (any social providerId, one configured later included, refused; an oidcProviders entry and an sso-oidc provider admitted whatever they said; open forced vs declared off).

Acceptance notes

  • Three existing cases in invitation-acceptance-verified-address.test.ts drove a social account whose provider did not verify the address under open with verification in force; that creation is now refused. They now run under open with the deployment's verification declared off (OPEN_VERIFICATION_OFF), the one deployment where such an account is still created, so the accept, decline and listing rules for it stay exercised; their assertions are unchanged.
  • That file's deployment() now boots the self-registration permission set for open as well as email_domain, because an uninvited sign-up under open is granted the declared set; no existing case's outcome depends on it.
  • The console's callback page maps SELF_REGISTRATION_CLOSED to its "not invited" sentence (ui/apps/console/src/pages/auth/ssoCallbackRefusal.ts), whose docblock names only the invite_only emitter. For this refusal an invitation is not the remedy; the server's description, behind the page's technical details, names the remedy. Not changed here (outside this order's file surface); raised as an open question in the report.
  • The rule is told by creation class and method, so it covers every oauth creation that is not an oidcProviders entry, a social provider added later included. Other self-serve methods are unchanged by design: email-and-password keeps its forced verification before a session, and magic link and email OTP prove the mailbox in their own flow.
  • auth-manager-auth-instance.ts is not touched: the forced verification there still reaches emailAndPassword only, and the rule lives in the admission decision instead of a per-provider requirement.

Verification

Local subset at bf6fa3de (CI runs the full farm):

  • pnpm --filter @objectstack/plugin-auth typecheck (with the package built): exit 0, check:test-typecheck: OK with the test-layer debt unchanged.
  • pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2: exit 0, 285 files, 6014 passed, 10 skipped.
  • The diff-derived gate list (node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack): 100 families derived from merge base c480f335; 99 exit 0, 1 NOT MEASURED: pnpm check:dual-build-cjs-loads exit 3 (PREREQUISITE NOT MET, it reads every package's built output and needs a repo-wide pnpm build; CI's Lint & Repo Gates runs it). Two first runs exited 3 and were re-run after meeting their prerequisite: node scripts/check-plugin-teardown-shape.mjs --self-test (its pinned fixture commit fetched into this shallow clone) exit 0, and pnpm --filter @objectstack/spec run check:skill-examples (after building @objectstack/client-react and its closure) exit 0. --ran reconciliation: 100 derived, 99 run, 1 NOT-MEASURED, 0 UNRUN, every line carrying its exit code. test:repo is not run locally (no file of that project is in the diff); CI's Test Core runs it.
  • Dogfood battery on the final head: bf6fa3de, closure built (pnpm --filter '@objectstack/dogfood^...' build, exit 0), then pnpm --filter @objectstack/dogfood test under the verify lock: VERDICT command-exit 0, Test Files 480 passed | 3 skipped (483), Tests 4075 passed | 68 skipped (4143).

Generated by Claude Code

… a provider-verified address under an address-based posture

Under the email_domain audience posture, and under open while email
verification is in force, a self-serve creation through a social
provider is admitted only when the provider verified the address. Any
other is refused SELF_REGISTRATION_CLOSED at the admission gate, as
invite_only refuses it: no account row, no session, no membership. A
pending invitation addressed to it does not admit it either. The
operator-registered provider class, the operator class and the
bootstrap carve-out are unaffected; open with the deployment's
verification declared off admits as before.

Claude-Session: https://claude.ai/code/session_01ASNY8VyogmQQgdcx5jLwwc
Co-authored-by: Claude <noreply@anthropic.com>
… a provider-verified address under an address-based posture

The authentication page states the rule beside the OAuth callback, and
the tenancy page's membership reconciler notes that such a sign-in
creates no account to bind. The changeset carries the declaration lines
and the ADR-0087 disposition.

Claude-Session: https://claude.ai/code/session_01ASNY8VyogmQQgdcx5jLwwc
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m 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 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-auth, touching 9 documentable anchor(s).

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

  • content/docs/deployment/environment-variables.mdx (via email_domain (literal, a string literal in admissionRestsOnAddress))
  • content/docs/deployment/self-hosting.mdx (via email_domain (literal, a string literal in admissionRestsOnAddress))
  • content/docs/deployment/tenancy-modes.mdx (via email_domain (literal, a string literal in admissionRestsOnAddress))
  • content/docs/permissions/authentication.mdx (via emailVerified (symbol, a field of interface AudienceAdmissionInput), email_domain (literal, a string literal in admissionRestsOnAddress))
  • content/docs/permissions/sso.mdx (via email_domain (literal, a string literal in admissionRestsOnAddress))

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

  • content/docs/releases/v17/17-3.mdx (via email_domain (literal, a string literal in admissionRestsOnAddress))
  • content/docs/releases/v17/17-5.mdx (via email_domain (literal, a string literal in admissionRestsOnAddress))
  • content/docs/releases/v18/18-1.mdx (via email_domain (literal, a string literal in admissionRestsOnAddress))
  • content/docs/releases/v18/18-6.mdx (via email_domain (literal, a string literal in admissionRestsOnAddress))

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
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • 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 — 21 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 cf6bb70e2d98a8502077ccd602b036f0d9086786 → packageMentionDocs.

Which tree this was computed on

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

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

⚠️ 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 cf6bb70e2d98a8502077ccd602b036f0d9086786 → 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

security#1 · os-mickey · session_01ASNY8VyogmQQgdcx5jLwwc

Contract-review-claim: session_01ASNY8VyogmQQgdcx5jLwwc · head bf6fa3d · 2026-11-18T13:31Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-mickey · session_01ASNY8VyogmQQgdcx5jLwwc

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: bf6fa3de2066ea804f72007c9b9c441e56bd60cc
Local-runs: none
Scope: packages/plugins/plugin-auth/src/audience-posture.ts, packages/plugins/plugin-auth/src/auth-manager-membership-admission.ts, packages/plugins/plugin-auth/src/audience-posture.test.ts, packages/plugins/plugin-auth/src/invitation-acceptance-verified-address.test.ts + packages/plugins/plugin-auth/src/presented-invitation.ts, packages/plugins/plugin-auth/src/auth-manager-auth-instance.ts, packages/plugins/plugin-auth/src/auth-manager.ts, packages/plugins/plugin-auth/src/auth-manager-plugin-list.ts, packages/plugins/plugin-auth/src/invitation-mailbox-proof.ts, packages/spec/src/system/auth-config.zod.ts, packages/spec/src/api/error-code-ledger.zod.ts, ui/apps/console/src/pages/auth/ssoCallbackRefusal.ts, and the pinned vendor at 1.7.12, read from the package store because node_modules is not installed where this review ran (better-auth dist: oauth2/link-account.mjs, oauth2/callback.mjs, db/internal-adapter.mjs, utils/validate-user-info.mjs, api/routes/callback.mjs, api/routes/sign-in.mjs, plugins/generic-oauth, plugins/one-tap, plugins/oauth-proxy; @better-auth/core dist/social-providers; @better-auth/sso dist)
Security-touching: yes

① Derived judgments

Judged on the net diff against main (7 files, +371 −15). The changeset and the two content/docs pages are prose faces, read here for ② only.

Accept-set changes the diff implies, each against the ruling:

  • Narrowed, right: email_domain. A self-serve creation whose vendor method is oauth and whose provider did not report the address verified is refused SELF_REGISTRATION_CLOSED, whatever the deployment declares for email verification: for an address on the allowlist, and for one off it that a pending invitation is addressed to. This is the ruling's first pin and its invitation pin. The PR decides the invitation case takes the same refusal and states it in the body, the changeset, both doc pages and the module doc. It is pinned on the real engine: the invitation stays pending, and the provider-verified retry is admitted and accepts the invited role.
  • Narrowed, right: open while email verification is in force (declared absent or true), invited or not. The ruling's second pin. "In force" is resolveEmailVerificationRequirement over the same config.emailAndPassword.requireEmailVerification that the better-auth wiring and getPublicConfig read, so the gate cannot disagree with the wired or the advertised value. Absent resolves to in force.
  • Unchanged, right (the ruling's controls).
    • A provider-verified social creation admits, is granted and binds under both postures.
    • The provider class (oauth with an oidcProviders providerId, sso-oidc, sso-saml) and the operator class return before the rule.
    • The first account of a fresh install returns before it, in the same order as under invite_only.
    • open with the deployment's verification declared off, invite_only, and every other self-serve method read as before.
    • link-account and sign-in are not judged: the rule is about a creation, as the ruling words it.
  • One refusal changes its code, right as an ordering. Under email_domain, an address off the allowlist with no invitation, unverified by the provider, is refused before and after, but the code moves from EMAIL_DOMAIN_NOT_ALLOWED to SELF_REGISTRATION_CLOSED because the rule sits ahead of the posture switch. The PR body says so; the changeset's sentence covers the case without naming the moved code.
  • Only the boolean true counts as verified, which is the reading invitationProofFor already takes. Fail closed.

Public surface: no wire code, config key, schema or export is added or removed. audience-posture.ts is not re-exported from the package entry, so the three optional inputs on AudienceAdmissionInput and the two private helpers publish nothing, and the error-code ledger does not move. One new errorDescription sentence rides an existing code.

② Semver level

patch on @objectstack/plugin-auth is correct.

  • Clause-②: no (narrowing: …) reads no with the narrowing arm, on the PR body and in the changeset. Nothing widens.
  • Metadata-protocol: none is truthful: no authorable key, accepted value or default moves. The published AudienceConfigSchema already says email_domain forces email verification on with no opt-out, and open forces it on unless the deployment declares it off.
  • A non-protocol breaking change ships patch with its banner. The !, BREAKING, "What to do" and the ADR-0087 not-required (no-migration-prescription) marker are all present.
  • The changeset's statements match the diff.

③ Boundary flags

  • Open question: keep SELF_REGISTRATION_CLOSED (A), or a dedicated code (B).
    • A stands for this head. The ruling's words are "refused at the admission gate, as invite_only already does", and invite_only answers this creation with that code. The code is registered, nothing is added to the surface, and the server's description names the provider-side remedy.
    • B is escalated to the maintainer. A new wire code is a ledger entry in packages/spec, a constant and console copy: a contract decision, which security-findings.md §6 hands to the maintainer. It is not the reviewer's or the dev's to take.
    • What the maintainer weighs:
      • With A, a client cannot tell this refusal from the invite_only one, and the two have different remedies.
      • The ledger line for the code reads "audience posture invite_only: self-registration is closed (no pending invitation for this address)", and the console's callback sentence for it is "Ask your administrator to invite you". Both describe the invite_only emitters only. For this refusal an invitation does not open the social door (pinned); it opens the invitation mail's own link, where email sign-up is on.
      • The tree holds one precedent each way: PASSWORD_RESET_REQUIRED was split from PASSWORD_EXPIRED by ruling so that a client can tell the two apart, and EMAIL_DOMAIN_NOT_ALLOWED stays one code for two emitters because the console's one sentence is true of both.
    • Reviewer's reading: here the remedies differ and no one sentence is true of both emitters, so B is the better end state. If the maintainer keeps one code, the ledger line and the console sentence need rewording so that they are true of every emitter.
    • Timing: the ruling is cheapest before the release that publishes this refusal. After that release, moving the refusal to a new code is a second wire change.
    • Either way the follow-up lands in ui/ and packages/spec, outside this order's surface, as its own card. This head does not wait on it.
  • Dev flags in the PR body, each confirmed against the tree:
    • The bootstrap carve-out stays ahead of the rule; pinned at the decision level.
    • auth-manager-auth-instance.ts has no hunk, so the declined "allow but hold" per-provider requirement is not introduced.
    • Three existing call sites moved to open with verification declared off; their assertions are unchanged.
    • deployment() boots the self-registration set for open as well as email_domain.
  • SQL push-down: no finding. The diff adds no query, no id materialisation and no in-app join. The decision stays pure and the gate's existing probes are unchanged.
  • No governed path and no published schema is in the diff. settleMembership has no hunk, so ADR-0093 and the binding rule are untouched.
  • Gate verdicts on this head: 55 check-runs, all completed: 40 success, 15 skipped, none failed, none still running.
    • Success: Lint & Repo Gates, TypeScript Type Check, Test Core (10 of 10 shards), Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate, Check Changeset and the PR-body guards.
    • Skipped on this pull-request run, among the required contexts: Lint UI, Type Check UI and Build & E2E UI. The dogfood shards are skipped too; the queue run carries them.

④ Design judgment

No must-fix, no should-fix.

The narrowing against the published spec on main takes no declared capability away. AudienceConfigSchema declares verification forced on under these postures; the gate now holds a social creation to that at the one admission seam, before anything is written.

  • audience-posture.ts holds. One predicate sits after the class exemptions, the bootstrap carve-out and the vocabulary guard, and before the invitation carve-out and the posture switch, so every admit below it is covered. The module doc, the input docs and the function doc agree with the code sentence by sentence. Tried against the cited code, and held:
    • A social creation under another method. In the pinned vendor every social door hands the gate method: 'oauth', which is also the vendor's default; SSO hands sso-oidc or sso-saml.
    • emailVerified from the caller. It is internalAdapter.createUser's own input, set by the vendor from the provider adapter. The request body does not reach it.
    • Providers added later. Any socialProviders key arrives as oauth with a providerId outside oidcProviders and meets the rule unnamed. Pinned with an unknown providerId and with an absent emailVerified.
    • Operator-registered providers. oidcProviders entries also arrive as oauth; enterpriseOAuthProviderIds() classes them provider, ahead of the rule. Pinned at the decision and at the manager's gate.
    • open with nothing declared. Resolves to in force. Pinned.
  • auth-manager-membership-admission.ts holds. Three reads are handed to the pure decision: the vendor's source.method, user.emailVerified, and the live emailAndPassword.requireEmailVerification through the config getter. A refusal returns before anything is staged.
  • audience-posture.test.ts holds. Two top-level describes in the existing harness file: the decision matrix, with a control for each exemption, and the real manager's gate.
  • invitation-acceptance-verified-address.test.ts holds. Real engine, real sign-in/social door. The three ruled refusals each assert status, code, no session and unchanged sys_user, sys_account, sys_session and sys_member counts. The verified controls assert admission and the default-organization membership. The one rewritten case is the ruled change of outcome, not a deleted pin.

Nits (no effect on correctness or the contract):

  • N1 (nit) — method is optional on AudienceAdmissionInput, and it is the one new input whose absence leaves the rule unevaluated; the other two refuse when absent. There is one call site, and it passes it.
  • N2 (nit) — the refusal's only prescription is to verify the address with the provider. Where a provider's adapter never reports an address verified, the person cannot follow it. The changeset names the other doors; the runtime sentence does not.
  • N3 (nit) — the refusal is pinned through the id-token door only. The browser callback's error=SELF_REGISTRATION_CLOSED redirect, which the changeset and the doc page state, rests on the vendor's callback handing any gate refusal to the error URL: read in the vendor, not pinned here.
  • N4 (nit) — the rule is keyed on the vendor method oauth. A creation method that a later vendor release adds needs classifying against this rule at the bump.

Implemented-by: claude/sec1-xc39-admission-requires-verified-address
Reviewed-by: session_01ASNY8VyogmQQgdcx5jLwwc

VERDICT: PASS

… address-based posture creates an account only for a provider-verified address

Under email_domain, and under open while email verification is in
force, the self-hosting page's invitation paragraph and its email
verification section now say that a new account through a social
provider is created only when the provider reports the address
verified, and is otherwise refused 403 SELF_REGISTRATION_CLOSED,
whatever the allowlist or an invitation says.

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

Copy link
Copy Markdown
Contributor Author

security#1 · os-mickey · session_01ASNY8VyogmQQgdcx5jLwwc

Regen-provenance: 6980628412 · bf6fa3de2066ea804f72007c9b9c441e56bd60cc → 45c45799967c56542bbc5f240d62e9ea3252d2bb · git diff --name-only bf6fa3d..45c4579 -- . ':!content/docs/' → (empty)

The head moved on the prose face alone (content/docs/deployment/self-hosting.mdx, seat L1 rework); the contract-review record 6980628412 carries to 45c45799.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#2 · os-elon-musk · session_016WV4czt69hUUaG5XcgFNYL

Release: security#1's claim on this PR — os-mickey · session_01ASNY8VyogmQQgdcx5jLwwc (contract-review claim 6980058182; dispatch paused on #29740). Provenance: the maintainer, in this seat's project thread, verbatim 「再开一个 security 私密安全公告座位,只处理高危」 (2026-11-19T15:13Z), and the maintainer's decision-card answer in the same thread at 2026-11-19T15:17Z that security#2 takes every high row security#1 held while paused, following this PR to merge. Split knock: mailbox #35169 comment 7013408768.

Claim: PM loop round 1
Session: session_016WV4czt69hUUaG5XcgFNYL
Account: os-elon-musk
Branch: claude/sec1-xc39-admission-requires-verified-address
Seat: security#2
Resume-from: claude/sec1-xc39-admission-requires-verified-address@45c4579996
Thread-read: 6981973717

Hand-over record: last pushed head 45c4579996; all check-runs green there, contract review PASS 6980628412 carried by Regen-provenance 6981973717. Next: sync with main (138 behind), run the dogfood battery on the new head, then land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#2 · os-elon-musk · session_016WV4czt69hUUaG5XcgFNYL

Contract-review-claim: session_016WV4czt69hUUaG5XcgFNYL · head d4dc6f3 · 2026-11-19T21:50Z

The head moved by update-branch (main merged in); main changed two files of this PR's own delta, so record 6980628412 does not carry. Dogfood battery on this head: 482/485 files, 4092 passed, 0 failed.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#2 · os-elon-musk · session_016WV4czt69hUUaG5XcgFNYL

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d4dc6f350cc47bf56f7f51163ffc59f446c1f614
Local-runs: none
Scope: packages/plugins/plugin-auth/src/audience-posture.ts, packages/plugins/plugin-auth/src/auth-manager-membership-admission.ts, packages/plugins/plugin-auth/src/audience-posture.test.ts, packages/plugins/plugin-auth/src/invitation-acceptance-verified-address.test.ts, .changeset/social-creation-needs-provider-verified-address.md (declaration lines) + packages/plugins/plugin-auth/src/dev-seed-credential.ts, packages/plugins/plugin-auth/src/auth-manager.ts, packages/plugins/plugin-auth/src/auth-manager-auth-instance.ts (read in the tree at this head, not in the diff)
Security-touching: yes

① Derived judgments

Judged on the net diff of this head against main at cf6bb70e2d98 (8 files, +383 −16). The three content/docs pages and the changeset's narrative are prose faces, read for ② only. This head is the earlier head 45c45799 plus a merge of main; across the scoped files that merge moved auth-manager-membership-admission.ts alone (main's development-seed staging step), so the whole function was re-read as it stands here.

Accept-set changes the diff implies:

  • Narrowed, right: email_domain. A self-serve creation whose vendor method is oauth, and whose provider did not report the address verified, is refused SELF_REGISTRATION_CLOSED whatever the deployment declares for email verification: on the allowlist, off it, and with a pending invitation addressed to it.
  • Narrowed, right: open while email verification is in force (declared absent or true), invited or not. "In force" is resolveEmailVerificationRequirement('open', declared) over config.emailAndPassword.requireEmailVerification, the same value and the same resolver the better-auth wiring (auth-manager-auth-instance.ts) and getPublicConfig (auth-manager.ts) read. The gate cannot disagree with the wired or the advertised requirement. Absent resolves to in force.
  • Unchanged, right. A provider-verified social creation; the provider class (oauth with an oidcProviders providerId, sso-oidc, sso-saml); the operator class; the first account of a fresh install; open with the deployment's verification declared off; invite_only; every other self-serve method. link-account and sign-in return before the decision, as on main.
  • One refusal changes its code, right as an ordering. Under email_domain, an address off the allowlist with no invitation and unverified by the provider was refused EMAIL_DOMAIN_NOT_ALLOWED and is now refused SELF_REGISTRATION_CLOSED, because the rule sits ahead of the posture switch. It is a refusal before and after.
  • Only the boolean true counts as verified, the reading invitationProofFor already takes. Pinned over false, undefined, null, 'true' and 1.

Public surface: no wire code, config key, schema or export is added or removed. audience-posture.ts is not re-exported from the package entry; the three new inputs on AudienceAdmissionInput are optional and the two helpers are module-private. One new errorDescription sentence rides an existing registered code.

② Semver level

patch on @objectstack/plugin-auth is correct.

  • Clause-②: no (narrowing: …) is present and identical on the PR body and in the changeset. Nothing in the diff widens an accept-set.
  • Metadata-protocol: none is truthful: no authorable key, accepted value or default moves.
  • The narrowing ships with its !, the BREAKING paragraph, "What to do", and the ADR-0087 not-required (no-migration-prescription) marker. No stored row changes shape, so no migration is owed.
  • The changeset's statements match the code at this head. The merge of main added nothing the changeset has to name: the seed-staging step is main's own change and is not in this PR's net diff.

③ Boundary flags

  • How this PR's rule and main's seed-staging step meet in validateAudienceAdmission. Read line by line at this head:
    • The order is: class resolution, the read-only probes, decideAudienceAdmission, the refusal return, then the stagings (owner-verified stamp, development-seed mark, invitation admission, self-registration grant).
    • A refusal by the new rule returns at the !verdict.admit branch, which is ahead of every staging call. Nothing is staged and nothing is written before it. The only work done ahead of it is reads: the bootstrap probe and, under email_domain and open, the address-matched invitation lookup.
    • The seed mark is staged on seedTicketProven alone. The same boolean sets creationClass to operator, and the decision returns for operator before the rule. So the two sets are disjoint: a creation the rule judges is never the seed's own, and the seed's own creation never meets the rule. Neither change alters the other's outcome.
    • stageDevSeedCredential is request-scoped state, a no-op outside development mode, and never throws, so it cannot turn an admission into the gate's fail-closed refusal.
    • The seed mark is staged ahead of the two later configuration refusals, but those sit under verdict.grantPermissionSet, which the operator class never sets. No seed mark is staged for a creation that is then refused.
  • Open question carried from the earlier record: keep SELF_REGISTRATION_CLOSED, or add a dedicated code. Keeping the code stands for this head: the code is registered and nothing is added to the surface. A dedicated code is a ledger entry in packages/spec plus console copy, a contract decision for the maintainer. It stays escalated; the merge of main did not change the question, and this head does not wait on it. The console's sentence for this code names an invitation as the remedy, which does not hold for this refusal; that rewording belongs to the same follow-up, outside this diff.
  • Dev flags in the PR body, each confirmed in the tree: the bootstrap carve-out is ahead of the rule; auth-manager-auth-instance.ts has no hunk; three existing cases moved to open with verification declared off with their assertions unchanged; the test file's deployment() boots the self-registration set for open as well.
  • SQL push-down: no finding. The diff adds no query, no id materialisation and no in-app join. The decision is pure; the gate's existing probes are unchanged.
  • No published schema and no governed path is in the diff. settleMembership has no hunk.
  • Gate verdicts on this head: 55 check-runs, all completed: 40 success, 15 skipped, none failed, none pending. Success includes Lint & Repo Gates, TypeScript Type Check, Test Core and its 10 shards, Build Core, Build Docs, Test UI, Live E2E UI, Dogfood Regression Gate, Governed Surface Queue Guard, Check Changeset and the PR-body guards. Skipped on this pull-request run: Lint UI, Type Check UI, Build & E2E UI, the dogfood and UI test shards, and the queue-only jobs. The dev evidence on this exact head covers the dogfood battery (command-exit 0, 482 files passed, 3 skipped, no failures) and the full plugin-auth suite (287 of 287 files).
  • Not re-read this round: the pinned vendor's own sources (not installed where this review ran). That every social door hands the gate method: 'oauth' rests on the earlier record's reading and on the real-engine pins, which drive the real sign-in/social door and are green on this head.

④ Design judgment

No must-fix, no should-fix.

The narrowing takes no declared capability away: the published audience configuration already declares email verification forced on under email_domain, and under open unless the deployment declares it off. The gate now holds a social creation to that at the single admission seam, before any row exists.

  • audience-posture.ts holds. One predicate, placed after the operator and provider returns, the bootstrap return and the off-vocabulary guard, and before the invitation carve-out and the posture switch. Every admit below it is covered, and nothing above it admits a self-serve creation except bootstrap, which is the stated exception. Tried, and held:
    • An invalid posture. The vocabulary guard returns first, and admissionRestsOnAddress answers false for one anyway.
    • A social provider configured later. classifyCreationMethod classes any oauth providerId outside oidcProviders as self-serve; the rule names no provider.
    • An operator-registered oidcProviders entry. Classed provider, returned ahead of the rule. Pinned at the decision and at the manager's gate.
    • open with nothing declared, and a console-stored false. Absent resolves to in force. A console-stored false under open is refused at entry by assertAudienceConfig, so the value the gate reads as false is the deployment's own declaration.
    • invite_only. admissionRestsOnAddress is false there; the invitation proof already asks a verified address of an oauth creation, and the result is the same refusal code.
    • The module doc, the input docs and the function doc agree with the code.
  • auth-manager-membership-admission.ts holds on this head. The PR's hunk is three inputs handed to the pure decision, with config read through the live getter. Its interaction with main's seed-staging step is answered under ③: refusal precedes every staging, and the two conditions are disjoint by class.
  • audience-posture.test.ts holds. The decision matrix has a control for each exemption, and the manager's gate is driven with a real AuthManager for both postures, an oidcProviders entry, an SSO method and an unknown providerId.
  • invitation-acceptance-verified-address.test.ts holds. Real engine, real sign-in/social door. Each refusal pin asserts status, code, no session and unchanged sys_user, sys_account, sys_session and sys_member counts; the invitation stays pending and the verified retry is admitted and accepts. The one rewritten case is the ruled change of outcome; the three moved cases keep their assertions.
  • The changeset's declaration lines hold. Clause-②, Metadata-protocol and the ADR-0087 marker each match the diff.

Nits (no effect on correctness or the contract):

  • N1 (nit) — under email_domain and open, an unverified social creation still pays the address-matched invitation lookup before the decision refuses it whatever the lookup says. One read, no write.
  • N2 (nit) — method is optional on AudienceAdmissionInput, and it is the one new input whose absence leaves the rule unevaluated. There is one call site and it passes it.
  • N3 (nit) — no pin places the seed-staging step and the new rule in one case. Their independence is structural (the proven ticket is the operator class) and each side is pinned on its own.
  • N4 (nit) — the changeset's Skills-docs: line names two of the three docs pages the diff changes; self-hosting.mdx is not named. The PR body's "Verification" counts name earlier heads; the counts for this head are in the dev evidence.
  • N5 (nit) — the rule is keyed on the vendor method oauth; a creation method a later vendor release adds needs classifying against it at the bump.

Implemented-by: claude/sec1-xc39-admission-requires-verified-address
Reviewed-by: isolated sub-agent of session_016WV4czt69hUUaG5XcgFNYL

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#2 · os-elon-musk · session_016WV4czt69hUUaG5XcgFNYL

席位核对

ACCEPT · head d4dc6f350cc47bf56f7f51163ffc59f446c1f614

  • Shape: not governed (check-governed-merges --pr 35200: 0 of 8 paths hit the register). 399 changed lines. Clause-②: no (narrowing: …); patch on @objectstack/plugin-auth with the BREAKING note.
  • Review: contract tier, isolated reviewer, PASS 7023256847 on this head (tier evidence verified), no must-fix, no should-fix; nits accepted as deviations. The head moved from 45c4579996 by update-branch (main merged in, which touched two files of this PR's delta), so the earlier record 6980628412 was not carried; the new record judges the interaction with main's change.
  • Dev evidence on this head (verify-only run, no code change): plugin-auth 287/287 files, 6045 passed, 10 skipped; dogfood battery d4dc6f350c · VERDICT command-exit 0 · Test Files 482 passed | 3 skipped (485) · Tests 4092 passed | 68 skipped (4160) · failures: none.
  • Prose faces: the three docs pages and the changeset describe the refusal and its controls as the code implements them (refused under email_domain and under open with verification in force; admitted when the provider verified the address, or under open with verification declared off). The added self-hosting.mdx section is main's, carried by the merge.
  • Landing: the maintainer, in this seat's project thread, verbatim 「xc39 的修复 PR fix(plugin-auth)!: a self-serve social creation is admitted only with a provider-verified address under an address-based posture #35200 能由席2 直接落地。」. label-write --land cannot judge a narrowing pull that names no card (this one has none by rule), so the seat lands it with the relay's pr_ready + automerge_enable after the battery above. Ready, then auto-merge into the merge queue.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 19, 2026 21:54
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 6927c3f Nov 19, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/sec1-xc39-admission-requires-verified-address branch November 19, 2026 22:28
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…eives the declared self-registration set, and is refused when that set cannot be resolved (objectstack-ai#36312)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X8UqWLrzTYpuat8L5eLdf2c)_
Fixes objectstack-ai#34971
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill under `skills/**` teaches the audience
posture's invitation sign-up or `selfRegistrationPermissionSet`;
`content/docs/deployment/self-hosting.mdx` gains the rule in this
change.
Security-touching: yes

repo:objectstack#4 · os-project-manager ·
session_01FEkQ5pb2t8Z8C64PkPyVt1 (dev executor, area a4-B; resumed from
the released WIP `claude/issue-34971-allowlist-invite-grant@706e936`).

## 维护者速读

-
用户能看到什么变化:开放注册或按邮箱域名放行的自建部署里,被邀请的人自己注册后,和普通注册者一样拿到管理员指定给自助注册者的那组权限;若那组权限不存在或已停用,被邀请者注册也会被明确拒绝并提示去修配置。
- 为什么做:执行维护者对本单的裁决:被邀请与未被邀请的自助注册者只用一条规则,授权和入组读同一个判断,补上被邀请者少一组权限的漏洞。
-
出错会怎样:权限组配置坏掉的部署里,原本靠邀请仍能进来的人会被拒,直到管理员改好配置或直接为其建账号;没有任何账号会被多给权限;回滚即撤回本改动。
- 要你做什么:这是收紧注册权限的改动,需要你本人审阅、批准并亲手合并。L1 ACCEPT 7076000414,全量测试 4107 通过,契约
PASS 7076202877(座位 7,head ffffab1);两个小问题另立 objectstack-ai#36355 跟进。

## What changes

**The rule (ruling A, card comment 7063136215).** Under `open`, and
under `email_domain` for an address on `allowedEmailDomains`, a
self-serve sign-up is admitted by the posture's own rule whether or not
it also holds a pending invitation. It receives the declared
`selfRegistrationPermissionSet`, and when that set cannot be resolved it
is refused `403 AUTH_CONFIG_ERROR`, like an uninvited sign-up. The
invitation no longer admits it with no grant.

- `packages/plugins/plugin-auth/src/audience-posture.ts`: a
module-private `isAdmittedByPostureRule(audience, email)` (`open`: every
address; `email_domain`: an address on the allowlist; `invite_only` and
an invalid posture: none). `decideAudienceAdmission` reads it after the
social-provider address rule and before the invitation carve-out,
answering `grantPermissionSet: true`; `isAdmittedByInvitationAlone`
reads it to answer false for an address the rule admits. The grant path
in `auth-manager-membership-admission.ts` is unchanged: a verdict that
asks for the set already refuses `AUTH_CONFIG_ERROR` when
`selfRegistrationSetResolvable` answers false, so the invited sign-up
now meets that refusal. The module doc's invitation carve-out and
fail-posture paragraphs state the exception.
- Unchanged (standing readings): under `invite_only` an invitation
admits with no self-registration grant; under `email_domain` an
off-allowlist sign-up an invitation admitted gets the account and no
grant, whatever state the declared set is in; `admin_full_access` stays
refused as the self-registration set; operator, bootstrap and provider
creations.
- `content/docs/deployment/self-hosting.mdx`: "admitted by its domain,
invitation or not" now holds for the grant and the binding, and a new
paragraph states the fail-closed refusal for both postures.
-
`packages/spec/src/migrations/entries/semantic/18.self-registration-permission-set-reaches-invited-sign-ups.ts`:
the ADR-0087 D3 semantic entry (the one spec path), registered by the
changeset's `registered` marker.
-
`packages/qa/dogfood/test/signup-organization-census-walled.dogfood.test.ts`:
the open-posture invitee now holds the declared set on its first
membership (the battery found the stale fixture).
- `.changeset/34971-allowlist-invite-grant.md`: BREAKING, `Clause-②: no
(narrowing)`, `Metadata-protocol: none`, `patch` on
`@objectstack/plugin-auth` and `@objectstack/spec`.

| posture | invited | address | before | after |
|:---|:---|:---|:---|:---|
| `invite_only` | yes (presented) | any | admit, no grant | same |
| `email_domain` | yes | on list | admit, NO grant, bound | admit,
GRANT, bound |
| `email_domain` | yes | off list | admit, no grant, unbound until
accept | same |
| `open` | yes | any | admit, NO grant, bound | admit, GRANT, bound |
| `open` / `email_domain` on list | no | | admit, grant, bound | same |
| the two changed rows, declared set unresolvable | | | admitted
ungranted | refused `AUTH_CONFIG_ERROR` (the narrowing) |

## Tests

All readings under `scripts/pm/os-verify-lock.sh`, tree
`objectstack-ai/objectstack`; the source of the change is unchanged from
`ca290ccdc` to the head `ffffab1779` (the two later commits touch only
test files).

<details><summary>plugin-auth and spec (at ca290cc, after merging
origin/main a5a5312)</summary>

- `pnpm --filter @objectstack/plugin-auth test`: Test Files 291 passed
(291); Tests 6204 passed, 10 skipped (6214); exit 0. The one red the WIP
left (`presented-invitation.test.ts`, the `open` row) is rewritten here.
- `pnpm --filter @objectstack/plugin-auth typecheck`: exit 0;
`check:test-typecheck` OK (debt ledger held).
- `pnpm --filter @objectstack/spec build`, `typecheck`, and `exec vitest
run --maxWorkers=2 src/migrations` (5 files, 198 tests): all exit 0; the
new entry reaches `registry.ts` and `dist/migrations/index.{js,mjs}`.
- At `0ef10daa0b`: the three target files, `audience-posture.test.ts`,
`invitation-acceptance-verified-address.test.ts`,
`presented-invitation.test.ts`: 3 files, 152 tests passed.

</details>

<details><summary>Ablations (src read by relative import, no dist leg),
restored to the HEAD blob fc4dbd6</summary>

- M1, the subject of the new pins: `if
(isAdmittedByPostureRule(audience, email))` mutated to `if
(!hasPendingInvitation && isAdmittedByPostureRule(audience, email))`
(the old order). Mutation landed (anchor 1 to 0, blob changed); 3 files:
9 failed, 143 passed. Red: the four invited unresolvable-set refusal
rows (open and email_domain on the list, missing and switched off), the
two invited verdict rows, the social on-list row, and the invited grant
pins under email_domain on the list and under open. Restored: blob
equals HEAD, `git diff HEAD` empty.
- M2, the subject of the controls: the invitation-alone branch's
`grantPermissionSet: false` mutated to `true`. 36 failed, 116 passed.
Red include every CONTROL: the off-allowlist invited sign-up with a
missing set, the off-allowlist and `invite_only` no-grant pins, and the
`presented-invitation.test.ts` email_domain row. Restored: blob equals
HEAD, `git diff HEAD` empty.

</details>

<details><summary>Dogfood battery (the title carries !)</summary>

- At `0ef10daa0b`: closure build `pnpm --filter
'@objectstack/dogfood^...' build` exit 0, then `pnpm --filter
@objectstack/dogfood test`: Test Files 1 failed, 483 passed, 3 skipped
(487); Tests 2 failed, 4105 passed, 68 skipped (4175). Both failures are
one stale fixture this change makes false:
`signup-organization-census-walled.dogfood.test.ts`, the grant-writer
case under `group` and `isolated`, asserting the open-posture invitee
holds no declared set.
- Fixed in `ffffab1779` to the ruled behaviour (the invitee's declared
grant settles on its first membership, the inviting organization). Rerun
at `ffffab1779`: that file and its `single` sibling
`signup-organization-census.dogfood.test.ts`, 2 files, 15 tests passed.
The full battery was not rerun on the new head; the only change is that
test file.

</details>

## Acceptance notes

- `boot-sign-in-reachability.ts` (outside this card's file surface) says
`decideAudienceAdmission` short-circuits on `hasPendingInvitation`
before the posture switch, admitting under every posture. It stays true
of the switch; the posture-rule check now precedes the invitation, and
under `open` / on-list `email_domain` with an unresolvable set an
invitation no longer admits. Not edited here. Carried by objectstack-ai#36355 (with
the `self-hosting.mdx` open-posture half-clause, contract review
7076202877 N1 and N3).
- Dispatch and claim spell `Clause-②: no (narrowing)` (copied); the
decision analysis 7062693710 suggested `yes (narrowing)` for a diff that
widens who receives the set and narrows the unresolvable case. Left for
the contract review.
- The dispatch asked for an ADR-0087 migration entry; objectstack-ai#34969 and objectstack-ai#35200
used `not-required (no-migration-prescription)` instead. This change
registers a semantic entry, so `os migrate meta` and the upgrade guide
carry the notice.

## Verification

<details><summary>Dispatch-gate families at ffffab1</summary>

- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` over 8 changed paths: 115 families, each run
with its exit code recorded before any pipe; `--ran` reconciliation: 115
derived, 115 run, 0 NOT-MEASURED, 0 UNRUN, every one exit 0.
- On the first pass (at `ca290ccdc`) `check:test-source-alias` was red
on the edited `presented-invitation.test.ts` (collection reaches the
dynamic import of `@objectstack/core/egress`); fixed by the module-top
import its two sibling test files carry (`0ef10daa0b`).
- `check:adr-0087-registration`: the changeset is
`[BREAKING+bang+clause-②-narrowing]`, `registered
self-registration-permission-set-reaches-invited-sign-ups (new here)`.
- `overlap-check` before each push: clean against origin/main and objectstack-ai#35129
(shares `self-hosting.mdx`, merges cleanly).
- Local-only `check:dev-prereqs`: exit 1, the box's workspace is not
fully built (35 `ui/` and other dists absent); a machine-state reading,
not about this diff.

</details>

**Read first (by risk):** `audience-posture.ts`
`decideAudienceAdmission` (the new `isAdmittedByPostureRule` branch
ahead of `if (hasPendingInvitation)`); `isAdmittedByInvitationAlone`;
the new `it.each` refusal pins in `audience-posture.test.ts`
(end-of-chain describe).

**Two-minute check:** `pnpm --filter @objectstack/plugin-auth exec
vitest run --maxWorkers=2 src/audience-posture.test.ts
src/invitation-acceptance-verified-address.test.ts
src/presented-invitation.test.ts` — expect 3 files green.

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

https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1

<!-- signed: repo:objectstack#4 · os-project-manager ·
session_01FEkQ5krBqrrgxCYgjXmfbv -->

---------

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 size/m 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.

3 participants