Skip to content

Commit 2302a5f

Browse files
committed
feat(spec): EngineDeleteOptions.permanent, the delete that skips the recycle bin
A by-id delete that sets `permanent: true` keeps nothing in the recycle bin and is authorized as the `purge` operation rather than `delete`: the privacy-erasure door ADR-0148 D3 keeps, and a recycle-bin manager's act. A delete by predicate never enters the bin, so the key is for by-id deletes only. The authorable surface and the reference page are regenerated. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czFGLnXKQd6cQjv3Pr
1 parent 25e1c1a commit 2302a5f

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎content/docs/references/data/data-engine.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ QueryAST-aligned options for DataEngine.delete operations
656656
| **context** | `{ userId?: string; actor?: string; attributedUserId?: string; email?: string; … }` | optional | |
657657
| **where** | `Record<string, any> \| any` | optional | |
658658
| **multi** | `boolean` | optional (default: `false`) | |
659+
| **permanent** | `boolean` | optional | Delete for good: the rows skip the recycle bin and cannot be restored. Authorized as the `purge` operation, not `delete`. By-id deletes only. |
659660

660661
### Nested Shape: `EngineDeleteOptions.context`
661662

‎packages/spec/authorable-surface/data.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@
238238
"data/EngineCountOptions:where",
239239
"data/EngineDeleteOptions:context",
240240
"data/EngineDeleteOptions:multi",
241+
"data/EngineDeleteOptions:permanent",
241242
"data/EngineDeleteOptions:where",
242243
"data/EngineQueryOptions:context",
243244
"data/EngineQueryOptions:cursor [RETIRED]",

‎packages/spec/src/data/data-engine.zod.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,17 @@ export const EngineDeleteOptionsSchema = lazySchema(() => BaseEngineOptionsSchem
444444
where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),
445445
/** Delete multiple records? If false, only the first match is deleted. Default: false */
446446
multi: z.boolean().default(false).optional(),
447+
/**
448+
* [ADR-0148 D3] Delete for good: the deleted rows are not kept in the
449+
* recycle bin (`sys_recycle_bin`), so nothing can restore them. This is the
450+
* privacy-erasure door, and a recycle-bin manager's act: it is authorized
451+
* as the `purge` operation, not as `delete`. Only a by-id delete takes it:
452+
* a delete by predicate never enters the bin, so the engine refuses
453+
* `permanent: true` beside `multi: true` or without an id.
454+
*/
455+
permanent: z.boolean().optional().describe(
456+
'Delete for good: the rows skip the recycle bin and cannot be restored. Authorized as the `purge` operation, not `delete`. By-id deletes only.',
457+
),
447458
}).describe('QueryAST-aligned options for DataEngine.delete operations'));
448459

449460
// --------------------------------------------------------------------------

0 commit comments

Comments
 (0)