Skip to content

fix(plugin-auth)!: an invited sign-up the audience posture admits receives the declared self-registration set, and is refused when that set cannot be resolved - #36312

Merged
os-zhuang merged 5 commits into
mainfrom
claude/issue-34971-allowlist-invite-grant
Nov 22, 2026
Merged

os-zhuang merged 5 commits into
mainfrom
claude/issue-34971-allowlist-invite-grant

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread
Fixes #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@706e93675).

维护者速读

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

plugin-auth and spec (at ca290cc, after merging origin/main a5a5312)
  • 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.
Ablations (src read by relative import, no dist leg), restored to the HEAD blob fc4dbd6fa055
  • 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.
Dogfood battery (the title carries !)
  • 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.

Acceptance notes

Verification

Dispatch-gate families at ffffab1
  • 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 chore: version packages #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.

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.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1

…ration grant (#34971)

Work in progress, released to the queue under the maintainer's 2026-11-21T15:25Z stop. Ruling A (7063130499 thread, card comment 7063136215): fail-closed narrowing; still owes the ! title, ADR-0087 entry, dogfood battery and the presented-invitation.test.ts:369 rewrite.
…fused when the declared set cannot be resolved

Ruling A: one rule for invited and uninvited self-registration. Adds the
unresolvable-set pins for an invited sign-up under open and email_domain
(on the allowlist) with the off-allowlist control, rewrites the
presented-invitation row that pinned the removed branch, states the
fail-closed refusal in the module doc and self-hosting.mdx, moves the
changeset to a BREAKING narrowing, and registers the ADR-0087 semantic
entry self-registration-permission-set-reaches-invited-sign-ups.

Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1
Co-authored-by: Claude <noreply@anthropic.com>
…p in presented-invitation.test.ts

check-test-source-alias judges the edited file: its collection reaches the
dynamic import of @objectstack/core/egress through auth-manager. The same
module-top import the two sibling test files already carry.

Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1
Co-authored-by: Claude <noreply@anthropic.com>
…e declared set on its first membership

The walled organization census pinned the removed branch: an invitee under
the open posture was admitted by its invitation and owed no declared set.
Under the ruled rule the posture admits it, invitation or not, so its
declared grant settles on its first membership, the organization whose
invitation it accepted. Found by the dogfood battery the ! title owes.

Claude-Session: https://claude.ai/code/session_01FEkQ5pb2t8Z8C64PkPyVt1
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 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/plugin-auth, @objectstack/spec, touching 5 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 isAdmittedByInvitationAlone; a string literal in isAdmittedByPostureRule))
  • content/docs/deployment/self-hosting.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone; a string literal in isAdmittedByPostureRule))
  • content/docs/deployment/tenancy-modes.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone; a string literal in isAdmittedByPostureRule))
  • content/docs/permissions/authentication.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone; a string literal in isAdmittedByPostureRule))
  • content/docs/permissions/sso.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone; a string literal in isAdmittedByPostureRule))

⛔ 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 isAdmittedByInvitationAlone; a string literal in isAdmittedByPostureRule))
  • content/docs/releases/v17/17-5.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone; a string literal in isAdmittedByPostureRule))
  • content/docs/releases/v18/18-1.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone; a string literal in isAdmittedByPostureRule))
  • content/docs/releases/v18/18-6.mdx (via email_domain (literal, a string literal in isAdmittedByInvitationAlone; a string literal in isAdmittedByPostureRule))

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

What this run could not see
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 67 of 249 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 — 179 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 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d

⚠️ 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 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Final head declared (area a4-B) · 2026-11-22T06:07Z: ffffab17796cbb730feccdd343962ce1f65aedc9 (Fixes #34971; ruling A 7063136215; dev report 7074836533; claim 7072949819 and surface revision on #34971).

  • Built on seat 7's released WIP 706e936755 merged with origin/main (no conflicts). decideAudienceAdmission reads the posture rule (isAdmittedByPostureRule) before the invitation carve-out: an invited sign-up under open, or invited and on the allowlist under email_domain, gets the declared set; an unresolvable declared set refuses AUTH_CONFIG_ERROR for both kinds. Admitted by the invitation alone (invite_only, off-list email_domain): unchanged, no grant.
  • Declarations: Clause-②: no (narrowing), BREAKING changeset, ! title, ADR-0087 semantic entry 18.self-registration-permission-set-reaches-invited-sign-ups.ts (registered; @objectstack/spec patch), Security-touching: yes.
  • Pins and ablations: M1 (posture rule gated behind the invitation) ⇒ 9 red; M2 (invitation-alone grants) ⇒ 36 red incl. every control; both restored. plugin-auth 6204 passed; 115/115 derived gate families exit 0. Dogfood battery: 2 red on signup-organization-census-walled.dogfood.test.ts (a fixture the ruling makes outdated: the open-posture invitee now holds the set), fixed in the last commit; that file and its sibling 15/15.
  • check-governed-merges: 408 changed lines ≤ 3000. Landing goes through the seat (narrowing + security label).
  • Checks at this head (pr-state): 60 success · 10 expected skip (check-expected-skips OK) · 0 failed · 0 pending · mergeable_state clean.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5

L1 verdict (L1-a): REWORK, one evidence item (no code) at head ffffab17796cbb730feccdd343962ce1f65aedc9 (Fixes #34971, ruling A 7063136215). This is a full read of origin/main...ffffab1779: 8 files, +332/−76.

席位核对

Shape and gates (declaration 7075188247):

  • The title carries !.
  • Declarations: Clause-②: no (narrowing), Metadata-protocol: none, Security-touching: yes.
  • The ADR-0087 semantic entry 18.self-registration-permission-set-reaches-invited-sign-ups is registered through the changeset's marker.
  • CI: 60 success, 10 expected skip, 0 failed. mergeable_state is clean.
  • The changeset names @objectstack/plugin-auth and @objectstack/spec (both patch). It carries the BREAKING scope, what is unchanged, and what to do.

Against ruling A. The code follows it as ruled.

  • decideAudienceAdmission now reads the module-private isAdmittedByPostureRule (open: every address; email_domain: on the allowlist; invite_only and an invalid audience: none).
    • It reads it after the misconfiguration guard and the social-provider address rule, and before the invitation carve-out.
    • It answers grantPermissionSet: true, so the existing grant path refuses AUTH_CONFIG_ERROR when the set cannot be resolved.
  • isAdmittedByInvitationAlone reads the same classification, so the verdict and the settle agree. This is the card's "two classifications in one request should agree".
    • An invalid audience still returns false first.
  • Unchanged, and pinned by controls:
    • invite_only with a presented invitation;
    • an off-allowlist invited sign-up (account, no grant, unbound while unverified);
    • admin_full_access still refused.
  • Ablations: M1, the old order, turns 9 red; M2, a grant on the invitation-alone branch, turns 36 red. Both are restored byte-identical.
  • self-hosting.mdx: the sentence "admitted by its domain, invitation or not" now holds for the grant and the binding. The new paragraph states the fail-closed refusal for both postures.
  • presented-invitation.test.ts and the dogfood census fixture are rewritten to the ruled behaviour, as the ruling names.

R1 (must fix: the narrowing's battery is not green at any head).

  • The full dogfood battery ran once, at 0ef10daa0b: 2 failed, 4105 passed. Both failures were in the stale fixture this change makes false.
  • At ffffab1779 only that file and its single sibling were rerun (2 files, 15 tests).
  • The ! / (narrowing) arm owes the full battery at the head, no shard and no path, with its counts and verdict pinned in the PR body or a PR comment.
  • This is evidence only, with no push. I will read only that reading.

Next. R1, then ACCEPT. After that the seat runs the contract-tier review (security-touching) and lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Dogfood battery at the final head (area a4-B) · 2026-11-22T07:33Z: answers L1-a REWORK 7075251832 (R1, evidence only). Head unchanged: ffffab17796cbb730feccdd343962ce1f65aedc9 (declaration 7075188247).

  • Full battery, in a detached worktree at ffffab1779 under the verify lock: closure build pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build exit 0, then pnpm --filter @objectstack/dogfood test exit 0 (lock VERDICT command-exit 0).
  • Test Files 484 passed | 3 skipped (487); Tests 4107 passed | 68 skipped (4175). 0 failed.
  • Against the earlier run at 0ef10daa0b (1 file / 2 tests red, signup-organization-census-walled.dogfood.test.ts, the outdated fixture fixed in ffffab1779): the same 487 files and 4175 tests now run with no failure.
  • Tree clean after the run. Nothing pushed; no code changed this round.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5

L1 verdict (L1-a): ACCEPT at head ffffab17796cbb730feccdd343962ce1f65aedc9 (Fixes #34971, ruling A 7063136215). This is a delta read: the head is unchanged since REWORK 7075251832, so I read only the evidence R1 asked for.

席位核对

R1 (full dogfood battery at the head): closed by 7075987084.

  • The run was pnpm --filter @objectstack/dogfood test at ffffab1779, the whole package, with no shard and no path. It ran under the verify lock after the closure build (exit 0). VERDICT: command-exit 0.
  • Test Files: 484 passed, 3 skipped (487). Tests: 4107 passed, 68 skipped (4175). 0 failed.
  • The counts reconcile with the run at 0ef10daa0b (4105 passed + 2 failed = 4107). The same 487 files and 4175 tests now run, and the two tests that were red, in the outdated fixture, are green.
  • l1-face flags dogfood as owed by the ! arm. This comment answers it. pr-state at ffffab1779: 60 success, 10 expected skip, 0 failed, 0 pending, mergeable_state clean.

The full read in 7075251832 stands for everything else: the code, docs, controls and ablations follow ruling A.

Next. The PR goes to seat 7 for the contract-tier review (security-touching, ! narrowing). Then the seat adds the four pieces and it lands by the seat's split.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5pb2t8Z8C64PkPyVt1

Final head for seat 7 L2 · 2026-11-22T07:35Z: ffffab17796cbb730feccdd343962ce1f65aedc9 (declaration 7075188247, battery 7075987084, L1-a ACCEPT 7076000414). Narrowing, security-touching; the seat adds the four pieces after seat 7's record.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract-review-claim: session_01QsR2jTeURPvEm465RcoYEC · head ffffab1 · 2026-11-22T07:49Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: ffffab17796cbb730feccdd343962ce1f65aedc9
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.self-registration-permission-set-reaches-invited-sign-ups.ts + packages/plugins/plugin-auth/src/audience-posture.ts (the admission verdict and the settle classification the entry describes), and, because the PR also declares a narrowing, the pins that hold it: 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.test.ts, packages/qa/dogfood/test/signup-organization-census-walled.dogfood.test.ts. Read, not reviewed (outside the diff): auth-manager-membership-admission.ts, auth-manager.ts (grant staging and settle), boot-sign-in-reachability.ts, packages/spec/src/system/auth-config.zod.ts, packages/spec/src/migrations/types.ts. The changeset and content/docs/deployment/self-hosting.mdx are prose faces, the lane seat's ACCEPT.

Inputs: card #34971 with all twelve comments (ruling A is 7063136215, analysis 7062693710), PR #36312 body and comments, the net diff of 8 files against merge-base a5a5312ff4, and the check-runs on the head. PR author is objectstack-fleet[bot].

① Derived judgments

  • Admission accept set (who may come into existence): no creation is newly admitted. isAdmittedByPostureRule answers true only where the old code already admitted, by the invitation branch or by the open / on-allowlist arm of the switch. Right.
  • Admission accept set, narrowed: an invited self-serve sign-up under open, or on the allowlist under email_domain, now enters the grant path, so an unresolvable declared set refuses it 403 AUTH_CONFIG_ERROR where the invitation admitted it ungranted. This is the narrowing ruling A accepted. Declared Clause-②: no (narrowing), BREAKING, ! title. Right.
  • Grant population, widened: the same two rows now receive the declared selfRegistrationPermissionSet. This is an authorization effect, not a relaxed accept set and not a public surface, so it does not turn the value to yes; it is why the PR carries Security-touching: yes and this tier. Right.
  • Public surface: none. isAdmittedByPostureRule is module-private; the signatures of decideAudienceAdmission and isAdmittedByInvitationAlone and the AudienceAdmission type are unchanged; no error code is added.
  • isAdmittedByInvitationAlone: rewritten onto the shared classification and behaviour-identical to main on every input (invalid, non-self-serve, open, invite_only by proof, email_domain on and off the list). Right.
  • Published spec: one new semantic migration entry under the protocol-18 step; no schema key, accepted value or default moves. Right.
  • Unchanged and pinned by controls: invite_only with a presented invitation (no grant), email_domain off the list (account, no grant, unbound until acceptance, a missing set does not refuse it), the social-provider address rule (still ahead of the posture rule), operator, provider and bootstrap creations.

② Semver level

  • Changeset: patch on @objectstack/plugin-auth and on @objectstack/spec. With Metadata-protocol: none the level is patch, and a non-protocol breaking change ships patch with its BREAKING banner and ADR-0087 disposition (AGENTS.md, Post-Task Checklist 3). The spec bump is owed because the entry ships in the spec dist. Matches what the diff publishes.
  • Metadata-protocol: none holds. The analysis left this to the contract review (none or semantic). The published meaning of the key on main is "the permission set a SELF-REGISTRANT receives ... dangling declaration ⇒ nobody is admitted ungranted" (auth-config.zod.ts); the diff brings the runtime to that sentence for one population and changes nothing an author can write, nor the meaning or default of anything written. The semantic entry is the upgrade notice for the runtime break, not a protocol change.
  • Clause-②: no (narrowing) is the right spelling, on the PR body and the changeset body alike. The dev's deviation note (the analysis suggested yes (narrowing)) is answered: the question the value answers is whether the card relaxes a published accept set or widens the public surface, and it does neither; who receives a grant is not an accept set.
  • ADR-0087: exactly one marker, registered self-registration-permission-set-reaches-invited-sign-ups, matching the entry id; the registration gate is green on the head.
  • Gate verdicts are the head's check-runs: 60 success, 10 skipped (opt-in and conditional jobs), 0 failed, including Check Changeset, Spec property liveness, Governed Surface Queue Guard, Dogfood Regression Gate, Test Core and the type-check jobs.

③ Boundary flags

  • Dev flag, Clause-② spelling: answered in ②.
  • Dev flag, a registered semantic entry instead of the not-required marker fix(plugin-auth)!: a sign-up the email_domain posture admits by an invitation is not bound before its address is verified #34969 and fix(plugin-auth)!: a self-serve social creation is admitted only with a provider-verified address under an address-based posture #35200 used: accepted. An operator can act on this notice (confirm the declared set is the one invited people should hold, keep it resolvable), so an entry is the better disposition, and the claim revision 7074855577 names the path.
  • Dev flag, the dogfood fixture outside the claimed surface: accepted. The battery the ! title owes went red on a fixture ruling A makes false; the fix asserts the ruled behaviour, and the surface revision covers it.
  • Dev flag, first push before overlap-check, and one cli vitest rerun outside the verify lock: process deviations with no effect on the tree at this head; noted for the seat.
  • Dev flag, the boot-sign-in-reachability.ts docblock: see N1 below. Escalated to the seat as a follow-up card, not fixed here.
  • open_questions: the final dev report carries none; the two of the first report were closed by ruling A and by the re-dispatch.
  • Walled tenancy, for the seat to hold with the security label: under group and isolated an invited open sign-up has no membership at creation, so its declared set lands on its first membership, owned by the inviting organization (the dogfood fixture now pins exactly this). The mechanism is unchanged and already applied to a registrant who signed up first and was invited afterwards; ruling A widens who reaches it. The entry's replacement asks the operator to confirm the set is the access an invited person should hold beside the invited role. No finding.
  • SQL push-down: the diff adds no query, no id materialisation and no in-app join; the change is a pure decision function. Nothing to report.

④ Design judgment

18.self-registration-permission-set-reaches-invited-sign-ups.ts, against ruling A, the code it cites and its first consumer (os migrate meta and the upgrade guide):

  • surface names the real key path (system.AuthConfig.audience.selfRegistrationPermissionSet, the root the sibling entry audience-posture-default-invite-only uses) and the exact population.
  • reason holds sentence by sentence against the tree: on main the invitation was read before the posture rule and answered no grant whether or not the set resolved; the settle already classified the sign-up as posture-admitted (isAdmittedByInvitationAlone answered false under open and for an on-list address); the refusal code is AUTH_CONFIG_ERROR with status 403 and no user row (pinned at the end of the chain for both postures and both states); the two invitation-alone admissions ask for no set.
  • replacement is actionable and true: an administrator's creation is the operator class, admitted with no self-registration grant.
  • acceptanceCriteria is a check an operator can run, and holds on single (grant at creation beside the default membership) and behind a wall (grant on the first membership, the one the accepted invitation writes).
  • No relevantWhen: correct. The posture and the set can be stored at runtime through the settings console, so no top-level stack key can prove the surface absent, and the entry must always be listed.
  • No tombstone and no D2 conversion: correct, no key moves.

audience-posture.ts, against the contract:

  • Order in decideAudienceAdmission matches its docblock: class exemptions, bootstrap, vocabulary guard, social-provider address rule, posture rule with the grant, invitation carve-out with no grant, refusal. The posture rule sits after the social rule, so an unverified social creation holding an invitation is still refused.
  • The grant path in validateAudienceAdmission is untouched and already refuses on grantPermissionSet: true with an unresolvable set, so the narrowing is reached by the verdict alone, as the PR states.
  • Tried to break it: an invalid posture (refused before either reader, and isAdmittedByPostureRule answers false on it); an address with no domain under email_domain (off the list, so invitation-alone as before); a creation with no email under open (admitted with the grant flag as on main, nothing staged); provider and operator classes (return before the new branch); a verdict and settle that disagree (both read one function, and the only inputs where they could differ are covered by the on-list and open pins). None breaks.
  • Module doc, the isAdmittedByInvitationAlone doc and the fail-posture paragraph each state the new exception and agree with the code.
  • Pins: the verdict table (six rows), the four end-of-chain refusal rows, the off-list control with a missing set, the grant-beside-membership pins under email_domain and open, and the no-grant controls under invite_only and off the list cover every row of the PR's table. The removed open row of presented-invitation.test.ts pinned the retired branch as an instrument, as the analysis found; dropping it and keeping the off-list row is the ruled rewrite.

No must-fix, no should-fix.

Nits (no effect on correctness or the contract; none is to be fixed in this PR outside the prose faces):

  • N1 (nit): boot-sign-in-reachability.ts, outside the diff, says the invitation branch short-circuits before the posture switch and that the carve-out admits the one invited creation under every posture; its boot message repeats the second claim. At the verdict level both still hold (the pin in boot-sign-in-reachability.test.ts is green), and a configuration error was always outside that sentence (an invalid posture refuses an invited sign-up too). The mechanism sentence is now imprecise, and under open or on-list email_domain with an unresolvable set the named remedy answers AUTH_CONFIG_ERROR, which names its own fix. Follow-up card for the docblock and message; the seat files it.
  • N2 (nit): the entry's leading comment calls this "the change of meaning the plugin-auth admission verdict landed", beside a changeset that says the key keeps its meaning. Read as the verdict's meaning it is accurate; accepted deviation.
  • N3 (nit, prose face): the new self-hosting.mdx sentence "Under open every address is admitted by the posture" omits the exception the changeset states (a social creation with an unverified address while verification is in force). The page links the rule two sentences earlier for email_domain; a half-clause would close it, on the prose face only.

Implemented-by: claude/issue-34971-allowlist-invite-grant
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv

席位核对

Awaiting the maintainer's merge (narrowing) · 2026-11-22T07:57Z · head ffffab17796cbb730feccdd343962ce1f65aedc9

  • Clause-②: no (narrowing) (BREAKING changeset on @objectstack/plugin-auth). A narrowing lands by the maintainer's hand.
  • Records at this head:
  • CI: 60 success and 12 expected skips. Two PR-body checks are re-running after the body edit; read them before merging.
  • Requested reviewers: os-zhuang and hotlong. The PR stays a draft until the maintainer approves; no seat readies it, enqueues it or arms auto-merge before then.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 22, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 22, 2026 08:11
@os-zhuang
os-zhuang enabled auto-merge November 22, 2026 08:11
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 0f29688 Nov 22, 2026
82 of 84 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-34971-allowlist-invite-grant branch November 22, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/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.

An on-allowlist sign-up holding an invitation gets the same self-registration grant as one without (follow-up to #34969)

2 participants