Skip to content

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

Closed
1 of 1 issue completed

Description

@objectstack-fleet

repo:objectstack#1 · os-project-manager · session_01FEkQ5pmEYLVFDcQ1Z1CS8H

Problem

PR #34162 (merged as 329f2f7, card #33228) landed while its contract-review record still had an open should-fix: review#2 PASS 6915354714, S1. The record also escalated two items to the dispatching seat. That seat (server#7) is now off duty, so the follow-ups are carried here.

Owed

  1. S1: docs and logs contradict the door. When the host fails, the removal door refuses with 503. Three places on main still say the removal goes ahead:
    • the EnvironmentUserHost docblock in environment-user-host.ts;
    • the goesAhead('removed') log line in environment-user-host.ts;
    • the environmentUserHost option docblock in auth-plugin.ts.
      Fix all three to say the removal is refused. Code behaviour is unchanged.
  2. No admin audit row. POST /admin/remove-sso-user removes a pending person without writing an admin audit row. Three dev reports recorded this as "noted, not filed". Add the audit row the other admin user doors write, or record why this door is exempt.
  3. The comment promised on Setup → Users on a managed environment: add-person and CSV-import UI with per-row invitation status (reverses objectui#13330 for adding) #33187. Ruling A promised a comment on Setup → Users on a managed environment: add-person and CSV-import UI with per-row invitation status (reverses objectui#13330 for adding) #33187 that has not been posted. Post it, citing feat(plugin-auth): remove a pending person and retry every environment-user host call from a durable outbox #34162 as the delivery.

Acceptance

Clause-②: no. Metadata-protocol: none.

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

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

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: regrade p2 → p3 (maintainer) · 2026-11-16T16:28Z

    ⛔ Not a claim.

    Backlog re-grade (p2 batch 3): the maintainer set p3 for the #34162 review follow-ups: host-failure doc wording, and no audit row on remove-sso-user.

  3. added and removed
    priority:p2
    on Nov 16, 2026
  4. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbabAdcWyApSTGBYJNY

    Ruling-ref: maintainer 14:43Z 「立一张专题卡,开始执行」 and 15:56Z 「domain 和优先级 不是已经定了吗?为什么现在不能改卡」 · regrade v3 under epic #35205

    Grade: p2 (was p3) · area:data · Bug · audit gap · remove-sso-user writes no audit row (type moves Task → Bug once issue types can be set)

  5. added
    priority:p2
    and removed on Nov 18, 2026
  6. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

    Claim: PM loop round 5 · area data-1 (the maintainer, verbatim, 2026-11-19T04:35Z project chat: 「再开 area:data」; standing 「暂时都只派 p1 p2 的卡」) · 2026-11-19T07:44Z
    Area: data-1
    Session: session_01Utp6Ca1jJvsA1dHsPwMiQb
    Account: os-bill
    Branch: claude/issue-34404-remove-sso-user-followups
    Worktree: objectstack-issue-34404 (os-dev worktree in the data-1 container)
    Domain: domain:server
    Seat: repo:objectstack#5
    File surface: packages/plugins/plugin-auth/src/environment-user-host.ts (the EnvironmentUserHost docblock ~:96 and goesAhead('removed') ~:272-279), packages/plugins/plugin-auth/src/auth-plugin.ts (the environmentUserHost option docblock ~:394; the admin/remove-sso-user route ~:5281 only if the audit row is written there), packages/plugins/plugin-auth/src/pending-sso-users.ts (the remove path) and, if the shared writer lives there, admin-user-endpoints.ts; new test file named for this card; root .changeset/. Item 3 (the comment promised on #33187) is posted by the area, not the dev. Stop on breach and report.
    Container & model: S, mode:subagent, model: default — no path-derived mandate, effort: medium
    Clause-②: no (card line; measure on the diff)
    Metadata-protocol: none
    Responsibility: platform — three plugin-auth texts say a removal goes ahead after a host failure while the door refuses with 503 (environment-user-host.ts:278 "The removal goes ahead."), and POST /admin/remove-sso-user removes a pending person without the admin audit row the other admin user doors write; every admin removing a pending person on a managed environment.
    Thread-read: 6984575650
    Premise: holds — on origin/main 35c63310: goesAhead (environment-user-host.ts:272-279) answers "The removal goes ahead." for removed; the docblocks at environment-user-host.ts:96 and auth-plugin.ts:394 describe the same; the dev measures whether remove-sso-user writes any admin audit row and which writer the sibling doors use.
    Serial constraints cleared: none — overlap-check.mjs on a probe branch touching the three plugin-auth files: base merges cleanly, 0 open PR heads share them.
    Pre-claim lane: domain:server (packages/plugins/plugin-auth/**)
    Pre-claim deps: PR #34162 merged; no Blocked-by. #35220 (same door, UI action) follows this card.
    Prior rulings read: contract review#2 PASS 6915354714 S1 on PR #34162 (the doc fix); ruling A on #33187 (the promised comment); check-prior-rulings 121 hits — ADR-0033 §8/§10, ADR-0045 §3, ADR-0073 D3, ADR-0090 D10, ADR-0091 D4/D7, ADR-0092 D2, ADR-0146 D1 (dev reads ADR-0091 if it rules admin audit rows); thread: none

  7. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 19, 2026
  8. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
    os-dev-report

    {
      "issue": 34404,
      "status": "done",
      "branch": "claude/issue-34404-remove-sso-user-followups",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35422",
      "head": "463fa17bc0",
      "session": "session_01Utp6Ca1jJvsA1dHsPwMiQb",
      "premise_still_valid": true,
      "summary": "Items 1 and 2 of the card. The three host-failure texts (environment-user-host.ts header + EnvironmentUserHost docblock, the goesAhead('removed') warn sentence, the auth-plugin.ts environmentUserHost option docblock) now say a removal is refused (503) on a host failure; door behaviour unchanged. A removal that commits now writes one sys_audit_log row through the shared writeAdminAudit (action 'delete', record_id the removed user, metadata {event:'user.admin_removed_pending', hostNotified}); every refusal returns before it. Item 3 (the #33187 comment) is the area's, so the PR body says Part of, not Fixes.",
      "A1": "holds: goesAhead('removed') answered 'The removal goes ahead.' while runRemoveSsoUser returns 503 SERVICE_UNAVAILABLE on host_failed from both the member throw and the accessor throw. 'deactivated' already said refused; 'reactivated' falls to 'The change goes ahead.', true (unban never blocks); 'added' says the addition stands, true. Only the 'removed' sentence changed.",
      "A2": "holds, with a refinement: the false sentence sat in the EnvironmentUserHost docblock (~:69-75, 'reported on the answer for an add, a reactivation or a removal') and the auth-plugin.ts option docblock (~:394-399); the file header (~:22-28) omitted removal from the refused cases and was corrected too. The accessor docblock (~:94-97, 'a deactivation then goes ahead' with no host wired) is true and left alone.",
      "A3": "holds: the shared writer is writeAdminAudit in admin-user-endpoints.ts:618; callers admin/create-user (event user.admin_created, action create), admin/set-user-password (user.admin_password_set, action update), add/import-sso-user (pending-sso-users.ts:472, user.admin_added_pending, action create). runRemoveSsoUser wrote none. ban/unban write none either (noted only). New event: user.admin_removed_pending, action delete (a declared sys_audit_log.action option).",
      "tests": "463fa17bc0 tree (test + fix at 9f80b17d49, changeset-only commit after). vitest on remove-sso-user-audit-row-34404.test.ts + pending-sso-users.test.ts + pending-sso-seams.test.ts + admin-user-endpoints.test.ts: Test Files 4 passed (4), Tests 219 passed (219), lock VERDICT command-exit 0. Ablation on the committed fix via ablation-replace.mjs (the writeAdminAudit call guarded never to run): anchor 1 -> 0, blob 13f9a76b -> 844dc222, Tests 2 failed | 2 passed (both row pins red, both controls green as designed), restored blob == HEAD 13f9a76b, git diff HEAD empty. Test imports source (relative), not dist. First ablation attempt was a no-op (replacement contained the anchor; the tool refused before running) and was redone with a different anchor. pnpm --filter @objectstack/plugin-auth typecheck: exit 0 after building plugin-auth (first run exit 2: examples tsconfig needs the package's own dist).",
      "gates": "dispatch-gates --commands at 463fa17bc0: 77 families; 75 exit 0; NOT MEASURED check:dual-build-cjs-loads (exit 3 PREREQUISITE NOT MET, needs full build) and check:type-check-debt (exit 3, closure build queue-timeout 99 on the shared lock). --ran with exit codes: '77 derived famil(ies) accounted for, 75 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)'. overlap-check --branch=HEAD: VERDICT clean exit 0. check-platform-checklist n/a (no export renamed or removed). PR check-runs at 463fa17bc0 when reported: in_progress/queued (Check Changeset, Lint families, Type Check families, PR-body guards); not awaited, per os-dev.",
      "dogfood_battery": "n/a: no ! in the PR title and no (narrowing) arm",
      "line_budget": "n/a: no skills/** or ledgered file touched; diff 6 files, +163 / -10 (test file 122 lines)",
      "files_changed": [
        ".changeset/34404-remove-sso-user-audit-row.md",
        "packages/plugins/plugin-auth/src/admin-user-endpoints.ts",
        "packages/plugins/plugin-auth/src/auth-plugin.ts",
        "packages/plugins/plugin-auth/src/environment-user-host.ts",
        "packages/plugins/plugin-auth/src/pending-sso-users.ts",
        "packages/plugins/plugin-auth/src/remove-sso-user-audit-row-34404.test.ts"
      ],
      "deviations": [
        "PR body: the dispatch order's four-line maintainer brief (seat-practice section 1) replaces os-dev.md's six-line one; the order wins on this card, conflict named here.",
        "PR body first line is Part of #34404, not Fixes: item 3 (the #33187 comment) is the area's and was not visibly posted at report time; the card should close after it.",
        "First push was refused by check:commit-card-trailers (model name in the co-author trailer); amended to the model-free pair before anything was published.",
        "test:repo not run locally (no repo-project test touched); CI Test Core owns it."
      ],
      "mcp_calls": "0",
      "api_writes": "2 relay strokes: pr_create (POST /repos/objectstack-ai/objectstack/pulls + assignees os-bill, read back identical 5629 bytes) and this os-dev-report comment (POST /repos/objectstack-ai/objectstack/issues/34404/comments)",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed · the auth-route-ledger.ts note for POST /api/v1/auth/admin/remove-sso-user and the authentication.mdx section do not mention the new audit row (outside the claim's file surface)",
        "carrier: none · noted, not filed · admin/ban-user and admin/unban-user write no explicit admin audit row (observation, no contract cited)"
      ]
    }

    Generated by Claude Code

  9. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
    os-dev-report

    Addendum, round 2 (L1-a ACCEPT 7004734980 requirement: shared harness).

    {
      "issue": 34404,
      "round": 2,
      "status": "done",
      "branch": "claude/issue-34404-remove-sso-user-followups",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35422",
      "head": "19f393f361",
      "previous_head": "463fa17bc0",
      "session": "session_01Utp6Ca1jJvsA1dHsPwMiQb",
      "summary": "Round 2, per L1-a ACCEPT 7004734980 (shared-harness rule). The four cases now sit in 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'), built on the file's stage()/managedStage() with the existing removingHost/addPending/verdict helpers, so each case adds the person through the real add-sso-user route and removes them through the real remove-sso-user route. remove-sso-user-audit-row-34404.test.ts is deleted. Production code is untouched: pending-sso-users.ts blob is 13f9a76b, the same as at 463fa17bc0. One small helper, removalAuditRows (rows with action 'delete'), was added because the add route now writes its own 'create' row.",
      "files_changed_this_round": [
        "packages/plugins/plugin-auth/src/pending-sso-users.test.ts (+76)",
        "packages/plugins/plugin-auth/src/remove-sso-user-audit-row-34404.test.ts (deleted, -122)"
      ],
      "tests": "Closure built with pnpm --filter '@objectstack/plugin-auth...' build, then vitest 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. Same count as round 1, since the four cases moved files.",
      "ablation": "On committed head 19f393f361, with ablation-replace.mjs and the same mutation (the writeAdminAudit call guarded never to run): anchor 1 -> 0, blob 13f9a76b -> 844dc222. vitest -t 34404 --reporter=verbose: x 'a removal the host took writes one delete row…', x 'a removal with no host wired writes the row with hostNotified false', ok 'CONTROL: a host that cannot be reached refuses the removal with 503…', ok 'CONTROL: a host refusal and a person who is not pending write no row'. Tests 2 failed | 2 passed | 91 skipped (95). Restored: blob == HEAD 13f9a76b, git diff HEAD empty. The test imports source, not dist.",
      "gates": "pnpm --filter @objectstack/plugin-auth typecheck: exit 0 (check:test-typecheck OK, 10 files / 71 errors / 23 pinned signatures held). dispatch-gates --commands at 19f393f361: 77 families, 76 exit 0, 1 NOT MEASURED: check:dual-build-cjs-loads, exit 3 PREREQUISITE NOT MET (needs a full build; CI runs it). check:type-check-debt now measured: exit 0. --ran reconciliation with exit codes: '77 derived famil(ies) accounted for, 76 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)'. overlap-check --branch=HEAD against origin/main ee40658d0d: VERDICT clean exit 0. Push hook check:commit-card-trailers: ok (model-free pair). PR check-runs at 19f393f361 were just triggered and not awaited.",
      "deviations": [
        "The PR body's Tests section still names remove-sso-user-audit-row-34404.test.ts, which is now deleted. Under os-dev, a subagent writes the PR body only at pr_create, so the seat should PATCH that line to name the [#34404] describe in pending-sso-users.test.ts. Nothing else in the body changed.",
        "Worktree recreated from origin/claude/issue-34404-remove-sso-user-followups at 463fa17bc0, as ordered."
      ],
      "mcp_calls": "0",
      "api_writes": "1 relay write this round: this os-dev-report addendum comment (POST /repos/objectstack-ai/objectstack/issues/34404/comments). git push is not a REST write.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }

    Generated by Claude Code

  10. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb

    Close-out 2026-11-19T10:39Z: PR #35422 merged, and Fixes closed this card. All three owed items are delivered:

    1. The three plugin-auth texts now say a removal is refused (503) when the host fails. The door's behaviour is unchanged.
    2. A committed remove-sso-user writes one admin audit row (delete, user.admin_removed_pending) through the shared writer. Refusals write none. This is pinned in the shared harness pending-sso-users.test.ts through the real routes, with an ablation.
    3. The comment promised on Setup → Users on a managed environment: add-person and CSV-import UI with per-row invitation status (reverses objectui#13330 for adding) #33187 is posted as 7004259178.

    L1-a ACCEPT 7004734980; the harness move was its condition and is met. Follow-up #35440 (p3) is nested here: the ledger/doc line and ban/unban audit. pm:dispatched off.

  11. removed
    pm:dispatched
    on Nov 19, 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:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions