@substrat-run/kernel 0.220.0 → 0.221.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 (51) hide show
  1. package/dist/adopt-major.d.ts +150 -0
  2. package/dist/adopt-major.d.ts.map +1 -0
  3. package/dist/adopt-major.js +150 -0
  4. package/dist/adopt-major.js.map +1 -0
  5. package/dist/app-environments.d.ts +54 -3
  6. package/dist/app-environments.d.ts.map +1 -1
  7. package/dist/app-environments.js +126 -3
  8. package/dist/app-environments.js.map +1 -1
  9. package/dist/carried-copy.d.ts.map +1 -1
  10. package/dist/carried-copy.js +3 -0
  11. package/dist/carried-copy.js.map +1 -1
  12. package/dist/directory-lake-keep.d.ts.map +1 -1
  13. package/dist/directory-lake-keep.js +1 -0
  14. package/dist/directory-lake-keep.js.map +1 -1
  15. package/dist/index.d.ts +9 -5
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +10 -3
  18. package/dist/index.js.map +1 -1
  19. package/dist/permission-checker.d.ts.map +1 -1
  20. package/dist/permission-checker.js +4 -2
  21. package/dist/permission-checker.js.map +1 -1
  22. package/dist/reserved-roles.d.ts +6 -1
  23. package/dist/reserved-roles.d.ts.map +1 -1
  24. package/dist/reserved-roles.js.map +1 -1
  25. package/dist/schedule-due.d.ts +88 -0
  26. package/dist/schedule-due.d.ts.map +1 -0
  27. package/dist/schedule-due.js +116 -0
  28. package/dist/schedule-due.js.map +1 -0
  29. package/dist/schedule-state.d.ts +1 -1
  30. package/dist/schedule-state.d.ts.map +1 -1
  31. package/dist/schedule-state.js +6 -0
  32. package/dist/schedule-state.js.map +1 -1
  33. package/dist/scope-copy.d.ts.map +1 -1
  34. package/dist/scope-copy.js +7 -1
  35. package/dist/scope-copy.js.map +1 -1
  36. package/dist/scope-host.d.ts +138 -2
  37. package/dist/scope-host.d.ts.map +1 -1
  38. package/dist/scope-host.js.map +1 -1
  39. package/dist/scope-store.d.ts +30 -6
  40. package/dist/scope-store.d.ts.map +1 -1
  41. package/dist/scope-store.js +30 -1
  42. package/dist/scope-store.js.map +1 -1
  43. package/dist/scope-types.d.ts +107 -3
  44. package/dist/scope-types.d.ts.map +1 -1
  45. package/dist/scope-types.js +153 -2
  46. package/dist/scope-types.js.map +1 -1
  47. package/dist/store-proof.d.ts +45 -0
  48. package/dist/store-proof.d.ts.map +1 -0
  49. package/dist/store-proof.js +97 -0
  50. package/dist/store-proof.js.map +1 -0
  51. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"reserved-roles.js","sourceRoot":"","sources":["../src/reserved-roles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAiD,MAAM,yBAAyB,CAAC;AAExG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAe,EACf,QAA6B,EAC7B,IAA2B;IAE3B,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAClD,OAAO,CACL,SAAS,IAAI,CAAC,GAAG,iGAAiG;YAClH,yCAAyC,CAC1C,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,CACL,SAAS,IAAI,CAAC,GAAG,WAAW,IAAI,yEAAyE;YACzG,gCAAgC,WAAW,GAAG,CAC/C,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EA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G,iIAAiI,CAAC;AAEtJ;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAqB,EAAE,QAA0B;IAChF,KAAK,MAAM,GAAG,IAAI,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC3I,CAAC;AAED,gHAAgH;AAChH,MAAM,UAAU,gBAAgB,CAAC,QAAqB,EAAE,QAA0B;IAChF,KAAK,MAAM,CAAC,IAAI,QAAQ,CAAC,WAAW,IAAI,EAAE;QAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAClE,CAAC;AA2BD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAA4C,EAAE,QAAgB;IACjG,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,QAAQ,CAAC;QAAE,OAAO;IACxF,MAAM,IAAI,KAAK,CACb,mBAAmB,QAAQ,oFAAoF;QAC7G,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,WAAW,8BAA8B;QACxG,mGAAmG;QACnG,wEAAwE,CAC3E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * A schedule made due by an event (#3540, K-69's second step).
3
+ *
4
+ * A schedule declared `due: 'event'` is not due again every `everyMinutes`. The work it acts on
5
+ * says when it is due: the operation that creates that work writes the instant, in its own
6
+ * transaction (`ctx.scheduleDue`), and every run of the schedule's operation clears it first, in
7
+ * the run's transaction, and writes the next one for the work it leaves. So a scope with nothing
8
+ * due has nothing to wake for, and its alarm is armed for the earliest due schedule.
9
+ *
10
+ * The state is one column of the schedule's own `_substrat_schedule_state` row, `due_at`:
11
+ *
12
+ * - **NULL**: the schedule has not run once under this form. Its cadence decides, as for any
13
+ * schedule. That is the reading of every row written before the column, so work a scope holds
14
+ * from before the switch, or from before its engine declared the form, is found by one run on
15
+ * the cadence, which then writes what it left. A write while NULL does nothing for the same
16
+ * reason: a date known for only SOME of the work is not a date the cadence may give way to.
17
+ * - **`'none'`** (`SCHEDULE_DUE_NONE`): it has, and nothing it acts on is due.
18
+ * - **an ISO instant**: when it is next due. A write only ever moves it earlier, so two
19
+ * operations naming two dates leave the earlier, and a date already due is never pushed back.
20
+ *
21
+ * `'none'` sorts after every ISO instant this platform writes (a digit sorts before a letter), so
22
+ * "earlier" is one comparison on the column and the write is one `UPDATE`.
23
+ *
24
+ * Who runs a due schedule is the adapter's to decide (`ScheduleTick.dueAlarm`): a Durable Object
25
+ * scope arms its one alarm for it, and the pure host's pass runs it when it is due by the host's
26
+ * clock. Neither changes who it runs as: a schedule runs as `system:<module>`, and `ctx.check` is
27
+ * still the only gate.
28
+ */
29
+ import { type ScheduleSpec } from '@substrat-run/contracts';
30
+ import type { ScopedSql } from './scope-host.js';
31
+ /** `due_at` once the schedule has run under the form and nothing it acts on is due. */
32
+ export declare const SCHEDULE_DUE_NONE = "none";
33
+ /** What the due-date reads need of one schedule declared `due: 'event'`. */
34
+ export interface DueSchedule {
35
+ readonly operation: string;
36
+ /** The cadence a failed run waits before it is due again, as a cadence schedule would. */
37
+ readonly everyMinutes: number;
38
+ }
39
+ /**
40
+ * The schedules of a manifest that are due by event, keyed by operation. A purge schedule is left
41
+ * out whatever it declares: its due date is its trashed rows (`purgeDueAt`).
42
+ */
43
+ export declare function dueByEventSchedulesOf(schedules: readonly ScheduleSpec[] | undefined): Map<string, DueSchedule>;
44
+ /**
45
+ * `ctx.scheduleDue(operation, at)`: the schedule named is due no later than `at`. Written through
46
+ * the spine seam, in the calling operation's transaction, so it rolls back with the work it
47
+ * describes.
48
+ *
49
+ * `operation` must be a schedule declared `due: 'event'` by a module the host registers, which is
50
+ * refused otherwise: a name that runs nothing would be a date nothing ever reads. It need not be
51
+ * the caller's own module's. An engine's in-scope function runs under the vertical's context, and
52
+ * making a schedule due grants nothing: the schedule runs as its own module's system principal,
53
+ * with its own declared input, and does what it would have done on its cadence.
54
+ *
55
+ * A no-op while the schedule has not run under the form (`due_at` NULL), since its cadence still
56
+ * decides there, and when the row already holds an earlier date.
57
+ */
58
+ export declare function noteScheduleDue(sql: ScopedSql, schedules: ReadonlyMap<string, DueSchedule>, operation: string, at: string): void;
59
+ /**
60
+ * The start of a run of a due-by-event schedule's operation: its date is cleared, in the run's own
61
+ * transaction, before the handler, which writes the next one for the work it leaves. A run that
62
+ * throws rolls this back, so the date it was due by is still there for the next try. This is also
63
+ * what moves a schedule onto the form (NULL → `'none'`), which is why it is a run that does it and
64
+ * never a write: only a run has looked at all of the work.
65
+ *
66
+ * Every run clears it, whoever invoked the operation: whatever ran it ran over the work.
67
+ */
68
+ export declare function consumeScheduleDue(sql: ScopedSql, operation: string): void;
69
+ /** One due-by-event schedule's row, read for the decision who runs it and when. */
70
+ export interface ScheduleDueRow {
71
+ /** Whether it has run under the form (`due_at` not NULL): only then may anything but its cadence decide. */
72
+ readonly established: boolean;
73
+ /**
74
+ * When it is next due in epoch milliseconds, or null when nothing is due (or it is not
75
+ * established). A run that failed waits its cadence from that run, never earlier, as under the
76
+ * pass, so a schedule that keeps failing is tried once per cadence and never spins an alarm.
77
+ */
78
+ readonly dueAt: number | null;
79
+ readonly lastRunAt: string | null;
80
+ }
81
+ /** Read `schedule`'s due state (`ScheduleDueRow`). */
82
+ export declare function readScheduleDue(sql: ScopedSql, schedule: DueSchedule): ScheduleDueRow;
83
+ /**
84
+ * The earliest instant any of `schedules` is due, in epoch milliseconds, or null when none is
85
+ * (nothing due, or none established). What a scope arms its one alarm for, beside its purges.
86
+ */
87
+ export declare function scheduleDueAt(sql: ScopedSql, schedules: Iterable<DueSchedule>): number | null;
88
+ //# sourceMappingURL=schedule-due.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-due.d.ts","sourceRoot":"","sources":["../src/schedule-due.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,uFAAuF;AACvF,eAAO,MAAM,iBAAiB,SAAS,CAAC;AAExC,4EAA4E;AAC5E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0FAA0F;IAC1F,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAO9G;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,EAC3C,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,GACT,IAAI,CAsBN;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAM1E;AAED,mFAAmF;AACnF,MAAM,WAAW,cAAc;IAC7B,4GAA4G;IAC5G,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,sDAAsD;AACtD,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,GAAG,cAAc,CAYrF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,IAAI,CAO7F"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * A schedule made due by an event (#3540, K-69's second step).
3
+ *
4
+ * A schedule declared `due: 'event'` is not due again every `everyMinutes`. The work it acts on
5
+ * says when it is due: the operation that creates that work writes the instant, in its own
6
+ * transaction (`ctx.scheduleDue`), and every run of the schedule's operation clears it first, in
7
+ * the run's transaction, and writes the next one for the work it leaves. So a scope with nothing
8
+ * due has nothing to wake for, and its alarm is armed for the earliest due schedule.
9
+ *
10
+ * The state is one column of the schedule's own `_substrat_schedule_state` row, `due_at`:
11
+ *
12
+ * - **NULL**: the schedule has not run once under this form. Its cadence decides, as for any
13
+ * schedule. That is the reading of every row written before the column, so work a scope holds
14
+ * from before the switch, or from before its engine declared the form, is found by one run on
15
+ * the cadence, which then writes what it left. A write while NULL does nothing for the same
16
+ * reason: a date known for only SOME of the work is not a date the cadence may give way to.
17
+ * - **`'none'`** (`SCHEDULE_DUE_NONE`): it has, and nothing it acts on is due.
18
+ * - **an ISO instant**: when it is next due. A write only ever moves it earlier, so two
19
+ * operations naming two dates leave the earlier, and a date already due is never pushed back.
20
+ *
21
+ * `'none'` sorts after every ISO instant this platform writes (a digit sorts before a letter), so
22
+ * "earlier" is one comparison on the column and the write is one `UPDATE`.
23
+ *
24
+ * Who runs a due schedule is the adapter's to decide (`ScheduleTick.dueAlarm`): a Durable Object
25
+ * scope arms its one alarm for it, and the pure host's pass runs it when it is due by the host's
26
+ * clock. Neither changes who it runs as: a schedule runs as `system:<module>`, and `ctx.check` is
27
+ * still the only gate.
28
+ */
29
+ import { substratError } from '@substrat-run/contracts';
30
+ /** `due_at` once the schedule has run under the form and nothing it acts on is due. */
31
+ export const SCHEDULE_DUE_NONE = 'none';
32
+ /**
33
+ * The schedules of a manifest that are due by event, keyed by operation. A purge schedule is left
34
+ * out whatever it declares: its due date is its trashed rows (`purgeDueAt`).
35
+ */
36
+ export function dueByEventSchedulesOf(schedules) {
37
+ const out = new Map();
38
+ for (const schedule of schedules ?? []) {
39
+ if (schedule.due !== 'event' || schedule.purge)
40
+ continue;
41
+ out.set(schedule.operation, { operation: schedule.operation, everyMinutes: schedule.cadence.everyMinutes });
42
+ }
43
+ return out;
44
+ }
45
+ /**
46
+ * `ctx.scheduleDue(operation, at)`: the schedule named is due no later than `at`. Written through
47
+ * the spine seam, in the calling operation's transaction, so it rolls back with the work it
48
+ * describes.
49
+ *
50
+ * `operation` must be a schedule declared `due: 'event'` by a module the host registers, which is
51
+ * refused otherwise: a name that runs nothing would be a date nothing ever reads. It need not be
52
+ * the caller's own module's. An engine's in-scope function runs under the vertical's context, and
53
+ * making a schedule due grants nothing: the schedule runs as its own module's system principal,
54
+ * with its own declared input, and does what it would have done on its cadence.
55
+ *
56
+ * A no-op while the schedule has not run under the form (`due_at` NULL), since its cadence still
57
+ * decides there, and when the row already holds an earlier date.
58
+ */
59
+ export function noteScheduleDue(sql, schedules, operation, at) {
60
+ if (!schedules.has(operation)) {
61
+ throw substratError('validation_failed', `ctx.scheduleDue: '${operation}' is not a schedule declared \`due: 'event'\` by a module this host registers`, { reason: 'schedule_not_due_by_event' });
62
+ }
63
+ const ms = typeof at === 'string' ? Date.parse(at) : Number.NaN;
64
+ if (!Number.isFinite(ms)) {
65
+ throw substratError('validation_failed', `ctx.scheduleDue: '${String(at)}' is not an instant`, {
66
+ reason: 'schedule_due_not_an_instant',
67
+ });
68
+ }
69
+ // One spelling, so the column compares as instants: `2026-03-02T00:00:00Z` and
70
+ // `2026-03-02T00:00:00.000Z` are the same instant and must not order by their punctuation.
71
+ const iso = new Date(ms).toISOString();
72
+ sql.exec(`UPDATE _substrat_schedule_state SET due_at = ?
73
+ WHERE kind = 'schedule' AND schedule_op = ? AND due_at IS NOT NULL AND due_at > ?`, [iso, operation, iso]);
74
+ }
75
+ /**
76
+ * The start of a run of a due-by-event schedule's operation: its date is cleared, in the run's own
77
+ * transaction, before the handler, which writes the next one for the work it leaves. A run that
78
+ * throws rolls this back, so the date it was due by is still there for the next try. This is also
79
+ * what moves a schedule onto the form (NULL → `'none'`), which is why it is a run that does it and
80
+ * never a write: only a run has looked at all of the work.
81
+ *
82
+ * Every run clears it, whoever invoked the operation: whatever ran it ran over the work.
83
+ */
84
+ export function consumeScheduleDue(sql, operation) {
85
+ sql.exec(`INSERT INTO _substrat_schedule_state (kind, schedule_op, due_at) VALUES ('schedule', ?, ?)
86
+ ON CONFLICT(kind, schedule_op) DO UPDATE SET due_at = excluded.due_at`, [operation, SCHEDULE_DUE_NONE]);
87
+ }
88
+ /** Read `schedule`'s due state (`ScheduleDueRow`). */
89
+ export function readScheduleDue(sql, schedule) {
90
+ const [row] = sql.query(`SELECT due_at, last_run_at, last_status FROM _substrat_schedule_state WHERE kind = 'schedule' AND schedule_op = ?`, [schedule.operation]);
91
+ const lastRunAt = row?.last_run_at ?? null;
92
+ if (!row || row.due_at === null)
93
+ return { established: false, dueAt: null, lastRunAt };
94
+ if (row.due_at === SCHEDULE_DUE_NONE)
95
+ return { established: true, dueAt: null, lastRunAt };
96
+ let due = Date.parse(row.due_at);
97
+ if (!Number.isFinite(due))
98
+ return { established: true, dueAt: null, lastRunAt };
99
+ if (row.last_status === 'failed' && lastRunAt)
100
+ due = Math.max(due, Date.parse(lastRunAt) + schedule.everyMinutes * 60_000);
101
+ return { established: true, dueAt: due, lastRunAt };
102
+ }
103
+ /**
104
+ * The earliest instant any of `schedules` is due, in epoch milliseconds, or null when none is
105
+ * (nothing due, or none established). What a scope arms its one alarm for, beside its purges.
106
+ */
107
+ export function scheduleDueAt(sql, schedules) {
108
+ let earliest = null;
109
+ for (const schedule of schedules) {
110
+ const { dueAt } = readScheduleDue(sql, schedule);
111
+ if (dueAt !== null && (earliest === null || dueAt < earliest))
112
+ earliest = dueAt;
113
+ }
114
+ return earliest;
115
+ }
116
+ //# sourceMappingURL=schedule-due.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-due.js","sourceRoot":"","sources":["../src/schedule-due.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,aAAa,EAAqB,MAAM,yBAAyB,CAAC;AAG3E,uFAAuF;AACvF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AASxC;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAA8C;IAClF,MAAM,GAAG,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC3C,KAAK,MAAM,QAAQ,IAAI,SAAS,IAAI,EAAE,EAAE,CAAC;QACvC,IAAI,QAAQ,CAAC,GAAG,KAAK,OAAO,IAAI,QAAQ,CAAC,KAAK;YAAE,SAAS;QACzD,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC9G,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAc,EACd,SAA2C,EAC3C,SAAiB,EACjB,EAAU;IAEV,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,MAAM,aAAa,CACjB,mBAAmB,EACnB,qBAAqB,SAAS,+EAA+E,EAC7G,EAAE,MAAM,EAAE,2BAA2B,EAAE,CACxC,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,GAAG,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAA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M,CAAC,CAAC;IACjC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAChF,IAAI,GAAG,CAAC,WAAW,KAAK,QAAQ,IAAI,SAAS;QAAE,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC,YAAY,GAAG,MAAM,CAAC,CAAC;IAC3H,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;AACtD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAc,EAAE,SAAgC;IAC5E,IAAI,QAAQ,GAAkB,IAAI,CAAC;IACnC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,EAAE,KAAK,EAAE,GAAG,eAAe,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACjD,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,KAAK,GAAG,QAAQ,CAAC;YAAE,QAAQ,GAAG,KAAK,CAAC;IAClF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -20,7 +20,7 @@ export type ScheduleStateKind = 'schedule' | 'freshness';
20
20
  * definition is what keeps the rebuilt shape and the created shape the same shape;
21
21
  * the gate then holds each adapter to including it.
22
22
  */
23
- export declare const SCHEDULE_STATE_DDL = "\n CREATE TABLE IF NOT EXISTS _substrat_schedule_state (\n -- #1288: WHICH of the two families this row belongs to, named with the same two\n -- words _substrat_sweep_runs already records its entries under:\n -- * 'schedule' -- keyed by the operation (module/verb). last_run_at and\n -- last_status are when that operation RAN here and how it ended.\n -- * 'freshness' -- keyed freshness:<eventType> (#1232). last_run_at and\n -- last_status are when the evaluator last RECORDED a verdict for that event\n -- type and what it was. Nothing ran; the row gates what the sweep records.\n kind TEXT NOT NULL,\n schedule_op TEXT NOT NULL,\n last_run_at TEXT,\n last_status TEXT,\n -- #1525: the invocation this row's last run happened in, or null. Null is a fact\n -- here, not a gap: a 'freshness' row never invokes anything (the evaluator only\n -- records a verdict), a 'schedule' row a pass SKIPPED carries no fresh call to\n -- attribute and keeps whatever it already held, and a row written before this\n -- column existed predates the possibility. Only a due schedule's own invoke\n -- mints one and writes it here, in the same call that stamps it onto whatever\n -- the operation emits \u2014 see runDueSchedules in each adapter.\n invocation_id TEXT,\n -- #2096: a purge horizon's lap in progress (entity-trash.ts, PurgeLap) -- where its\n -- next pass resumes in the bin, and how many purges failed earlier in the lap. Only a\n -- 'schedule' row of a purge schedule holds one, and only mid-lap: NULL is the start\n -- of a lap, which is also the honest reading of every row written before the column.\n purge_cursor TEXT,\n -- The key LEADS with kind, and that is the point of #1288 rather than a tidy-up.\n -- Until it did, the two families were told apart by the spelling of one column:\n -- a freshness key could never LOOK like an operation (an event type has passed\n -- contracts' eventType regex -- lowercase ns.verb, no colon, no slash), but the\n -- other direction was convention only, because scheduleSpec.operation is\n -- z.string().min(1). A module declaring a schedule literally named\n -- \"freshness:orders.placed\" shared the evaluator's row and nothing refused it:\n -- each write clobbered the other's verdict, and the sweep read back whichever\n -- ran last. With kind in the key those are two rows that cannot meet.\n PRIMARY KEY (kind, schedule_op)\n );\n";
23
+ export declare const SCHEDULE_STATE_DDL = "\n CREATE TABLE IF NOT EXISTS _substrat_schedule_state (\n -- #1288: WHICH of the two families this row belongs to, named with the same two\n -- words _substrat_sweep_runs already records its entries under:\n -- * 'schedule' -- keyed by the operation (module/verb). last_run_at and\n -- last_status are when that operation RAN here and how it ended.\n -- * 'freshness' -- keyed freshness:<eventType> (#1232). last_run_at and\n -- last_status are when the evaluator last RECORDED a verdict for that event\n -- type and what it was. Nothing ran; the row gates what the sweep records.\n kind TEXT NOT NULL,\n schedule_op TEXT NOT NULL,\n last_run_at TEXT,\n last_status TEXT,\n -- #1525: the invocation this row's last run happened in, or null. Null is a fact\n -- here, not a gap: a 'freshness' row never invokes anything (the evaluator only\n -- records a verdict), a 'schedule' row a pass SKIPPED carries no fresh call to\n -- attribute and keeps whatever it already held, and a row written before this\n -- column existed predates the possibility. Only a due schedule's own invoke\n -- mints one and writes it here, in the same call that stamps it onto whatever\n -- the operation emits \u2014 see runDueSchedules in each adapter.\n invocation_id TEXT,\n -- #2096: a purge horizon's lap in progress (entity-trash.ts, PurgeLap) -- where its\n -- next pass resumes in the bin, and how many purges failed earlier in the lap. Only a\n -- 'schedule' row of a purge schedule holds one, and only mid-lap: NULL is the start\n -- of a lap, which is also the honest reading of every row written before the column.\n purge_cursor TEXT,\n -- #3540: when a schedule declared due: 'event' is next due (schedule-due.ts). NULL: it\n -- has not run once under that form, so its cadence decides -- the honest reading of every\n -- row written before the column, and of every row of a cadence schedule. 'none': it has,\n -- and nothing it acts on is due. Otherwise an ISO instant, which only ever moves earlier\n -- until the schedule's next run clears it (a run's own transaction writes 'none' first).\n due_at TEXT,\n -- The key LEADS with kind, and that is the point of #1288 rather than a tidy-up.\n -- Until it did, the two families were told apart by the spelling of one column:\n -- a freshness key could never LOOK like an operation (an event type has passed\n -- contracts' eventType regex -- lowercase ns.verb, no colon, no slash), but the\n -- other direction was convention only, because scheduleSpec.operation is\n -- z.string().min(1). A module declaring a schedule literally named\n -- \"freshness:orders.placed\" shared the evaluator's row and nothing refused it:\n -- each write clobbered the other's verdict, and the sweep read back whichever\n -- ran last. With kind in the key those are two rows that cannot meet.\n PRIMARY KEY (kind, schedule_op)\n );\n";
24
24
  /**
25
25
  * The `kind` a pre-#1288 row belongs to, derived from its `schedule_op` — the backfill's one
26
26
  * rule, shared by `SCHEDULE_STATE_REBUILD` below and by a restore of a dump taken before the
@@ -1 +1 @@
1
- {"version":3,"file":"schedule-state.d.ts","sourceRoot":"","sources":["../src/schedule-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;A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AC;IACf,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -39,6 +39,12 @@ export const SCHEDULE_STATE_DDL = `
39
39
  -- 'schedule' row of a purge schedule holds one, and only mid-lap: NULL is the start
40
40
  -- of a lap, which is also the honest reading of every row written before the column.
41
41
  purge_cursor TEXT,
42
+ -- #3540: when a schedule declared due: 'event' is next due (schedule-due.ts). NULL: it
43
+ -- has not run once under that form, so its cadence decides -- the honest reading of every
44
+ -- row written before the column, and of every row of a cadence schedule. 'none': it has,
45
+ -- and nothing it acts on is due. Otherwise an ISO instant, which only ever moves earlier
46
+ -- until the schedule's next run clears it (a run's own transaction writes 'none' first).
47
+ due_at TEXT,
42
48
  -- The key LEADS with kind, and that is the point of #1288 rather than a tidy-up.
43
49
  -- Until it did, the two families were told apart by the spelling of one column:
44
50
  -- a freshness key could never LOOK like an operation (an event type has passed
@@ -1 +1 @@
1
- {"version":3,"file":"schedule-state.js","sourceRoot":"","sources":["../src/schedule-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCjC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACpC,0FAA0F,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;;IAElC,kBAAkB,CAAC,OAAO,CAC1B,qDAAqD,EACrD,2CAA2C,CAC5C;;;;;aAKU,yBAAyB;;;;CAIrC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,OAAO,QAAQ,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC;AAC9D,CAAC"}
1
+ {"version":3,"file":"schedule-state.js","sourceRoot":"","sources":["../src/schedule-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CjC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACpC,0FAA0F,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;;IAElC,kBAAkB,CAAC,OAAO,CAC1B,qDAAqD,EACrD,2CAA2C,CAC5C;;;;;aAKU,yBAAyB;;;;CAIrC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,OAAO,QAAQ,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC;AAC9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"scope-copy.d.ts","sourceRoot":"","sources":["../src/scope-copy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,UAAU,gBAAiB,MAAM,GAAG,SAAS,iBAAiB,MAAM,GAAG,SAAS,KAAG,OACpC,CAAC;AAS7D;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,EACtF,MAAM,EAAE,CAAC,EAAE,EACX,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,aAAa,EAAE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,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,EACtF,MAAM,EAAE,CAAC,EAAE,EACX,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,CAAC,EAAE,CAGL;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEzH;AAcD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,eAAe,8cAW3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,sBAAiB,MACqD,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,SAAS,EACd,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,GAAG,EAAE,MAAM,GACV,IAAI,CAqDN;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAInE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,QAEa,CAAC;AAE/C;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAIpE;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,0FAA0F,CAAC;AAEnH;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,uHACsF,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { CAPABILITY_TABLE_NAMES } from './capability.js';
2
2
  import { DOWNLOAD_LINK_TABLE_NAMES } from './download-link.js';
3
+ import { STORE_PROOF_TABLE_NAMES } from './store-proof.js';
3
4
  import { UPLOAD_LINK_TABLE_NAMES } from './upload-link.js';
4
5
  import { clearSettledEmailIn, pendingEmailIds } from './email-intent.js';
5
6
  /**
@@ -36,11 +37,16 @@ import { clearSettledEmailIn, pendingEmailIds } from './email-intent.js';
36
37
  * consumer's position, so a copy's cursor acknowledges nothing at the source either.
37
38
  */
38
39
  export const isCopyLoad = (destScopeId, sourceScopeId) => destScopeId === undefined || sourceScopeId !== destScopeId;
39
- /** The capability tables — and the upload- and download-link tables, bearer links of the same kind — as `capabilitiesForLoad` matches a dump's (lowercased) names. */
40
+ /**
41
+ * The capability tables — and the upload- and download-link tables, bearer links of the same kind,
42
+ * and the store proofs (#2996), bearer proofs of one store call — as `capabilitiesForLoad` matches a
43
+ * dump's (lowercased) names.
44
+ */
40
45
  const CAPABILITY_TABLES = new Set([
41
46
  ...CAPABILITY_TABLE_NAMES,
42
47
  ...UPLOAD_LINK_TABLE_NAMES,
43
48
  ...DOWNLOAD_LINK_TABLE_NAMES,
49
+ ...STORE_PROOF_TABLE_NAMES,
44
50
  ]);
45
51
  /**
46
52
  * A dump's tables as a load into `destScopeId` takes them: **capability rows never cross a scope
@@ -1 +1 @@
1
- {"version":3,"file":"scope-copy.js","sourceRoot":"","sources":["../src/scope-copy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,WAA+B,EAAE,aAAiC,EAAW,EAAE,CACxG,WAAW,KAAK,SAAS,IAAI,aAAa,KAAK,WAAW,CAAC;AAE7D,sKAAsK;AACtK,MAAM,iBAAiB,GAAwB,IAA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C,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAClD,GAAG,CAAC,GAAG,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,yHAAyH;IACzH,4CAA4C,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,GAAc;IAC5C,IAAI,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACvD,GAAG,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC;IACrE,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,uFAAuF,CAAC;AAEnH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,oHAAoH,CAAC"}
@@ -9,7 +9,7 @@ import type { VerticalScopeStore } from './vertical-scope-stores.js';
9
9
  import type { DeploymentWireAuthFilter, DeploymentWireAuthInput, WireWalkAudit } from './deployment-wire-auth.js';
10
10
  import type { StoreDriverApprovalRecord, StoreDriverHoldMode, StoreDriverRebuildFailure, StoreDriverRebuildRecord, StoreDriverReleaseRecord, StoreDriverRevokeWalkRecord, StoreDriverRolloutAction, StoreDriverRolloutRecord, StoreDriverRolloutState, StoreDriverRolloutTarget, StoreDriverState } from './store-driver-releases.js';
11
11
  import type { SubjectRedactionCounts } from './subject-redaction.js';
12
- import type { OnBehalfOf, ExportReadInput, ExportedBatch, ImportBatch, ImportedEvent, ImportResult, ImportState, ImportCursorMove, ImportCursorMoved, AdminAction, BecomeCapabilityInput, CapabilityExchange, CapabilityExchangeOptions, CapabilityFilter, CapabilityId, CapabilityPage, MintedCapability, ListPage, ConnectLink, ConnectLinkConsume, ConnectLinkFilter, ConnectLinkKey, ConsumeConnectLinkInput, MintConnectLinkInput, Connection, ConnectionFilter, ConnectionId, ConnectionGrant, ConnectionRevoke, ConnectionGrantRecord, ConnectionSecret, CreateConnectionInput, OpenConnection, ProjectedConnectionGrant, ProjectedConnectionKey, AccessLogEntry, DelegatedReadRecord, OwnerTransferAudit, MemberChangeAudit, PeerBindingAudit, ConnectionBindingAudit, CopyMarkAudit, OrphanSweepAudit, DeliveryRedriveAudit, BrokerDeadLetterAudit, BindHostnameInput, AdminLogEntry, OpsFailureEntry, PlatformRequestDrainTotalsEntry, SweepRunEntry, SweepRunKind, SweepRunOutcome, ModelUsageEntry, ModelUsageSummary, MarkupRow, MarkupRowInput, CapabilityGrant, CreateTenantInput, Decision, Instant, DomainEvent, DomainEventInput, PlatformRequestInput, PlatformRequestId, PlatformRequestEntry, PlatformRequestFilter, PlatformRequestStatus, PlatformRequestFailure, PlatformOutcomeEvent, EntitlementGrant, EntitlementGrantInput, EntitlementView, MeterReading, MeterDay, MeterDayTake, StaleScope, StaleScopeTake, VerticalOwnerPeriod, ScopeStorageSample, StorageGauge, RequestDay, RequestRollupDay, CostDay, EntityRef, IdentityLink, IdentityPool, Jurisdiction, ModuleId, ModuleManifest, ScheduleSpec, SystemGrant, PeerGrantsStatusEntry, SystemGrantsStatusEntry, SystemSwitchRecord, SystemSwitch, SystemSwitchResult, PeerCoverage, PeerSwitch, PeerSwitchResult, VerticalCaller, VerticalResolution, PeerBinding, AppEnvironment, PeerInstanceResolution, CreateOrgInput, Node, Org, OrgId, OrgMembership, PermissionKey, PlatformActorId, ChannelName, ExportBreak, ChannelHistoryEntry, DnsRecord, HostnameBinding, HostnameStatus, PromotionAcknowledgement, BindAcknowledgement, PublishVersionInput, RegisterVerticalInput, VerticalServingState, DeploymentWireAuth, RouteTarget, DirectoryDump, DirectoryCopyByReference, DirectoryDumpPage, ScopeDumpTable, IdentityMembership, PrincipalId, ResolvedIdentity, RoleAssignment, RoleDefinition, QueryScopeInput, ReadScopeTableInput, Scope, ScopeDump, ScopeDumpInput, SubjectShredReceipt, SubjectReadPage, SubjectReadRequest, SubjectAccessReceipt, ScopeQueryResult, ScopeId, ScopeStatus, ScopeTable, DenialFilter, DenialSummary, RefusalFilter, RefusalRecord, PermissionDenial, Coverage, BeginImpersonationInput, ImpersonationFilter, ImpersonationSession, ImpersonationSessionId, ScopeTablePage, StorageShape, Tenant, TenantId, TenantRole, TenantStoreHandle, AttachmentRecord, UploadLinkView, BlobStoreHandle, Visibility, Vertical, VerticalChannel, VerticalVersion, TenantStatus, Page, CountedPage, FreshnessSpec, EntityHistoryInput, EventFacetInput, EventCauseInput, EventEffectsInput, EffectsTree, InvocationEventsInput, InvocationEvents, DeadLettersInput, DeadLetter, LifecycleFlowInput, LifecycleFlowResult, OperationSeriesInput, OperationSeriesResult, CauseChain, EventFacetResult, HistoryEntry, ErrorCode, PlatformRequestFailureOrigin, IssueEntry, IssueStatus, IssueStatusInput, FindingEntry, FindingFilter, FindingRuleEntry, FindingRuleInput, FindingStatusInput, DeclaredMigration, CheckSubject, EntityGrantShape, NotedTransition, VerticalTraceSampling } from '@substrat-run/contracts';
12
+ import type { OnBehalfOf, ExportReadInput, ExportedBatch, ImportBatch, ImportedEvent, ImportResult, ImportState, ImportCursorMove, ImportCursorMoved, AdminAction, BecomeCapabilityInput, CapabilityExchange, CapabilityExchangeOptions, CapabilityFilter, CapabilityId, CapabilityPage, MintedCapability, ListPage, ConnectLink, ConnectLinkConsume, ConnectLinkFilter, ConnectLinkKey, ConsumeConnectLinkInput, MintConnectLinkInput, Connection, ConnectionFilter, ConnectionId, ConnectionGrant, ConnectionRevoke, ConnectionGrantRecord, ConnectionSecret, CreateConnectionInput, OpenConnection, ProjectedConnectionGrant, ProjectedConnectionKey, AccessLogEntry, DelegatedReadRecord, OwnerTransferAudit, MemberChangeAudit, PeerBindingAudit, ConnectionBindingAudit, CopyMarkAudit, OrphanSweepAudit, DeliveryRedriveAudit, BrokerDeadLetterAudit, BindHostnameInput, AdminLogEntry, OpsFailureEntry, PlatformRequestDrainTotalsEntry, SweepRunEntry, SweepRunKind, SweepRunOutcome, ModelUsageEntry, ModelUsageSummary, MarkupRow, MarkupRowInput, CapabilityGrant, CreateTenantInput, Decision, Instant, DomainEvent, DomainEventInput, PlatformRequestInput, PlatformRequestId, PlatformRequestEntry, PlatformRequestFilter, PlatformRequestStatus, PlatformRequestFailure, PlatformOutcomeEvent, EntitlementGrant, EntitlementGrantInput, EntitlementView, MeterReading, MeterDay, MeterDayTake, StaleScope, StaleScopeTake, VerticalOwnerPeriod, ScopeStorageSample, StorageGauge, RequestDay, RequestRollupDay, CostDay, EntityRef, IdentityLink, IdentityPool, Jurisdiction, ModuleId, ModuleManifest, ScheduleSpec, SystemGrant, PeerGrantsStatusEntry, SystemGrantsStatusEntry, SystemSwitchRecord, SystemSwitch, SystemSwitchResult, PeerCoverage, PeerSwitch, PeerSwitchResult, VerticalCaller, VerticalResolution, PeerBinding, AppEnvironment, EnvironmentServing, PeerInstanceResolution, CreateOrgInput, Node, Org, OrgId, OrgMembership, PermissionKey, PlatformActorId, ChannelName, ExportBreak, ChannelHistoryEntry, DnsRecord, HostnameBinding, HostnameStatus, PromotionAcknowledgement, BindAcknowledgement, PublishVersionInput, RegisterVerticalInput, VerticalServingState, DeploymentWireAuth, RouteTarget, DirectoryDump, DirectoryCopyByReference, DirectoryDumpPage, ScopeDumpTable, IdentityMembership, PrincipalId, ResolvedIdentity, RoleAssignment, RoleDefinition, QueryScopeInput, ReadScopeTableInput, Scope, ScopeDump, ScopeDumpInput, SubjectShredReceipt, SubjectReadPage, SubjectReadRequest, SubjectAccessReceipt, ScopeQueryResult, ScopeId, ScopeStatus, ScopeTable, DenialFilter, DenialSummary, RefusalFilter, RefusalRecord, PermissionDenial, Coverage, BeginImpersonationInput, ImpersonationFilter, ImpersonationSession, ImpersonationSessionId, ScopeTablePage, StorageShape, Tenant, TenantId, TenantRole, TenantStoreHandle, AttachmentRecord, UploadLinkView, BlobStoreHandle, Visibility, Vertical, VerticalChannel, VerticalVersion, TenantStatus, Page, CountedPage, FreshnessSpec, EntityHistoryInput, EventFacetInput, EventCauseInput, EventEffectsInput, EffectsTree, InvocationEventsInput, InvocationEvents, DeadLettersInput, DeadLetter, LifecycleFlowInput, LifecycleFlowResult, OperationSeriesInput, OperationSeriesResult, CauseChain, EventFacetResult, HistoryEntry, ErrorCode, PlatformRequestFailureOrigin, IssueEntry, IssueStatus, IssueStatusInput, FindingEntry, FindingFilter, FindingRuleEntry, FindingRuleInput, FindingStatusInput, DeclaredMigration, CheckSubject, EntityGrantShape, NotedTransition, VerticalTraceSampling, StoreProof } from '@substrat-run/contracts';
13
13
  import type { ConnectionUseOutcome } from './connector-calls.js';
14
14
  import type { ScopeDelegation } from './delegation-ceiling.js';
15
15
  import type { ByteBody } from './byte-stream.js';
@@ -505,6 +505,26 @@ export interface OperationContext {
505
505
  * type that declares neither.
506
506
  */
507
507
  entityState(entity: EntityRef): EntityStateName | null;
508
+ /**
509
+ * Mint the proof a scope-store call needs (#2996, K-64). A module operation does not call its
510
+ * store inside its transaction: it checks the permission key the vertical declared for
511
+ * `operation` on `binding` (`definePermissions({ stores })`) and records a proof, and host code
512
+ * makes the call with it through `getScopeStore(...).invoke(operation, input, proof)`, between two
513
+ * transactions. A second operation records the result.
514
+ *
515
+ * - **Checks the declared key** as the caller, scope-wide; a denial throws `PermissionDenied`, and
516
+ * a store operation with no declared key is refused `forbidden`, since nothing could prove it.
517
+ * - **Transactional.** The proof is a row in the scope's spine. A rollback takes it, so a proof
518
+ * from an operation that failed redeems nothing.
519
+ * - **Narrow and short.** Good for one call of `operation` on `binding` in this scope, by this
520
+ * principal's stub, within a minute; spent by that call whatever the store answers.
521
+ * - **A principal's operation only.** A consumer (whose checks allow unconditionally), a
522
+ * capability session, a peer, a system actor and a read-only impersonation are refused.
523
+ *
524
+ * Return the proof in the operation's output so the host code that called it can make the call.
525
+ * The secret is withheld from the invocation's idempotency record, as every kernel secret is.
526
+ */
527
+ storeProof(binding: string, operation: string): Promise<StoreProof>;
508
528
  /**
509
529
  * One page of the TRASH of a declared entity (#119) — `ctx.page` over the trashed rows,
510
530
  * with the declared trash key checked on EACH row inside the kernel, so a handler cannot
@@ -667,6 +687,26 @@ export interface OperationContext {
667
687
  * `onEmitted`). Names only: a note whose type or states are not shaped like names is dropped.
668
688
  */
669
689
  noteTransition(transition: NotedTransition): void;
690
+ /**
691
+ * #3540 (K-69): the schedule `operation`, declared `due: 'event'`, is due no later than `at`.
692
+ * The operation that creates the work a schedule acts on calls this in the same transaction, so
693
+ * the date rolls back with the work; and the schedule's own operation calls it for the earliest
694
+ * work its run left, since every run clears the date first.
695
+ *
696
+ * ```ts
697
+ * ctx.scheduleDue?.('absence/expire-stale', `${dayAfter(startDate)}T00:00:00.000Z`);
698
+ * ```
699
+ *
700
+ * It only ever moves a date earlier, and it does nothing until the schedule has run once under
701
+ * this form: its cadence decides until then, and that first run writes what it found. Making a
702
+ * schedule due grants nothing: it runs as its own module's system principal, with its declared
703
+ * input, and `ctx.check` is still its only gate. Refused for an operation that is not a
704
+ * due-by-event schedule a registered module declares (`schedule-due.ts`).
705
+ *
706
+ * Optional, so an engine can call it on a host older than it: absent there, the schedule runs on
707
+ * its cadence, which is what it did before. Call it as `ctx.scheduleDue?.(…)`.
708
+ */
709
+ scheduleDue?(operation: string, at: Instant): void;
670
710
  }
