@substrat-run/adapter-cloudflare 0.219.0 → 0.220.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 (54) hide show
  1. package/dist/control-plane-do.d.ts +69 -5
  2. package/dist/control-plane-do.d.ts.map +1 -1
  3. package/dist/control-plane-do.js +126 -9
  4. package/dist/control-plane-do.js.map +1 -1
  5. package/dist/directory-mirror-backfill.d.ts +143 -0
  6. package/dist/directory-mirror-backfill.d.ts.map +1 -0
  7. package/dist/directory-mirror-backfill.js +467 -0
  8. package/dist/directory-mirror-backfill.js.map +1 -0
  9. package/dist/directory-mirror-verify.d.ts +166 -0
  10. package/dist/directory-mirror-verify.d.ts.map +1 -0
  11. package/dist/directory-mirror-verify.js +478 -0
  12. package/dist/directory-mirror-verify.js.map +1 -0
  13. package/dist/directory-mirror.d.ts +101 -3
  14. package/dist/directory-mirror.d.ts.map +1 -1
  15. package/dist/directory-mirror.js +143 -37
  16. package/dist/directory-mirror.js.map +1 -1
  17. package/dist/directory-objects.d.ts +14 -0
  18. package/dist/directory-objects.d.ts.map +1 -1
  19. package/dist/directory-objects.js +34 -0
  20. package/dist/directory-objects.js.map +1 -1
  21. package/dist/directory-placement.d.ts.map +1 -1
  22. package/dist/directory-placement.js +7 -1
  23. package/dist/directory-placement.js.map +1 -1
  24. package/dist/directory-split-inventory.d.ts +2 -1
  25. package/dist/directory-split-inventory.d.ts.map +1 -1
  26. package/dist/directory-split-inventory.js +3 -1
  27. package/dist/directory-split-inventory.js.map +1 -1
  28. package/dist/host.d.ts +33 -4
  29. package/dist/host.d.ts.map +1 -1
  30. package/dist/host.js +129 -14
  31. package/dist/host.js.map +1 -1
  32. package/dist/peer-call-target.d.ts.map +1 -1
  33. package/dist/peer-call-target.js +3 -2
  34. package/dist/peer-call-target.js.map +1 -1
  35. package/dist/route-read-model-publisher.d.ts +37 -1
  36. package/dist/route-read-model-publisher.d.ts.map +1 -1
  37. package/dist/route-read-model-publisher.js +127 -44
  38. package/dist/route-read-model-publisher.js.map +1 -1
  39. package/dist/route-read-model.d.ts +15 -0
  40. package/dist/route-read-model.d.ts.map +1 -1
  41. package/dist/route-read-model.js +21 -9
  42. package/dist/route-read-model.js.map +1 -1
  43. package/dist/scope-do.d.ts +31 -1
  44. package/dist/scope-do.d.ts.map +1 -1
  45. package/dist/scope-do.js +207 -18
  46. package/dist/scope-do.js.map +1 -1
  47. package/dist/scope-sweeper-do.d.ts +18 -0
  48. package/dist/scope-sweeper-do.d.ts.map +1 -1
  49. package/dist/scope-sweeper-do.js +72 -1
  50. package/dist/scope-sweeper-do.js.map +1 -1
  51. package/dist/scope-work.d.ts +1 -1
  52. package/dist/scope-work.js +1 -1
  53. package/dist/scope-work.js.map +1 -1
  54. package/package.json +18 -13
