@substrat-run/contract-tests 0.139.0 → 0.140.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/capability-suite.d.ts.map +1 -1
  2. package/dist/capability-suite.js +5 -0
  3. package/dist/capability-suite.js.map +1 -1
  4. package/dist/caused-by-suite.d.ts.map +1 -1
  5. package/dist/caused-by-suite.js +54 -10
  6. package/dist/caused-by-suite.js.map +1 -1
  7. package/dist/connect-link-suite.d.ts +19 -0
  8. package/dist/connect-link-suite.d.ts.map +1 -0
  9. package/dist/connect-link-suite.js +215 -0
  10. package/dist/connect-link-suite.js.map +1 -0
  11. package/dist/entity-state-migration-suite.d.ts +16 -0
  12. package/dist/entity-state-migration-suite.d.ts.map +1 -0
  13. package/dist/entity-state-migration-suite.js +305 -0
  14. package/dist/entity-state-migration-suite.js.map +1 -0
  15. package/dist/entity-state-module.d.ts +183 -0
  16. package/dist/entity-state-module.d.ts.map +1 -1
  17. package/dist/entity-state-module.js +139 -1
  18. package/dist/entity-state-module.js.map +1 -1
  19. package/dist/entity-state-suite.d.ts.map +1 -1
  20. package/dist/entity-state-suite.js +35 -12
  21. package/dist/entity-state-suite.js.map +1 -1
  22. package/dist/entity-trash-module.d.ts +439 -0
  23. package/dist/entity-trash-module.d.ts.map +1 -0
  24. package/dist/entity-trash-module.js +287 -0
  25. package/dist/entity-trash-module.js.map +1 -0
  26. package/dist/entity-trash-suite.d.ts +59 -0
  27. package/dist/entity-trash-suite.d.ts.map +1 -0
  28. package/dist/entity-trash-suite.js +568 -0
  29. package/dist/entity-trash-suite.js.map +1 -0
  30. package/dist/erasure-module.d.ts +259 -0
  31. package/dist/erasure-module.d.ts.map +1 -0
  32. package/dist/erasure-module.js +251 -0
  33. package/dist/erasure-module.js.map +1 -0
  34. package/dist/index.d.ts +13 -1
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +13 -1
  37. package/dist/index.js.map +1 -1
  38. package/dist/list-suite.d.ts.map +1 -1
  39. package/dist/list-suite.js +101 -1
  40. package/dist/list-suite.js.map +1 -1
  41. package/dist/membership-executor-suite.d.ts.map +1 -1
  42. package/dist/membership-executor-suite.js +60 -9
  43. package/dist/membership-executor-suite.js.map +1 -1
  44. package/dist/migration-comments-suite.d.ts +3 -0
  45. package/dist/migration-comments-suite.d.ts.map +1 -0
  46. package/dist/migration-comments-suite.js +92 -0
  47. package/dist/migration-comments-suite.js.map +1 -0
  48. package/dist/migration-comments.d.ts +3 -0
  49. package/dist/migration-comments.d.ts.map +1 -0
  50. package/dist/migration-comments.js +50 -0
  51. package/dist/migration-comments.js.map +1 -0
  52. package/dist/migration-digest-suite.d.ts +3 -0
  53. package/dist/migration-digest-suite.d.ts.map +1 -0
  54. package/dist/migration-digest-suite.js +175 -0
  55. package/dist/migration-digest-suite.js.map +1 -0
  56. package/dist/modules.d.ts +542 -0
  57. package/dist/modules.d.ts.map +1 -1
  58. package/dist/modules.js +155 -7
  59. package/dist/modules.js.map +1 -1
  60. package/dist/peer-suite.d.ts +2 -1
  61. package/dist/peer-suite.d.ts.map +1 -1
  62. package/dist/peer-suite.js +103 -1
  63. package/dist/peer-suite.js.map +1 -1
  64. package/dist/permission-suite.d.ts.map +1 -1
  65. package/dist/permission-suite.js +515 -2
  66. package/dist/permission-suite.js.map +1 -1
  67. package/dist/scope-host-suite.d.ts.map +1 -1
  68. package/dist/scope-host-suite.js +54 -1
  69. package/dist/scope-host-suite.js.map +1 -1
  70. package/dist/split-cases.d.ts +12 -0
  71. package/dist/split-cases.d.ts.map +1 -0
  72. package/dist/split-cases.js +59 -0
  73. package/dist/split-cases.js.map +1 -0
  74. package/dist/subject-erasure-suite.d.ts +6 -0
  75. package/dist/subject-erasure-suite.d.ts.map +1 -0
  76. package/dist/subject-erasure-suite.js +287 -0
  77. package/dist/subject-erasure-suite.js.map +1 -0
  78. package/dist/switch-audit-fault.d.ts +48 -0
  79. package/dist/switch-audit-fault.d.ts.map +1 -0
  80. package/dist/switch-audit-fault.js +80 -0
  81. package/dist/switch-audit-fault.js.map +1 -0
  82. package/dist/system-switch-suite.d.ts +2 -1
  83. package/dist/system-switch-suite.d.ts.map +1 -1
  84. package/dist/system-switch-suite.js +90 -0
  85. package/dist/system-switch-suite.js.map +1 -1
  86. package/dist/vertical-events-suite.d.ts +41 -0
  87. package/dist/vertical-events-suite.d.ts.map +1 -1
  88. package/dist/vertical-events-suite.js +55 -0
  89. package/dist/vertical-events-suite.js.map +1 -1
  90. package/package.json +3 -3
