Skip to content

fix(plugin-auth): remove-sso-user writes an admin audit row; host-failure texts say the removal is refused - #35422

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34404-remove-sso-user-followups
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-34404-remove-sso-user-followups

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

Fixes #34404

Clause-②: no
Metadata-protocol: none

维护者速读

  1. 用户能看到什么变化:管理员在托管环境里删掉一位还没登录过的待加入人员后,审计日志里会多出一条“谁删了谁”的记录;云端联系不上时删除照旧被拒,服务端日志与开发文档也改成如实说“删除被拒绝”。
  2. 为什么做:上一轮“删除待加入人员”功能评审遗留的两项问题,删除操作此前不留管理员审计记录,而日志与文档写着“删除照常进行”。
  3. 出错会怎样:最坏是审计记录写不进去,删除本身仍然成功并在日志里报警;回退本改动即可恢复原状。
  4. 要你做什么:无,席位落地。

席位核对

What changes

  • packages/plugins/plugin-auth/src/environment-user-host.ts: the goesAhead('removed') log sentence said "The removal goes ahead." although runRemoveSsoUser answers 503 SERVICE_UNAVAILABLE on host_failed (both the member-throw and the accessor-throw paths). It now says "The removal is refused: the door keeps no record to ask the host again from." The file header and the EnvironmentUserHost docblock now list a removal with a deactivation as refused on a host failure. The added / deactivated / reactivated sentences are unchanged (A1: only removed was false).
  • packages/plugins/plugin-auth/src/auth-plugin.ts: the environmentUserHost option docblock, same correction.
  • packages/plugins/plugin-auth/src/pending-sso-users.ts: a removal that committed calls the shared writeAdminAudit with action: 'delete', recordId the removed user, and metadata { event: 'user.admin_removed_pending', hostNotified }. Every refusal path returns before it, so a refused removal writes nothing.
  • packages/plugins/plugin-auth/src/admin-user-endpoints.ts: writeAdminAudit's action admits 'delete' (a declared sys_audit_log.action option), and AdminAuditDecisions gains the user.admin_removed_pending variant. Neither symbol is exported from the package entry.
  • .changeset/34404-remove-sso-user-audit-row.md: @objectstack/plugin-auth patch.

The door's behaviour is unchanged apart from the new audit row.

Tests