@@ -1 +1 @@
1
- {"version":3,"file":"route-read-model.js","sourceRoot":"","sources":["../src/route-read-model.ts"],"names":[],"mappings":"AA0BA,uGAAuG;AACvG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAC1C,MAAM,MAAM,GAAG,UAAU,wBAAwB,GAAG,CAAC;AAErD,+FAA+F;AAC/F,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,GAAG,MAAM,KAAK,QAAQ,EAAE,CAAC;AACjF,mGAAmG;AACnG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,GAAG,MAAM,KAAK,IAAI,EAAE,CAAC;AAYjF;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAc,EAAU,EAAE,CACxD,GAAG,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,aAAa,IAAI,kBAAkB,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AAC/G,4DAA4D;AAC5D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAA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AAG,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;QACpD,IAAI,UAAU;YAAE,OAAO,EAAE,GAAG,EAAE,UAAU,CAAC,KAA8B,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QAC5F,IAAI,QAAwC,CAAC;QAC7C,IAAI,CAAC;YACH,QAAQ,GAAG,MAAM,SAAS,CAAC,GAAG,CAAC,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,QAAQ,GAAG,MAAM,CAAC,CAAC,wDAAwD;QAC7E,CAAC;QACD,IAAI,QAAQ,KAAK,MAAM;YAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAChE,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,EAAE,GAAG,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,KAAK,CAAC,GAAG,CACZ,SAAS,EACT,GAAG,EACH,EAAE,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,IAAI,qBAAqB,CAAC,CAAC,CAC1H,CAAC;QACF,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IACtC,CAAC,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { DurableObject } from 'cloudflare:workers';
2
- import { type TenantId } from '@substrat-run/contracts';
2
+ import { type ScopeId, type TenantId } from '@substrat-run/contracts';
3
3
  import { type DeclaredPermissions, type SwitchSql, type ModuleRegistration, type OperationHandler } from '@substrat-run/kernel';
4
4
  import { type DoReply } from './do-reply.js';
5
5
  import type { AnalyticsEngineDatasetLike } from './connector-calls.js';
@@ -77,6 +77,36 @@ export interface ScopeDoEnv {
77
77
  * (`BROKER_TELEMETRY_BINDING`). Unbound, nothing is written.
78
78
  */
79
79
  SUBSTRAT_BROKER_TELEMETRY?: AnalyticsEngineDatasetLike;
80
+ /**
81
+ * #3540 (K-69's first step): `event` makes the derived purge schedules (`trash: { purgeAfterDays }`)
82
+ * due by the trashed rows themselves. The scope arms its one alarm for its earliest due row, and the
83
+ * alarm asks this deployment's scope sweeper (`SWEEPER`) to run them for this scope alone; the
84
+ * sweeper's pass then runs none, and only re-arms the alarm. Unset (the default), or with no
85
+ * `SWEEPER` bound, the pass runs them on their cadence, as before. The uploader binds it from the
86
+ * control plane's `VERTICAL_PURGE_DUE` (`PURGE_DUE_BINDING`).
87
+ */
88
+ SUBSTRAT_PURGE_DUE?: string;
89
+ /** #3540: the deployment's scope sweeper (`defineScopeSweeperDO`), bound as the platform binds it. */
90
+ SWEEPER?: DurableObjectNamespace;
91
+ }
92
+ /**
93
+ * #3540: who asks a scope for a purge pass (`runPurgeSweep`). `alarm` is the scope's own alarm,
94
+ * through its sweeper; `deferrable` is a pass whose sweeper can take that alarm's call, so a scope
95
+ * whose purges are due by event answers it `byAlarm`. Absent is a pass that cannot, which is run.
96
+ */
97
+ export type PurgeSweepMode = 'alarm' | 'deferrable';
98
+ /**
99
+ * #3540: the storage KV key of the scope's purge alarm — the pair the alarm asks its sweeper to run,
100
+ * which a commit names and the alarm does not otherwise know, and the instant before which no purge
101
+ * run is asked again (`notBefore`, set after a run that made no progress). KV, not SQL, as the wake's
102
+ * state is: what the scope's rows say is due is read from them every time (`purgeDueAt`).
103
+ */
104
+ export declare const PURGE_ALARM_KEY = "substrat:purge-alarm";
105
+ /** #3540: what `PURGE_ALARM_KEY` holds. */
106
+ export interface PurgeAlarmState {
107
+ readonly tenantId: TenantId;
108
+ readonly scopeId: ScopeId;
109
+ readonly notBefore?: number;
80
110
  }
81
111
  /** #2016: how a tenant reads against a scope's record (`ScopeDO.tenantVerdict`). */
82
112
  export type TenantVerdict = 'recorded' | 'inferred' | 'foreign' | 'unknown';
@@ -1 +1 @@
1
- {"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,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AA8lBjG,kGAAkG;AAClG,wBAAgB,QAAQ,CAAC,GAAG,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAQxD;AAgQD;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;AAmBtD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAOxD;AAED,gHAAgH;AAChH,OAAO,EAAE,kBAAkB,EAAE,CAAC;AA2B9B,wBAAgB,aAAa,CAC3B,OAAO,EAAE,kBAAkB,EAAE,EAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACzD;;;;GAIG;AACH,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,mBAAmB,CAAA;CAAO,GAClD,KAAK,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,UAAU,KAAK,aAAa,CAAC,UAAU,CAAC,CA4qT7E"}
package/dist/scope-do.js CHANGED
@@ -9,22 +9,30 @@ import { OperationQueue } from './serialization.js';
9
9
  import { reconcileOnWake } from './reconcile-on-wake.js';
10
10
  import { meterScopeWorkEntries, ScopeWorkMeter } from './scope-work.js';
11
11
  import { assertNoRuntimeStorage, doScopedSql, doBuiltColumnsOf, doRedactionSql, doSpineSql } from './sql.js';
12
- import { actorOf, admitPeer, boundToPeerDeclarations, collectPeers, switchPeer, peerSubjectRef, subjectGrantState, assertNoSecret, CAPABILITY_DDL, UPLOAD_LINK_DDL, DOWNLOAD_LINK_DDL, createAttachmentVerbs, inspectUploadLink, resolveDownloadLink, redeemUploadLinkInTransaction, COPY_ORIGIN_DDL, ENTITY_STATE_MOVES_DDL, SWITCH_FENCES_DDL, TABLE_OWNERS_DDL, assertMigrationLeavesLedgerAlone, recordOwnershipSteps, runMigrationStatements, splitSqlStatements, executableSqlStatements, blankSqlComments, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_BECOME_MINT_OPERATION, becomeMintCheck, mintBecomeCapabilityAsPrincipal, CAPABILITY_BIND_MINT_OPERATION, bindLinkMintCheck, mintBindLinkAsPrincipal, revokeBecomeCapabilityAsPrincipal, readBecomeLinkStates, ENTITY_UNBIND_OPERATION, allowedFor, unbindEntityHolderBounded, capabilityAttachmentWriteRefused, createCapabilityVerbs, createEntityEdgeVerbs, createEntityStateVerbs, createTrashedReads, CONTINUATION_POSITION_CAP, visibleContinuation, searchStateWhere, uncheckedView, addStatePlans, addUpdatedStampPlans, watchUpdatedStamps, assertNoCallerPurge, isUnreachableParent, PURGE_BATCH, heldPurgePass, lifecycleRefusal, purgeHeldBy, assertPlatformRequestRoom, CONNECTOR_DISPATCH_REQUESTED_BY, MAX_PENDING_CONNECTOR_DISPATCHES, purgeDueOf, purgeOnlyKeysOf, runPurgePass, refuseTrashedTarget, assertBoundOperations, checkHeldOperationsOf, countChecks, noteUncheckedCompletion, registerTrashTargets, withheldKeysFor, capCoverage, delegationCeilingOf, delegationStampOf, outsideCeiling, parseScopeDelegation, statefulTablesOf, afterMigration, afterRuntimeDdl, derivesAnything, repairDerivedObjects, StateColumnLost, exchangeCapability, exchangeBecomeLinkById, guardSecrets, mintBecomeCapability, redactSecrets, redactSecretText, moduleLog, asyncInvocationId, asyncLinePass, resolveCapabilitySession, revokeCapabilityAsPlatform, readCapabilityPage, domainEventOf, facetEvents, readDeadLetters, readLifecycleFlow, readOperationSeries, readHistory, readInvocation, readUndrainedOutbox, walkEventCause, walkEventEffects, } from '@substrat-run/kernel';
12
+ import { actorOf, admitPeer, boundToPeerDeclarations, collectPeers, switchPeer, peerSubjectRef, subjectGrantState, assertNoSecret, CAPABILITY_DDL, UPLOAD_LINK_DDL, DOWNLOAD_LINK_DDL, createAttachmentVerbs, inspectUploadLink, resolveDownloadLink, redeemUploadLinkInTransaction, COPY_ORIGIN_DDL, ENTITY_STATE_MOVES_DDL, SWITCH_FENCES_DDL, TABLE_OWNERS_DDL, assertMigrationLeavesLedgerAlone, recordOwnershipSteps, runMigrationStatements, splitSqlStatements, executableSqlStatements, blankSqlComments, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_BECOME_MINT_OPERATION, becomeMintCheck, mintBecomeCapabilityAsPrincipal, CAPABILITY_BIND_MINT_OPERATION, bindLinkMintCheck, mintBindLinkAsPrincipal, revokeBecomeCapabilityAsPrincipal, readBecomeLinkStates, ENTITY_UNBIND_OPERATION, allowedFor, unbindEntityHolderBounded, capabilityAttachmentWriteRefused, createCapabilityVerbs, createEntityEdgeVerbs, createEntityStateVerbs, createTrashedReads, CONTINUATION_POSITION_CAP, visibleContinuation, searchStateWhere, uncheckedView, addStatePlans, addUpdatedStampPlans, watchUpdatedStamps, assertNoCallerPurge, isUnreachableParent, PURGE_ALARM_MIN_GAP_MS, PURGE_BATCH, PURGE_DUE_BY_EVENT, heldPurgePass, purgeDueAt, readPurgeLap, lifecycleRefusal, purgeHeldBy, assertPlatformRequestRoom, CONNECTOR_DISPATCH_REQUESTED_BY, MAX_PENDING_CONNECTOR_DISPATCHES, purgeDueOf, purgeOnlyKeysOf, runPurgePass, refuseTrashedTarget, assertBoundOperations, checkHeldOperationsOf, countChecks, noteUncheckedCompletion, registerTrashTargets, withheldKeysFor, capCoverage, delegationCeilingOf, delegationStampOf, outsideCeiling, parseScopeDelegation, statefulTablesOf, afterMigration, afterRuntimeDdl, derivesAnything, repairDerivedObjects, StateColumnLost, exchangeCapability, exchangeBecomeLinkById, guardSecrets, mintBecomeCapability, redactSecrets, redactSecretText, moduleLog, asyncInvocationId, asyncLinePass, resolveCapabilitySession, revokeCapabilityAsPlatform, readCapabilityPage, domainEventOf, facetEvents, readDeadLetters, readLifecycleFlow, readOperationSeries, readHistory, readInvocation, readUndrainedOutbox, walkEventCause, walkEventEffects, } from '@substrat-run/kernel';
13
13
  import { assertSameAttachmentGate, attachmentGateOf, decideAttachmentRemove } from '@substrat-run/kernel';
14
14
  import { COPY_RESTORE_FENCE_LAPSED, copyRestoreFenceLapsed, orphanSweepVersionRefusal } from '@substrat-run/kernel';
15
15
  import { createDoTupleChecker, createLocalControlPlaneReader, scopeTupleReader } from './checker.js';
16
- import { settlePlatformRequestIn } from '@substrat-run/kernel';
16
+ import { clearSettledEmailIn, settlePlatformRequestIn } from '@substrat-run/kernel';
17
17
  import { loadDropsRowsOf, SCOPE_COPY_LEASE_MS, ulidTime } from '@substrat-run/kernel';
18
18
  import { handoffOutcome, reportHandoff, traceIdOf } from '@substrat-run/kernel';
19
19
  import { currentTraceparent } from '@substrat-run/kernel/invocation-line';
20
20
  import { analyticsBrokerSink, brokerTelemetryDataset } from './broker-telemetry.js';
21
21
  import { DELIVERY_HANDOFF_KEY, DELIVERY_MODE_KEY, HANDOFF_ROUNDS, deliveryModeAfter, handoffAfterFailure, handoffDue, handoffPending, mergeHandoff, sameMarks, } from './delivery-handoff.js';
22
22
  import { registerPlatformDeliveryBroker } from './delivery-broker-platform.js';
23
- import { advanceMarks, brokerName, handoffQueries, messagesOf } from '@substrat-run/kernel';
23
+ import { advanceMarks, brokerName, handoffQueries, messagesOf, senderDeliveryOf } from '@substrat-run/kernel';
24
24
  import { DELIVERY_HANDOFF_ENV, intentStateOf, intentStateQuery, witnessesOf, witnessQueries, } from '@substrat-run/kernel';
25
+ import { SCOPE_SWEEPER_NAME } from './scope-sweeper-do.js';
25
26
  import { SCOPE_WAKE_KEY, keepRegisteredMeanwhile, kickControlPlane, runWake, wakeAfterCommit, wakeDueAt } from './scope-wake.js';
26
27
  import { CARRIED_AWAY_KEY, COPY_MARK_CLEARED_KEY, KEPT_COPY_REFUSAL, KEPT_DIVERGENT_KEY, LOAD_STAMP_KEY, STORE_LOCAL_META_KEYS, WRITE_REVISION_KEY, carriedAwayDump, isCopyMarkInsert, isWriteStatement, assertSpineTablesBuilt, clearCopyMarker, dumpRowsInsert, isSpineTable, markCopyOrigin, repointScopeGrants, settleCopiedWork, emittedHere, IS_COPY_SQL, CLEAN_ROOM_COPY_SQL, isCopyLoad, isLifecycleWrite, readLifecycle, settleLifecycleAfterLoad, writeLifecycle, spineColumnAdditions } from '@substrat-run/kernel';
27
28
  import { GRANT_CHILDREN_INDEX_DDL, SHAPE_MARKER_INDEX_DDL, grantedEntitiesForContext } from '@substrat-run/kernel';
29
+ /**
30
+ * #3540: the storage KV key of the scope's purge alarm — the pair the alarm asks its sweeper to run,
31
+ * which a commit names and the alarm does not otherwise know, and the instant before which no purge
32
+ * run is asked again (`notBefore`, set after a run that made no progress). KV, not SQL, as the wake's
33
+ * state is: what the scope's rows say is due is read from them every time (`purgeDueAt`).
34
+ */
35
+ export const PURGE_ALARM_KEY = 'substrat:purge-alarm';
28
36
  /** A scope's migration journal: `module@version` → the SQL digest it recorded (#2066). */
29
37
  function readAppliedMigrations(sql) {
30
38
  const rows = sql.exec('SELECT module_id, version, sql_digest FROM _substrat_migrations').toArray();
@@ -928,6 +936,9 @@ options = {}) {
928
936
  // import, rather than at the first scope it wakes.
929
937
  for (const registration of modules)
930
938
  assertModuleDeclared(options.permissions, registration.manifest.id);
939
+ // #3488: the sender's delivery declarations by type, which every handoff reads. Two modules
940
+ // declaring one type differently fail here, at the worker's first import.
941
+ const senders = senderDeliveryOf(modules.map((m) => m.manifest));
931
942
  // A5 (#3471): the broker the platform's supplied class forwards to is this kernel's.
932
943
  registerPlatformDeliveryBroker();
933
944
  // What the declared surface reserves holds in every instance too, whatever registers under its ids.
@@ -996,6 +1007,12 @@ options = {}) {
996
1007
  purgeOnlyKeys = new Map();
997
1008
  /** #119: a purge schedule's operation → the module that declared it and the entity it purges. */
998
1009
  purgeSchedules = new Map();
1010
+ /**
1011
+ * #3540: true while this scope's alarm is waiting on its sweeper's purge run. The purges that
1012
+ * run meanwhile commit through `settleCommitted`, and must not arm the alarm the handler is about
1013
+ * to set from what the run left.
1014
+ */
1015
+ #purgeAlarmRunning = false;
999
1016
  /** #116: the operations that declared `idempotency: false` — refusals, not participants. */
1000
1017
  operationIdempotencyOptOut = new Set();
1001
1018
  /** #2821: the operations that declared `impersonation: 'refused'` — no session may invoke them. */
@@ -1197,8 +1214,13 @@ options = {}) {
1197
1214
  const trashTargets = registerTrashTargets(manifest.id, new Set(Object.keys(registration.operations?.handlers ?? {})), registration.operations?.inputs, manifest.entityStates, manifest.schedules);
1198
1215
  this.purgeOnlyKeys.set(manifest.id, purgeOnlyKeysOf(manifest.schedules ?? []));
1199
1216
  for (const schedule of manifest.schedules ?? []) {
1200
- if (schedule.purge)
1201
- this.purgeSchedules.set(schedule.operation, { moduleId: manifest.id, entityType: schedule.purge.entityType });
1217
+ if (schedule.purge) {
1218
+ this.purgeSchedules.set(schedule.operation, {
1219
+ moduleId: manifest.id,
1220
+ entityType: schedule.purge.entityType,
1221
+ everyMinutes: schedule.cadence.everyMinutes,
1222
+ });
1223
+ }
1202
1224
  }
1203
1225
  // #2068: refused before anything is recorded, as on the pure host.
1204
1226
  const erasure = moduleErasurePlan(registration);
@@ -1788,13 +1810,25 @@ options = {}) {
1788
1810
  async importApply(batch, tenantId, scopeId,
1789
1811
  /** #2029: the instance the peer door's gate read for the producer; on another, nothing applies. */
1790
1812
  doorInstance) {
1813
+ return this.applyImport(batch, tenantId, scopeId, doorInstance, { after: batch.after, next: batch.next });
1814
+ }
1815
+ /**
1816
+ * K-74 (#3492): an event another app's broker PUSHED here. `importApply`'s body with no
1817
+ * compare-and-set and no watermark move, so a pushed event that arrives ahead of an earlier
1818
+ * one cannot make the pull path skip that one; the pull path finds this one journaled.
1819
+ */
1820
+ async importPushed(pushed, tenantId, scopeId, doorInstance) {
1821
+ return this.applyImport(pushed, tenantId, scopeId, doorInstance, null);
1822
+ }
1823
+ /** One import, pulled (`edge`: the compare-and-set and the advance) or pushed (`edge` null). */
1824
+ async applyImport(batch, tenantId, scopeId, doorInstance, edge) {
1791
1825
  const source = batch.source;
1792
1826
  if (this.peerDoorMoved(source.vertical, doorInstance))
1793
1827
  return SYSTEM_DOOR_MOVED;
1794
1828
  await this.ensureMigrations();
1795
1829
  return await this.queue.enqueue(async () => {
1796
1830
  const liveSince = this.liveHighWaterMark();
1797
- const result = emptyImportResult(batch);
1831
+ const result = emptyImportResult({ after: edge?.after ?? null });
1798
1832
  // #1706's door, for a delivery (`operation: null`), inside the queued body: the producer
1799
1833
  // is a declared peer with its switch on, or nothing runs and the edge pauses.
1800
1834
  let peerSubject;
@@ -1806,7 +1840,9 @@ options = {}) {
1806
1840
  }
1807
1841
  const current = (this.sql.exec(IMPORT_CURSOR_OF_SQL, source.scopeId).toArray()[0]
1808
1842
  ?.cursor ?? null);
1809
- if (current !== batch.after)
1843
+ if (edge === null)
1844
+ result.cursor = current;
1845
+ else if (current !== edge.after)
1810
1846
  return { ...result, cursor: current, stale: true };
1811
1847
  const at = new Date().toISOString();
1812
1848
  const journaled = (id, moduleId) => this.sql
@@ -1882,8 +1918,11 @@ options = {}) {
1882
1918
  if (!ran)
1883
1919
  result.duplicates += 1;
1884
1920
  }
1885
- this.sql.exec(IMPORT_CURSOR_ADVANCE_SQL, source.scopeId, source.vertical, batch.next, at);
1886
- result.cursor = batch.next;
1921
+ // A pushed event moves nothing (#3492).
1922
+ if (edge !== null) {
1923
+ this.sql.exec(IMPORT_CURSOR_ADVANCE_SQL, source.scopeId, source.vertical, edge.next, at);
1924
+ result.cursor = edge.next;
1925
+ }
1887
1926
  lines.end();
1888
1927
  await this.settleCommitted(tenantId, scopeId, liveSince, null);
1889
1928
  return result;
@@ -2993,14 +3032,139 @@ options = {}) {
2993
3032
  await this.ctx.storage.setAlarm(at);
2994
3033
  }
2995
3034
  /**
2996
- * The scope's alarm, shared by its two users: the live reaper (#938) closes what has expired, and
2997
- * the scope's wake (K-69, `scope-wake.ts`) asks for the drains its pending work is waiting on.
2998
- * Each re-arms for what it has next, earliest wins.
3035
+ * The scope's alarm, shared by its users: the live reaper (#938) closes what has expired, the
3036
+ * scope's wake (K-69, `scope-wake.ts`) asks for the drains its pending work is waiting on, the
3037
+ * broker handoff retries (K-74), and the purge alarm (#3540) asks for the purges its bins have
3038
+ * made due. Each re-arms for what it has next, earliest wins.
2999
3039
  */
3000
3040
  async alarm() {
3001
3041
  await this.armLiveExpiry();
3002
3042
  await this.runScopeWake();
3003
3043
  await this.retryHandoff();
3044
+ await this.runPurgeAlarm();
3045
+ }
3046
+ /**
3047
+ * #3540: whether this scope's purges are due by event: the switch is `event`, a sweeper is bound
3048
+ * for the alarm to ask, and a registered module declares a purge horizon.
3049
+ */
3050
+ purgeDueByEvent() {
3051
+ return this.env.SUBSTRAT_PURGE_DUE === PURGE_DUE_BY_EVENT && this.env.SWEEPER !== undefined && this.purgeSchedules.size > 0;
3052
+ }
3053
+ /** #3540: when this scope's purges are next due, read from its own rows (`purgeDueAt`). */
3054
+ purgeDueAtNow(now) {
3055
+ const schedules = [...this.purgeSchedules].map(([operation, s]) => ({ operation, entityType: s.entityType, everyMinutes: s.everyMinutes }));
3056
+ return purgeDueAt(doSpineSql(this.sql), this.statePlans, schedules, now);
3057
+ }
3058
+ /**
3059
+ * #3540: arm the scope's alarm for its earliest due row, and record the pair the alarm will ask
3060
+ * for. Never before the `notBefore` a run with no progress left. A copy arms nothing: a fork, a
3061
+ * snapshot or a preview runs no schedule. Answers whether anything is armed.
3062
+ */
3063
+ async armPurgeAlarm(tenantId, scopeId) {
3064
+ if (!this.purgeDueByEvent() || this.isCopyRead())
3065
+ return false;
3066
+ const at = this.purgeDueAtNow(Date.now());
3067
+ if (at === null)
3068
+ return false;
3069
+ const held = (await this.ctx.storage.get(PURGE_ALARM_KEY)) ?? null;
3070
+ if (!held || held.tenantId !== tenantId || held.scopeId !== scopeId) {
3071
+ await this.ctx.storage.put(PURGE_ALARM_KEY, { tenantId, scopeId });
3072
+ }
3073
+ await this.armAlarmBy(Math.max(at, held?.notBefore ?? 0));
3074
+ return true;
3075
+ }
3076
+ /**
3077
+ * #3540: after a commit, arm the purge alarm for what is now earliest. Never fails the commit it
3078
+ * follows: an alarm not armed costs latency, and the sweeper's pass re-arms it (the safety net).
3079
+ */
3080
+ async notePurgeDue(tenantId, scopeId) {
3081
+ if (this.#purgeAlarmRunning || !this.purgeDueByEvent())
3082
+ return;
3083
+ try {
3084
+ await this.armPurgeAlarm(tenantId, scopeId);
3085
+ }
3086
+ catch (err) {
3087
+ console.error('substrat: purge alarm not armed after commit; the sweeper pass re-arms it', err);
3088
+ }
3089
+ }
3090
+ /**
3091
+ * #3540: the purge alarm's half of `alarm()`. When a purge is due, the scope asks its sweeper to
3092
+ * run this scope's purge schedules (`runScopePurges`), which runs them through the coordinator's
3093
+ * door, with every gate a pass applies. Then it re-arms from what its rows say now:
3094
+ *
3095
+ * - nothing left binned (a restore cancelled it, or the run purged it): nothing armed;
3096
+ * - a lap left open by a run that answered: due again at once, since that run made progress;
3097
+ * - otherwise never sooner than `PURGE_ALARM_MIN_GAP_MS`, or the schedule's cadence when the
3098
+ * sweeper could not be asked, so a run that cannot progress cannot spin the alarm;
3099
+ * - a run the sweeper held (a lifecycle, a switch, a scope off its roster): not re-armed, and no
3100
+ * commit re-arms it within the cadence. The pass re-arms it when the scope's schedules run.
3101
+ *
3102
+ * Never throws: a thrown alarm is retried by the runtime.
3103
+ */
3104
+ async runPurgeAlarm() {
3105
+ try {
3106
+ const state = (await this.ctx.storage.get(PURGE_ALARM_KEY)) ?? null;
3107
+ if (!state)
3108
+ return;
3109
+ // The switch turned off, or the scope became a copy: the pass has it again, or nothing does.
3110
+ if (!this.purgeDueByEvent() || this.isCopyRead()) {
3111
+ await this.ctx.storage.delete(PURGE_ALARM_KEY);
3112
+ return;
3113
+ }
3114
+ await this.ensureMigrations();
3115
+ const now = Date.now();
3116
+ const at = this.purgeDueAtNow(now);
3117
+ if (at === null) {
3118
+ await this.ctx.storage.delete(PURGE_ALARM_KEY);
3119
+ return;
3120
+ }
3121
+ const notBefore = state.notBefore ?? 0;
3122
+ if (at > now || notBefore > now) {
3123
+ await this.armAlarmBy(Math.max(at, notBefore));
3124
+ return;
3125
+ }
3126
+ const sweeper = this.env.SWEEPER;
3127
+ let answer;
3128
+ this.#purgeAlarmRunning = true;
3129
+ try {
3130
+ const stub = sweeper.get(sweeper.idFromName(SCOPE_SWEEPER_NAME));
3131
+ answer = await stub.runScopePurges(state.tenantId, state.scopeId);
3132
+ }
3133
+ catch (err) {
3134
+ answer = { error: err instanceof Error ? err.message : String(err) };
3135
+ }
3136
+ finally {
3137
+ this.#purgeAlarmRunning = false;
3138
+ }
3139
+ const after = Date.now();
3140
+ const next = this.purgeDueAtNow(after);
3141
+ if (next === null) {
3142
+ await this.ctx.storage.delete(PURGE_ALARM_KEY);
3143
+ return;
3144
+ }
3145
+ const cadence = after + Math.min(...[...this.purgeSchedules.values()].map((p) => p.everyMinutes)) * 60_000;
3146
+ if ('held' in answer) {
3147
+ // Not re-armed, and no commit re-arms it within the cadence: a held scope does not ask on
3148
+ // every write. The pass arms it again once the scope's schedules run.
3149
+ await this.ctx.storage.put(PURGE_ALARM_KEY, { tenantId: state.tenantId, scopeId: state.scopeId, notBefore: cadence });
3150
+ return;
3151
+ }
3152
+ let floor;
3153
+ if ('error' in answer) {
3154
+ console.error('substrat: the purge alarm could not ask its sweeper; asking again after the cadence', answer.error);
3155
+ floor = cadence;
3156
+ }
3157
+ else {
3158
+ const sql = doSpineSql(this.sql);
3159
+ const open = [...this.purgeSchedules.keys()].some((op) => readPurgeLap(sql, op).after !== null);
3160
+ floor = open ? after : after + PURGE_ALARM_MIN_GAP_MS;
3161
+ }
3162
+ await this.ctx.storage.put(PURGE_ALARM_KEY, { tenantId: state.tenantId, scopeId: state.scopeId, notBefore: floor });
3163
+ await this.armAlarmBy(Math.max(next, floor));
3164
+ }
3165
+ catch (err) {
3166
+ console.error('substrat: purge alarm failed; the sweeper pass re-arms it', err);
3167
+ }
3004
3168
  }
3005
3169
  /** K-69: a scope with the control plane's origin and secret asks for its own drains. */
3006
3170
  wakeTransport() {
@@ -3126,7 +3290,7 @@ options = {}) {
3126
3290
  // A backlog larger than one batch follows in the next round; bounded, so a commit never spins.
3127
3291
  for (let round = 0; round < HANDOFF_ROUNDS; round++) {
3128
3292
  inFlight = null;
3129
- const sent = handoffQueries(marks).flatMap((q) => messagesOf(q.kind, this.sql.exec(q.sql, ...q.params).toArray(), ids, commit));
3293
+ const sent = handoffQueries(marks).flatMap((q) => messagesOf(q.kind, this.sql.exec(q.sql, ...q.params).toArray(), ids, commit, senders));
3130
3294
  if (sent.length === 0) {
3131
3295
  // A5: a window's start the broker has not acknowledged goes on its own.
3132
3296
  if (options.start) {
@@ -3401,6 +3565,8 @@ options = {}) {
3401
3565
  await this.dispatch(tenantId, scopeId, invocationId);
3402
3566
  // K-69: after the consumers, whose own emits and intents count too.
3403
3567
  await this.noteScopeWake(tenantId, scopeId);
3568
+ // #3540: a row this commit binned may now be the earliest due.
3569
+ await this.notePurgeDue(tenantId, scopeId);
3404
3570
  // K-74: the same, for the delivery broker. #3474: the rows this call wrote carry its trace.
3405
3571
  await this.handOffCommitted(tenantId, scopeId, { invocationId, traceId: traceIdOf(currentTraceparent()) });
3406
3572
  if (liveSince === null)
@@ -5112,7 +5278,12 @@ options = {}) {
5112
5278
  * #2517: platform requests the purge runs earlier in the same tick enqueued. LAST and optional
5113
5279
  * for the same reason; absent means none, so a refused head is a failure as before.
5114
5280
  */
5115
- earlierPurgeRequests) {
5281
+ earlierPurgeRequests,
5282
+ /**
5283
+ * #3540: who asks (`PurgeSweepMode`). LAST and optional for the same reason; absent is a pass
5284
+ * whose sweeper cannot take a scope alarm's call, which is always run, as before.
5285
+ */
5286
+ mode) {
5116
5287
  await this.ensureMigrations();
5117
5288
  const schedule = this.purgeSchedules.get(operation);
5118
5289
  if (!schedule)
@@ -5131,6 +5302,13 @@ options = {}) {
5131
5302
  const held = purgeHeldBy(this.purgeGateFacts(schedule.moduleId, tenantId));
5132
5303
  if (held !== null)
5133
5304
  return heldPurgePass(held);
5305
+ // #3540: due by event, and the pass's sweeper can take the alarm's call: the pass runs nothing
5306
+ // here, so a purge is never run by both. It arms the alarm instead, which is also how a bin
5307
+ // filled before the switch was turned on, or an alarm that was lost, comes to be armed.
5308
+ if (mode === 'deferrable' && this.purgeDueByEvent()) {
5309
+ await this.armPurgeAlarm(tenantId, scopeId);
5310
+ return { purged: 0, skipped: 0, errors: [], more: false, lapFailed: 0, byAlarm: true };
5311
+ }
5134
5312
  const due = purgeDueOf(doSpineSql(this.sql), this.statePlans, this.operationTarget, operation, schedule.entityType, new Date().toISOString(), PURGE_BATCH);
5135
5313
  // #2440: what each committed purge enqueued, from the same envelope an ordinary invoke's
5136
5314
  // caller reads. A purge that threw rolled back, and its intents with it.
@@ -5773,6 +5951,10 @@ options = {}) {
5773
5951
  isCopy() {
5774
5952
  return this.sql.exec(IS_COPY_SQL).toArray().length > 0;
5775
5953
  }
5954
+ /** #3540: `isCopy`, read on a scope that may not hold the classification's table yet. */
5955
+ isCopyRead() {
5956
+ return this.hasTable('_substrat_copy_origin') && this.isCopy();
5957
+ }
5776
5958
  /** Whether this scope is a clean-room copy (#3108, `CLEAN_ROOM_COPY_SQL`): what a seeded preview's persona link is behind. */
5777
5959
  isCleanRoomCopy() {
5778
5960
  return this.hasTable('_substrat_copy_origin') && this.sql.exec(CLEAN_ROOM_COPY_SQL).toArray().length > 0;
@@ -5972,10 +6154,17 @@ options = {}) {
5972
6154
  * row that is correctly over.
5973
6155
  */
5974
6156
  settlePlatformRequest(id, status, result, lastError, lastFailure = null) {
5975
- this.sql.exec(`UPDATE _substrat_platform_requests
5976
- SET status = ?, result = COALESCE(?, result), last_error = ?, last_failure = ?,
5977
- attempts = attempts + 1, settled_at = ?
5978
- WHERE id = ? AND status = 'pending'`, status, result, lastError, lastFailure, status === 'pending' ? null : new Date().toISOString(), id);
6157
+ const now = new Date().toISOString();
6158
+ this.revision.transactionSync(() => {
6159
+ this.sql.exec(`UPDATE _substrat_platform_requests
6160
+ SET status = ?, result = COALESCE(?, result), last_error = ?, last_failure = ?,
6161
+ attempts = attempts + 1, settled_at = ?
6162
+ WHERE id = ? AND status = 'pending'`, status, result, lastError, lastFailure, status === 'pending' ? null : now, id);
6163
+ // #3568: a settled row's message is cleared when its sender asked, in this transaction, as
6164
+ // the kernel's settle does on the other verb. Idempotent, and never a pending row.
6165
+ if (status !== 'pending')
6166
+ clearSettledEmailIn(this.switchSql(), id, now);
6167
+ });
5979
6168
  }
5980
6169
  /**
5981
6170
  * A settle that writes an outcome event (#2102): the kernel's one settle — the same