Skip to content

Commit c8583f8

Browse files
test(dogfood): pin access-security checklist clauses at the api oracle's layer, slice 1 (#26797)
<!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8YSjPf3hTSLEBa52VUBikb4)_ Refs #26571 (slice 1 of about 4, items: access-security.rls-both-sides, access-security.write-path-guards, access-security.crud-permission-matrix, access-security.owd-sharing-matrix, access-security.fls-mask-and-strip) Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:给 access-security 区前 5 个清单条目补上 dogfood 断言(进程内 HTTP,正是这些条款的 oracle 层),共钉住 19 条此前只靠现场手跑的条款;5 个条目的 `automated.ref` 改写成逐条款对应、`revision` 加一、`history` 记本卡。 - 为什么改:18.2.0 Tier 1 记录 #26468 里这 5 条全是 PARTIAL——旧断言只看状态码、不复读行,或只覆盖部分对象/人设;每次发版都要重新手跑。钉住后成为可重复跑的常备证明。 - 风险与回滚:只加测试和改清单文字,不动任何产品代码;新增断言全部按现行行为写成并跑绿。dogfood 仍在原有位置运行,没有新 CI 通道。回滚即 revert 本 PR。 - 先看:① `showcase-crud-persona-matrix.dogfood.test.ts` 新增的 delegate × sys_* 16 格用例(含 sys_user 的 405);② `showcase-readonly-when-parent.dogfood.test.ts` 的 updateMany 逐行用例;③ `access-security.json` 里 crud-permission-matrix 的新 `automated.ref`。 - 两分钟验证:`cd packages/qa/dogfood && pnpm exec vitest run test/showcase-crud-persona-matrix.dogfood.test.ts`(需先按 dogfood 惯例 build 依赖闭包),预期 `Tests 49 passed`。 - 需要你做的:无,席位落地。 ## What changes Pins at the layer each clause's oracle names (`api`: the in-process HTTP stack of `@objectstack/verify`), in `packages/qa/dogfood/**` only. No product code changes. Every new assertion was written against today's behaviour and is green. | item | clauses newly pinned | where | |---|---|---| | rls-both-sides | acceptance[2], acceptance[3], negative[0] | `showcase-private-owd`: the admin re-reads the foreign note after the refused PATCH (whole record equal), and the admin's filtered list carries every note the file created | | write-path-guards | acceptance[0], [4], [5], [6], negative[0] | `showcase-static-readonly`: INSERT strip advertised in body `droppedFields` and the `X-ObjectStack-Dropped-Fields` header. `owner-anchor-and-bulk-writes`: member REST `createMany` stamps the caller on all three rows; the admin's forge-insert and disown pass. `showcase-readonly-when-parent`: the paid line's `product` is held; a mixed `updateMany` reports `results[i].droppedFields` (`readonly_when`) on the locked row only, and the open row lands; `updateMany` with `continueOnError: true` fails the row below `min: 0` alone (`VALIDATION_FAILED`, unchanged) and applies both neighbours, with the default stop shape (tail `NOT_ATTEMPTED`) pinned beside it | | crud-permission-matrix | acceptance[0], [1], [3], [6], negative[0] | `showcase-crud-persona-matrix`: the auditor's viewAllRecords over a foreign inquiry, invoice and line (by id and filtered list) against a contributor who holds read without the bit; the first denied cell of every set re-run as the admin answers 2xx; and the 16 `showcase_field_ops_delegate` × `sys_*` cells driven by a member holding exactly that set, with `sys_user` create and delete scored 405 `OBJECT_API_METHOD_NOT_ALLOWED` for the delegate and the admin | | owd-sharing-matrix | acceptance[0], [1], [4], [5] | `showcase-private-owd` / `showcase-public-read-owd`: non-2xx by-id read, PATCH at least 400, admin re-read unchanged. New `showcase-invoice-line-contributor-pair` (shared-showcase project): two stock `showcase_contributor` members C1/C2 and a stock `showcase_auditor`; C2's filtered list excludes C1's line while C1's identical list carries it, C2's by-id read and PATCH are refused with the row unchanged, C1 reads and edits it, the auditor lists and reads it | | fls-mask-and-strip | acceptance[0], [2] | `showcase-permission-zoo`: the contributor's name edit re-reads changed; the admin's budget write on a seeded project lands and re-reads changed (raised, then put back) | Ledger: each of the five items gets a rewritten `automated.ref` that maps clauses to cases, `revision` +1, and a `history` row citing #26571. The owd-sharing-matrix ref also names two existing `showcase-crud-persona-matrix` cases that already pinned its acceptance[2] (modifyAllRecords) and acceptance[3] (`showcase_contributor` / `showcase_member_default` × `showcase_project` edit cells), which revision 5 recorded as unpinned. `vitest.config.ts`: the new file joins `SHARED_SHOWCASE`. It meets that list's three eligibility rules: plain showcase boot, only `sys_user_permission_set` rows for its own sign-ups, and every list filtered to its own row. Clauses left as they are, each with its reason in the item's `automated.ref`: - rls-both-sides acceptance[5], negative[1], negative[2]: procedural (a reading of the verify report, run-record rules), and the D11 spot-check needs the private write-up. - crud-permission-matrix acceptance[5]: `blocked(fixture)` per knownGaps[2] (the guest anchor intake is not observable on a member persona). - owd-sharing-matrix acceptance[6]: procedural (run-record completeness). - fls-mask-and-strip acceptance[3] and the UI half of acceptance[4]: `dom` / browser oracle. The dogfood suite drives no browser and the ruling adds no CI lane, so they stay a run's browser leg. ## Tests Head `fd634911`, the eight touched files, under `os-verify-lock`: `Test Files 8 passed (8)`, `Tests 103 passed (103)` (`VERDICT command-exit 0`). `pnpm --filter @objectstack/dogfood typecheck`: exit 0. The full dogfood battery is CI's (no `!` in the title, no narrowing arm). ## Acceptance notes - crud-permission-matrix `acceptance[6].verify` and `steps[6]` still describe the 16 delegate cells as hand-driven, and the same file's header comment said "6 delegate rows" (now corrected to 4 in the test header). The two item-text fields sit outside this slice's claimed edit surface (`automated.ref`, `revision`, `history`); the history row says so. - Measured on head `fd634911`: the delegate's 16 cells answer exactly the matrix, unioned with nothing — `sys_business_unit`, `sys_business_unit_member` and `sys_user` read 200, every withheld verb 403 `PERMISSION_DENIED`, `sys_user` create and delete 405, `sys_user_position` create 201 and read/edit/delete 200 on the delegate's own in-subtree row. ## Verification Local gate subset on head `fd634911` (origin/main merged, including #26337): `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derives 55 families; all 55 ran and exited 0, and `--ran` reconciles `55 derived famil(ies) accounted for — 55 run, 0 NOT-MEASURED`. Repository-wide scans (`pnpm lint`, the full dogfood battery) are CI's. `node scripts/check-platform-checklist.mjs`: `check-platform-checklist: OK — 16 areas, 329 items (324 active, 1 planned)`. Changeset: none. `@objectstack/dogfood` is private and `docs/qa/**` ships in no package, so this PR carries `skip-changeset`. Template note: `.github/PULL_REQUEST_TEMPLATE.md`'s `Why` is folded into 维护者速读 and `What changes`; its Human Minimum items hold as follows: 1 n/a (no spec), 2 yes, 3 no formatter ran, `pnpm lint` left to CI, 4 yes, 5 n/a (publishes nothing), 6 n/a, 7 yes, 8 yes. --- _Generated by [Claude Code](https://claude.ai/code/session_01JQwxbWKBLcQCG7FBS17aMA)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0f0b9f5 commit c8583f8

10 files changed

Lines changed: 554 additions & 26 deletions

‎docs/qa/platform-checklist/areas/access-security.json‎

Lines changed: 40 additions & 10 deletions
Large diffs are not rendered by default.

‎packages/qa/dogfood/test/owner-anchor-and-bulk-writes.dogfood.test.ts‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,42 @@ describe('owner anchor guard + owner-scoped bulk writes (#3004 / #2982)', () =>
160160
expect(back.status).toBeLessThan(300);
161161
});
162162

163+
// ── access-security.write-path-guards negative[0] + acceptance[4] (#26571) ──
164+
// The guard gates on privilege, not on the key: the forge and the disown the
165+
// member is refused above succeed for the privileged caller. And the
166+
// REST bulk create stamps the caller as owner on every row it leaves empty.
167+
168+
it('a privileged caller CAN insert a record owned by someone else (forge is privilege-gated)', async () => {
169+
const r = await stack.apiAs(adminToken, 'POST', OBJ, { title: 'admin-planted for bob', owner_id: bobId });
170+
expect(r.status, 'platform admin forge-insert must pass').toBeLessThan(300);
171+
expect(await ownerOf(idOf(await r.json())), 'the row is owned by the named user').toBe(bobId);
172+
});
173+
174+
it('a privileged caller CAN disown a record (owner_id: null)', async () => {
175+
const made = await stack.apiAs(adminToken, 'POST', OBJ, { title: 'admin disown probe', owner_id: aliceId });
176+
expect(made.status).toBeLessThan(300);
177+
const id = idOf(await made.json());
178+
const r = await stack.apiAs(adminToken, 'PATCH', `${OBJ}/${id}`, { owner_id: null });
179+
expect(r.status, 'platform admin disown must pass').toBeLessThan(300);
180+
expect(await ownerOf(id) ?? null, 'the anchor is cleared').toBeNull();
181+
});
182+
183+
it('a member’s REST createMany with no owner_id stamps the caller on every row', async () => {
184+
const r = await stack.apiAs(aliceToken, 'POST', `${OBJ}/createMany`, [
185+
{ title: 'alice bulk 1' },
186+
{ title: 'alice bulk 2' },
187+
{ title: 'alice bulk 3' },
188+
]);
189+
const body: any = await r.json();
190+
expect(r.status, `bulk create as a member — got ${JSON.stringify(body)}`).toBeLessThan(300);
191+
const rows = await ql.find('showcase_private_note', {
192+
where: { title: { $in: ['alice bulk 1', 'alice bulk 2', 'alice bulk 3'] } },
193+
context: { isSystem: true },
194+
});
195+
expect(rows.length, 'all three rows were created').toBe(3);
196+
for (const row of rows) expect(row.owner_id, `${row.title} owner`).toBe(aliceId);
197+
});
198+
163199
// ── #3004 × #2982 — bulk change-set carrying owner_id fails closed ─────────
164200

