Skip to content

plugin-auth: the remove-sso-user audit row is missing from the route ledger note and the auth docs; ban/unban write no admin audit row #35440

Closed

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

Area: data-1 · follow-up of #34404 (PR #35422, L1-a 7004734980; dev report 7004204444)

维护者速读

  • 问题: 移除待加入人员现在会写审计记录,但接口清单和认证文档还没写这一点;封禁和解封用户也没有单独的管理员审计记录。
  • 要做: 补上文档里的这句;对封禁和解封,要么补审计记录,要么写明为什么不需要。
  • 不做会怎样: 读文档的人不知道这条审计记录的存在;封禁操作在管理员审计里查不到。
  • 你要做的: 无。

What

  1. packages/plugins/plugin-auth/src/auth-route-ledger.ts (the note for POST /api/v1/auth/admin/remove-sso-user) and the content/docs/**/authentication.mdx section on that door don't mention the admin audit row PR fix(plugin-auth): remove-sso-user writes an admin audit row; host-failure texts say the removal is refused #35422 adds (user.admin_removed_pending, action delete, written only on a committed removal).
  2. admin/ban-user and admin/unban-user write no explicit admin audit row. The sibling doors do, through the shared writeAdminAudit (admin-user-endpoints.ts): create-user, set-user-password, add/import/remove SSO user. Decide whether ban/unban should write one too, or record why they are exempt (e.g. if another audit path already covers them; measure it).

Done when

The ledger note and doc name the remove-sso-user audit row. ban/unban either write a row (pinned in the shared harness, with an ablation) or carry a recorded exemption.

Grade: area:data · Docs + Bug · reach: admins reading auth docs / auditing ban actions · evidence: read → p3.