@@ -0,0 +1,287 @@
1
+ /**
2
+ * The fixture behind `entityTrashContractSuite` (#119 PR 2): the host's trash refusal, the
3
+ * link refusal and the purge horizon, declared the way a vertical declares them — through
4
+ * `defineEntities`, `defineOperations`, `operationInputsOf` and `purgeSchedulesOf` — so the
5
+ * suite is held against the producers a vertical actually calls, not a hand-written copy.
6
+ *
7
+ * - `tbox` — archivable and trashable, purged after `TBOX_PURGE_DAYS` by `trash/delete-box`.
8
+ * - `tthing` — a child of `tbox`, for `ctx.link` / `ctx.relink`.
9
+ * - `tkeep` — trashable with NO horizon: in the bin forever, whatever the sweep does.
10
+ *
11
+ * One operation per refusal shape: refused by default (`rename-box`), `trashed: 'admits'`
12
+ * (`restore-box`, `peek-box`, `link-thing`, `move-thing`), `trashed: 'purges'`
13
+ * (`delete-box`), and a check `resolved` in the handler (`touch-thing`) the host cannot see.
14
+ */
15
+ import { z } from 'zod';
16
+ import { defineEntities, defineOperations, manifestEntities, manifestOperations, moduleManifest, operationInputsOf, purgeSchedulesOf, } from '@substrat-run/contracts';
17
+ import { assertAllowed, readHistory } from '@substrat-run/kernel';
18
+ export const TRASH_MODULE_ID = '@test/trash';
19
+ export const TBOX_PURGE_DAYS = 7;
20
+ /** A box whose purge always fails after deleting — a crash inside the purge's transaction. */
21
+ export const EXPLODING_BOX = 'explode';
22
+ export const trashEntities = defineEntities({
23
+ tbox: {
24
+ table: 'trash_boxes',
25
+ fields: z.object({ id: z.string(), name: z.string() }),
26
+ archive: { permission: 'box:archive' },
27
+ trash: { permission: 'box:trash', purgeAfterDays: TBOX_PURGE_DAYS },
28
+ },
29
+ tthing: {
30
+ table: 'trash_things',
31
+ fields: z.object({ id: z.string(), box_id: z.string() }),
32
+ parents: ['tbox'],
33
+ },
34
+ tkeep: {
35
+ table: 'trash_keeps',
36
+ fields: z.object({ id: z.string() }),
37
+ trash: { permission: 'box:trash' },
38
+ },
39
+ });
40
+ const PERMISSIONS = ['box:read', 'box:write', 'box:archive', 'box:trash', 'box:delete'];
41
+ const boxId = z.object({ boxId: z.string() });
42
+ const box = (key) => ({ key, entity: 'tbox', idFrom: 'boxId' });
43
+ const ok = z.object({ ok: z.boolean() });
44
+ export const trashOperations = defineOperations(trashEntities, PERMISSIONS)({
45
+ 'trash/add-box': {
46
+ summary: 'Add a box',
47
+ permission: 'box:write',
48
+ input: z.object({ id: z.string(), name: z.string() }),
49
+ output: ok,
50
+ },
51
+ 'trash/add-keep': {
52
+ summary: 'Add a keep',
53
+ permission: 'box:write',
54
+ input: z.object({ id: z.string() }),
55
+ output: ok,
56
+ },
57
+ 'trash/bin-many': {
58
+ summary: 'Add and bin many boxes in one call — the fixture for a full purge batch',
59
+ permission: 'box:write',
60
+ input: z.object({ prefix: z.string(), count: z.number().int().positive() }),
61
+ output: z.object({ ids: z.array(z.string()) }),
62
+ },
63
+ 'trash/rename-box': {
64
+ summary: 'Rename a box — refused on a trashed one by the host',
65
+ permission: box('box:write'),
66
+ input: z.object({ boxId: z.string(), name: z.string() }),
67
+ output: ok,
68
+ },
69
+ 'trash/archive-box': { summary: 'Archive a box', permission: box('box:archive'), input: boxId, output: ok },
70
+ 'trash/trash-box': { summary: 'Bin a box', permission: box('box:trash'), input: boxId, output: ok },
71
+ 'trash/trash-keep': {
72
+ summary: 'Bin a keep',
73
+ permission: { key: 'box:trash', entity: 'tkeep', idFrom: 'keepId' },
74
+ input: z.object({ keepId: z.string() }),
75
+ output: ok,
76
+ },
77
+ 'trash/restore-box': {
78
+ summary: 'Restore a box from the bin',
79
+ permission: box('box:trash'),
80
+ trashed: 'admits',
81
+ input: boxId,
82
+ output: ok,
83
+ },
84
+ 'trash/peek-box': {
85
+ summary: "A box's state, binned or not",
86
+ permission: box('box:read'),
87
+ trashed: 'admits',
88
+ input: boxId,
89
+ output: z.object({ state: z.string().nullable() }),
90
+ },
91
+ 'trash/delete-box': {
92
+ summary: 'Delete a box and its things for good — the purge horizon runs this',
93
+ permission: box('box:delete'),
94
+ trashed: 'purges',
95
+ // Strict: a purge's parsed input is the id and nothing else, which registration requires.
96
+ input: z.strictObject({ boxId: z.string() }),
97
+ output: z.object({ ok: z.boolean(), boxId: z.string() }),
98
+ emits: { entity: 'tbox', entityIdFrom: 'boxId', type: 'trashbox.deleted', schemaVersion: 1, piiClass: 'none' },
99
+ },
100
+ 'trash/other-delete': {
101
+ summary: 'Another operation checking the purge key — the system principal may not run it',
102
+ permission: box('box:delete'),
103
+ input: boxId,
104
+ output: ok,
105
+ },
106
+ 'trash/link-thing': {
107
+ summary: 'Hang a thing off a box — admits a binned box, so ctx.link is what refuses',
108
+ permission: box('box:write'),
109
+ trashed: 'admits',
110
+ input: z.object({ boxId: z.string(), thingId: z.string() }),
111
+ output: ok,
112
+ },
113
+ 'trash/move-thing': {
114
+ summary: 'Move a thing to another box — admits a binned box, so ctx.relink is what refuses',
115
+ permission: box('box:write'),
116
+ trashed: 'admits',
117
+ input: z.object({ boxId: z.string(), thingId: z.string(), fromBoxId: z.string() }),
118
+ output: ok,
119
+ },
120
+ 'trash/touch-thing': {
121
+ summary: 'Touch a thing — its check is resolved, so the host cannot refuse it (the stated gap)',
122
+ permission: { key: 'box:write', entity: 'tbox', resolved: 'the box the thing is in' },
123
+ input: z.object({ thingId: z.string() }),
124
+ output: ok,
125
+ },
126
+ 'trash/box-exists': {
127
+ summary: 'Whether a box row exists at all',
128
+ permission: 'box:read',
129
+ input: boxId,
130
+ output: z.object({ exists: z.boolean(), things: z.number() }),
131
+ },
132
+ 'trash/ddl': {
133
+ summary: "Runtime DDL through ctx.sql — after which the kernel checks every stateful table is intact",
134
+ permission: 'box:write',
135
+ input: z.object({ table: z.string() }),
136
+ output: ok,
137
+ },
138
+ 'trash/history': {
139
+ summary: "A box's event history, after it is gone too",
140
+ permission: 'box:read',
141
+ input: boxId,
142
+ output: z.object({ entries: z.array(z.unknown()) }),
143
+ },
144
+ });
145
+ export const trashModManifest = moduleManifest.parse({
146
+ id: TRASH_MODULE_ID,
147
+ version: '1.0.0',
148
+ kernelContract: '^0.0.1',
149
+ migrations: { journalDir: './migrations', compatibleFrom: '1.0.0' },
150
+ ...manifestOperations(trashOperations, {
151
+ permissions: {
152
+ 'box:read': 'read boxes',
153
+ 'box:write': 'write boxes',
154
+ 'box:archive': 'archive a box',
155
+ 'box:trash': 'bin a box or restore it',
156
+ 'box:delete': 'delete a box for good',
157
+ },
158
+ consumes: [],
159
+ }),
160
+ ...manifestEntities(trashEntities, {}),
161
+ schedules: purgeSchedulesOf(trashOperations, trashEntities),
162
+ entitlementKey: 'trash',
163
+ });
164
+ const boxRef = (id) => ({ entityType: 'tbox', entityId: id });
165
+ const thingRef = (id) => ({ entityType: 'tthing', entityId: id });
166
+ const P = (key) => key;
167
+ export const trashMod = {
168
+ manifest: trashModManifest,
169
+ migrations: [
170
+ {
171
+ version: '0001-init',
172
+ sql: `CREATE TABLE trash_boxes (id TEXT PRIMARY KEY, name TEXT NOT NULL);
173
+ CREATE TABLE trash_things (id TEXT PRIMARY KEY, box_id TEXT NOT NULL);
174
+ CREATE TABLE trash_keeps (id TEXT PRIMARY KEY);`,
175
+ },
176
+ ],
177
+ // The host derives each operation's target from these — the same declarations it parses with.
178
+ operationInputs: operationInputsOf(trashOperations),
179
+ // Every handler checks its declared key first, as a vertical's does — the host's refusal has
180
+ // to agree with that order, which is what the suite asserts.
181
+ operations: {
182
+ 'trash/add-box': (async (ctx, i) => {
183
+ assertAllowed(await ctx.check(P('box:write')));
184
+ ctx.sql.exec('INSERT INTO trash_boxes (id, name) VALUES (?, ?)', [i.id, i.name]);
185
+ return { ok: true };
186
+ }),
187
+ 'trash/add-keep': (async (ctx, i) => {
188
+ assertAllowed(await ctx.check(P('box:write')));
189
+ ctx.sql.exec('INSERT INTO trash_keeps (id) VALUES (?)', [i.id]);
190
+ return { ok: true };
191
+ }),
192
+ 'trash/bin-many': (async (ctx, i) => {
193
+ assertAllowed(await ctx.check(P('box:write')));
194
+ const ids = [];
195
+ for (let n = 0; n < i.count; n++) {
196
+ const id = `${i.prefix}${String(n).padStart(4, '0')}`;
197
+ ctx.sql.exec('INSERT INTO trash_boxes (id, name) VALUES (?, ?)', [id, id]);
198
+ await ctx.trash(boxRef(id));
199
+ ids.push(id);
200
+ }
201
+ return { ids };
202
+ }),
203
+ 'trash/rename-box': (async (ctx, i) => {
204
+ assertAllowed(await ctx.check(P('box:write'), boxRef(i.boxId)));
205
+ ctx.sql.exec('UPDATE trash_boxes SET name = ? WHERE id = ?', [i.name, i.boxId]);
206
+ return { ok: true };
207
+ }),
208
+ 'trash/archive-box': (async (ctx, i) => {
209
+ await ctx.archive(boxRef(i.boxId));
210
+ return { ok: true };
211
+ }),
212
+ 'trash/trash-box': (async (ctx, i) => {
213
+ await ctx.trash(boxRef(i.boxId));
214
+ return { ok: true };
215
+ }),
216
+ 'trash/trash-keep': (async (ctx, i) => {
217
+ await ctx.trash({ entityType: 'tkeep', entityId: i.keepId });
218
+ return { ok: true };
219
+ }),
220
+ 'trash/restore-box': (async (ctx, i) => {
221
+ await ctx.restore(boxRef(i.boxId));
222
+ return { ok: true };
223
+ }),
224
+ 'trash/peek-box': (async (ctx, i) => {
225
+ assertAllowed(await ctx.check(P('box:read'), boxRef(i.boxId)));
226
+ return { state: ctx.entityState(boxRef(i.boxId)) };
227
+ }),
228
+ 'trash/delete-box': (async (ctx, i) => {
229
+ assertAllowed(await ctx.check(P('box:delete'), boxRef(i.boxId)));
230
+ const row = ctx.sql.query('SELECT name FROM trash_boxes WHERE id = ?', [i.boxId])[0];
231
+ if (!row)
232
+ return { ok: false, boxId: i.boxId };
233
+ // The vertical's cascade rule, which is why the horizon runs this and not a kernel DELETE.
234
+ ctx.sql.exec('DELETE FROM trash_things WHERE box_id = ?', [i.boxId]);
235
+ ctx.sql.exec('DELETE FROM trash_boxes WHERE id = ?', [i.boxId]);
236
+ ctx.emit({
237
+ type: 'trashbox.deleted',
238
+ schemaVersion: 1,
239
+ entity: boxRef(i.boxId),
240
+ piiClass: 'none',
241
+ payload: { boxId: i.boxId },
242
+ });
243
+ if (row.name === EXPLODING_BOX)
244
+ throw new Error('the purge crashed after deleting — everything rolls back');
245
+ return { ok: true, boxId: i.boxId };
246
+ }),
247
+ 'trash/other-delete': (async (ctx, i) => {
248
+ assertAllowed(await ctx.check(P('box:delete'), boxRef(i.boxId)));
249
+ return { ok: true };
250
+ }),
251
+ 'trash/link-thing': (async (ctx, i) => {
252
+ assertAllowed(await ctx.check(P('box:write'), boxRef(i.boxId)));
253
+ ctx.sql.exec('INSERT OR IGNORE INTO trash_things (id, box_id) VALUES (?, ?)', [i.thingId, i.boxId]);
254
+ ctx.link(thingRef(i.thingId), boxRef(i.boxId));
255
+ return { ok: true };
256
+ }),
257
+ 'trash/move-thing': (async (ctx, i) => {
258
+ assertAllowed(await ctx.check(P('box:write'), boxRef(i.boxId)));
259
+ ctx.relink(thingRef(i.thingId), boxRef(i.fromBoxId), boxRef(i.boxId));
260
+ ctx.sql.exec('UPDATE trash_things SET box_id = ? WHERE id = ?', [i.boxId, i.thingId]);
261
+ return { ok: true };
262
+ }),
263
+ 'trash/touch-thing': (async (ctx, i) => {
264
+ const thing = ctx.sql.query('SELECT box_id FROM trash_things WHERE id = ?', [i.thingId])[0];
265
+ if (!thing)
266
+ throw new Error('no such thing');
267
+ assertAllowed(await ctx.check(P('box:write'), boxRef(thing.box_id)));
268
+ return { ok: true };
269
+ }),
270
+ 'trash/box-exists': (async (ctx, i) => {
271
+ assertAllowed(await ctx.check(P('box:read')));
272
+ const exists = ctx.sql.query('SELECT 1 AS x FROM trash_boxes WHERE id = ?', [i.boxId]).length > 0;
273
+ const things = ctx.sql.query('SELECT 1 AS x FROM trash_things WHERE box_id = ?', [i.boxId]).length;
274
+ return { exists, things };
275
+ }),
276
+ 'trash/ddl': (async (ctx, i) => {
277
+ assertAllowed(await ctx.check(P('box:write')));
278
+ ctx.sql.exec(`CREATE TABLE ${i.table} (id TEXT)`);
279
+ return { ok: true };
280
+ }),
281
+ 'trash/history': (async (ctx, i) => {
282
+ assertAllowed(await ctx.check(P('box:read')));
283
+ return { entries: readHistory({ sql: ctx.sql }, boxRef(i.boxId)).entries };
284
+ }),
285
+ },
286
+ };
287
+ //# sourceMappingURL=entity-trash-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-trash-module.js","sourceRoot":"","sources":["../src/entity-trash-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,GAEjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAkD,MAAM,sBAAsB,CAAC;AAElH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AACjC,8FAA8F;AAC9F,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEvC,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC;IAC1C,IAAI,EAAE;QACJ,KAAK,EAAE,aAAa;QACpB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QACtD,OAAO,EAAE,EA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7E,CAAC,CAAY;KACd;CACF,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { type ScopeId, type TenantId } from '@substrat-run/contracts';
2
+ import type { ScopeHostFixture } from './scope-host-suite.js';
3
+ import type { RawScopeSql } from './entity-state-suite.js';
4
+ export declare function entityTrashContractSuite(adapterName: string, makeFixture: () => Promise<ScopeHostFixture>, raw: RawScopeSql, options?: {
5
+ /**
6
+ * Whether a whole `runPlatformSweep` is affordable on this fixture. It walks every active
7
+ * scope its directory holds, so on a directory SHARED by every suite in the file (the
8
+ * Cloudflare fixture's control plane) one pass takes minutes and starves the suites after
9
+ * it. The property it holds — a copy that is not primary never runs a schedule, the purge's
10
+ * included — is the kernel sweep's `isPrimaryScope` filter, the same code on both adapters.
11
+ */
12
+ platformSweep?: boolean;
13
+ /**
14
+ * The adapter's own door to a scope, BELOW every host API — what code holding the scope's
15
+ * storage binding could call (#119, Codex r2). `claimPurge` invokes as the module's system
16
+ * principal with every purge claim that door can carry attached, and answers the error code
17
+ * (or `'ok'`); `runPurgeSweep` runs one purge pass directly, outside the coordinator's sweep.
18
+ */
19
+ direct?: {
20
+ claimPurge(tenant: TenantId, scope: ScopeId, operation: string, input: unknown): Promise<string>;
21
+ runPurgeSweep(tenant: TenantId, scope: ScopeId, operation: string): Promise<{
22
+ purged: number;
23
+ skipped: number;
24
+ held?: string;
25
+ }>;
26
+ /**
27
+ * Hold (or release) the scope's lifecycle where THIS adapter's scope-side gate reads it: the
28
+ * directory on the pure adapter, the delivered lifecycle (#1713) in a Durable Object.
29
+ */
30
+ holdLifecycle(tenant: TenantId, scope: ScopeId, held: boolean): Promise<void>;
31
+ /**
32
+ * Record the scope's tenant where this adapter's scope-side gate reads it: the directory on the
33
+ * pure adapter (already there), the `provisioned_for` receipt in a Durable Object — which only a
34
+ * projection or a lifecycle delivery writes, so a directory-backed host's scope has none.
35
+ */
36
+ recordTenant(tenant: TenantId, scope: ScopeId): Promise<void>;
37
+ /**
38
+ * What a direct sweep naming a foreign tenant meets on a scope that has NOT recorded its tenant:
39
+ * `refused` where the directory is the record (the pure adapter); `admitted` in a Durable Object
40
+ * with no receipt — the doors' rule for an `unknown` pair, and why a directory-backed host leaves
41
+ * the tenant to the coordinator. Pinned, so a change to either is seen.
42
+ */
43
+ unrecordedTenant: 'refused' | 'admitted';
44
+ /** Classify the scope a copy where this adapter's scope-side gate reads it. */
45
+ markCopy(tenant: TenantId, scope: ScopeId): Promise<void>;
46
+ /**
47
+ * Where the sweep's scope id is attribution only (the Durable Object, which records no scope id
48
+ * of its own): run the sweep on `scope`'s object while NAMING `named`.
49
+ */
50
+ runPurgeSweepNaming?(tenant: TenantId, scope: ScopeId, named: ScopeId, operation: string): Promise<{
51
+ purged: number;
52
+ errors: {
53
+ entityId: string;
54
+ error: string;
55
+ }[];
56
+ }>;
57
+ };
58
+ }): void;
59
+ //# sourceMappingURL=entity-trash-suite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-trash-suite.d.ts","sourceRoot":"","sources":["../src/entity-trash-suite.ts"],"names":[],"mappings":"AAcA,OAAO,EAYL,KAAK,OAAO,EACZ,KAAK,QAAQ,EAEd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAW3D,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,EAC5C,GAAG,EAAE,WAAW,EAChB,OAAO,GAAE;IACP;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,MAAM,CAAC,EAAE;QACP,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QACj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