Skip to content

Commit 9cfc766

Browse files
committed
test(spec): a hook delete literal carrying permanent fails to compile; changeset headline names runtime
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxhbtrhtRZ958iyyJp
1 parent 9f76546 commit 9cfc766

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎.changeset/30237-recycle-bin-purge-empty-permanent.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'@objectstack/runtime': minor
55
---
66

7-
feat(objectql,spec): purge and empty the recycle bin, and delete a record for good (ADR-0148): `ObjectQL.purge(entryId)`, `ObjectQL.empty(object)` and `delete(object, { where: { id }, permanent: true })`, all authorized as the `purge` operation
7+
feat(objectql,spec,runtime): purge and empty the recycle bin, and delete a record for good (ADR-0148): `ObjectQL.purge(entryId)`, `ObjectQL.empty(object)` and `delete(object, { where: { id }, permanent: true })`, all authorized as the `purge` operation; hooks and app-authored bodies cannot pass `permanent`
88

99
Clause-②: yes (widening)
1010
Metadata-protocol: added

‎packages/spec/src/data/hook-api.test.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,18 @@ describe('HookApi — the published hook ctx.api face', () => {
174174
const wrong: HookDeleteOptions = {
175175
where: { id: 'a' },
176176
// @ts-expect-error `returning` is an UPDATE option; the engine's delete
177-
// set is `{ context, where, multi }` plus the pass-throughs.
177+
// set is `{ context, where, multi, permanent }` plus the pass-throughs,
178+
// and this face carries `{ where, multi }` of it.
178179
returning: true,
179180
};
180-
expect([ok, wrong].length).toBe(2);
181+
const purge: HookDeleteOptions = {
182+
where: { id: 'a' },
183+
// @ts-expect-error `permanent` is off this face: app-authored code
184+
// cannot purge, its deletes enter the recycle bin (maintainer ruling A,
185+
// recorded in 6691358077).
186+
permanent: true,
187+
};
188+
expect([ok, wrong, purge].length).toBe(3);
181189
});
182190
});
183191

0 commit comments

Comments
 (0)