Skip to content

feat(plugin-auth)!: SCIM projects the enterprise manager attribute into sys_user.manager_id - #34252

Merged
objectstack-fleet[bot] merged 22 commits into
mainfrom
claude/area-A1-33918
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 22 commits into
mainfrom
claude/area-A1-33918

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #33918

Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: none — skills/** teaches no SCIM route to sys_user.manager_id; the route is taught in content/docs/automation/approvals.mdx and content/docs/capabilities/approvals.mdx, updated here.

维护者速读

  • 改了什么:SCIM 目录在创建、替换、修补用户并点名企业扩展 manager 时,把它写进 sys_user.manager_id;不点名不动,显式移除或不带它的替换才清空;只对目录持有的身份写,与管理员入口共用同一个归属判断;解析不到的上级(含该连接自己开过、但平台用户已被删除的上级)照常保存用户,并记一条运维告警和一条有界的审计记录。
  • 为什么改:管理员入口拒绝目录持有的人,而目录这一侧从没写过上级字段,两边都改不了,按上级流转的审批跟不上组织调整;裁决要求查不到人不拒、但要留痕。
  • 风险与回滚:今天被接受、此后被拒的只有四类结构性请求(自指、成环、超深、跨组织 → SCIM 400 invalidValue,整笔不写);审计记录每个目录连接每十分钟最多一条,只记连接、用户和截断到 256 字的上级引用。以替换方式同步、且没有映射上级的身份提供方,升级后下次同步会清空目录持有用户此前设置的上级,变更说明已写明。回滚即撤本 PR,无数据迁移。
  • 先看:packages/plugins/plugin-auth/src/scim-manager-projection.ts(何时写、何时拒、何时只告警加留痕)、packages/plugins/plugin-audit/src/scim-refusal-audit.ts(新审计记录的内容与上限)、admin-set-user-manager.ts(共用的归属与拒绝判断)。
  • 两分钟验证:pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/scim-manager-projection.test.ts,预期全部通过,其中「one bounded audit row per warn」一组验证留痕。
  • 需要你做的:无,席位落地。

What changes

BREAKING for a SCIM identity provider that sends a manager the admin endpoint would refuse. A SCIM create, replace or patch that names the Enterprise User manager attribute, for an active user the directory holds, whose manager resolves to a User the same connection provisioned, and where the link would make the user their own manager, close a cycle, run past the depth cap, or cross an organization boundary, was served 201 / 200 with manager_id untouched. It is now refused with SCIM 400 invalidValue and nothing is written. Those four are the only requests served before and refused now.

On upgrade. An identity provider that syncs by replace and maps no manager clears, on its next sync, a manager_id set earlier for a user the directory holds, since a replace without the attribute is a clear. The plugin-auth changeset says so.

  • The projection (scim-manager-projection.ts) runs on the vendor's identity.reconcileUser callback, after the lifecycle reconcile (the ADR-0135 D4 stamp, untouched), and writes through the data engine inside the SCIM transaction. manager.value is the manager's SCIM resource id among the Users the same connection provisioned (RFC 7643 section 4.3); a $ref alone is read by its final /Users/{id} segment.
  • Silence is not a clear (seat ruling 6907953084, item a). Whether a request names the attribute is read off the request before the vendor runs (scimUserManagerIntentOf, recorded on the SCIM request scope). A create or PATCH that does not name it leaves manager_id alone; an explicit remove, or a replace without it, clears.
  • One ownership predicate, two doors (item b). directoryOwnsManagerOf in admin-set-user-manager.ts is what the admin endpoint's directory refusal reads and what gates the projection, through directoryOwnedUser, which answers with the user's row so the projection reads sys_user once per write and takes the current manager_id from it. On an identity the directory does not hold, the projection writes nothing.
  • Unresolvable is served (maintainer ruling 6909383114). An unknown id, an externalId-style value, another connection's id, a $ref with no readable segment (including one that does not decode), or this connection's own User whose sys_user no longer exists (the screen's manager_not_found, routed to the served path rather than to a refusal) saves the user, leaves manager_id, and is recorded with one operator warn and one scim_manager_unresolved audit row, both once per connection per window with the count held back. The check runs after the unchanged-manager short-circuit, and a write that does not name the attribute never reaches it.
  • The audit row (seat route 6913160680). The warn's admission notes the event on the SCIM request scope; handleRequest hands it to the audit slot's new recordScimManagerUnresolved after the response, outside the vendor's transaction, and only for an answer below 400. plugin-audit writes it through the SCIM writer's existing insert (scim-refusal-audit.ts): actor svc:scim:CONNECTION_ID, object_name sys_user / record_id the user, tenant_id the connection's organization, and metadata scim_connection_id, reference_kind, manager_reference (at most 256 characters, manager_reference_truncated when cut) and suppressed. sys_audit_log.action gains scim_manager_unresolved, labelled and translated in every shipped locale. No packages/spec value and no error-code ledger row is added; plugin-auth's published exports are unchanged (the slot member is declared package-internally).
  • Structural refusals are the admin endpoint's own (screenUserManagerLink), imported, never copied: each a SCIM 400 invalidValue with the refusal's sentence and its ADR-0112 code, stamped as a literal per code (switched on the refusal's own code) so check:dispatcher-error-vocabulary reads it; a code with no SCIM mapping fails loudly instead of being answered under another.
  • Not projected, with the reason in the changeset: outside an authenticated SCIM request (decommission, domain replay); from a profile source another connection owns; for an inactive user (a manager named while inactive is not applied on re-activation alone; it lands on the next replace, or on a patch that changes it).
  • lint: the graded-route note and MANAGER_ONLY_ROUTES say the projection runs only for an active, directory-held user, from its profile-source connection, on a write that names the attribute, and that an id naming no existing user the connection provisioned is served.
  • docs: automation/approvals.mdx and capabilities/approvals.mdx name SCIM as a route this platform gives, with the same rule; the first also names the audit row.

Tests

packages/plugins/plugin-auth/src/scim-manager-projection.test.ts, end to end through AuthManager.handleRequest() with a real SCIM bearer on ObjectQL over better-sqlite3:

  • set by id and by $ref; PUT change and PUT clear; PATCH set and PATCH remove; an unchanged manager not judged again (on a PATCH elsewhere and on a replace re-sending it once the chain above has grown past the cap); a deprovision with a dangling reference served.
  • unresolvable, each served with the column unchanged: unknown id, externalId, another connection's id, $ref without a segment and one that does not decode, PATCH to an unknown id keeping the old manager; the warn names the connection and is bounded per window; a report whose manager was deleted keeps working on a PATCH that does not name it and on a PUT re-sending the dangling reference; a manager whose scimUser row stays while its sys_user was removed at the driver (past the engine's restrict) is served on a create and on a replace, the column unchanged (null on the create, the earlier live manager on the replace), with one warn and one event each (the replace in the next window).
  • the four seat-ruling pins: an absent attribute keeps a value the admin route set (and a replace without it then clears it); an explicit PATCH remove clears; on an identity the directory does not hold the projection writes nothing while the admin route writes; on one it holds the admin route refuses (idp_provisioned) and the projection writes.
  • not projected: an inactive user (named while inactive, re-activation alone, then a replace naming it); outside a SCIM request and from another connection's profile source, each with a control leg that reaches the engine.
  • the four structural refusals, each asserting status, scimType, code and unchanged state.
  • the audit row (maintainer ruling 6909383114, seat route 6913160680), on the audit slot the door hands it to: one event per served unresolvable write, naming the connection, its organization, the user and the reference and nothing else; an unreadable $ref recorded as such; the reference capped at 257 characters at the door (reached through a long unreadable $ref: the vendor caps manager.value at 256 characters and a $ref at 2048), with nothing of the body beside it; a manager.value past 256 characters is the vendor's own 400 invalidValue, with nothing written, no warn and no row; rows follow the warn's rate (three unresolvable creates in a window: one event and one warn; past the window the next carries suppressed: 2); no event on the served-unchanged paths (a resolved manager re-sent, a write that names none, a dangling reference left alone) and none on the structural refusals; a request refused after the warn admitted its reference records nothing, with a served control leg.
  • scimBodyNamesManager and readScimManagerReference unit pins.

packages/plugins/plugin-audit/src/scim-refusal-audit.test.ts (the writer's existing harness, a new top-level describe plus one case on the real slot): the row read back from sys_audit_log on ObjectQLPlugin + AuditPlugin over sqlite (action, actor, object_name / record_id, tenant, exact metadata); the reference cut to 256 characters with manager_reference_truncated; undeclared fields never reach the row; an event that cannot name its connection, user or reference writes nothing; a refused insert is reported at error once per cause, apart from the refusal rows, and never thrown. sys-audit-log-action-labels.test.ts and sys-audit-log-retired-actions.test.ts carry the new action and its writer.

packages/lint/src/validate-approval-approvers.test.ts: the pin on the rewritten sentence follows the new text.

Acceptance notes

  • The audit row is built here (seat route 6913160680; claim amendment 6913182972 widened the surface to plugin-audit's action and writer). Premise measured first: the row needs a new sys_audit_log.action option, which lives in plugin-audit's object, not in packages/spec, and no error-code ledger row. It reuses the SCIM writer's named insert, so the tenant-audit census and the durability-log-level vocabulary are unchanged. The bound is the warn's own: one row per connection per 10-minute window, 1000 rows per window across connections, with the dropped count carried as suppressed.
  • A request refused after the warn admitted its reference spends that window's notice and writes no row (it rolled back). The warn is still logged, since it is said inside the vendor's transaction before the answer is known, so the next served unresolvable reference in that window is counted only in the next row's suppressed. The plugin-audit changeset says so.
  • The structural-refusal stamp was red on check:dispatcher-error-vocabulary (a helper passed refusal.code through, so the gate could not read the codes); each code is now a literal at its stamp, no ledger row and no waiver.
  • validate-approval-approvers.test.ts and the two docs pages are outside the claim's file surface, edited because the sentences they carried are made false by this change (docs per the S1 patch the seat supplied).
  • The vendor calls the host on a PATCH only when the PATCH changes what it stores. So a PATCH that re-sends the manager the resource already holds, or removes an attribute the directory never sent, reaches no host code and writes nothing; a replace always reaches the projection. Two pins use a replace for that reason, and the changeset states it.
  • Test bodies that drive the callback directly: the outside-a-request and other-connection branches have no single public request that reaches them; each such pin carries a control leg in the same test.

Verification

Final head 317c4955, worktree on the dogfood closure plus lint (pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' --filter @objectstack/lint build, lock VERDICT command-exit 0), built after the last source change.

Tests
  • scim-manager-projection.test.ts at 317c4955: 36/36 (one new: a manager whose scimUser row stays and whose sys_user was removed at the driver, served on a create and on a replace).
  • plugin-auth at 317c4955: 280 files, 5682 passed, 10 skipped.
  • lint at 317c4955: 212 files, 9067/9067.
  • plugin-audit: no source change since c659399a (this round touches only its changeset), 97 files, 1577/1577 there.
  • typecheck plugin-auth and lint at 317c4955: exit 0.
Ablations (each through scripts/ablation-replace.mjs, anchor hit once, restored to the HEAD blob with git diff HEAD empty)

Rerun at 317c4955 for every leg whose code moved this round (A3, A4, A5, A7) and the new A13; the rest are from 4c0b0ffd, on code this round does not touch.

  • A1 the projection unwired from reconcileUser: 24 red.
  • A2 the intent gate removed (silence clears): 4 red.
  • A3 the ownership predicate removed (a user the directory does not hold read as owned, with no manager): 1 red (the identity the directory does not hold).
  • A4 the structural screen removed: 5 red (four refusals plus no-row-on-refusal).
  • A5 the unchanged short-circuit removed: 1 red. First run green at dcf1984e: the pin's PATCH names no manager and stops at the intent gate. The pin gained a replace that names the same manager (4c0b0ffd), and the rerun is red.
  • A6 the inactive skip removed: 1 red.
  • A7 an unresolvable reference refused instead of served: 11 red. First run void at 4c0b0ffd: the replacement kept the anchor and the tool refused it as a no-op; rerun with a replacement that drops it.
  • A8 the audit note not recorded: 4 red.
  • A9 the hand-off's status gate removed: 1 red (a refused request records nothing).
  • A10 the door's reference cap removed: 1 red.
  • A11 the note admitted without the warn bound: 2 red (rate and warn bound).
  • A12 the writer's reference cap removed (plugin-audit): 1 red.
  • A13 the manager_not_found branch removed, so a manager whose user is gone goes to the refusal: 1 red, the new pin, on expected 400 to be 201 with INVALID_REFERENCE "The proposed manager does not exist".
Gates
  • dispatch-gates --commands at 317c4955: 104 derived; --ran with each exit code recorded: 101 run (all exit 0), 2 NOT MEASURED, 1 UNRUN.
  • NOT MEASURED locally, reason: each refused its prerequisite (exit 3, a full build this worktree does not have): check:skill-examples (spec), CI Type Check · consumer gates on 317c4955: success; check:dual-build-cjs-loads, CI Build Core on 317c4955: success.
  • UNRUN locally: check:type-check-debt, whose closure build takes the shared verify lock behind siblings' locked batches; CI Type Check · debt ledger on 317c4955: success.
  • check:dispatcher-error-vocabulary: exit 0. check:i18n, check:i18n-stale-fill (derived) and check:i18n-coverage: exit 0.
  • PR-body gates on this body: check-closing-keyword-parity --body exit 2, its report code: two of three parsers bind exactly Fixes #33918, nothing else; check-partof-closing-keyword exit 0; check-changeset-no-major --event exit 0; check-closing-target-claim exit 0, with SCIM: project the enterprise manager attribute into sys_user.manager_id, so SCIM-held users' managers can change at all #33918 UNDETERMINED because the newest Claim: comment has no Branch: line the parser reads.
Dogfood battery (the narrowing arm)

pnpm --filter @objectstack/dogfood test under the verify lock on 317c4955 (no shard, no path): exit 0, lock VERDICT command-exit 0; Test Files 473 passed, 3 skipped (476); Tests 4003 passed, 42 skipped (4045); no failure.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw

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

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/lint, @objectstack/plugin-audit, @objectstack/plugin-auth, touching 73 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/lint/src/validate-approval-approvers.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

59 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 f84dc192d728aa22e38770737583de3395f46b34.

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

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/lint/src/validate-approval-approvers.ts) — pages documenting those are invisible to this run
  • 1 cross-cutting symbol(s) contributed no route anchor: userId (5 routes)
  • 1 anchor(s) matched too much of the corpus to be a work list: sys_user (literal, 55 pages)
  • 4 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 — 30 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 f84dc192d728aa22e38770737583de3395f46b34 → packageMentionDocs.

Which tree this was computed on

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

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

⚠️ 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 f84dc192d728aa22e38770737583de3395f46b34 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…e admin door and the SCIM projection

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

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head bec3326 · 2026-11-16T05:02Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract review

Served-tier: TIER_DEFAULT
Head-sha: bec3326d5fec0554c455badbaabe535c27bc8e61
Local-runs: none

Read at 2026-11-16T05:10Z. First review of this head; claim: comment 6907815215; no lane request (owed per check-owed-reviews). Independence: implemented in a project thread for domain:server#5 (zhuangjianguo); reviewed by os-tesla, who neither dispatched nor implemented it.

Face: the committed changesets carry Clause-②: yes (widening), so this record is rendered on the declaration face. M1 below says that line is not true of this head; a head that re-declares the narrowing owes its review on the narrowing face at CONTRACT_REVIEW_TIER, and this record does not stand in for it. Read: all nine paths of the diff, plus, read and not reviewed, scim-sso-adoption.ts, scim-identity-source.ts, scim-connection-service.ts, auth-manager.ts (reconcileScimUserLifecycle) and content/docs/automation/approvals.mdx at this head. The vendor package is not installed in the review container, so its behaviour is taken from the host's own notes and the dev's end-to-end suite.

① Derived judgments

Against the card's four terms:

  • Term 1 (create, replace and patch set manager_id under the admin endpoint's four refusals, as SCIM errors): holds. screenUserManagerLink is extracted and imported, not copied; applyUserManagerLink calls the same function, and its moved body is unchanged. Each refusal is answered 400 invalidValue in RFC 7644 shape with the admin code, inside the SCIM transaction. The manager is looked up only among the Users the same connection provisioned, and an id of another connection gets the same answer as an unknown one. Self-reference is judged on the platform user, not on the SCIM id. Pinned end to end for self, cycle, depth, cross-organization, unknown, another connection, and "nothing written".
  • Term 2 (unknown manager refused loudly): holds for the profile-source connection on an active user. It does not hold on two paths that answer 2xx and write nothing (S3).
  • Term 3 (clearing the attribute clears manager_id): holds, and the head does more than the term says (M2).
  • Term 4 (lint note and rule explanation): holds; the two rewritten pins assert the new sentence. One overstatement (N2).

Findings:

  • M1 (must-fix) — the Clause-② line is false for this head. Both changesets and the PR body say yes (widening); the PR's own re-measure lists eight requests served today and refused now, and the plugin-auth changeset body has a paragraph headed "Requests accepted before and refused now". AGENTS.md makes (narrowing) BREAKING, with its banner and exactly one ADR-0087 disposition marker in the changeset; neither is present. This is the dev's open_questions entry, answered here: option A. Option B ships an undeclared narrowing. Option C contradicts card term 2 and, as the dev notes, still narrows. Under A the dogfood battery is owed on the final head.
  • M2 (must-fix) — the projection writes more than the card and the changeset declare, and nothing pins it. (a) The column is cleared on any active SCIM write whose stored attributes carry no manager, including a write that never named the attribute, so a value another route put there is removed with a 2xx. The changeset declares a clear only for "a PATCH remove, or a replace without it", and content/docs/automation/approvals.mdx at this head still says of a directory-held user that "a value the column already holds stays as it is". (b) The set of identities the projection writes is wider than the set the admin endpoint refuses (the two are decided by different predicates; the detail is in the seat's private notes). On the overlap both doors accept a write and each replaces the other's without a refusal. That is the last-writer-wins outcome admin-set-user-manager.ts refusal 5 names as the one the ruling rejected. Needed: one ownership rule that both doors read, the absent-attribute behaviour stated in the changeset, and a pin for each. Which door owns the overlap is a maintainer call (③).
  • S1 (should-fix) — content/docs/automation/approvals.mdx:101-107 and content/docs/capabilities/approvals.mdx:19-21 are made false by this diff and are not in it. The dev reports a ready patch; it should land with the behaviour or have a named carrier before merge.
  • S2 (should-fix) — the plugin-auth changeset says "an unrelated update is never refused over the org chart". The dev's own loose end 3 says otherwise: once a stored manager reference stops resolving, every active write on the report is refused until the directory resends or removes it. Either the unchanged short-circuit covers that case or the changeset says what happens.
  • S3 (should-fix) — three declared "not projected" branches have no pin: outside a SCIM request, a profile source of another connection, and an inactive user projected on re-activation. The second and third also accept a request carrying manager and write nothing, which is the silent drop term 2 rules out; each needs a stated reason in the changeset or a refusal.
  • N1 (nit) — a $ref whose last segment is not decodable is answered as a server error, not as invalidValue, unless the vendor rejects it first.
  • N2 (nit) — the rule explanation and the lint note say "on every SCIM create, replace and patch"; the projection runs only for an active user from its profile-source connection. The screenUserManagerLink jsdoc says "Refusals 1 to 4" and lists five.

No prior ids: this is the first review of the PR.

② Semver level

patch on @objectstack/plugin-auth and @objectstack/lint, Metadata-protocol: none: correct for a non-protocol change, and it stays patch once the narrowing is declared. What is missing is the declaration itself (M1): the (narrowing) arm, the BREAKING banner and the ADR-0087 disposition marker.

CI on this head: 66 check-runs, 53 success, 11 skipped, 2 failure (Test UI and its shard Test UI (5/16)). Nothing is still running. The diff touches no ui/ path and the dev reports the failing case as an app-shell deep-link timeout, but the head is red as read; a later PASS needs that check green or re-run, not waved.

③ Boundary flags

  • open_questions Clause-② arm: answered, option A (M1). No maintainer ruling is needed for the arm itself; the card's term 2 already rules the strict refusal.
  • Escalated to the maintainer: who owns manager_id for a SCIM-provisioned identity the admin endpoint does not refuse (M2b), and whether a SCIM write that never names manager may clear a value another route wrote (M2a). The ruling of record 6895645364 says the directory wins where a directory holds the identity; it does not say the directory also writes where it does not.
  • Deviation, validate-approval-approvers.test.ts outside the claim surface: accepted. The two pins asserted the sentence term 4 makes false.
  • Deviation, second shared export writeUserManagerLink: accepted. One write site, package-internal, and the tenant-audit census stays at one.
  • Deviation, dependents' suites not run and the full plugin-auth suite not measured locally at this head: accepted on Test Core success for this head; the package's public exports are unchanged.
  • Loose ends 1 and 2 (docs): S1. Loose end 3: S2. Loose end 4: S3. Loose end 5: M1.
  • File surface: within the claim, apart from the accepted test file. ADR-0135 D4 stamping is untouched and runs first.
  • SQL push-down: no finding. The projection adds keyed single-row reads; the chain walk is the existing helper, moved and not changed.
  • Security discipline: mechanisms are kept out of this record.

④ Design judgment

The seam is right: one screen, one write, inside the vendor's transaction, with the manager resolved inside the acting connection only. The design gap is ownership. The card closes "no path changes it" for identities the admin endpoint refuses, and the head projects onto a wider set and treats "the directory says nothing" as "the directory says none". Both follow from projecting the stored state without asking who owns the column, and both are settled by the one rule M2 asks for.

Implemented-by: claude/area-A1-33918
Reviewed-by: session_01L9qibxTeW8xHnxoHxWNHWW

VERDICT: FAIL

…ject only on directory-owned identities and on writes that name the attribute

An unresolvable manager reference (unknown id, externalId-style value,
another connection's id, unreadable $ref) no longer refuses the SCIM user
write: the write lands, manager_id stays, and one bounded operator warn
names the connection. The four structural refusals stay SCIM 400
invalidValue.

A write that does not name the attribute leaves manager_id alone, and the
projection writes only on identities the directory owns, read through the
one predicate the admin endpoint's directory refusal reads.

Lint explanation, docs and changesets follow the rule; both changesets
declare the narrowing.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
…ich the vendor always calls back on

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
@github-actions github-actions Bot added size/xl and removed size/l labels Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jVPGBoi3MCGoKbW1Hv

Hand-off · PR #34252 · Fixes #33918 · 2026-11-16T09:04Z

By the maintainer's order to push and hand off, area S1 clocks out. The next seat takes this PR from here.

  • Head. 345781c4c, work in progress. The body was updated at this head.
  • Done in this round.
  • Left.
    • Audit row: open question. The ruling asks for an audit row beside the warn. A served request cannot write one inside the claim's files, because it needs a new plugin-audit action. The options are (A) widen into plugin-audit, (B) file a follow-up card, or (C) keep the warn only. This is the seat's call.
    • Run the ablations.
    • Run the dogfood battery that the narrowing arm owes.
    • Measure check:type-check-debt, check:dts-closure and check:dual-build-cjs-loads on a full build.
    • Read CI and Test UI on this head.
    • Post the round-2 report.
  • Vendor note. The SCIM plugin runs the host step only on a PATCH that changes what it stores. Two pins use a replace for this reason, and the changeset says so.
  • Owed reviews.
    • The L2 delta at CONTRACT_REVIEW_TIER, on the narrowing face, from the reviewer of 6907927050.
    • The L1 read from the S1 review thread (review-a).
    • Both are owed on the final head, after the items above.

…e leaves one bounded scim_manager_unresolved row

The served write's operator warn and the ledger row share one admission, so
rows follow the warn's rate (one per connection per window) and carry its
dropped count. The projection notes the event on the request scope; the SCIM
arm hands it to the audit slot after the response, outside the vendor's
transaction, only for an answer below 400. The row names the connection, the
user's record and the reference capped at 256 characters, nothing else.

Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
Co-authored-by: Claude <noreply@anthropic.com>
… scim_manager_unresolved audit row

Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
Co-authored-by: Claude <noreply@anthropic.com>
…so the dispatcher error vocabulary reads them

Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
Co-authored-by: Claude <noreply@anthropic.com>
…, the attribute the vendor lets past 256 characters

Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
Co-authored-by: Claude <noreply@anthropic.com>
…s refusal, with no audit row

Claude-Session: https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw
Co-authored-by: Claude <noreply@anthropic.com>
…ce, the write that names the manager

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

Copy link
Copy Markdown
Contributor Author

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

Final head · PR #34252 · Fixes #33918 · area o1-A · head 4c0b0ff · 2026-11-16T12:23Z

Area o1-A took this PR over from domain:server#5 (claim 6913062456 on #33918, amendment 6913182972) and declares head 4c0b0ffd9bd0fc0b3d508e26f2e36ccc9609d1e7 final and green: 68 check runs, 58 success, 10 path-skipped, 0 failed (dev report 6916278197 on #33918). The body was rewritten by the area at this head (body-only).

  • Delta since predecessor head 345781c4 (round 3, 23 files, +609/−34): the bounded audit row ruling 6909383114 requires (seat route A, 6913160680) as plugin-audit action scim_manager_unresolved: written on the same admission as the warn (one per connection per 10-minute window, 1000 per window across connections, dropped count as suppressed), carrying connection, organization, user record id, reference kind and the reference cut to 256 characters (manager_reference_truncated), handed over after the response and only below 400. No packages/spec member, no error-code ledger row. Plus: refusal codes as literals at their stamps (check:dispatcher-error-vocabulary), the action label translated in 10 locales, and the cap pin moved to an over-long $ref (the vendor caps manager.value at 256, now pinned as the vendor's own 400 with nothing written).
  • Gates on this head: 104/104 derived gates run (check:type-check-debt not measured locally behind the shared lock; CI Type Check · debt ledger green), dogfood battery 473 files / 4003 tests passed, 12/12 ablations red and restored. Not governed (check-governed-merges: 0 of 30 paths), 1975 changed lines.
  • Faces: Clause-②: yes (narrowing) (SCIM 400 for self / cycle / depth / cross-org manager links), BREAKING banner and ADR-0087 markers on the changesets; Metadata-protocol: none.
  • Open for the readers, not reproduced: a SCIM manager reference to a sys_user deleted outside SCIM may be refused 400 by the screen instead of served (warn + row) as ruling 6909383114 says. L1 and L2 to judge whether this is a defect of this PR.
  • Owed on this head: the L1 delta read (L1-a) and the L2 delta at CONTRACT_REVIEW_TIER on the narrowing face (review#1; first record 6907927050). Then the area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head 4c0b0ff · 2026-11-16T12:25Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

席位核对 · ACCEPT (L1, first read) · Head-sha: 4c0b0ff · 2026-11-16T12:29Z

L1 thread L1-a for area o1-A, on the final head declared in 6916329740. No earlier L1 exists on this PR, so this read covers the full diff against merge base 951eceee (30 files, +1842/−133), not only the round-3 delta. Also read: card #33918, the PR body, maintainer ruling 6909383114, seat rulings 6907953084 (items a and b) and 6913160680 (route A), and dev report 6916278197. The L2 record at CONTRACT_REVIEW_TIER belongs to review#1 and is not repeated here.

  • Ruling 6909383114, rule by rule.
    • createScimManagerProjection returns early for: a non-SCIM request, userManagerIntent !== 'named', an inactive user, a profile source owned by another connection, and an identity the directory does not own (directoryOwnsUserManager).
    • The order after those returns is: read the reference, resolve it among the connection's own sys_scim_user rows, then the unchanged short-circuit, then the unresolvable path, then the screen.
    • The unresolvable path (unknown id, externalId, another connection's id, a $ref that cannot be read or decoded) serves the write, leaves manager_id as it is, and records one warn and one row. Each case is pinned (scim-manager-projection.test.ts § "a reference that names no User is served").
    • The four structural refusals become SCIM 400 invalidValue through scimRefusalError, pinned one test per refusal.
    • The unchanged short-circuit comes before both the unresolvable check and the screen, as the ruling orders. It is pinned on a PATCH elsewhere and on a replace that re-sends the same manager (4c0b0ffd).
  • The shared screen is a pure extraction. screenUserManagerLink holds refusals 1–4 and the manager-exists check, word for word as they left applyUserManagerLink. writeUserManagerLink is the same authSystemWriteContext() write. directoryOwnsManagerOf is the same predicate refusal 5 used to inline. Nothing in the admin endpoint's answers moves.
  • Silence is not a clear (item a). scimUserManagerIntentOf reads a clone of the body before the vendor consumes it. A replace always counts as named, and a create or PATCH counts only when it carries or addresses the attribute. scimBodyNamesManager has unit pins. One predicate covers both doors (item b), pinned from both sides.
  • The audit row (route A). recordScimManagerUnresolved sits on the existing audit slot beside recordScimRefusal. There is no spec member and no error-code ledger row.
    • The row carries: actor svc:scim:…, user_id null, object_name sys_user with the user's record_id, tenant_id from the connection's organization, and in metadata the connection, the reference kind, the reference cut to 256 characters with a truncation flag, and suppressed.
    • Every field is re-checked against a token shape before it reaches the row, and nothing else of the body is recorded.
    • It is written after the response, only below 400, on the warn's admission. Pinned: rate and suppressed, the cap, no row on the unchanged paths, no row on refusals, and no row for a request refused after admission.
    • The enum value is added writer-first, with a label, 11 translation bundles, and the action-labels and retired-actions ledgers.
  • Docs and remedy text checked against the code.
    • automation/approvals.mdx and capabilities/approvals.mdx: SCIM is now named as a route this repo provides. The "names no user ⇒ served, column unchanged, warn + scim_manager_unresolved once per connection per ten minutes" sentence matches the projection and the writer.
    • The lint remedy and its block comment are re-graded the same way. The test drops without projecting it and pins the new wording.
  • Faces.
    • All three changesets read Clause-②: yes (narrowing) / Metadata-protocol: none, with the BREAKING banner and an ADR-0087 not-required marker. The plugin-auth note names exactly the four refusals as the requests that are now refused.
    • The body has Fixes #33918 with no closing keyword next to any other number.
    • dogfood_battery is pinned to 4c0b0ffd in 6916278197: command exit 0, 473 files / 4003 tests.
  • Tier. Not governed: 0 of the 30 paths are under docs/adr/**, .claude/**, skills/**, workflows or AGENTS/CLAUDE. It has 1975 changed lines, under 3,000, so the area lands it after the L2 PASS.
  • Checks on this head (check-runs, latest per name). 72 names: 60 success, 12 skipped (path-filtered, opt-in and queue-only), 0 failed, 0 pending.
  • Base. PRBASE = 6cc3f974 (Test Core plan, Affected-set diff base). K = 8 to origin/main, below 15. Nothing from 951eceee to origin/main touches any SCIM file, admin-set-user-manager.ts, sys-audit-log.object.ts, the approvals docs or the lint remedy.

The open item: a manager whose sys_user was deleted outside SCIM

It is not reachable through any platform door, so it is not a defect of this PR.

  • When it can happen. It needs a sys_scim_user row of this connection that still exists while its sys_user is gone. Only then does managerId resolve non-undefined and fall through to the screen's findUser → INVALID_REFERENCE manager_not_found, which this PR maps to 400.
  • Why a platform delete cannot cause it. sys_scim_user.user_id is Field.lookup('sys_user', { required: true }) with no deleteBehavior. The spec materializes set_null, and the referential pass escalates set_null on a required lookup to restrict (engine-referential-required-lookup-default-restrict.test.ts, verify family split (#15953), engine rows: objectql and driver-sql regression tests that replace hotcrm's platform-semantics pins (rows 3, 4-5, 7, 8, 10, 11) #23603). An engine delete of that sys_user is therefore refused as DELETE_RESTRICTED before anything is written. Every user delete in plugin-auth goes through the engine (objectql-adapter.ts delete → e.delete).
  • The paths that remain.
    • A SCIM DELETE /Users/{id} removes the sys_scim_user row too, so a later reference is unresolvable and is served. That is pinned (§ "a report whose manager was deleted keeps working").
    • Only an out-of-band database edit leaves the dangling pair.

Should (not blocking)

  • Spend one line in createScimManagerProjection and route a screen answer of manager_not_found to warnUnresolved (kind id) instead of scimRefusalError, with a pin that removes the sys_user at the driver. "查不到人不拒" then holds by construction rather than through the engine's restrict escalation, and a later deleteBehavior on sys_scim_user.user_id cannot reopen the gap. If the area prefers not to touch the code on this head, record it in ## Acceptance notes as accepted, with the restrict reasoning above. Either is fine for L1.

Nit

  • The warn's admission happens inside the SCIM transaction. A request refused after admission records no row (pinned), but it has already logged the warn for a write that was never saved and used up that connection's window. The next served unresolvable reference within ten minutes therefore lands only as suppressed on the following row. This is acceptable as bounded, and a sentence in the plugin-audit note would make it visible.

Landing: not Tier H. After review#1's L2 PASS on this head, area o1-A lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 4c0b0ffd9bd0fc0b3d508e26f2e36ccc9609d1e7
Local-runs: none
Scope: packages/plugins/plugin-auth/src/scim-manager-projection.ts, packages/plugins/plugin-auth/src/admin-set-user-manager.ts, packages/plugins/plugin-auth/src/scim-connection-service.ts, packages/plugins/plugin-auth/src/auth-manager-plugin-list.ts, packages/plugins/plugin-auth/src/auth-manager-request-routing.ts, packages/plugins/plugin-auth/src/scim-manager-projection.test.ts, packages/plugins/plugin-audit/src/scim-refusal-audit.ts, packages/plugins/plugin-audit/src/scim-refusal-audit.test.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log-action-labels.test.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log-retired-actions.test.ts, packages/plugins/plugin-audit/src/translations (eleven generated bundles, read for effect), packages/lint/src/validate-approval-approvers.ts, packages/lint/src/validate-approval-approvers.test.ts, packages/lint/src/rule-explanations.ts + the three changesets and content/docs/automation/approvals.mdx, content/docs/capabilities/approvals.mdx (judged for ② and against the code); read and not reviewed: packages/plugins/plugin-auth/src/scim-sso-adoption.ts, scim-identity-source.ts, scim-refusal-audit.ts (the bound), auth-manager.ts (the lifecycle reconcile), packages/platform-objects/src/identity/sys-scim-user.object.ts, packages/objectql/src/engine-cascade-planning.ts
Security-touching: yes

Read at 2026-11-16. Delta review after record 6907927050 (head bec3326d5fec0554c455badbaabe535c27bc8e61), on the narrowing face. Inputs: card #33918 with every comment (seat ruling 6907953084, maintainer ruling 6909383114, claim amendment 6913182972), the PR files and net diff against origin/main, the PR comments, and the check-runs of this head: 68 runs, 58 success, 10 skipped, 0 failed, none running. The vendor SCIM package is not installed in the review container, so its behaviour is taken from the host's notes and the end-to-end suite that CI ran green on this head.

Earlier ids

M1: closed.
M2: closed.
S1: closed.
S2: closed.
S3: closed.
N1: closed.
N2: closed.

  • M1: all three changesets and the tree's declarations read Clause-②: yes (narrowing), each with the BREAKING banner and exactly one ADR-0087 disposition marker.
  • M2: (a) a write that does not name the attribute leaves the column alone, read off the request before the vendor runs; an explicit remove or a replace without it clears. (b) one ownership predicate, directoryOwnsUserManager, is read by the admin door's directory refusal and by the projection. The four pins the seat ruling names are present.
  • S1: both docs pages are in the diff and agree with the code as read.
  • S2: an unchanged manager is not judged again, an unresolvable reference is served, and the changeset says so.
  • S3: the three not-projected branches are pinned, each with its reason in the changeset.
  • N1: a $ref that does not decode is read as unreadable and served.
  • N2: the lint note and the rule explanation name the active, directory-held, profile-source and names-the-attribute conditions; the screen's jsdoc names the existence check.

① Derived judgments

What is added, each judged right against the card and the two rulings:

  • A SCIM create, replace or patch that names the Enterprise User manager attribute writes sys_user.manager_id, inside the SCIM transaction, after the lifecycle reconcile (ADR-0135 D4 untouched).
  • It writes only for an active user whose manager the directory owns, and only from the connection that holds that user's profile source.
  • The manager is resolved by SCIM resource id among the Users the same connection provisioned.
  • An explicit remove, or a replace without the attribute, clears; silence does not.
  • An unresolvable reference (unknown id, externalId-style value, another connection's id, unreadable $ref) is served with the column unchanged, one operator warn and one scim_manager_unresolved row, both on one admission per connection per window. The row is written after the response, outside the transaction, only for an answer below 400.
  • The admin door's body is moved, not changed: applyUserManagerLink calls the same screen and the same single write.

What moves from accepted to refused:

  • The four structural refusals (self, cycle, depth cap, cross-organization) are the admin door's own screen, imported, each answered SCIM 400 invalidValue with nothing written. Right, and ruled.
  • A fifth refusal is not declared: see M3.

Findings:

  • M3 (must-fix) — a manager reference that resolves to a SCIM row of the connection whose platform user no longer exists is refused 400 invalidValue (the screen's manager_not_found, code INVALID_REFERENCE), and the whole user write rolls back. Maintainer ruling 6909383114 says an unresolvable manager is not refused: the write is served, manager_id stays, and the event is recorded; it keeps only self, cycle, depth and cross-organization as refusals. Before this PR that request was served, so it is a fifth request that moves from accepted to refused, and the plugin-auth changeset's sentence "Those four are the only requests served before and refused now" is not true of the tree. No pin covers either behaviour. Reach is narrow and was not measured (it needs a projection row whose user was removed outside SCIM), but the package's own SCIM code and tests treat orphan SCIM rows as a state that occurs, and when it does, every report naming that manager fails its create or update until the directory changes. Needed: that case takes the served path (column unchanged, warn and row) with a pin; or a ruling that keeps the refusal, with the changeset and the lint note listing it and a pin on it. This is the lane's open item from its final-head comment, judged against the tree: yes, this head refuses it.
  • N3 (nit) — the projection reads the same sys_user row twice per projected write (once for the ownership predicate, once for the current manager). Two keyed single-row reads; no effect on the result.
  • N4 (nit) — the plugin-auth changeset states that a replace without the attribute clears the column, but not what that means on upgrade: an identity provider that syncs by replace and maps no manager clears, on its next sync, a value put there earlier for a directory-held user. The behaviour is ruled (6907953084, item a); only the operator-facing sentence is missing.
  • N5 (nit) — the PR title carries no ! while the three changeset titles do. No gate on this head reads it red.

② Semver level

patch on @objectstack/plugin-auth, @objectstack/plugin-audit and @objectstack/lint, each with Metadata-protocol: none: correct per AGENTS.md on main. Nothing a metadata author writes changes: no packages/spec key or value, no error-code ledger row; the new sys_audit_log.action option is a ledger value written by the platform's own writer, added writer-first with its label in every shipped locale. A non-protocol breaking change ships patch and keeps its banner and disposition, and all three changesets carry Clause-②: yes (narrowing), the BREAKING banner and one ADR-0087 marker. Check Changeset and Lint & Repo Gates are green on this head. The declaration's content is incomplete by one refused case (M3).

③ Boundary flags

  • open_questions in the round-2 report: none.
  • Lane's open item (a reference to a user deleted outside SCIM): answered, M3.
  • Out-of-scope note, PR title without !: N5.
  • Out-of-scope note, check-closing-target-claim reads the card as undetermined: a claim-comment shape matter for the seat; PR-body guards is green on this head.
  • Deviation, plugin-audit pins placed in the writer's existing harness: accepted (shared-harness rule).
  • Deviation, the lint test file and the two docs pages outside the claim surface: accepted; the sentences they carried are made false by this change.
  • Deviation, the plugin-audit surface: covered by claim amendment 6913182972; the premise it sets (no published contract value, no ledger row) holds as read.
  • SQL push-down: no finding. The manager lookup is one keyed read on (id, connectionId), the profile source one keyed read, the user one keyed read; nothing is materialised or looped. The chain walk and the subordinate walk are the admin door's existing helpers, unchanged, and the second is already level-batched. The duplicate read is N3.
  • Dogfood battery for the narrowing arm: reported on this head by the dev, and Dogfood Regression Gate is green on it.
  • Security discipline: no security finding. As read at rule level: one owner per identity, shared by both doors; a connection writes only where it authors the user's profile; the manager is resolved inside the acting connection only; the organization boundary is the admin door's own screen; the audit row carries the connection, the user and the bounded reference and nothing else of the request.

④ Design judgment

The narrowing makes a declared refusal real; it takes no declared capability away. The docs on main say a directory-held user's manager is authored in the directory and that the admin operation's refusals guard the column; before this change the directory's answer went nowhere, so a refused link and an accepted one were indistinguishable (both served, neither written). On this head the accepted ones are written and the four structural ones are refused loudly, through one derivation shared with the admin door.

Tried against it, as read:

  • A manager outside the organization: refused by the shared screen where both sides have tenancy facts.
  • A self-manager and a cycle: refused on platform user ids.
  • An unresolved reference: served, column unchanged, warned and recorded once per window.
  • PATCH against PUT: a PATCH that names nothing writes nothing; a replace always decides; a PATCH to an unknown id keeps the old manager.
  • The admin door against SCIM: one predicate, so exactly one door writes for any identity.
  • A cloud-managed environment: neither door has a manager-specific gate, so nothing diverges.

The one place the design does not hold against ruling 6909383114 is M3: resolution is decided at the SCIM row, and the user's existence is left to a screen whose answer for "no such manager" is a refusal. Whether the vendor accepts PATCH shapes the names-the-attribute reader does not recognise was not measured here (vendor package absent); such a shape fails safe, writing nothing.

Implemented-by: claude/area-A1-33918
Reviewed-by: session_01ASNY8Ywba8ySbMdWvra2vS

VERDICT: FAIL

@objectstack-fleet objectstack-fleet Bot changed the title feat(plugin-auth): SCIM projects the enterprise manager attribute into sys_user.manager_id feat(plugin-auth)!: SCIM projects the enterprise manager attribute into sys_user.manager_id Nov 16, 2026
…ne, like any reference that names no User

A connection's own SCIM User whose sys_user no longer exists screened as
manager_not_found and answered SCIM 400. Per maintainer ruling 6909383114 it
names no User: the write is served, manager_id is unchanged, and it gets the
bounded warn and scim_manager_unresolved row. Only the four structural
refusals answer 400.

The ownership predicate now answers with the user's row, so the projection
reads sys_user once per write instead of twice.

Changesets: the upgrade note on replace-syncing providers that map no
manager, and the note that the warn's admission runs inside the SCIM
transaction. Lint and approvals docs say "no existing user".

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

Copy link
Copy Markdown
Contributor Author

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

Final head · PR #34252 · Fixes #33918 · area o1-A · head 317c495 · 2026-11-16T14:19Z

Head 317c495572e4351db852b1e1e26183ac04a68f36 supersedes 4c0b0ffd (6916329740) by one commit, round 4 on review#1's L2 6916550843 (FAIL on M3). CI is 68 runs: 58 success, 10 skipped, 0 failed. The dev report is 6918967257 on #33918. The area rewrote the body at this head (body-only) and added ! to the title (review#1's N5).

  • M3: a manager reference that resolves to this connection's own SCIM user whose sys_user is gone is now served as ruling 6909383114 orders: manager_not_found goes to warnUnresolved (kind id), with manager_id unchanged and one warn and one scim_manager_unresolved row. Only the four structural refusals answer 400, so the changeset's "Those four are the only requests served before and refused now" holds. It is pinned by removing the manager's sys_user at the driver, then a create (201) and a replace in the next window (200), and the ablation goes red.
  • N3: the projection reads sys_user once. The ownership check returns the row; there is no behaviour change.
  • L1-a's nit (6916464429): the plugin-audit changeset says a refused request still spends the warn's window.
  • N4: the plugin-auth changeset gains an "On upgrade" paragraph. An identity provider that syncs by replace and maps no manager clears an earlier manager_id on its next sync.
  • Wording: the lint note, its changeset and approvals.mdx say "no existing user the connection provisioned".
  • Round size: 8 files, +73/−21. The PR is 2027 changed lines, not governed. The dogfood battery is pinned to 317c4955: 473 files and 4003 tests passed.
  • Owed on this head: the L1 delta (L1-a, on 6916464429) and the L2 delta at CONTRACT_REVIEW_TIER (review#1, on 6916550843). Then the area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head 317c495 · 2026-11-16T14:21Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

席位核对 · ACCEPT (L1, delta) · Head-sha: 317c495 · 2026-11-16T14:21Z

This is a delta read of the final head declared in 6919028644, against my ACCEPT 6916464429 at 4c0b0ffd. The delta 4c0b0ffd..317c4955 is one fast-forward commit: 8 files, +73/−21. I also read dev report 6918967257. The L2 delta is review#1's.

  • My Should, which is review#1's M3, is closed.
    • In createScimManagerProjection, a screen answer with reason === 'manager_not_found' now goes to warnUnresolved with kind id and returns, so it is served. It no longer reaches scimRefusalError.
    • Self, cross-organization, cycle and depth still throw the SCIM 400.
    • The check sits after the unchanged short-circuit, as ruling 6909383114 orders.
  • The new pin removes the manager's sys_user at the driver, past the engine's restrict, and confirms the row is gone.
    • A create naming that manager answers 201 with manager_id null, one warn, and one event: connection, organization, user, kind id, reference.
    • In a fresh window, a replace answers 200, keeps the earlier manager, and gives its own warn and event.
    • The test passes 36/36 at this head (6918967257).
  • N3: one read of sys_user. directoryOwnedUser returns the row that findUser already read. That read selects id, manager_id and source, so current comes from the same row as the ownership predicate. The second sys_user read and SYSTEM_READ_CTX are gone from the projection. directoryOwnsUserManager is now a wrapper over it, and the admin endpoint's own path is unchanged.
  • My Nit is closed. The plugin-audit changeset now says the admission happens inside the SCIM transaction, and that a request refused after admission still logs the warn and uses up the window.
  • N4: the "On upgrade" paragraph. It says that an identity provider which syncs by replace and maps no manager will, on its next sync, clear a manager_id set earlier for a directory-held user. That is true on the code: a replace always counts as naming the attribute, and without it the value is null (seat ruling 6907953084, item a). It also gives the remedy: map the attribute before upgrading. This is a data-visible consequence of the ruled shape, and the L2 delta judges whether the BREAKING banner should name it as well. For L1 the sentence is accurate and placed where an upgrader reads.
  • Wording carried to every face. "names no existing user the connection provisioned" appears in the lint changeset, rule-explanations.ts and approvals.mdx. The plugin-auth changeset and the projection docblock list "this connection's own User whose platform user no longer exists" among the unresolvable kinds. validate-approval-approvers.test.ts's toContain pins still match, since none of them quotes the changed phrase.
  • Title now carries ! (feat(plugin-auth)!: …), matching the Clause-②: yes (narrowing) faces.
  • Faces. dogfood_battery is pinned to 317c4955 in 6918967257: command exit 0, 473 files / 4003 tests.
  • Checks on this head (check-runs, when I read them): 72 names, 59 success, 12 skipped, 0 failed, and 1 still running (Check Changeset). Landing needs it green.
  • Base. PRBASE = f84dc192 (Test Core plan, Affected-set diff base), and K = 6 to origin/main, below 15. Nothing since then touches SCIM files, admin-set-user-manager.ts, sys-audit-log.object.ts, the approvals docs or the lint remedy.

Landing: not Tier H. After review#1's L2 delta PASS on this head and a green Check Changeset, area o1-A lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 317c495572e4351db852b1e1e26183ac04a68f36
Local-runs: none
Scope: packages/plugins/plugin-auth/src/scim-manager-projection.ts, packages/plugins/plugin-auth/src/admin-set-user-manager.ts, packages/plugins/plugin-auth/src/scim-connection-service.ts, packages/plugins/plugin-auth/src/auth-manager-plugin-list.ts, packages/plugins/plugin-auth/src/auth-manager-request-routing.ts, packages/plugins/plugin-auth/src/scim-manager-projection.test.ts, packages/plugins/plugin-audit/src/scim-refusal-audit.ts, packages/plugins/plugin-audit/src/scim-refusal-audit.test.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log-action-labels.test.ts, packages/plugins/plugin-audit/src/objects/sys-audit-log-retired-actions.test.ts, packages/plugins/plugin-audit/src/translations (eleven generated bundles, read for effect), packages/lint/src/validate-approval-approvers.ts, packages/lint/src/validate-approval-approvers.test.ts, packages/lint/src/rule-explanations.ts + the three changesets and content/docs/automation/approvals.mdx, content/docs/capabilities/approvals.mdx (judged for ② and against the code); read and not reviewed: packages/plugins/plugin-auth/src/scim-refusal-audit.ts (the bound)
Security-touching: yes

Read at 2026-11-16. Delta review after record 6916550843 (head 4c0b0ffd9bd0fc0b3d508e26f2e36ccc9609d1e7), on the narrowing face. Inputs: card #33918 with every comment (seat ruling 6907953084, maintainer ruling 6909383114, seat route 6913160680), the PR files and net diff against origin/main, the round's own diff (one commit, 8 files, no main merge in it), the PR comments, and the check-runs of this head: 72 runs, 60 success, 12 skipped, 0 failed, none running. The files this round does not touch were judged in record 6916550843 and are unchanged since. The head is 30 commits behind origin/main; none of them touches a path of this diff.

Earlier ids

M3: closed.
N3: closed.
N4: closed.
N5: closed.

  • M3: a manager reference that resolves to the connection's own SCIM row whose platform user no longer exists is now served. The projection sends the screen's manager_not_found answer to the same unresolved path as every other reference that names no User: the write lands, manager_id is unchanged, and the one admission per connection per window gives one operator warn and one scim_manager_unresolved row, handed over after the response and only for an answer below 400. It sits after the unchanged-manager short-circuit. A pin covers a create and a replace (in a later window), each asserting status, the unchanged column, the warn count and the exact event. The plugin-auth changeset lists the case among the served ones, and its sentence "Those four are the only requests served before and refused now" is true of this tree.
  • N3: the ownership predicate answers with the row it read, and the projection takes the current manager from it: one sys_user read per projected write. The admin door's path is unchanged.
  • N4: the plugin-auth changeset carries an "On upgrade" paragraph directly under the banner: a provider that syncs by replace and maps no manager clears an earlier value on its next sync, with the remedy. True of the code (a replace always counts as naming the attribute; seat ruling 6907953084, item a).
  • N5: the PR title carries !.

① Derived judgments

This round, as read in the tree:

  • Only the existence answer moved from refused to served. The branch keys on the single reason manager_not_found; self-assignment is judged before the existence read, and cross-organization, cycle, an existing loop and the depth cap still answer SCIM 400 invalidValue with nothing written. No other screen answer is downgraded.
  • The served path for this case is the same closure the other unresolvable cases use: same bound, same note on the request scope, same warn, same after-response hand-off and status gate. Nothing is written to manager_id on it.
  • The reference recorded for this case is the SCIM resource id the directory sent, under the existing 256-character cap.
  • The ownership predicate's new by-id form returns the user's row or null; the boolean form is a wrapper over it, so both doors still read one predicate.
  • Wording: the lint note, its changeset and automation/approvals.mdx say "no existing user the connection provisioned"; the projection's docblock and the plugin-auth changeset name the case. The plugin-audit changeset now says the admission happens inside the SCIM transaction and that a request refused after admission spends the window.

Everything judged right in record 6916550843 stands on this head; the round changes none of it.

Findings:

No must-fix, no should-fix.

  • N6 (nit) — the jsdoc of screenUserManagerLink in admin-set-user-manager.ts still says every refusal of the screen applies unchanged to the SCIM projection, while the projection now serves the screen's existence answer. The projection's own docblock, the changeset and the docs say it correctly; no effect on behaviour.

② Semver level

patch on @objectstack/plugin-auth, @objectstack/plugin-audit and @objectstack/lint, each with Metadata-protocol: none: correct per AGENTS.md on main. Nothing a metadata author writes changes. A non-protocol breaking change ships patch and keeps its banner and disposition; all three changesets carry Clause-②: yes (narrowing), the BREAKING banner and one ADR-0087 marker, and the PR body and title agree. The declaration's content is now complete: the four structural refusals are the only requests that move from served to refused, and the upgrade effect of a replace without the attribute is stated with its remedy. Check Changeset, PR-body guards and Lint & Repo Gates are green on this head.

③ Boundary flags

  • open_questions in the round's report: none.
  • L1 question, whether the banner itself should also name the upgrade clear: answered, no. The banner declares requests that are now refused; the clear is a ruled write effect, stated in its own paragraph beside the banner with the migration step, which is what a breaking changeset owes.
  • Ablation for the new branch reported red on this head by the dev (the new pin); taken as reported, not re-run.
  • Dogfood battery for the narrowing arm: reported on this head by the dev, and Dogfood Regression Gate is green on it.
  • SQL push-down: no finding. The round removes one keyed single-row read and adds none; nothing is materialised or looped.
  • Security discipline: no security finding. As read at rule level: a reference that names no existing User is answered one way whatever the reason, nothing is written on that path, the organization boundary and the other structural refusals are still the admin door's own screen, and the audit row carries the connection, the user and the bounded reference and nothing else of the request.

④ Design judgment

The narrowing still makes a declared refusal real and takes no declared capability away, and it now holds against maintainer ruling 6909383114 in full: resolution is decided in two steps (the SCIM row, then the platform user), and both steps end on the served path when they find no one; only self, cycle, depth and cross-organization refuse.

Tried against it, as read:

  • A manager whose SCIM row stays and whose platform user is gone: served on a create and on a replace, column unchanged, warned and recorded once per window.
  • The same manager still held in the column and re-sent: stops at the unchanged short-circuit, no warn and no row, so the report keeps working.
  • A self-reference: refused before the existence read, so the new branch cannot serve it.
  • A manager outside the organization, a cycle and an over-deep chain: refused by the shared screen, unchanged.
  • A request refused after the reference was admitted: no row, the window spent, as the plugin-audit changeset now says.
  • The admin door: its screen, its refusal for a missing manager and its write are unchanged.

Implemented-by: claude/area-A1-33918
Reviewed-by: session_01ASNY8Ywba8ySbMdWvra2vS

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Landing · PR #34252 · Fixes #33918 · head 317c495 · 2026-11-16T14:27Z

probe reading
L1 / contract on this head L1-a delta ACCEPT 6919078630; CONTRACT_REVIEW_TIER delta PASS 6919199357 (review#1, Head-sha 317c495; M3, N3, N4, N5 closed)
checks on this head 72 check runs: 60 success, 12 path-skipped, 0 red, 0 pending (re-read after the body edit re-ran Check Changeset); mergeable state clean
narrowing gate Clause-②: yes (narrowing), title !; dogfood battery pinned to 317c4955 in os-dev-report 6918967257 (473 files / 4003 tests passed, command exit 0)
governed / size check-governed-merges --pr 34252: NOT governed, 0 of 30 paths, +1894/−133
base PRBASE f84dc192; no commit on origin/main since touches a path of this diff (L2 record)

State change: ready and auto-merge armed. If the queue's dogfood gate goes red, area o1-A dequeues and treats it as this PR's own fault. #33918 closes on merge through Fixes; the area clears its labels then.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 16, 2026 14:28
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 18194fb Nov 16, 2026
73 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-A1-33918 branch November 16, 2026 14:56
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/xl 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.

SCIM: project the enterprise manager attribute into sys_user.manager_id, so SCIM-held users' managers can change at all

1 participant