Head 19f393f361 (round 2, per L1-a ACCEPT 7004734980). The pins live in the component's shared harness, pending-sso-users.test.ts, as one top-level describe('[#34404] admin/remove-sso-user writes an admin audit row for a removal that committed') on its stage() / managedStage(). Each case adds the person through the real admin/add-sso-user route and removes them through the real admin/remove-sso-user route:

  • A committed removal writes exactly one delete row, both with and without a host.
  • CONTROLS: an unreachable host (503, the person is kept), a typed host refusal, and a not-pending person (409) write zero rows.

The round-1 file remove-sso-user-audit-row-34404.test.ts is deleted.

Readings
  • Targeted run on pending-sso-users.test.ts + pending-sso-seams.test.ts + admin-user-endpoints.test.ts: Test Files 3 passed (3), Tests 219 passed (219); lock VERDICT command-exit 0.
  • Ablation at 19f393f361: the writeAdminAudit call guarded never to run (blob 13f9a76b → 844dc222) gives 2 failed / 2 passed. The two row pins go red and the two CONTROLs stay green. Restored: blob == HEAD.
  • pnpm --filter @objectstack/plugin-auth typecheck: exit 0.

Acceptance notes

Verification

dispatch-gates.mjs --commands at 19f393f361 gives 77 families: 76 exit 0, and 1 NOT MEASURED (check:dual-build-cjs-loads, which needs a full build; CI runs it). overlap-check.mjs --branch=HEAD: clean.


Generated by Claude Code

…is refused; a committed removal writes an admin audit row

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
@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

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

What this run could not see
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 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 a5ddeb6ead111f4d1a7373e05cf5ddcbab2b86a8 → packageMentionDocs.

Which tree this was computed on

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

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

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 用户能看到什么变化:管理员移除一个还没登录过的待加入人员时,审计日志里现在会留下一条记录,写明是谁移除了谁。另外三处说明文字改正为:外部系统联系不上时,移除会被拒绝。实际行为一直如此。
  • 为什么做:这是上一张卡合入时遗留的待办,复核记录要求补齐。
  • 出错会怎样:最坏是多写或少写一条审计记录。审计写入失败不会影响移除本身。撤回即可。
  • 要你做什么:无。

席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head 463fa17bc0 · 2026-11-19T09:09Z

  • Shape: 6 files, +163/−10, all in plugin-auth, plus one changeset. Not governed. K = 10 since base 35c63310, and it merges cleanly into current main. The body says Part of #34404, which is right while item 3 was the area's. data-1 closes the card at close-out.

  • Fixes vs card (plugin-auth: review follow-ups of PR #34162 — host-failure docs say removal proceeds, remove-sso-user writes no audit row #34404, three owed items):

    1. S1 texts. The environment-user-host.ts header and the EnvironmentUserHost docblock, the goesAhead('removed') warn line, and the auth-plugin.ts environmentUserHost option docblock now all say a host failure refuses a removal (503). That matches runRemoveSsoUser, whose docblock already said so. No code path changes.
    2. Audit row. After the delete commits, runRemoveSsoUser calls the shared writeAdminAudit, which was already imported there for the add door. The call passes action: 'delete', the actor, recordId set to the removed user, and metadata { event: 'user.admin_removed_pending', hostNotified }. Every refusal returns before the call.
    3. Setup → Users on a managed environment: add-person and CSV-import UI with per-row invitation status (reverses objectui#13330 for adding) #33187 comment is posted as 7004259178 (area).
  • Changeset (read sentence by sentence): plugin-auth patch, Clause-②: no, Metadata-protocol: none. It matches the code: the row on commit only, no row on any refusal or without plugin-audit, and unchanged door behaviour.

  • Gates: CI on 463fa17b is 37 success and 16 skipped, with 0 failed and 0 pending. Locally 75 of 77 passed. 2 are NOT MEASURED (check:dual-build-cjs-loads and check:type-check-debt, both exit 3 on build prerequisites), and CI covers both.

  • Pins: 2 row pins and 2 CONTROLs. The ablation (the call guarded never to run) turns both row pins red while the CONTROLs stay green.

  • ⚠ Required before landing: move the pin into the shared harness (AGENTS.md, ruling record 6583487846).

    • The new file remove-sso-user-audit-row-34404.test.ts builds its own stage and imports createMemoryEngine from another test file. pending-sso-users.test.ts is the component's shared harness: it has stage() around line 241 and already carries the [#33228] admin/remove-sso-user … describes.
    • Move the four cases there as one top-level describe('[#34404] …') on its stage(), which also drives them through the real route, and delete the new file.
    • The four cases must stay green, and the same ablation must still turn both row pins red.
    • That push needs no fresh L1. data-1 confirms it in the landing note.
  • Out of scope, needs a card. data-1 files one p3 card nested under plugin-auth: review follow-ups of PR #34162 — host-failure docs say removal proceeds, remove-sso-user writes no audit row #34404 for:

    • the auth-route-ledger.ts note and the authentication.mdx section, which do not mention the new audit row;
    • admin/ban-user and admin/unban-user, which write no explicit admin audit row. The card should ask whether they should, or record why they are exempt.

    These can instead ride the harness-move push if data-1 prefers, in which case the docs lines are welcome there.

  • Landing clause: not governed, so data-1 lands it after the harness move. K < 15, so no main merge is required. A new push needs a fresh L1 only if it changes more than a main merge, the test move above, or the two docs lines.

…ng-sso-users shared harness

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

Landing · area data-1 · 2026-11-19T10:16Z

reading value
L1-a ACCEPT 7004734980 at 463fa17bc0, with one requirement: move the pins into the shared harness
Requirement met head 19f393f361 (round 2, addendum 7005678197). The four cases now sit in pending-sso-users.test.ts as one [#34404] describe on its stage(), through the real routes. The separate test file is deleted, and the same ablation turns both row pins red. Per the ACCEPT's landing clause, this push needs no fresh L1.
check-governed-merges --pr 35422 NOT governed; K = 10 (< 15)
CI complete on 19f393f361, 0 failed

State: draft → ready + auto-merge (merge queue). The PR body now says Fixes #34404: item 3, the #33187 comment, was posted as 7004259178. Follow-up #35440 (p3) is nested under #34404.

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.

plugin-auth: review follow-ups of PR #34162 — host-failure docs say removal proceeds, remove-sso-user writes no audit row

2 participants