From 538d33df97069b010e3aba5c50ef6138986eedee Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 2 Sep 2026 23:24:32 +0000 Subject: [PATCH] test(plugin-approvals): pin the lock release in the tenant-admin reverse check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `#12775` override-narrowing block's tenant-admin reverse check ("the narrowing is about status, not posture") proved a strict subset of the platform-admin case it mirrors: `recalled` status plus the action row, but nothing about the record lock. The platform-admin case pins `locked → released` around the recall; this makes the pair symmetric with the same two lines, in the same idiom. Both lines, not just the release: asserting only the release would pass vacuously if the lock never engaged for this posture, which is the same "proves a subset of what it mirrors" weakness one level down. Test-only. No product change; the ruled behaviour from #12775 is untouched. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8 --- packages/plugins/plugin-approvals/src/approval-revise.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/plugins/plugin-approvals/src/approval-revise.test.ts b/packages/plugins/plugin-approvals/src/approval-revise.test.ts index 783180039f..e0a7dc8da8 100644 --- a/packages/plugins/plugin-approvals/src/approval-revise.test.ts +++ b/packages/plugins/plugin-approvals/src/approval-revise.test.ts @@ -480,10 +480,12 @@ describe('Send back for revision (ADR-0044)', () => { }); it('reverse check (tenant admin): admitted on `pending` too — the narrowing is about status, not posture', async () => { - const { req } = await pendingRequest(); + const { req, editAttempt } = await pendingRequest(); + await expect(editAttempt()).rejects.toThrow(/RECORD_LOCKED/); // pending → locked const out = await service.recall(req.id, { actorId: 'org_owner' }, TENANT_ADMIN); expect(out.request.status).toBe('recalled'); expect(await actionsOf(req.id)).toContain('recall'); + await expect(editAttempt()).resolves.toBeUndefined(); // the #3424 release still happens }); it("the submitter's own revise-window recall is untouched (ADR-0044)", async () => {