Skip to content

feat(platform-objects): Setup → Users can remove a pending person on a managed environment - #35487

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-35220-remove-pending-sso-user-action
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-35220-remove-pending-sso-user-action

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #35220

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:托管环境里,平台管理员在 Setup → Users 中对"尚未首次登录"的人员行,可以点"移除待登录用户",确认后该行被删除,其邀请随之取消。
  • 为什么做:管理员填错邮箱或加错人后,此前没有任何按钮能把这条待登录记录撤回,陌生人手里的邀请会一直有效。
  • 出错会怎样:按钮只在"托管环境 + 平台管理员 + 待登录行"三者同时成立时出现;服务端本身仍逐条把关,对方已登录或托管组织联系不上时不会删除任何人,回滚即撤下这个按钮。
  • 要你做什么:无,席位落地。

What changes

  • sys_user gains the row action remove_sso_user (label "Remove Pending User", Users list row + record header). It posts the row id as userId to plugin-auth's existing /api/v1/auth/admin/remove-sso-user, behind a confirmText confirmation (no params, so the question rides confirmText, the impersonate_user precedent).
  • Visibility: the Add / Import standing and managed flag (current_user.isPlatformAdmin == true && has(features.cloudManaged) && features.cloudManaged == true), then has(record.source) && record.source == 'idp_pending', the field the door itself checks (isPendingSsoSource(target.source)).
  • The confirmation promises no more than the door does: it says no one is removed if the person has signed in meanwhile or the hosting organization cannot be reached (the door's 409 and 503).
  • Labels through the regenerated translation bundles (node scripts/check-i18n-bundles.mjs --write), hand-translated for zh-CN, ja-JP and es-ES; the other seven locales carry the source copy with its source hash, as Add / Import do.
  • The server door is unchanged.

Tests

  • New packages/platform-objects/src/identity/remove-pending-sso-user-visibility.test.ts: the predicate evaluated through @objectstack/formula. Offered on pending + managed + platform admin; CONTROLs hidden on an idp_provisioned row, an env_native row, a row with no source, flag off, no flag served, and an org owner below the rung. Also pins the target, recordIdParam: 'userId', no params, no requiresFeature.
  • pnpm --filter @objectstack/platform-objects exec vitest run: Test Files 124 passed (124), Tests 2061 passed (2061). pnpm --filter @objectstack/platform-objects typecheck: exit 0.

Acceptance notes

  • The live drive "dialog posts to the door and the row is gone" sits beside the door's own tests in plugin-auth pending-sso-users.test.ts (the [#33186] block drives Add / Import declared actions); that file is outside this claim's surface, so no live-drive pin for remove_sso_user was added there. The door's removal and invitation cancellation are already pinned by its own suites.

席位核对

  • Deviation (approved by the seat before widening): packages/platform-objects/src/feature-gate-guard.test.ts gains one row, ['sys_user.actions.remove_sso_user', 'cloudManaged'] in SHOWN_WHEN_ON. The guard's reverse walk books every features.* reference in an action predicate, so without it the guard goes red.
  • A1: at origin/main no sys_user action targets remove-sso-user (grep: only plugin-auth tests and dogfood route rosters name it), and userActions opens edit only, so the standard delete is off. The gap holds.
  • A2: siblings use MANAGED_ADD_PERSON_VISIBLE; pending is record.source == 'idp_pending', the value the door checks.
  • A3: no forward or allow entry. buildApiActionRequest is generic and stamps organizationId, which the door's unknownBodyKeys admits. The standing census in platform-admin-affordance-standing.test.ts is a floor that picks the action up by its target; it passes unchanged. platform-objects.test.ts rows are not exhaustive for SysUser; unchanged.
  • A4: body { userId } (closed key set plus stamped organizationId); refusals 409 (not pending / not managed), 503 (host unreachable), 404, 400. The confirmation names only the 409 and 503 cases.
Ablation (one-shot, restored, blob checked against HEAD)
  • Dropped the pending term (node scripts/ablation-replace.mjs, anchor 1 to 0): 3 failed, 5 passed; the three non-pending CONTROLs went red. Restored: blob == HEAD, git diff HEAD empty.
  • Replaced the standing and managed terms with true: the flag-off, no-flag and org-owner CONTROLs went red. Restored the same way.
  • The first pending-term attempt used a replacement that already occurred 684 times, so the tool refused it as unverifiable and restored. That run was a no-op. It was redone with a distinct marker.
  • The suite imports ./sys-user.object.js from source, so no dist/ leg applies.
Derived gates (dispatch-gates --commands, exit codes captured before any pipe)
  • 65 of 66 derived families ran, each exit 0 (including check:i18n "platform-objects in sync (32 bundle(s))", check:i18n-stale-fill, check:nul-bytes, check:cross-package-test-inputs, check:type-check-coverage, the changeset families).
  • NOT MEASURED: check:dual-build-cjs-loads, reason: PREREQUISITE NOT MET (exit 3). It needs a whole-workspace pnpm build and this container has partial dist/. Left to CI as a declared narrowing.
  • test:repo not run locally: no file of that project changed. CI's Test Core covers it.

Generated by Claude Code

@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 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/platform-objects, touching 14 documentable anchor(s).

32 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 6f36818f032edd8d9cff7aaf65f762374b62e070.

⛔ 8 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 anchor(s) matched too much of the corpus to be a work list: sys_user (symbol, 56 pages)
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • 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 — 3 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 6f36818f032edd8d9cff7aaf65f762374b62e070 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 6f36818f032edd8d9cff7aaf65f762374b62e070

⚠️ 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 6f36818f032edd8d9cff7aaf65f762374b62e070 → 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#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 用户能看到什么变化:在托管环境的"设置 → 用户"里,平台管理员可以把一个还没登录过的人移除,同时取消对方的邀请;列表行和用户详情页顶部各多一个按钮。
  • 为什么做:以前加错人(比如邮箱打错)后,界面上没有办法撤回。
  • 出错会怎样:按钮只对"尚未登录"的人显示,点击前会再确认;如果对方已经登录或托管方联系不上,系统不会移除任何人。
  • 要你做什么:无。区域自行落地。

席位核对

L1-a: ACCEPT · head e6380b4f1cc008824fd5a7b90affd0d6f2f20a76 · Fixes #35220 · 2026-11-19T12:07Z

Readings: K=14 (under 15, no main merge owed); check-governed-merges --pr 35487 not governed; merge-tree against main clean; CI 37 success / 16 skipped / 0 failed. The PR is a draft, so mark it ready before queueing.

Code (22 files, +210/−0; 76 lines are generated translation bundles).

  • sys_user gains remove_sso_user, an api action on list_item + record_header. It targets /api/v1/auth/admin/remove-sso-user with recordIdParam: 'userId', PLATFORM_ADMIN_USERS_GATE, confirmText, variant: 'danger' and refreshAfter. It has the same declarative shape as ban_user / unban_user / impersonate_user on the same two locations.
  • Visibility is MANAGED_ADD_PERSON_VISIBLE plus has(record.source) && record.source == 'idp_pending', the same standing and flag as Add / Import, and the value the door checks (isPendingSsoSource). has() keeps it hidden where source is not projected.
  • The door (auth-plugin.ts:5281; ledger auth-route-ledger.ts:265) is unchanged. The confirm text names only the outcomes the ledger records: 409 when the person signed in meanwhile, and 503 when the host cannot be reached, where no one is removed.
  • feature-gate-guard.test.ts gains one SHOWN_WHEN_ON row, cloudManaged, beside its two siblings, as the guard requires.

Pins. remove-pending-sso-user-visibility.test.ts: shown for pending + managed + platform admin. CONTROLs: hidden for idp_provisioned, env_native, no source, flag off, no flag, and an org owner who is not a platform admin. Two ablations were red and restored. check:i18n is in sync.

The judgment asked: no R item. The card's outcome ("deletes the row and cancels the invitation") is the door's contract, pinned on the door's own suites (#34404 / #34162). This PR adds no runtime code between the button and the door. The action is declarative, and its request is built by the generic api-action path: the recordIdParam seeding in useConsoleActionRuntime.tsx and the record_header page-record fallback in RecordDetailView.tsx. That path already serves the three sibling actions above. What is new here is who sees the button, and that is what the visibility pins cover. A live drive from the button to the door would repeat the door suites through a generic path. It is a good dogfood item for the next managed-environment pass, not a landing condition.

Declaration: agreed. Clause-②: no / Metadata-protocol: none / @objectstack/platform-objects patch. One platform-owned action is added, and no authorable key or value moves.

Routing. Not governed, no contract face: data-1 lands it. A new push needs a fresh L1 only if it changes more than a main merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

Landing · area data-1 · 2026-11-19T12:07Z

reading value
L1-a ACCEPT 7008624913 at e6380b4f1c (no R items; the action-to-door live drive is a dogfood item, not a landing condition)
Head e6380b4f1c, K=14 against main, merge-tree clean, CI green on this head
check-governed-merges --pr 35487 NOT governed; 210 changed lines; no contract face
Declaration Clause-②: no / Metadata-protocol: none / @objectstack/platform-objects patch (agreed by L1-a)
Widening +1 SHOWN_WHEN_ON row in feature-gate-guard.test.ts, approved by the area before the push

State: draft → ready + auto-merge (merge queue). #35220 closes on merge via Fixes.

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.

Setup → Users on a managed environment: an admin can remove a pending person from the list, and the removal cancels their invitation

2 participants