165201
it('a bulk update whose change-set carries owner_id fails closed for a member', async () => {

‎packages/qa/dogfood/test/showcase-crud-persona-matrix.dogfood.test.ts‎

Lines changed: 166 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,19 @@
4141
// goes red naming the object, instead of every persona's denial staying green
4242
// for the wrong reason.
4343
//
44-
// ── What this file deliberately does NOT cover ───────────────────────────────
44+
// ── What the sweep does not judge as plain cells ─────────────────────────────
4545
//
46-
// • The 6 `showcase_field_ops_delegate` × `sys_*` rows. Their verdicts are not
46+
// • The 4 `showcase_field_ops_delegate` × `sys_*` rows. Their verdicts are not
4747
// plain cells: the platform's OWN baseline sets grant some of that surface
4848
// independently of the app's matrix (measured: a member holding no app set
49-
// beyond the baseline reads `/data/sys_user` 200 — self-scoped — while the
50-
// matrix lists `sys_user` read only for the delegate), and the delegate's
51-
// `sys_user_position` writes are decided by the ADR-0090 D12 adminScope
52-
// subtree gate, which `showcase-permission-zoo.dogfood.test.ts` already pins
53-
// on both sides. A raw cell verdict for those rows would be a false negative
54-
// or a false positive depending on the row. They stay manual.
49+
// beyond the baseline reads `/data/sys_user` 200 — the organization's
50+
// directory — while the matrix lists `sys_user` read only for the delegate),
51+
// `sys_user` exposes no create or delete over the API at all (405 for every
52+
// caller), and the delegate's `sys_user_position` writes are decided by the
53+
// ADR-0090 D12 adminScope subtree gate. So the sweep leaves them out and one
54+
// dedicated case drives all 16 cells with those three facts spelled out
55+
// (#26571): a delegate holding exactly the set, `sys_user_position` judged on
56+
// rows the delegate made inside its subtree.
5557
// • The guest-anchor intake asymmetry (`guest_portal`: create without read).
5658
// It is NOT observable on a member persona: the everyone baseline grants read
5759
// on `showcase_inquiry`, so the union says read — and this file asserts the
@@ -101,7 +103,7 @@ const ROWS = matrix.entries.filter((e) => e.object.startsWith('showcase_'));
101103
const effective = (row: MatrixRow, verb: Verb): boolean =>
102104
Boolean(row[verb]) || Boolean(baselineByObject.get(row.object)?.[verb]);
103105

104-
/** The `sys_*` rows this file does not judge — named so the exclusion is visible. */
106+
/** The `sys_*` rows the sweep leaves out — named so the exclusion is visible; one dedicated case drives them. */
105107
const UNJUDGED_ROWS = matrix.entries.filter((e) => !e.object.startsWith('showcase_'));
106108

107109
/**
@@ -553,6 +555,160 @@ describe('showcase: persona × CRUD-cell matrix (#9481)', () => {
553555
expect(afterPlain?.title, 'and the row is untouched').toBe(opsValue);
554556
}, 120_000);
555557

558+
// ── VAMA on the rest of the auditor's objects (clause 3, #26571) ─────────
559+
// The private-note case above is one of the four objects the auditor's
560+
// viewAllRecords names. The other three each hide a foreign row from a
561+
// persona that HOLDS read but not the bit, by a different mechanism: the
562+
// private OWD (inquiry), the contributor's owner RLS (invoice) and the
563+
// master-derived scope (line, controlled_by_parent).
564+
it('viewAllRecords: the auditor reads a FOREIGN inquiry, invoice and invoice line by id AND in lists; a contributor gets none of them', async () => {
565+
const auditor = persona.get('showcase_auditor')!;
566+
const contributor = persona.get('showcase_contributor')!;
567+
const mark = `MX-vama3-${Date.now()}`;
568+
const make = async (object: string, body: Record<string, unknown>) => {
569+
const r = await stack.apiAs(adminTok, 'POST', `/data/${object}`, body);
570+
const json = await bodyOf(r);
571+
expect(r.status, `admin creates the foreign ${object} — got ${JSON.stringify(json)}`).toBeLessThan(300);
572+
return String(idOf(json));
573+
};
574+
const inquiry = await make('showcase_inquiry', PAYLOAD.showcase_inquiry(ctxFor('admin@objectos.ai', mark)));
575+
const invoice = await make('showcase_invoice', PAYLOAD.showcase_invoice(ctxFor('admin@objectos.ai', mark)));
576+
const line = await make('showcase_invoice_line', PAYLOAD.showcase_invoice_line(ctxFor('admin@objectos.ai', mark, invoice)));
577+
578+
for (const [object, id] of [
579+
['showcase_inquiry', inquiry],
580+
['showcase_invoice', invoice],
581+
['showcase_invoice_line', line],
582+
] as const) {
583+
const listPath = `/data/${object}?$filter=${encodeURIComponent(JSON.stringify({ id }))}`;
584+
const byId = await stack.apiAs(auditor.token, 'GET', `/data/${object}/${id}`);
585+
expect(byId.status, `auditor reads the foreign ${object} by id`).toBe(200);
586+
const listed = rowsOf(await bodyOf(await stack.apiAs(auditor.token, 'GET', listPath))).map((r: any) => r.id);
587+
expect(listed, `and in the ${object} list`).toContain(id);
588+
589+
const otherById = await stack.apiAs(contributor.token, 'GET', `/data/${object}/${id}`);
590+
expect(otherById.status, `the contributor cannot read the foreign ${object} by id`).toBeGreaterThanOrEqual(300);
591+
const otherList = await stack.apiAs(contributor.token, 'GET', listPath);
592+
expect(otherList.status, `the contributor's ${object} list itself is served`).toBe(200);
593+
expect(rowsOf(await bodyOf(otherList)).map((r: any) => r.id), `nor sees the ${object} in a list`).not.toContain(id);
594+
}
595+
}, 120_000);
596+
597+
// ── Wrong persona, both sides (negative[0], #26571) ──────────────────────
598+
// One denied cell per permission set, re-run as the admin: a denial that also
599+
// refuses the admin is a broken route or payload, not the persona's grant.
600+
it('one denied cell per set succeeds when re-run as the admin', async () => {
601+
const firstDenied = new Map<string, Cell>();
602+
for (const cell of VERDICTS) {
603+
if (cell.expected === 'deny' && !firstDenied.has(cell.set)) firstDenied.set(cell.set, cell);
604+
}
605+
const setsWithDenials = [...new Set(VERDICTS.filter((c) => c.expected === 'deny').map((c) => c.set))].sort();
606+
expect([...firstDenied.keys()].sort(), 'every set that has a denied cell is re-run').toEqual(setsWithDenials);
607+
expect(setsWithDenials.length, 'the sweep has denials to re-run').toBeGreaterThan(0);
608+
609+
const adminMake = async (object: string, mark: string) => {
610+
const r = await stack.apiAs(adminTok, 'POST', `/data/${object}`, PAYLOAD[object](ctxFor('admin@objectos.ai', mark)));
611+
expect(r.status, `admin seeds a ${object} target`).toBeLessThan(300);
612+
return String(idOf(await bodyOf(r)));
613+
};
614+
for (const cell of firstDenied.values()) {
615+
const label = `${cell.set} × ${cell.object} ${cell.verb}, re-run as admin`;
616+
const mark = `MX-n0-${cell.set}-${cell.object}`;
617+
let r: Response;
618+
if (cell.verb === 'create') {
619+
r = await stack.apiAs(adminTok, 'POST', `/data/${cell.object}`, PAYLOAD[cell.object](ctxFor('admin@objectos.ai', mark)));
620+
} else if (cell.verb === 'read') {
621+
r = await stack.apiAs(adminTok, 'GET', `/data/${cell.object}`);
622+
} else if (cell.verb === 'edit') {
623+
const { field, value } = EDIT_PROBE[cell.object](mark);
624+
r = await stack.apiAs(adminTok, 'PATCH', `/data/${cell.object}/${await adminMake(cell.object, mark)}`, { [field]: value });
625+
} else {
626+
r = await stack.apiAs(adminTok, 'DELETE', `/data/${cell.object}/${await adminMake(cell.object, mark)}`);
627+
}
628+
expect(r.status, `${label} — got ${JSON.stringify(await bodyOf(r))}`).toBeLessThan(300);
629+
}
630+
}, 180_000);
631+
632+
// ── The delegate × sys_* rows (clauses 0, 1 and 6, #26571) ───────────────
633+
// The four rows the sweep above leaves out, driven by a delegate holding
634+
// exactly `showcase_field_ops_delegate`. Two cells are not permission
635+
// verdicts at all: sys_user declares no create and no delete over the API, so
636+
// the API-exposure gate answers 405 for every caller, the admin included.
637+
// The sys_user_position cells are judged on rows the DELEGATE made, inside
638+
// its Field Operations subtree: a row another principal made meets the
639+
// platform's write-ownership floor instead, and an out-of-subtree write the
640+
// ADR-0090 D12 gate (the permission zoo pins both sides of that gate).
641+
it('the 16 showcase_field_ops_delegate × sys_* cells answer the matrix', async () => {
642+
const DELEGATE = 'crudmx-field-ops-delegate@verify.test';
643+
const TARGET = 'crudmx-delegate-target@verify.test';
644+
const delegateTok = await stack.signUp(DELEGATE);
645+
await stack.signUp(TARGET);
646+
const uid = async (email: string) =>
647+
String((await ql.findOne('sys_user', { where: { email }, context: SYS }))?.id ?? '');
648+
const delegateId = await uid(DELEGATE);
649+
const targetId = await uid(TARGET);
650+
expect(delegateId && targetId, 'delegate and target provisioned').toBeTruthy();
651+
const ps = await catalogPermissionSet(ql, 'showcase_field_ops_delegate');
652+
expect(ps, 'delegate set served by the security catalog').toBeTruthy();
653+
await ql.insert('sys_user_permission_set', { user_id: delegateId, permission_set: ps.name }, { context: SYS });
654+
await ql.insert('sys_business_unit_member', { business_unit_id: 'bu_field_ops', user_id: delegateId }, { context: SYS });
655+
await ql.insert('sys_business_unit_member', { business_unit_id: 'bu_west_coast', user_id: targetId }, { context: SYS });
656+
657+
const sysMake = async (object: string, data: Record<string, unknown>) =>
658+
String(idOf(await ql.insert(object, data, { context: SYS })));
659+
const delegateRows = UNJUDGED_ROWS.filter((r) => r.permissionSet === 'showcase_field_ops_delegate');
660+
const cells: Array<{ cell: string; status: number; code?: string; expected: string }> = [];
661+
const drive = (object: string, verb: Verb, status: number, json: any, expected: 'allow' | 'deny' | 405) => {
662+
cells.push({ cell: `${object} ${verb}`, status, code: json?.code, expected: String(expected) });
663+
return json;
664+
};
665+
const send = async (object: string, verb: Verb, r: Response, expected: 'allow' | 'deny' | 405) =>
666+
drive(object, verb, r.status, await bodyOf(r), expected);
667+
668+
for (const row of delegateRows) {
669+
const o = row.object;
670+
const expectOf = (verb: Verb): 'allow' | 'deny' | 405 =>
671+
o === 'sys_user' && (verb === 'create' || verb === 'delete') ? 405 : row[verb] ? 'allow' : 'deny';
672+
if (o === 'sys_user_position') {
673+
const created = await stack.apiAs(delegateTok, 'POST', `/data/${o}`, {
674+
user_id: targetId, position: 'contributor', business_unit_id: 'bu_west_coast',
675+
});
676+
const own = String(idOf(await send(o, 'create', created, expectOf('create'))));
677+
await send(o, 'read', await stack.apiAs(delegateTok, 'GET', `/data/${o}`), expectOf('read'));
678+
await send(o, 'edit', await stack.apiAs(delegateTok, 'PATCH', `/data/${o}/${own}`, { reason: 'crudmx delegate edit' }), expectOf('edit'));
679+
await send(o, 'delete', await stack.apiAs(delegateTok, 'DELETE', `/data/${o}/${own}`), expectOf('delete'));
680+
continue;
681+
}
682+
const createBody: Record<string, unknown> =
683+
o === 'sys_business_unit' ? { name: 'crudmx delegate BU' }
684+
: o === 'sys_business_unit_member' ? { business_unit_id: 'bu_west_coast', user_id: delegateId }
685+
: { email: 'crudmx-forged@verify.test', name: 'forged' };
686+
const probe =
687+
o === 'sys_business_unit' ? await sysMake(o, { name: 'crudmx probe BU' })
688+
: o === 'sys_business_unit_member' ? await sysMake(o, { business_unit_id: 'bu_hq_finance', user_id: targetId })
689+
: targetId;
690+
const editBody: Record<string, unknown> =
691+
o === 'sys_business_unit_member' ? { business_unit_id: 'bu_acme' } : { name: 'crudmx delegate edit' };
692+
await send(o, 'create', await stack.apiAs(delegateTok, 'POST', `/data/${o}`, createBody), expectOf('create'));
693+
await send(o, 'read', await stack.apiAs(delegateTok, 'GET', `/data/${o}`), expectOf('read'));
694+
await send(o, 'edit', await stack.apiAs(delegateTok, 'PATCH', `/data/${o}/${probe}`, editBody), expectOf('edit'));
695+
await send(o, 'delete', await stack.apiAs(delegateTok, 'DELETE', `/data/${o}/${probe}`), expectOf('delete'));
696+
}
697+
expect(cells.length, 'four rows × four verbs').toBe(16);
698+
for (const c of cells) {
699+
if (c.expected === 'allow') expect(c.status, `${c.cell}: allowed`).toBeLessThan(300);
700+
else if (c.expected === '405') expect([c.status, c.code], `${c.cell}: not exposed over the API`).toEqual([405, 'OBJECT_API_METHOD_NOT_ALLOWED']);
701+
else expect([c.status, c.code], `${c.cell}: withheld`).toEqual([403, 'PERMISSION_DENIED']);
702+
}
703+
704+
// The admin control on the two 405 cells: the exposure gate answers before
705+
// any permission is judged, so the admin is refused the same way.
706+
const adminCreate = await stack.apiAs(adminTok, 'POST', '/data/sys_user', { email: 'crudmx-admin-forged@verify.test', name: 'x' });
707+
expect([adminCreate.status, (await bodyOf(adminCreate))?.code], 'admin sys_user create').toEqual([405, 'OBJECT_API_METHOD_NOT_ALLOWED']);
708+
const adminDelete = await stack.apiAs(adminTok, 'DELETE', `/data/sys_user/${targetId}`);
709+
expect([adminDelete.status, (await bodyOf(adminDelete))?.code], 'admin sys_user delete').toEqual([405, 'OBJECT_API_METHOD_NOT_ALLOWED']);
710+
}, 180_000);
711+
556712
// ── The verdict table itself (clause 6) ──────────────────────────────────
557713
//
558714
// This is the anti-vacuity check. Without it the sweep could shrink — a
@@ -632,7 +788,7 @@ describe('showcase: persona × CRUD-cell matrix (#9481)', () => {
632788
});
633789

634790
// ── The exclusion is declared, not silent ────────────────────────────────
635-
it('names the matrix rows this file does not judge (the sys_* delegate surface)', () => {
791+
it('names the matrix rows the sweep leaves to the delegate case (the sys_* delegate surface)', () => {
636792
// The two retired catalog row objects (ADR-0131 D3) leave the matrix with
637793
// C3 stage 8; the rest of the delegate surface stays.
638794
const RETIRED = new Set(['sys_permission_set', 'sys_position']);

0 commit comments

Comments
 (0)