671
711
  export type OperationHandler<I = unknown, O = unknown> = (ctx: OperationContext, input: I) => O | Promise<O>;
672
712
  /**
@@ -870,6 +910,23 @@ export interface ScopeStub {
870
910
  * around an operation can react to what the operation did without the module
871
911
  * carrying a new surface.
872
912
  */
913
+ /**
914
+ * Who calls through `ScopeHost.getChildScope` (#2995): the calling scope, which the host holds to be
915
+ * the child's parent, and the actor the call acts for. These are the facts K-66's second envelope
916
+ * carries on the hosted path as the calling scope and the actor.
917
+ */
918
+ export interface ChildScopeCaller {
919
+ /** The calling scope. A host refuses a child whose recorded parent is any other scope. */
920
+ readonly parentScopeId: ScopeId;
921
+ /**
922
+ * The person the call acts for, as the parent's own door named them. The app acting as itself,
923
+ * which K-64 allows where the child admits it, is not built: nothing yet says what a child admits.
924
+ */
925
+ readonly actor: {
926
+ readonly kind: 'person';
927
+ readonly principal: PrincipalId;
928
+ };
929
+ }
873
930
  /** `getScope`'s options: the person's door is the only one an address may arrive through. */
874
931
  export interface PersonScopeOptions extends ScopeStubOptions {
875
932
  /**
@@ -1329,6 +1386,21 @@ export interface ScheduleTick {
1329
1386
  * is what keeps an older coordinator from leaving them to an alarm nothing would answer.
1330
1387
  */
1331
1388
  alarmRunsPurges?: true;
1389
+ /**
1390
+ * #3540: the call comes from the scope's OWN alarm, which found work due by event: its purges
1391
+ * (as `purgeAlarm`) and its `due: 'event'` schedules whose date has come (`readScheduleDue`). A
1392
+ * cadence schedule is left to the pass. A host older than the field reads it as an ordinary pass,
1393
+ * which is why a coordinator sends it only through `runScopeDue`, which an older scope never asks.
1394
+ */
1395
+ dueAlarm?: true;
1396
+ /**
1397
+ * #3540: the caller can take a scope alarm's `runScopeDue` call, so a `due: 'event'` schedule
1398
+ * that has run under that form may be left to the scope's alarm: the scope arms it and the pass
1399
+ * runs nothing. Absent, the pass runs it on its cadence, as it always did, which is what keeps an
1400
+ * older coordinator from leaving it to an alarm nothing would answer. Separate from
1401
+ * `alarmRunsPurges`, which a coordinator that cannot take that call already sends.
1402
+ */
1403
+ alarmRunsDue?: true;
1332
1404
  }
1333
1405
  /**
1334
1406
  * The host's clock (#812) — what `ctx.now()` reads.
@@ -2728,7 +2800,11 @@ export interface HostAdmin {
2728
2800
  environment: AppEnvironment;
2729
2801
  created: boolean;
2730
2802
  }>;
2731
- /** Take the name off; the preview stays. `prod` is refused. Audited when a row went. */
2803
+ /**
2804
+ * Take the name off; the preview stays. `prod` is refused. Audited when a row went. #3530 step 4:
2805
+ * refused (`conflict`) while the environment serves from a script of its own and its preview still
2806
+ * lives, since the preview's data is on that script: the preview is reaped first.
2807
+ */
2732
2808
  removeEnvironment(actor: PlatformActorId, input: {
2733
2809
  tenantId: TenantId;
2734
2810
  vertical: string;
@@ -2736,6 +2812,36 @@ export interface HostAdmin {
2736
2812
  }): Promise<{
2737
2813
  removed: boolean;
2738
2814
  }>;
2815
+ /**
2816
+ * Record what an environment's own serving script runs (#3530 step 4), after an upload onto it
2817
+ * landed: compare-and-set on `expected` (the record the upload diffed from, null for the first
2818
+ * serve), refused with `precondition_failed` when the row moved since. `not_found` for a name that
2819
+ * is no environment; `conflict` for another script than the one it serves from. Audited.
2820
+ */
2821
+ setEnvironmentServing(actor: PlatformActorId, input: {
2822
+ tenantId: TenantId;
2823
+ vertical: string;
2824
+ name: string;
2825
+ }, next: EnvironmentServing, expected: EnvironmentServing | null,
2826
+ /** The serve lease's claim: when given, the record lands only while that claim still holds it. */
2827
+ claim?: string): Promise<void>;
2828
+ /**
2829
+ * Take an environment's serve lease for `leaseMs` (#3530 step 4), so its serves run one at a time:
2830
+ * upload, record and bind. False while another live claim holds it; a lapsed one is taken over and
2831
+ * `claim`'s own is renewed. `not_found` for a name that is no environment. Not audited: it moves
2832
+ * nothing a reader sees, and the serve it guards is.
2833
+ */
2834
+ claimEnvironmentServe(actor: PlatformActorId, input: {
2835
+ tenantId: TenantId;
2836
+ vertical: string;
2837
+ name: string;
2838
+ }, claim: string, leaseMs: number): Promise<boolean>;
2839
+ /** Give an environment's serve lease back, if `claim` still holds it. */
2840
+ releaseEnvironmentServe(actor: PlatformActorId, input: {
2841
+ tenantId: TenantId;
2842
+ vertical: string;
2843
+ name: string;
2844
+ }, claim: string): Promise<void>;
2739
2845
  /**
2740
2846
  * Persist a tenant. Idempotent on the id — re-creating an existing tenant is a
2741
2847
  * no-op, not an error (control-plane.md §4.1). `status` starts `active` and
@@ -4367,6 +4473,15 @@ export interface ProvisionScopeInput {
4367
4473
  * type is refused (`conflict`), and one naming none keeps the recorded type.
4368
4474
  */
4369
4475
  scopeType?: string;
4476
+ /**
4477
+ * #2995 (K-64): the scope this one is a CHILD of, in the same tenant and app. Written by the
4478
+ * `provision-child` drain alone, with the scope the intent was drained from, and never from a
4479
+ * request body: no route carries it. The host refuses a link its declaration does not allow
4480
+ * (`childScopeRefusal`) before anything is written, and the link is fixed once written
4481
+ * (`provisionedParent`): a re-provision restates it or names none. A host that cannot keep the
4482
+ * link refuses the field rather than provisioning a scope without it.
4483
+ */
4484
+ parentScopeId?: ScopeId;
4370
4485
  /**
4371
4486
  * Where `vertical` came from, which decides what it is held to. `'input'` (the default): a
4372
4487
  * caller named it, and it must be a `verticalSlug`. `'copy'`: it is the stored vertical of a
@@ -5366,6 +5481,27 @@ export interface ScopeHost {
5366
5481
  * provisioned for the scope's vertical, exactly like `attachments`.
5367
5482
  */
5368
5483
  getCapabilityAttachments?(sessionToken: string, tenantId: TenantId, scopeId: ScopeId): Promise<ScopeAttachments>;
5484
+ /**
5485
+ * A person's stub on a CHILD scope, minted for host code of its parent (#2995, K-64): the door a
5486
+ * parent's app calls a child through, between two of its own transactions. No operation reaches a
5487
+ * child: there is no `ctx.scope(id).invoke()`. An ordered exchange commits the parent's intent
5488
+ * first, host code calls through this door, and a second operation in the parent records the
5489
+ * outcome; the two invocations share a request id, never a transaction.
5490
+ *
5491
+ * What it checks, before anything runs: the (tenant, child) pair as every door does; that the
5492
+ * caller's scope is the child's own parent (`childDoorRefusal`: a sibling, another scope's child or
5493
+ * another tenant's scope is `not_found`); that the child's type accepts `parent`; that the parent
5494
+ * is active; and then the child's lifecycle gates, as `getScope` applies them.
5495
+ *
5496
+ * What it grants: nothing. The stub acts as `caller.actor`'s person, and every check in the child
5497
+ * is that person's own grants in the child, under the child's own permissions. The parent holds
5498
+ * no standing access to its child, so a person who holds a role at the parent and none at the
5499
+ * child is refused there like anyone else.
5500
+ *
5501
+ * OPTIONAL: a host that does not keep parent links (the Durable Object host, until #2995's hosted
5502
+ * half lands) does not have it, and a caller feature-detects it.
5503
+ */
5504
+ getChildScope?(caller: ChildScopeCaller, tenantId: TenantId, scopeId: ScopeId, options?: PersonScopeOptions): Promise<ScopeStub>;
5369
5505
  /**
5370
5506
  * A scope stub whose authority is ANOTHER VERTICAL of the same tenant (#1706) — the sixth door,
5371
5507
  * beside the principal, connection, system, impersonation and capability ones, and a door