Activity

  1. added
    bug
    pm:queue
    domain:server
    on Nov 19, 2026
  2. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:server · pm:queue; rationale: area:data · Bug · Impeded (a doc omits the new audit row; ban and unban write no admin audit row) · admins, rare → p3 as set; kept open because it has a user effect.

  3. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibyy9KSA69EGZtjDj9c

    Claim: PM loop, area d7-A of seat repo:objectstack#7 (seat post #35557) · p3 close-out · executed by an os-dev subagent of the area d7-A thread · 2026-11-20T04:33Z
    Session: session_01L9qibyy9KSA69EGZtjDj9c
    Account: os-tesla
    Branch: claude/project-thread-aru6wr (this thread can push only its designated branch, a measured platform exception; the dev pushes only after the branch's PR ahead of it, for #34861, has merged)
    Worktree: objectstack-issue-35440
    Domain: domain:server
    Seat: repo:objectstack#7
    Area: d7-A
    File surface: packages/plugins/plugin-auth/src/auth-route-ledger.ts (the remove-sso-user note, and the ban/unban notes if a row is added), content/docs/permissions/authentication.mdx, packages/plugins/plugin-auth/src/admin-ban-endpoints.ts (only if ban/unban write a row through the shared writeAdminAudit), the shared-harness test for those doors, a changeset (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default (no path-derived mandate), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: plugin-auth: the remove-sso-user audit row added by PR #35422 is undocumented in the route ledger and authentication.mdx, and admin/ban-user and admin/unban-user write no admin audit row while their sibling doors do (objectstack) | to measure: whether plugin-audit's mirror rows already record the ban columns' write | platform admins auditing ban actions
    Pre-claim lane: repo:objectstack area d7-A (path root packages/plugins/plugin-auth), domain:server by path
    Pre-claim deps: no Blocked-by:; PR #35422 (#34404) merged; open PR #34738 also edits content/docs/permissions/authentication.mdx, so overlap-check runs against it before the push
    Prior rulings read: check-prior-rulings.mjs --card 35440 --paths packages/plugins/plugin-auth/src/admin-ban-endpoints.ts → 258 word hits; ADR-0069 D5, ADR-0036 §2, ADR-0092 D2, ADR-0093 D2 read for ban audit: 0 bearing (ADR-0092 L65 places ban/unban on dedicated admin endpoints, no audit rule); surface: the maintainer ruling of 2026-08-18 in admin-ban-endpoints.ts (re-implement the vendor's ban handlers; never re-synthesize user.role = 'admin') binds the writes and is not touched; thread: none
    Thread-read: 7005743659
    Premise: holds (origin/main: admin-ban-endpoints.ts has no writeAdminAudit call; the sibling doors call it at admin-user-endpoints.ts and pending-sso-users.ts)
    Serial constraints cleared: PR #35737 (#34861) on this branch goes first; PR #34738 (authentication.mdx) judged by overlap-check at push

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 20, 2026
  5. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibyy9KSA69EGZtjDj9c
    os-dev-report

    {
      "issue": 35440,
      "status": "done",
      "branch": "claude/project-thread-aru6wr",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35758",
      "head": "0f9dc05fa5d43ca924eaa2ffd6a33406235baa87",
      "session": "session_01L9qibyy9KSA69EGZtjDj9c",
      "premise_still_valid": true,
      "summary": "admin/ban-user and admin/unban-user now write the shared writeAdminAudit row on a committed change: action update on the target sys_user, user_id/actor = the admin, metadata {event: user.admin_banned | user.admin_unbanned, hostNotified}. A refused one writes none, and the ban writes are untouched (the 2026-08-18 ruling holds). H1 held. H2 was measured and refuted as an exemption: a spy on engine.update in the shared harness showed that with the admin plugin the ban write carries attributedUserId = admin (mirror row names the admin, but as a plain update diff with no event or hostNotified), and without the admin plugin (engineUserBanWriter) the context is {isSystem, positions:[], permissions:[]} with no attributedUserId, so plugin-audit records the ban as the system. The remove-sso-user ledger note and authentication.mdx now name user.admin_removed_pending; the doc's ban/unban paragraph names the new rows. Deviation: ban/unban have no ledger notes (they are only entries in BETTER_AUTH_MOUNTED_SURFACE), so the rows are named in the admin-ban-endpoints.ts header and the doc instead.",
      "tests": "Head 0f9dc05fa5: pnpm --filter @objectstack/plugin-auth typecheck && test under the lock: VERDICT command-exit 0, check:test-typecheck OK, Test Files 287 passed (287), Tests 6070 passed | 10 skipped (6080). The pre-merge head 64d7c506 read 287/287 files and 6053 passed. New pins are the [#35440] describe in pending-sso-users.test.ts (4 tests: plugin off and on, no-host hostNotified false, CONTROL refused ban 409 + self-ban 400 + refused unban 403 write no row). Ablation on the committed fix 64d7c506: scripts/ablation-replace.mjs --delete of the ban auditBan call, anchor 1->0, blob 6f0477963c20->1fe3fd0e2ff3, then 4 of 4 red. Restore: blob == HEAD 6f0477963c20, git diff HEAD empty. Tests import src, so no dist leg.",
      "gates": "Local, head 0f9dc05fa5: dispatch-gates --commands derived 104 families, and all 104 exited 0, captured per command before any pipe. --ran reconciliation: 104 derived, 104 run, 0 NOT-MEASURED, 0 UNRUN. check-platform-checklist --changed-from origin/main OK (0 anchors lost). check-nul-bytes exit 0. overlap-check --branch=HEAD VERDICT clean (main, #35664 and #34738 merge cleanly). CI on 0f9dc05fa5 at report time: 20 in_progress, 5 skipped, 0 failed. Conclusions not yet in; the PM reads them.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "line_budget": "+95/-5 (net +90, budget ~120): changeset 8, authentication.mdx +9/-3, admin-ban-endpoints.ts +25/-1, admin-user-endpoints.ts +9, auth-route-ledger.ts +1/-1, pending-sso-users.test.ts +43",
      "files_changed": [
        ".changeset/35440-ban-unban-admin-audit-row.md",
        "content/docs/permissions/authentication.mdx",
        "packages/plugins/plugin-auth/src/admin-ban-endpoints.ts",
        "packages/plugins/plugin-auth/src/admin-user-endpoints.ts",
        "packages/plugins/plugin-auth/src/auth-route-ledger.ts",
        "packages/plugins/plugin-auth/src/pending-sso-users.test.ts"
      ],
      "deviations": [
        "ban/unban carry no ledger note to amend (BETTER_AUTH_MOUNTED_SURFACE entries only); their rows are named in the admin-ban-endpoints.ts header and authentication.mdx instead",
        "worktree branch was named issue-35440 locally, as dispatched; pushed to claude/project-thread-aru6wr after the push gate opened (PR #35737 merged, 0 open PRs on the branch at the 05:22Z read), with merge of origin/main (no rebase) and --force-with-lease=claude/project-thread-aru6wr: (branch absent)",
        "measurement used a throwaway spy test, removed by git checkout HEAD before the fix commit"
      ],
      "mcp_calls": "0",
      "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST /issues/35758/assignees [os-tesla]), read-back 6792 bytes identical; post-stamped comment POST /repos/objectstack-ai/objectstack/issues/35440/comments (this report). git push is not counted.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: a · reach: POST /api/v1/auth/admin/ban-user and /admin/unban-user on a kernel without the vendor admin plugin. engineUserBanWriter writes sys_user with context {isSystem:true, positions:[], permissions:[]} and no attributedUserId (measured through the real mount in the pending-sso-users route harness), so plugin-audit's mirror row records the ban columns' change with user_id null (the system) instead of the admin. The explicit admin row added in #35758 now names the admin, but the mirror row still does not. Fix site: user-ban-write.ts engineUserBanWriter (spread authSystemWriteContext()), outside this claim · dedupe words: engineUserBanWriter attributedUserId, ban mirror row system actor, ban audit user_id null, no admin plugin ban attribution"
      ]
    }
  6. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibyy9KSA69EGZtjDj9c

    Claim amendment · #35440 · 2026-11-20T06:02Z

    File surface (amended): adds packages/plugins/plugin-auth/src/user-ban-write.ts (engineUserBanWriter), for one change only: its sys_user write takes the admin's attribution through the existing authSystemWriteContext() seam, as the sibling admin writes do (admin-user-endpoints.ts, admin-set-user-manager.ts). Reason: os-dev-report 7031844902 measured that on a kernel without the vendor admin plugin the ban write runs with no attributedUserId, so plugin-audit's mirror row records a ban as the system, while with the admin plugin the same write names the admin. Same operation, two implementations, the attributed one wins (SKILL.md 〈升级与决策〉 meta-rule ②). It rides PR #35758 as a patch round so the card's "ban actions findable in the admin audit" lands whole. No ban write field changes (the 2026-08-18 ruling stands).

  7. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibyy9KSA69EGZtjDj9c
    os-dev-report

    {
      "issue": 35440,
      "status": "done",
      "branch": "claude/project-thread-aru6wr",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35758",
      "head": "fe109ec6cf2eee4c8d64316174270301ce7d9fc6",
      "round": "patch round 1 (claim amendment 7031864853: adds user-ban-write.ts)",
      "session": "session_01L9qibyy9KSA69EGZtjDj9c",
      "premise_still_valid": true,
      "summary": "Patch round on #35758. engineUserBanWriter (no-vendor-admin-plugin kernels) now builds its sys_user context as { positions: [], permissions: [], ...(await authSystemWriteContext()) }. authSystemWriteContext carries isSystem: true, so authorization is unchanged, and it adds the administrator in scope, so plugin-audit's mirror row names the admin as it already did on the internalAdapter path. Written fields are unchanged (2026-08-18 ruling). The admin-ban-endpoints.ts header sentence that said the engine writer names no administrator is corrected. The changeset gains one sentence. The plugin-auth tenant-audit census shard is regenerated, because the census reads any spread as undecidable elevation, as it reads the sibling seam sites: 42 to 41 elevated, 45 to 46 undecidable. Round 0 is unchanged: ban/unban write the writeAdminAudit row (user.admin_banned / user.admin_unbanned, hostNotified); the remove-sso-user ledger note and the doc name user.admin_removed_pending.",
      "tests": "Head 1ccc2c1b23 (code head; fe109ec6cf adds only the regenerated census): pnpm --filter @objectstack/plugin-auth typecheck && test under the lock: VERDICT command-exit 0, check:test-typecheck OK, Test Files 287 passed (287), Tests 6071 passed | 10 skipped (6081). New pin in the shared harness (pending-sso-users.test.ts, [#35440] describe): with the admin plugin off and on, the ban and unban sys_user ban-column writes reach the engine with isSystem true and attributedUserId = admin. Ablation 2, on committed 1ccc2c1b23: ablation-replace swapped the context back to the bare { isSystem: true, positions: [], permissions: [] }, anchor 1->0, blob 8f671965f6e2->decb3e03c53a, and the pin went red for admin plugin off (attributedUserId missing). Restore: blob == HEAD 8f671965f6e2, git diff HEAD empty. Ablation 1 (round 0, 64d7c506): deleting the auditBan call turned the audit-row describe 4/4 red, restore verified. Tests import src, so no dist leg.",
      "gates": "Local, head fe109ec6cf: dispatch-gates --commands derived 104 families, and all 104 exited 0, captured per command before any pipe; --ran: 104 derived, 104 run, 0 NOT-MEASURED, 0 UNRUN. The first run on 1ccc2c1b23 had check-tenant-audit-census and its --self-test exit 1 (census drift from this change). Fixed by node scripts/tenant-audit-census.mjs --write, both then exit 0. check:skill-examples and check:dual-build-cjs-loads measured (no PREREQUISITE lines). check-platform-checklist --changed-from origin/main OK. overlap-check --branch=HEAD: VERDICT overlap exit 1. main and #35664 merge cleanly. #34738 (open draft) conflicts only in the generated docs/audits/2026-08-tenant-audit-write-call-sites.counts/plugins/plugin-auth.md; whichever lands second reruns tenant-audit-census --write. Nothing was reordered. CI on fe109ec6cf at report time: 20 queued, 5 skipped. The PM reads the conclusions.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "line_budget": "+127/-10 (net +117, budget ~120): changeset 8, authentication.mdx +9/-3, census shard +3/-3, admin-ban-endpoints.ts +25/-1, admin-user-endpoints.ts +9, auth-route-ledger.ts +1/-1, pending-sso-users.test.ts +63, user-ban-write.ts +9/-2",
      "files_changed": [
        ".changeset/35440-ban-unban-admin-audit-row.md",
        "content/docs/permissions/authentication.mdx",
        "docs/audits/2026-08-tenant-audit-write-call-sites.counts/plugins/plugin-auth.md",
        "packages/plugins/plugin-auth/src/admin-ban-endpoints.ts",
        "packages/plugins/plugin-auth/src/admin-user-endpoints.ts",
        "packages/plugins/plugin-auth/src/auth-route-ledger.ts",
        "packages/plugins/plugin-auth/src/pending-sso-users.test.ts",
        "packages/plugins/plugin-auth/src/user-ban-write.ts"
      ],
      "deviations": [
        "PR body not patched: os-dev.md lets the subagent write the PR body only at pr_create (no PATCH; the seat writes it). The replacement body is at /tmp/claude-0/-home-user/f9721a29-b017-538b-822a-e09d4f49d7b1/scratchpad/issue-35440/pr-body-r2.md (8729 bytes); it adds the attribution change, the census regeneration, ablation 2, the #34738 census overlap, and the fe109ec6cf readings",
        "census shard docs/audits/.../plugin-auth.md regenerated, outside the amended file surface. It is a derived artefact the census gate requires for the user-ban-write.ts change. A spread-then-literal isSystem spelling was tried to keep the site decidable and still drifted (the census treats any spread as undecidable), so it was reverted",
        "ban/unban carry no ledger note to amend (round 0, unchanged)",
        "worktree recreated as local branch issue-35440-r2 from origin/claude/project-thread-aru6wr at 0f9dc05fa5; pushed fast-forward 0f9dc05fa5..fe109ec6cf, no force, no merge of main (origin/main is 10 commits ahead; overlap-check says it merges cleanly)"
      ],
      "mcp_calls": "0",
      "api_writes": "1 this round — post-stamped comment POST /repos/objectstack-ai/objectstack/issues/35440/comments (this report). Round 0 total was 2 (relay pr_create with its assignees leg, and report comment 7031844902). git push is not counted.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · the round-0 finding (engineUserBanWriter attribution) is now fixed in this PR under the claim amendment; nothing else new"
      ]
    }
  8. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibyy9KSA69EGZtjDj9c

    Close-out · 2026-11-20T07:57Z: delivered whole by PR #35758 (merged 2026-11-20T07:57Z; L1 ACCEPT 7033421723). Banning or unbanning a user now writes an admin audit row naming the administrator (none when the ban is refused), the ban write's own audit trail names the administrator on kernels without the vendor admin plugin too, and the route ledger and authentication docs name the remove-sso-user audit row. Nothing remains on this card. Note for draft PR #34738: it now conflicts only in the generated tenant-audit census shard and reruns node scripts/tenant-audit-census.mjs --write when it lands. pm:dispatched removed now that the card is closed.

  9. removed
    pm:dispatched
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:databugdomain:serverpriority:p3

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions