Skip to content

feat(plugin-auth): import-users assigns positions from a positions column - #34531

Merged
objectstack-fleet[bot] merged 12 commits into
mainfrom
claude/project-thread-7l0awc
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 12 commits into
mainfrom
claude/project-thread-7l0awc

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #33113

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:管理员批量导入用户(POST /api/v1/auth/admin/import-users)新增一列 positions(岗位机器名,多个用 ; 分隔),用户建好后第二遍逐个指派岗位;控制台用户导入向导多了这一列和一句列说明。
  • 为什么改:按裁决 6920428750「C,只加岗位列」,托管演示组织和真实客户都能用一份 CSV 建好带岗位、带上级的人员,下游应用不再自写建账号脚本。
  • 风险与回滚:只加不减,不带 positions 列的文件行为不变;岗位按管理员自己的权限写入,和 Setup 里指派岗位走同一套校验;回滚即还原本 PR。
  • 先看:packages/plugins/plugin-auth/src/admin-import-users.ts 的 assignRowPositions 与第二遍循环;同文件 grantBlocked 那段(缺 seam 或管理员自身上下文解析不出时,用户照建,只把每个岗位逐行记为被拒,code 分别是 NOT_IMPLEMENTED / PERMISSION_DENIED);auth-plugin.ts 新增的一行 createGrant。
  • 两分钟验证:pnpm --filter @objectstack/plugin-auth exec vitest run src/admin-import-users-manager-pass.test.ts -t positions,预期 13 例全绿。
  • 需要你做的:无,席位落地。

What changes

POST /api/v1/auth/admin/import-users admits one new column, positions, per the maintainer's ruling 6920428750 (verbatim: 「C,只加岗位列,p1」).

  • The column. positions holds position machine names, several separated by ; (an array on a JSON row). The name and spelling are the ones admin/import-sso-users already reads (packages/plugins/plugin-auth/src/pending-sso-users.ts:188 and :590 on main, documented at content/docs/permissions/authentication.mdx:1294), so one CSV shape serves both identity import doors. Reading of the ruling: 「只加岗位列」 limits the import to this one new column; it does not limit the column to one value, since a user may hold several positions and the sibling door's column already carries a list. The cell is parsed by the one reader both doors now import (name-list-cell.ts, moved out of pending-sso-users.ts unchanged and not re-exported from the package index).
  • Second pass, like manager_id. The cell is stripped before the identity write and assigned after runImport returns, beside the manager pass, so every row of the batch exists.
  • Same checks as Setup. Each assignment is a sys_user_position insert through the data engine under the importing administrator's own execution context, through the createGrant seam create-user and the pending doors already use (auth-plugin.ts gains one line wiring it into this mount). The position catalog refusal, the delegated-administration gate and the grant-holder membership refusal judge it as they judge Setup's form; none is re-derived in the importer.
  • Per row, the user still created. rows[].positions lists each named position with assigned, already_assigned (an upserted user who already holds it; nothing written), unresolved (the refusal is the catalog's fields[].field === 'position' / reference_not_found) or refused (any other refusal, with its code). A cell that is not a list reads 'unreadable'. The sentence rides rows[].error when free; no rows[].code is stamped, for the manager pass's documented reason. summary.positions counts { assigned, alreadyAssigned, unresolved, refused }, and the run-level audit row carries the same split. The import only adds positions.
  • A host that cannot judge the grant costs the positions, never the users. When the host wires no grant seam, or the caller's own execution context does not resolve, the users are still created (200, the answer main gives the same file) and every named position is reported refused on its row, with code NOT_IMPLEMENTED (no seam) or PERMISSION_DENIED (no context), counted under summary.positions.refused; nothing is written to sys_user_position. Dry runs do not assign, and a dry run answers as main does. The open question was first read as A at L1 review (refuse the whole file 501 / 403 before any write; a reading, not a ruling, and withdrawn in L1 comment 6936586013) and is now per row, because A narrowed the same input: on main that file answers 200 and creates the users (see Acceptance notes, FROM). Per row is also what ruling 6920428750 says of a position that cannot be assigned.
  • No permission-set column (ADR-0090: a position carries its sets). demoStaff is untouched and stays development-only.
  • Console. The Users import wizard offers positions as a target column, and its options panel explains it (console.identityImport.positionsHint, added to all 11 @object-ui/i18n packs, as all-locales-key-parity requires).
  • Docs. content/docs/permissions/authentication.mdx › Bulk Import Users documents the column and its outcomes, including that an unreadable cell's rows[].positions is the string 'unreadable' (counted under summary.positions.unresolved), not an array, and that positions which cannot be judged at all are refused per row (NOT_IMPLEMENTED / PERMISSION_DENIED) while the users are still created.

Tests

  • packages/plugins/plugin-auth/src/admin-import-users-manager-pass.test.ts: the existing harness gains an optional grant seam and a sys_user_position insert double that refuses an unknown name the way the catalog refusal does and a denied one with PERMISSION_DENIED — only for non-system writes, so a system-context write would slip past it and fail the assertions. A new top-level describe holds 13 cases: assignment under the administrator's context after the last create; CSV ; parsing; unresolved per row with every other row landing; refused with the code; already_assigned on upsert; unreadable cell; the cell never reaching createUser; no seam needed without the column; a FROM control (the file measured on main, on a host with no seam: 200, both users created, summary.errors: 0, both rows ok); no seam → every named position refused / NOT_IMPLEMENTED on its row, the row without the column untouched, summary.positions.refused: 3, nothing written; no context → refused / PERMISSION_DENIED, the user created and ok; a dry run with no seam answers 200 with nothing written and no refusal; dry run assigns nothing.
  • ui/packages/app-shell/src/views/__tests__/identityImportFields.emailRule-11913.test.tsx: a new top-level describe pins the positions target column and the options-panel hint.
  • No existing assertion was changed. The manager-pass harness gained an optional grant seam and a sys_user_position double; its existing cases are untouched.

Acceptance notes

  • FROM, measured on origin/main d4c0c12. main's admin-import-users.ts, driven with a sys_user declaration reader and two rows carrying a non-empty positions cell (sales_rep; sales_rep;area_manager), answered 200, summary.created: 2, errors: 0, both rows ok: true / created, as JSON rows and as CSV; createUser received only email and name. The dry run answered 200, two rows created, nothing written. So on main the column is silently dropped and the users are created. Against that FROM this PR only widens: the column now assigns positions, and every input that answered 200 and created users on main still does. An earlier revision of this PR refused that file whole (501 on a host with no grant seam, 403 when the caller's own context does not resolve), which narrowed the same input; that revision is withdrawn. Those two cases now create the users as main does and report each named position refused (NOT_IMPLEMENTED / PERMISSION_DENIED) on its row; the FROM control test pins the 200 and the created users. Hence Clause-②: yes (widening) with no (narrowing) arm.
  • Scope of the acceptance: a single-organization deployment, where an imported user is given the default organization's membership by the user.create.after reconciler before the position is written. In multi-organization mode import-users does not join the importing admin's current organization (unlike create-user), so the grant-holder membership refusal answers each position refused / VALIDATION_FAILED on its row; the user is still created. Filed: plugin-auth: admin import-users does not join created users to the importing admin's current organization in multi-org mode #34535.
  • The Console import wizard offers no manager_id target column today, although the endpoint has admitted it since its own ruling; filed: console identity import wizard: no manager_id column to map, although import-users accepts a manager #34536.
  • The skills that teach the import are a separate domain:skills card, per the claim; filed: skills: teach the positions column of admin import-users #34537.
  • The tenant-audit census page and its counts file move by one write call site (the new grant insert); the figures are re-measured, not edited by hand.
  • already_assigned reads an existing hold by (user_id, position) regardless of organization, for upserted rows only.

Verification

Targeted tests
  • pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/admin-import-users-manager-pass.test.ts src/pending-sso-users.test.ts src/admin-import-users.test.ts → Test Files 3 passed (3), Tests 151 passed (151) (VERDICT command-exit 0, r3 head).
  • pnpm --filter @objectstack/plugin-auth test → Test Files 280 passed (280), Tests 5780 passed | 10 skipped (5790) (r3 head).
  • pnpm --filter @objectstack/plugin-auth typecheck → exit 0; check:test-typecheck: OK (r3 head).
  • ui: vitest run of identityImport.test.ts, identityImportFields.emailRule-11913.test.tsx, identityImport.csvBatches-13315.test.tsx and all of packages/i18n/ → Test Files 105 passed (105), Tests 1924 passed | 13 skipped (VERDICT command-exit 0, r1; r3 does not touch ui/). The zh-Hant line is the generator's output (node scripts/gen-zh-hant.mjs), and the de line avoids a quote pair so the de-quote-pairing count pin stays as it is.
  • pnpm --filter @object-ui/i18n type-check && pnpm --filter @object-ui/app-shell type-check → VERDICT command-exit 0.
Ablations (each mutation landed on disk via scripts/ablation-replace.mjs, then restored to the HEAD blob)
  1. (r1) Assignment written under SYSTEM_CTX instead of the administrator's context → 3 cases red (the context assertion and the two refusal cases, since the checks stand down for system writes).
  2. (r1) Second pass skipped → 6 red.
  3. (r3) The withdrawn whole-file refusal restored (an early return fail(501, 'NOT_IMPLEMENTED', …) when the file names positions and no seam is wired) → 2 red: the FROM control and the per-row NOT_IMPLEMENTED case.
  4. (r3) The per-row refusal branch disabled (if (grantBlocked && false)) → 2 red: the NOT_IMPLEMENTED and PERMISSION_DENIED cases.
Derived gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 111 commands on head d3c32ee (r1), on the r2 head d69957c, and on the r3 head 987b7e7 (after the per-row change and a merge of main; packages/spec was rebuilt first because the merge moved its sources); each was run with stdin closed and its exit captured before any pipe: all 111 exit 0 on each head. On r3, pnpm --dir ui exec vitest run scripts/ first exited 1 on one 15 s test timeout (check-i18n-call-site-keys.test.ts › main passes exactly the arguments…) while the plugin-auth full suite shared the box; the file alone then passed 152/152, and the whole family re-run on an idle box exited 0, which is the exit recorded. --ran reconciliation on each head: 111 derived, 111 run, 0 NOT-MEASURED, 0 UNRUN. check:tenant-audit-census first read the new sys_user_position insert as one more engine write call site (321 → 322); the generated tables were rewritten with node scripts/tenant-audit-census.mjs --write and the page's hand-written figures moved by one in the same commit (content/docs/permissions/tenant-audit-census.mdx, docs/audits/2026-08-tenant-audit-write-call-sites.counts.md). Every family CI runs is read from this PR's check runs.

The positions column (position machine names, ;-separated, the spelling
import-sso-users reads) is stripped before the write and assigned after
runImport, each as a sys_user_position insert under the importing
administrator's own execution context. An unresolved or refused position
is a per-row outcome; the user is still created.

Claude-Session: https://claude.ai/code/session_01ADHkmRNTuoSXYcZLxRV232
Co-authored-by: Claude <noreply@anthropic.com>
The Users import wizard offers the positions target column with a hint in
every locale pack; the authentication guide documents the column and its
per-row outcomes.

Claude-Session: https://claude.ai/code/session_01ADHkmRNTuoSXYcZLxRV232
Co-authored-by: Claude <noreply@anthropic.com>
…tion grant

The new sys_user_position insert in admin-import-users is one more engine
write call site; the generated tables and the prose figures move by one.

Claude-Session: https://claude.ai/code/session_01ADHkmRNTuoSXYcZLxRV232
Co-authored-by: Claude <noreply@anthropic.com>
…without a quote pair

Claude-Session: https://claude.ai/code/session_01ADHkmRNTuoSXYcZLxRV232
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l 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 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

24 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 1e4656d01fe485935c493a00ecdb8e0f8a0fed55.

⛔ 12 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: PERMISSION_DENIED (literal, 54 pages)
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • 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 1e4656d01fe485935c493a00ecdb8e0f8a0fed55 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 1e4656d01fe485935c493a00ecdb8e0f8a0fed55

⚠️ 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 1e4656d01fe485935c493a00ecdb8e0f8a0fed55 → 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#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

