Repository navigation
fix(platform-objects): show a user's manager and direct reports in Setup, prefill Set Manager, add Remove Manager - #36162
Conversation
…; prefill and clear it Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5okniknzVVR3KTSVr1
… and the Remove Manager clear Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5okniknzVVR3KTSVr1
… at the action door Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5okniknzVVR3KTSVr1
…ocale; changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5okniknzVVR3KTSVr1
📓 Docs Drift CheckThis PR changes 1 package(s): 34 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 10 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 3 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin a6e95a80a673a240018f63b6a79a0df570ee6024 && git checkout a6e95a80a673a240018f63b6a79a0df570ee6024
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 146b6f9b6018b8144690338cf1cf0374407a4187 e06f4b85bf4d8d65aefdc4aaee3cd54992f05102 && git checkout -B drift-repro 146b6f9b6018b8144690338cf1cf0374407a4187 && git merge --no-ff e06f4b85bf4d8d65aefdc4aaee3cd54992f05102
node scripts/docs-audit/affected-docs.mjs --json 146b6f9b6018b8144690338cf1cf0374407a4187
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5okniknzVVR3KTSVr1 Final green head · area a4-D · 2026-11-21T17:40Z |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — REWORK · head 30de59a (one test-only item; the rest is ACCEPT-ready)REWORK item:
What I checked, which carries to the ACCEPT:
|
…refusal Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5okniknzVVR3KTSVr1
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5okniknzVVR3KTSVr1 Final green head · area a4-D · round 2 · 2026-11-21T18:18Z |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oVqoTJkrRZcyZS4xd 席位核对 — ACCEPT · head e06f4b8 (delta 30de59a..e06f4b8, after REWORK 7066700418)
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5okniknzVVR3KTSVr1 席位核对Landing · area a4-D · 2026-11-21T18:21Z · head
Ready + auto-merge now. Not measured by anyone: the Console dialog and the Details tab painted in a browser (the dev measured the served metadata and the door on a booted showcase; L1 read the resolver chain in code). |
Requested by Leehom · project thread
Fixes #36017
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
An admin who set a user's manager could not read it back anywhere in Setup (the value was stored correctly; the card measured it over the data API). Four parts, each on an existing declared mechanism, no spec key added:
manager_id(packages/platform-objects/src/pages/sys-user.page.ts). The field staysreadonly: true(ADR-0092 D4); it is shown, not edited. Named "Reporting Line", not "Organization": the reporter mistook the Organizations tab (membership) for the org structure, and a section called "Organization" would repeat that.primary_business_unit_id(same field group) is deliberately left out: it is plugin-sharing's projection ofsys_business_unit_member.is_primary, and the Business Units tab already lists the source rows with their primary flag.record:related_listofsys_useronrelationshipField: 'manager_id'(parent valueid, the props default). It is read-only by construction:sys_useropens no create or delete (userActions: { edit: true },apiMethodswithout create/delete), so the host offers neither New nor Remove. Labels in the page's 11 locales.managerIdparam is now field-backed onmanager_idwithdefaultFromRow: true(the existing key; precedentsys_team_member'steamId). Measured: the console's resolver (ui/packages/fields/src/resolveActionParams.ts) seeds fromfield ?? nameand carries type, target and label but neverreadonly, andparamToFieldbuilds the widget without it, so the picker stays editable. The record header stamps its record as the row; a list row is projected with everydefaultFromRowseed field (@object-ui/corelistViewPredicates). Request body unchanged:{ userId, managerId }.remove_user_manager, new action): posts the same endpoint withbodyExtra: { managerId: null }(the existing static-body key, merged last at both doors). SamerequiredPermissionsand the same standing term as Set Manager, thenhas(record.manager_id) && record.manager_id != null, so it is only offered while there is a manager to remove (the Ban / Unban row-state pattern).confirmText, no params, noaiblock (an action after the ADR-0011 assessment stays human-only). ⛔ No client-side copy of any endpoint refusal (ruling record 6895645364 option A); the SCIM-held refusal applies to the clear at the endpoint.Decision batch #127 item 1 is untouched: the manager is
sys_user.manager_idalone; nothing reads or derives a business unit head.Tests
packages/platform-objects/src/pages/sys-user-details-tab.test.ts: the section list (Reporting Line added) and a new top-level describe: the Details section holdingmanager_id, the Direct Reports list onsys_user/manager_id/ parent valueid(read throughRecordRelatedListProps), labels in the tab's locales.packages/platform-objects/src/identity/sys-user-set-manager-action.test.ts: the param is field-backed +defaultFromRow(replacing the old INLINE pin, whose read-only rationale was measured false), and a new describe forremove_user_manager:bodyExtraequal to{ managerId: null }with the key present, no params,confirmText, gate keys equal to Set Manager's, the standing term first, the only record column read ismanager_id, offered/hidden verdicts through the CEL engine, noaiblock.packages/runtime/src/platform-admin-action-gate.test.ts: a new describe driving the real declaration through the REST action door: an admin's click is forwarded to/api/v1/auth/admin/set-user-managerwithuserIdandmanagerIdpresent and null; a plain member is refused 403 and nothing is forwarded.Ablation (one-shot, through
scripts/ablation-replace.mjs, src-resolved in both suites): deleting thebodyExtraline turned the runtime door test and the platform-objects declaration test red; restore proven (blob == HEAD,git diff HEADempty).Acceptance notes
filterby id,populate=manager_id), measured on a booted showcase: the populatedmanager_idcomes back as the manager's record withname. The painted Console page was not observed in a browser (Console build not run); the details renderer's lookup display is pre-existing behaviour.sys-user-set-manager-action.test.tspreviously pinned the param INLINE because a field-backed param "may render read-only". Measured onui/at this tree: neitherresolveActionParamsnorparamToFieldcarriesreadonlyonto a param. The comment and the pin are rewritten with that reading.sys-user.page.ts;overlap-checkreports it merges cleanly with this branch.Verification
pnpm --filter @objectstack/platform-objects exec vitest run --maxWorkers=2 src/pages/sys-user-details-tab.test.ts src/identity/sys-user-set-manager-action.test.ts→ 2 files, 25 tests pass.packages/platform-objects/src/identity/sys-user.object.ts(theremove_user_managerblock and theset_user_managerparam),packages/platform-objects/src/pages/sys-user.page.ts(the Details tab),packages/runtime/src/platform-admin-action-gate.test.ts.Local readings at head 30de59a
pnpm --filter @objectstack/platform-objects typecheck+pnpm --filter @objectstack/runtime typecheck(with theircheck:test-typecheck): exit 0, under the verify lock (VERDICT command-exit 0).pnpm --filter @objectstack/platform-objects exec vitest run --maxWorkers=2: Test Files 125 passed (125), Tests 2126 passed (2126).pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/platform-admin-action-gate.test.ts: Test Files 1 passed (1), Tests 18 passed (18).pnpm check:i18n: all ten extract packages in sync afternode scripts/check-i18n-bundles.mjs --write; the ten translated locales carry hand-writtenremove_user_managerstrings (their source-hash entries dropped by the next extract).dispatch-gates.mjs --commands, 67 with the changeset families): exit 0 except three NOT MEASURED, each a prerequisite refusal (exit 3), not a finding:check-plugin-teardown-shape.mjs --self-test(shallow clone cannot read its pinned fixture commit),check:dual-build-cjs-loads(needs the whole workspace built),check:type-check-debt(verify-lock queue timeout). CI runs all three.Booted showcase, server-side measurement (own port, torn down)
{"success":true,"data":{"userId":"usr_showcase_auditor_demo","managerId":"…","setBy":"…"}}.GET /api/v1/data/sys_user/usr_showcase_auditor_demo?expand=manager_idand the console's list read (filterid,populate=manager_id):manager_idcomes back as the manager's record,name: "Dev Admin"; without expansion it is the bare id.filter manager_id = admin id): 2 rows; control (manager_id = Ada): 0 rows.sys_usermetadata keepsbodyExtra: {"managerId": null}and the param'sfield+defaultFromRow; servedsys_user_detailcarries Reporting Line, Direct Reports andrelationshipField: manager_id.POST /api/v1/actions/sys_user/remove_user_manager:{"success":true,"data":{"userId":"usr_showcase_auditor_demo","managerId":null,…}}; afterwardsmanager_idreadsnulland the admin's reports drop to 1.Generated by Claude Code