Final head for review: d3c32ee1cc975ea3ffa747f22a32deace0a95208 (card #33113, branch claude/project-thread-7l0awc). CI on this head: 61 success, 11 skipped, 0 failed. Body carries the filed follow-ups #34535, #34536, #34537. Owed: L1 first review, and the L2 review the Clause-②: yes (widening) declaration asks for (no packages/spec/src path). A push after this comment restarts both on the new head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmPZf3MhxKeGaxV4P3W

席位核对

L1 first review · REWORK (1 item, docs only) · head d3c32ee1cc975ea3ffa747f22a32deace0a95208 · card #33113 · read 2026-11-17T00:48Z

REWORK

  1. The docs leave out two answers the door now gives. content/docs/permissions/authentication.mdx › Bulk Import Users, checked sentence by sentence against admin-import-users.ts:
    • rows[].positions is documented as a list of outcomes, but a cell that is not a list answers the string 'unreadable' (r.positions = 'unreadable'), and summary.positions counts that row under unresolved (positionLinks.unresolved++; pinned at admin-import-users-manager-pass.test.ts:783-785). A client that reads rows[].positions as an array breaks on it, so the page has to say both: the string value, and which counter it lands in.
    • Only the 501 whole-request refusal is documented. The 403 PERMISSION_DENIED refusal, nothing created and dry runs included, when the caller's own access does not resolve (seam.resolveActorContext() answering nothing; pinned at :828-836) is missing.
      Docs-only; the changeset already names 'unreadable' and both refusals and needs no change.

The open question in the report (whole-request 501 / 403 before any write)

L1 reads option A as inside ruling 6920428750, not a new fork. The ruling's per-row clause covers a position that does not resolve or whose assignment is refused; a host with no grant seam, or a caller whose own access does not resolve, is known before the first write and would refuse every position on every row. A matches the sibling door: import-sso-users settles its grant seam and actor context before writing and answers 501 NOT_IMPLEMENTED without one (pending-sso-users.ts:290-310), as create-user does (admin-user-endpoints.ts:820-850). Recorded here so it is visible to the maintainer's veto; not put to the decision box.

Checklist (read on GitHub at this head, not from the report)

  • Shape: draft, base main, attribution header then Fixes #33113. Closing-keyword scan of the whole body: one hit, #33113; #34535, #34536, #34537 follow Filed: / filed: with no keyword. Fixes is right: the ruled scope (one positions column, second pass, Setup's checks, per-row outcome, no permission-set column) is all in the diff.
  • File surface: 22 files from get_files, inside claim 6931355877 and amendments 6931386726, 6931474183 (supersedes the pending-sso-users.ts export with the new name-list-cell.ts; the console list in IdentityImportPanels.tsx; the 11 locale lines) and 6932377459 (the two census artefacts). The ui/ test identityImportFields.emailRule-11913.test.tsx pins the claimed panel. auth-plugin.ts: one line, createGrant: createGrantFor(c).
  • Shared file: auth-plugin.ts with open PR feat(auth): an invitation is accepted in one step with the proof its mail carries #34333. My own git merge-tree --write-tree of this head against refs/pull/34333/head: exit 0, no conflict.
  • Moved code: readNameList moved byte for byte from pending-sso-users.ts into name-list-cell.ts, which the package index does not re-export; no new public name.
  • Security path: the grant is a sys_user_position insert under the importing admin's context from seam.resolveActorContext(), never SYSTEM_CTX; ablation 1 (written as SYSTEM_CTX) turns 3 cases red because the test double refuses only non-system writes. The only SYSTEM_CTX read is the already_assigned probe for upserted rows, which writes nothing.
  • Changeset: .changeset/33113-import-users-positions-column.md: @objectstack/plugin-auth and @object-ui/i18n (both published) patch, @object-ui/app-shell (private) patch. Metadata-protocol: none holds: a REST import column, no authorable-surface / authorable-defaults shard moves. Sentences checked: "assigned after every row of the batch has landed" (the pass runs after runImport); "the user is still created"; "a cell that is not a list reads 'unreadable'"; "501 … 403 … with nothing created, dry runs included" (the settlement precedes runImport); "Dry runs do not assign".
  • Docs (checked sentences other than item 1): "the same column import-sso-users reads", "written under the importing admin's own access", "the user is still created", the four outcome names, "only adds positions", "dry runs do not assign": each true of the diff.
  • Rejection assertions: 501 and 403 cases assert status and error.code; the per-row refused outcome asserts its code.
  • Tests and controls: 11 new cases; ablations 1–3 with their red counts (3, 6, 7). Suites: plugin-auth 280 files / 5774 tests; ui 105 files / 1924 tests.
  • Gates at this head: check-runs on d3c32ee1…: 72 runs, 61 success, 11 skipped, 0 failed; Lint & Repo Gates, TypeScript Type Check, Type Check UI, Dogfood Regression Gate success. Derived-gate round 111/111.
  • Out of scope placed: plugin-auth: admin import-users does not join created users to the importing admin's current organization in multi-org mode #34535 (multi-org imported users have no membership, so positions refuse), console identity import wizard: no manager_id column to map, although import-users accepts a manager #34536 (wizard has no manager_id target), skills: teach the positions column of admin import-users #34537 (skills card).

Owed after this

  • L2: owed, TIER_DEFAULT, on Clause-②: yes (widening) alone (no packages/spec/src/**, no narrowing, no governed path): the lane seat writes it. It pins a head; item 1 is docs-only, so it can run on the fixed head.
  • Landing tier: node scripts/pm/check-governed-merges.mjs --pr 34531: 0 of 22 paths governed, 625 changed lines (+580 / −45) ≤ 3000 ⇒ ordinary queue landing by the area after L1 ACCEPT and L2 PASS on the same head. Whichever of this PR and feat(auth): an invitation is accepted in one step with the proof its mail carries #34333 lands second re-reads the auth-plugin.ts intersection on its landing head.

Next

L1 reads the delta only, on a head whose CI is green and announced final in a PR comment.

…tions per row, not the import

Before the positions column the same file answered 200 and created every
user, so a whole-request 501 or 403 narrowed the door. Every named position
is now reported refused on its row (NOT_IMPLEMENTED, PERMISSION_DENIED) and
the users land as before.

Claude-Session: https://claude.ai/code/session_01ADHkmRNTuoSXYcZLxRV232
Co-authored-by: Claude <noreply@anthropic.com>
…efused per row, users still created

Claude-Session: https://claude.ai/code/session_01ADHkmRNTuoSXYcZLxRV232
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

Final head for review (r3): 987b7e72531b18326315a7c2d6f77d8053af5c2a (card #33113, branch claude/project-thread-7l0awc). CI on this head: 61 success, 11 skipped, 0 failed. r3 replaces the whole-file 501 / 403 with a per-row refused (NOT_IMPLEMENTED / PERMISSION_DENIED), users created as on main; positions tests 11 → 13; docs and changeset rewritten the same way. Body carries the filed follow-ups #34535, #34536, #34537. Owed: L1 review of the r3 delta, and the Clause-②: yes (widening) declaration record (no packages/spec/src path, so TIER_DEFAULT, written by the area). A push after this comment restarts both on the new head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 987b7e72531b18326315a7c2d6f77d8053af5c2a
Local-runs: none

The face is the declaration only: record-recognisers --paths decides no schema or rules face on the PR's paths (no packages/spec/src, no governed path), and the changeset's Clause-②: yes (widening) line leaves the declaration face. Read: card #33113 and ruling 6920428750, the claim and its surface amendments, the net diff against the merge base, the r3 delta, and the head's check-runs (72: 61 success, 11 skipped, none failed or pending).

① Derived judgments

  • admin-import-users.ts: the positions cell is read with readNameList and stripped before the identity write, as manager_id is, so createUser receives exactly what it received on main. The second pass runs after runImport, only for rows whose own write landed (created / updated), and never on a dry run. Right.
  • Each assignment is one sys_user_position insert under the calling administrator's own context (createGrant.resolveActorContext(), the seam create-user and the pending doors use), never SYSTEM_CTX; the refusal is classified (reference_not_found on position ⇒ unresolved, else refused with the thrown code), never re-worded. The only SYSTEM_CTX use is the read of an existing hold on an upserted row, which writes nothing. Right.
  • r3: no seam ⇒ every named position refused / NOT_IMPLEMENTED on its row; no resolved context ⇒ refused / PERMISSION_DENIED; the users land in both cases, nothing is written to sys_user_position, rows[].ok, rows[].code and summary.errors are untouched. This matches ruling 6920428750's "per-row error, the user is still created". Right.
  • name-list-cell.ts is a byte-for-byte move of pending-sso-users.ts's readNameList, so the SSO import door reads its cells as before. auth-plugin.ts wires the same createGrantFor(c) the create-user door already gets. Right.
  • UI: one positions target field in the Users import wizard and one hint string in every i18n pack. Right.

② Semver level

Clause-②: yes (widening)

FROM, measured on main (the PR's FROM control test pins it): a file with a positions column answers 200, creates its users and drops the cell. On this head the same file answers 200, creates the same users, and now also assigns the positions or reports why not on the row. A file without the column takes no new branch (positionsWanted is all undefined, so neither the seam nor the pass is read). The response and the audit row only gain keys (rows[].positions, summary.positions). Nothing main accepted is refused; the r2 whole-file 501 / 403, which narrowed this input, is withdrawn. Metadata-protocol: none is right: no metadata author writes anything new. The changeset is patch on @objectstack/plugin-auth, @object-ui/app-shell and @object-ui/i18n and carries both declaration lines. Check Changeset: success.

③ Boundary flags

  • N1 (not blocking): resolveActorContext() is awaited before runImport. If it throws (an infrastructure fault while resolving the caller's session, not an unresolved principal, which answers undefined), the request fails before any user is written, where main would have created them. The create-user door shares this seam and this failure mode, and the caller's session has already been resolved once by the endpoint's own gate, so no input that main accepts is refused by contract. Hardening it to a per-row refused is a follow-up, not a reason to hold this PR.
  • N2 (cosmetic): the wizard's positions field label is the literal 'Positions', not passed through label() like its siblings; positions is no sys_user field, so label() would have no field label to read.
  • Multi-organization mode: the membership refusal answers each position refused / VALIDATION_FAILED, users created; filed as plugin-auth: admin import-users does not join created users to the importing admin's current organization in multi-org mode #34535 and named in the body.
  • Generated census tables moved by one (sys_user_position insert call site), rewritten by the generator in the same commit.
  • No open questions; no security finding.
  • SQL push-down: no finding. The existing-hold read is one keyed find per position on upserted rows only (limit: 1), no id materialisation or in-app join.

Implemented-by: claude/project-thread-7l0awc
Reviewed-by: session_01ADHkmRXuRn93HphKp7kXEz

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmPZf3MhxKeGaxV4P3W

席位核对

L1 delta · ACCEPT · head 987b7e72531b18326315a7c2d6f77d8053af5c2a (delta over d3c32ee1, my REWORK 6934156935) · card #33113 · read 2026-11-17T02:54Z

My earlier judgment of option A is superseded

In 6934156935 I read option A (refuse the whole file 501 / 403 before any write) as inside ruling 6920428750. That was wrong. On main the same file answers 200, creates the users and silently drops the column (FROM measured on d4c0c1210, body › Acceptance notes), so A refused an input main accepts: a narrowing that Clause-②: yes (widening) did not declare. This head drops A for per-row outcomes, which is the ruling's own direction for a position that cannot be assigned. One wording nit for the body: "first ruled A" was an L1 reading, not a ruling.

Delta read (3 commits of the PR's own and two merges of main)

  • REWORK item 1, closed (5185e099, docs). The page now says rows[].positions is an array, except the string 'unreadable' for a cell that is not a list, which counts once under summary.positions.unresolved with the user still created. Both match admin-import-users.ts (r.positions = 'unreadable', positionLinks.unresolved++). The 403 sentence the item asked for became moot when r3 removed the 403.
  • r3 code (4ed4e51c, admin-import-users.ts), read in the source:
    • Both whole-request fail(501…) and fail(403…) are gone.
    • The seam and the actor context are read only when the run is not a dry run and a row names a list of positions. Exactly one of grant or grantBlocked (NOT_IMPLEMENTED with no seam, PERMISSION_DENIED with no context) is set.
    • The second pass sits inside the if (!prepared.dryRun) post-write block, so the non-null grant! is never reached without one of the two.
    • On grantBlocked each named position is { outcome: 'refused', code }, summary.positions.refused grows by the count, and rows[].error is set once when empty. That is the same shape the existing refused-assignment branch uses. ok, rows[].code and summary.errors are untouched, and no sys_user_position insert runs.
    • 'unreadable' rows keep their own branch ahead of it.
    • The docblocks (IdentityImportDeps.createGrant, ImportPositionOutcome.refused, the header list) say the same thing.
  • Tests (admin-import-users-manager-pass.test.ts, 11 → 13 cases).
    • The two whole-request cases are removed. That is a change of behaviour the PR itself introduced, not a weakening of a pin on main.
    • The FROM control asserts 200, created: 2, errors: 0, createUser called twice, and both rows [true, 'created'].
    • The no-seam case asserts each row's positions with code: 'NOT_IMPLEMENTED', rows[].code undefined, a row with no positions untouched, summary.positions {0, 0, 0, refused: 3} and zero position inserts.
    • The no-context case asserts 200, the user created, ok: true, PERMISSION_DENIED per position, refused: 2 and zero inserts.
    • The no-seam dry run asserts 200, no positions, and all-zero counters.
    • Both r3 ablations are recorded with their red counts (whole-file 501 restored: the FROM control and the NOT_IMPLEMENTED case; grantBlocked && false: the two per-row cases), each restored to the HEAD blob.
  • Docs and changeset (e9211280). authentication.mdx › Bulk Import Users and the changeset now read: "the users are still created and every named position is reported refused on its row: NOT_IMPLEMENTED … PERMISSION_DENIED … Dry runs do not assign". That is true of the code above. A scan of the page and the changeset finds no sentence left over from the whole-file refusal ("nothing created", "no one was imported", a 501 / 403 for this door). The changeset's "Nothing that worked before is refused" now holds.
  • Declarations: Fixes #33113, Clause-②: yes (widening) with no narrowing arm, and Metadata-protocol: none, all unchanged and right. The FROM paragraph records the withdrawn revision.
  • Merges: the diff against the last merge's main parent is the same 22 files that get_files lists, at +659 / −45. git merge-tree --write-tree of this head against open PR feat(auth): an invitation is accepted in one step with the proof its mail carries #34333's head 9bb1e6ad exits 0.
  • Gates at this head: check-runs on 987b7e72…: 72 runs, 61 success, 11 skipped, 0 failed. Lint & Repo Gates, TypeScript Type Check, Type Check UI, Dogfood Regression Gate and Check Changeset are all success. The derived-gate round is 111/111. The final head is announced in 6936546424.

The first-review checklist (6934156935) stands for everything outside this delta, except its paragraph on option A, which this verdict replaces.

Owed after this

  • L2: owed, TIER_DEFAULT, on Clause-②: yes (widening) alone; the lane seat writes it on this head. It should read the per-row refusal for a host that cannot judge the grant against ruling 6920428750.
  • Landing tier: node scripts/pm/check-governed-merges.mjs --pr 34531: 0 of 22 paths governed, 704 changed lines (+659 / −45) ≤ 3000. This is an ordinary queue landing by the area once the L2 PASS names this head. Whichever of this PR and feat(auth): an invitation is accepted in one step with the proof its mail carries #34333 lands second re-reads the auth-plugin.ts intersection on its landing head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

Landing 987b7e72531b18326315a7c2d6f77d8053af5c2a (card #33113) on L1 ACCEPT 6936586013 (r3 delta) and the TIER_DEFAULT declaration record 6936574759 (PASS), both at this head. The declaration face is the only review owed: no packages/spec/src path, no governed path, Clause-②: yes (widening).

probe reading
check-governed-merges.mjs --pr 34531 NOT governed; 0 of 22 paths hit the register; 704 changed lines ≤ 3000
git merge-tree --write-tree of this head against origin/main 144cdc254 exit 0; main is 11 first-parent commits past the merge base
git merge-tree --write-tree of this head against open PR #34333 (also touches plugin-auth) exit 0; whichever lands second re-reads the auth-plugin.ts overlap

Follow-ups filed and named in the body: #34535, #34536, #34537. Body note: the r1 "A" wording now says it was an L1 reading, not a ruling (body only, head unchanged). State: ready, auto-merge armed.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 02:56
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit c493adb Nov 17, 2026
77 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-7l0awc branch November 17, 2026 03:27
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/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants