@substrat-run/adapter-sqlite 0.146.0 → 0.147.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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { type BlobStoreHandle, type ImportBatch, type ImportResult, type Coverage, type PeerCoverage, type VerticalCaller, type BoundedBecomeMint, type BoundedBecomeRevoke, type BoundedUnbind, type BecomeLinkState, type PrincipalBecomeCapabilityInput, type CapabilityExchange, type CapabilityId, type ConnectionId, type ModuleId, type DomainEvent, type PlatformRequestId, type PlatformRequestEntry, type PlatformRequestFilter, type ProjectedConnectionGrant, type EntityRef, type PermissionKey, type PlatformActorId, type OnBehalfOf, type PrincipalId, type ScopeDump, type ScopeId, type ImpersonationSessionId, type TenantId, type TenantStoreHandle } from '@substrat-run/contracts';
2
- import { type ModuleLogSink, type InvocationLineSink, type FreshnessReport, type FreshnessRegistration, type BlobStoreProvisionInput, type ScopeAttachments, type ExecutorDeadLetter, type ExecutorDrainReport, type MigrateScopeOutcome, type MigrationFrontier, type ExecutorHandler, type ExecutorRetryPolicy, type ScopeRoleHolder, type ConnectorHandler, type ConnectorOptions, type Clock, type FetchLike, type SecretBox, type HostAdmin, type ModuleRegistration, type OperationHandler, type PermissionChecker, type ProvisionScopeInput, type ScheduleRegistration, type ScheduleRunReport, type ScopeHost, type ScopeStub, type ScopeStubOptions, type TenantRelationalStore, type TenantStoreProvisionInput, type AttachmentExtractor, type AttachmentTextBounds, type JobDriveReport, type JobHandler, type JobRun, type JobRunFilter, type StartJobRunInput, type ConnectorCallRecorder } from '@substrat-run/kernel';
1
+ import { type BlobStoreHandle, type ImportBatch, type ImportResult, type Coverage, type PeerCoverage, type VerticalCaller, type BoundedBecomeMint, type BoundedBecomeRevoke, type BoundedUnbind, type BecomeLinkState, type PrincipalBecomeCapabilityInput, type CapabilityExchange, type CapabilityId, type ConnectionId, type ModuleId, type DomainEvent, type PlatformRequestId, type PlatformRequestEntry, type PlatformRequestFilter, type ProjectedConnectionGrant, type EntityRef, type PermissionKey, type PlatformActorId, type OnBehalfOf, type PrincipalId, type ScopeDumpInput, type ScopeId, type ImpersonationSessionId, type TenantId, type TenantStoreHandle } from '@substrat-run/contracts';
2
+ import { type ModuleLogSink, type InvocationLineSink, type FreshnessReport, type FreshnessRegistration, type BlobStoreProvisionInput, type ScopeAttachments, type ExecutorDeadLetter, type ExecutorDrainReport, type MigrateScopeOutcome, type MigrationFrontier, type ExecutorHandler, type ExecutorRetryPolicy, type ScopeRoleHolder, type ConnectorHandler, type ConnectorOptions, type Clock, type FetchLike, type SecretBox, type HostAdmin, type ModuleRegistration, type OperationHandler, type PermissionChecker, type ProvisionScopeInput, type ScheduleRegistration, type ScheduleRunReport, type ScopeHost, type ScopeStub, type ScopeStubOptions, type TenantRelationalStore, type TenantStoreProvisionInput, type AttachmentExtractor, type AttachmentTextBounds, type JobDriveReport, type JobHandler, type JobRun, type JobRunFilter, type StartJobRunInput, type ConnectorCallRecorder, type StoreStub, type ScopeStoreStubOptions, type ScopeStoreHostOptions, type StoreErasureReplay } from '@substrat-run/kernel';
3
3
  import { type PlatformRequestSettle } from '@substrat-run/kernel';
4
4
  /**
5
5
  * A fault in the database itself (full, corrupt, I/O), as opposed to one statement failing.
@@ -43,6 +43,12 @@ export interface SqliteScopeHostOptions {
43
43
  * the lock is what keeps another thread or process from doing so.
44
44
  */
45
45
  dir: string;
46
+ /**
47
+ * Scope stores this host answers (#2213). A binding with no runner is refused.
48
+ * Absent, every `getScopeStore` is refused after the directory check: this host
49
+ * has no runner at all. `vertical`, when set, is the only vertical it serves.
50
+ */
51
+ scopeStores?: ScopeStoreHostOptions;
46
52
  /** Defaults to the built-in tuple checker (deny-by-default on empty tuples). */
47
53
  checker?: PermissionChecker;
48
54
  /**
@@ -157,6 +163,9 @@ export declare class SqliteScopeHost implements ScopeHost {
157
163
  /** predicate name → the module-contributed implementation. Names are global. */
158
164
  private readonly predicates;
159
165
  /** operation names whose default binding some manifest withdrew (K-17). */
166
+ private readonly scopeStoreRunners;
167
+ private readonly scopeStoreVertical?;
168
+ private readonly scopeStoreLifecycle;
160
169
  private readonly withdrawn;
161
170
  private readonly relations;
162
171
  /** entityType → its derived FTS5 index (#827). One entity type, one index. */
@@ -345,18 +354,61 @@ export declare class SqliteScopeHost implements ScopeHost {
345
354
  * the per-tenant blob store — never through the scope pipe (the issue's point).
346
355
  */
347
356
  private buildAttachments;
348
- importScope(actor: PlatformActorId, input: ProvisionScopeInput, dump: ScopeDump): Promise<void>;
357
+ importScope(actor: PlatformActorId, input: ProvisionScopeInput, dump: ScopeDumpInput): Promise<void>;
349
358
  /** Drop-then-replay a dump into a scope's db, refreshing the migration frontier. */
350
359
  private loadDump;
351
- restoreScope(actor: PlatformActorId, tenantId: TenantId, scopeId: ScopeId, dump: ScopeDump, opts?: {
360
+ restoreScope(actor: PlatformActorId, tenantId: TenantId, scopeId: ScopeId, dump: ScopeDumpInput, opts?: {
352
361
  sourceScopeId?: ScopeId;
353
- }): Promise<void>;
362
+ }): Promise<StoreErasureReplay | void>;
354
363
  snapshotScope(actor: PlatformActorId, tenantId: TenantId, scopeId: ScopeId, opts?: {
355
364
  kind?: string;
356
365
  expiresAt?: string;
357
366
  }): Promise<ScopeId>;
358
367
  deleteSnapshot(actor: PlatformActorId, tenantId: TenantId, scopeId: ScopeId): Promise<void>;
359
368
  getScope(principal: PrincipalId, tenantId: TenantId, scopeId: ScopeId, options?: ScopeStubOptions): Promise<ScopeStub>;
369
+ getScopeStore(principal: PrincipalId, tenantId: TenantId, scopeId: ScopeId, binding: string, options?: ScopeStoreStubOptions): Promise<StoreStub>;
370
+ /** The scope's vertical when it has one. No vertical means this host has no store to touch. */
371
+ private scopeStoreVerticalIfPresent;
372
+ /** The scope's vertical, refused when this host is limited to another one. */
373
+ private scopeStoreVerticalOf;
374
+ /**
375
+ * One reserved call on a declared binding. The vertical's stub never reaches
376
+ * this; `callReservedStoreOperation` refuses a name that is not reserved.
377
+ */
378
+ private invokeReservedStore;
379
+ /**
380
+ * Each declared binding's `substrat.size`. No runners means an empty list,
381
+ * and the scope is not opened to discover that.
382
+ */
383
+ private readScopeStoreSizes;
384
+ /** The vertical whose stores this scope has on this host, or nothing when it has none. */
385
+ private storeVerticalOf;
386
+ /**
387
+ * `substrat.erase` on each declared binding. A store error throws, so the caller
388
+ * can leave the subject key untouched. Fail closed (#2242): an empty answer means
389
+ * this host KNOWS it holds nothing for the scope. It always can tell — the
390
+ * directory names the scope's vertical, and the runners are this host's own — so
391
+ * unlike a Cloudflare host with no control plane it has no "cannot tell" case.
392
+ */
393
+ private eraseScopeStores;
394
+ /**
395
+ * A dump's stores this host cannot load are refused before any write (#2211, L8): a
396
+ * binding that is not bound, a store with no kind or a kind other than the bound runner's,
397
+ * any store at all for a destination with no vertical (no store object can be named for
398
+ * it, so loading would drop them), or a destination on a vertical other than the one this
399
+ * host is pinned to.
400
+ */
401
+ private refuseUnusableScopeStores;
402
+ private exportScopeStores;
403
+ private importScopeStores;
404
+ /**
405
+ * `substrat.erase` again for every tombstoned subject (#2207), on the target's and the
406
+ * source's marks (`replayStoreErasures`). A target this host names no store for (no
407
+ * runner, or no vertical a store is kept for) has nothing to replay into: nothing is read.
408
+ */
409
+ private replayShreddedStoreErasures;
410
+ /** `substrat.wipe` on each declared binding, before the scope's own storage goes. */
411
+ private wipeScopeStores;
360
412
  /**
361
413
  * A scope stub whose authority is a CONNECTION (#97).
362
414
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAmBL,KAAK,eAAe,EAepB,KAAK,WAAW,EAEhB,KAAK,YAAY,EAwBjB,KAAK,QAAQ,EACb,KAAK,YAAY,EAIjB,KAAK,cAAc,EA4CnB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,8BAA8B,EAGnC,KAAK,kBA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G;IACH,OAAO,CAAC,yBAAyB;IAWjC,OAAO,CAAC,sBAAsB;IA+I9B,OAAO,CAAC,SAAS;IAejB;;;;OAIG;IACH,qGAAqG;IACrG,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,gBAAgB;IAmiBxB,oGAAoG;IACpG,OAAO,CAAC,YAAY;IAIpB;;;;;;OAMG;YACW,aAAa;YAqBb,sBAAsB;IAoFpC;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB;IAyB5B;;;;;OAKG;IACH;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,UAAU;IAKlB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,cAAc;IAKtB;;;;;OAKG;IACH,OAAO,CAAC,MAAM;IAuBd;;;OAGG;IACH,OAAO,CAAC,YAAY;IAUpB;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IA2G1B,OAAO,CAAC,OAAO;CAsChB"}
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, rmSync,
2
2
  import { dirname, join } from 'node:path';
3
3
  import Database from 'better-sqlite3';
4
4
  import { accessLogEntry, adminLogEntry, delegatedReadParams, operationSeriesCount, opsFailureEntry, opsFailureFingerprint, issueEntry, FRESHNESS_HEARTBEAT_MINUTES, sweepRunEntry, modelUsageEntry, ATTACHMENT_ADDED, ATTACHMENT_REMOVED, attachmentRecord, createTenantInput, domainEvent, domainEventInput, exportReadInput, importBatch, importCursorMove, exportsOfManifestJson, assertNoBindingShapeBreak, importsOfManifestJson, entitlementGrant, entitlementGrantInput, eventId, meterReading, platformRequestInput, platformRequestId, MAX_PENDING_PLATFORM_REQUESTS, identityLink, identityPool, instant, isSubstratError, connection, capabilityGrant, connectionGrant, connectionGrantRecord, connectionSecret, systemGrant, systemSwitch, systemSwitchRecord, peerSwitch, verticalCaller, verticalSlug as verticalSlugOf, subjectRef, requestFingerprint, createConnectionInput, connectLinkFilter, connectLinkKey, consumeConnectLinkInput, mintConnectLinkInput, projectedConnectionGrant, projectedConnectionKey, moduleManifest, createOrgInput, promotionAcknowledgement, bindAcknowledgement, bindHostnameInput, channelHistoryEntry, hostnameBinding, publishVersionInput, AUTO_ADMISSION_NOTE, routeTarget, ROUTE_SCOPE_HOSTNAMES_MAX, registerVerticalInput, vertical as verticalSchema, verticalChannel, verticalVersion, objectRef, entityObjectRef, assertModuleEmittableType, assertKernelAuthoredType, grantRefFromProof, org as orgSchema, orgMembership, principalId, resolvedIdentity, identityMembership, roleDefinition, scope as scopeSchema, tenant as tenantSchema, tenantRole, principalBecomeCapabilityInput, subjectShredReceipt, SCOPE_TABLE_PAGE_DEFAULT, SCOPE_TABLE_PAGE_MAX, SCOPE_QUERY_ROW_MAX, verticalServingState, callsOfManifestJson, outboundOfManifestJson, listLimitOf, pageOf, countedPageOf, SCOPE_GATE_REASONS, substratError, assertReplayableDump, delegatedReadRecord, ownerTransferAudit, memberChangeAudit, peerBindingAudit, copyMarkAudit, redrainEventsInput, REDRAIN_BATCH, } from '@substrat-run/contracts';
5
- import { actorOf, asPrincipal, assertAllowed, assertNoSecret, assertPermissionKey, CAPABILITY_DDL, COPY_ORIGIN_DDL, ENTITY_STATE_MOVES_DDL, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_BECOME_MINT_OPERATION, becomeMintCheck, mintBecomeCapabilityAsPrincipal, revokeBecomeCapabilityAsPrincipal, readBecomeLinkStates, ENTITY_UNBIND_OPERATION, allowedFor, unbindEntityHolderBounded, capabilityAttachmentWriteRefused, capabilityTokenHash, createCapabilityVerbs, createEntityEdgeVerbs, createEntityStateVerbs, createTrashedReads, CONTINUATION_POSITION_CAP, visibleContinuation, searchStateWhere, uncheckedView, addStatePlans, addUpdatedStampPlans, watchUpdatedStamps, entityStateMigrations, assertNoCallerPurge, isUnreachableParent, heldPurgePass, purgeDueOf, purgeHeldBy, lifecycleRefusal, purgeOnlyKeysOf, purgeReportOf, purgeStillDue, refuseTrashedTarget, assertBoundOperations, registerTrashTargets, runPurgePass, withheldKeysFor, statefulTablesOf, afterMigration, afterRuntimeDdl, derivesAnything, repairDerivedObjects, StateColumnLost, exchangeCapability as exchangeCapabilitySecret, guardSecrets, mintBecomeCapability, plausibleSessionToken, readCapabilityPage, redactSecrets, redactSecretText, moduleLog, consoleLogSink, asyncInvocationId, asyncLinePass, consoleInvocationLineSink, resolveCapabilitySession, revokeCapabilityAsPlatform, assertReadOnlyQuery, attachmentBlobKey, attachmentSha256, entitlementDenial, requiredEntitlementFor, foldMeterReading, guardSpine, guardSqlLimits, DO_SQL_LIMITS, tooManyResultColumns, tooManyTableColumns, parseValidationRecords, resolveScopeRecord, ulid, ISSUE_RETENTION_DAYS, telemetryRetentionStatements, FINDINGS_DDL, SCOPE_STORAGE_DDL, forgetScopeStorage, listScopeStorageAttemptRows, listScopeStorageRows, pruneScopeStorageRows, recordScopeStorageRows, CONNECT_LINKS_DDL, consumeConnectLinkRow, insertConnectLink, listConnectLinks as listConnectLinkRows, readConnectLink, restoreConnectLinkRow, revokeConnectLinkRow, createFindingRule, findingOfOpsFailure, findingOfSweepRun, pruneFindings, listFindingRules, listFindings, observeFinding, revokeFindingRule, setFindingStatus, assertRowLimit, assertRowOffset, OPS_FAILURE_RETENTION_DAYS, SWEEP_RUN_RETENTION_DAYS, SWEEP_RUNS_INTENT_INDEX, sweepRunsIntentHasKind, MODEL_USAGE_RETENTION_DAYS, foldModelUsage, backoffAt, platformRequestHistoryQuery, platformRequestOf, PLATFORM_REQUEST_COLUMNS, PLATFORM_REQUEST_REDACTION_SQL, platformRequestRedactionParams, platformRequestRedactionQuery, intentPayloadCarriesSubject, redactSubjectJobRuns, eraseSubjectFromModules, moduleRowsErased, moduleErasurePlan, redactSubjectScopeText, redactSubjectDirectoryText, ISSUE_EXEMPLAR_OWNER_BACKFILL_SQL, issueExemplarOwner, JOB_RUN_PATCH_SQL, JOB_RUN_CLAIM_SQL, JOB_RUN_RENEW_SQL, JOB_RUN_BEGIN_SQL, JOB_RUN_MISS_SQL, JOB_RUN_MISS_SETTLE_SQL, admissionMissOutcome, JOB_STEP_RECORD_SQL, JOB_LEASE_EXPIRED_NOTE, assertLeaseMs, DELIVERY_ERROR_REDACTION_SQL, REDACTED_DELIVERY_NOTE, seatScopeTuple, applyScopeRoleChange, changeScopeRole, revokeScopeRoles, scopeRoleHolders, admitPeer, peerCallerAt, collectPeers, peerSeats, resolveVerticalInstanceFrom, resolvePeerInstanceFrom, peerVerticalSpellings, samePeerVertical, peerGrantsStatus, systemGrantsStatus, systemScheduleState, systemSwitchedOff, systemSwitchedOffMessage, tenantSystemSwitchedOffMessage, PEER_SWITCHES_DDL, PEER_BINDINGS_DDL, SWITCH_OWED_DDL, SWITCH_FENCES_DDL, TABLE_OWNERS_DDL, assertMigrationLeavesLedgerAlone, recordOwnershipSteps, runMigrationStatements, executableSqlStatements, blankSqlComments, recordWriteSuperseded, switchFencesOf, switchSupersededMessage, SWITCH_KINDS, SYSTEM_SWITCHES_DDL, forgetSwitchesOf, listSystemSwitchRecords, moveSwitch, reassertActionOf, reassertEntry, reassertOffRow, recordSwitchedOff, recordSwitchedOn, restoreSwitchRecord, scopesSwitchedOffFor, switchActionOf, switchAuditSubject, recordAuditOutcome, auditedCapabilityRevoke, auditWarningOf, switchNotFoundMessage, switchRecordsOf, switchedOffOf, switchesBackfillSqlOf, switchesTableExists, tenantHeldOf, tenantHoldsGrant, inUnitMovesToAudit, staleCarryRevertRow, staleCarryReverts, withRecorded, VERSION_MIGRATIONS_DDL, splitManifestMigrations, splitVersionMigrationsBatch, versionMigrationsOf, writeVersionMigrations, denialListQuery, refusalListQuery, mapRefusalRow, denialSummaryQuery, denialTotalsQuery, DENIAL_WINDOW_QUERY, mapDenialRow, mapDenialSummaryBuckets, IMPERSONATION_COLUMNS, IMPERSONATION_DDL, ImpersonationRefused, assertImpersonationWrites, assertModuleEnqueueableKind, assertSessionUsable, impersonationByIdQuery, impersonationListQuery, impersonationRowValues, impersonationStampOf, mapImpersonationRow, newImpersonationSession, resolveRetryPolicy, executorOutcomeOf, isDeliveryRefusal, refusalJournalText, membershipFencesBackfillSql, MEMBERSHIP_FENCES_DDL, membershipFencesTableExists, MEMBERSHIP_FENCE_SINCE_SQL, RAISE_MEMBERSHIP_FENCE_SQL, memberAddedAudit, orgChangeBound, tenantCoverage, isSecretBoxConfigured, unconfiguredSecretBox, createSubjectKeys, generateSealingKeyPair, noSealingKeyMessage, openSealed, sealTo, ConnectionSealingKeyUnavailableError, PermissionDenied, createAtomic, NotSearchable, NotListable, listIndexMigrations, listIndexPlans, listQuery, cursorOf, moduleMigrations, MIGRATION_DIGEST_FENCE_DDL, MIGRATION_DIGEST_MARK_LEGACY, assertJournalDumpCoherent, assertMigrationSql, migrationDivergence, migrationFailedError, migrationSteps, planMigrations, isSearchIndexTable, searchIndexMigrations, searchIndexPlans, searchLimit, searchMatchExpression, searchQuery, ATTACHMENT_TEXT_DDL, assertAttachmentExtractors, resolveAttachmentTextBounds, assertJobRegistrable, attachmentRecordOfRow, attachmentTextJob, enqueueAttachmentText, ATTACHMENT_TEXT_BACKFILL_JOB, ATTACHMENT_TEXT_JOB, kernelJobFor, queueAttachmentTextBackfill, startAttachmentTextBackfill, attachmentTextBackfillJob, reconcileAttachmentText, recordAttachmentText, searchAttachments, entityVersionQuery, entityVersionOf, assertIfMatch, OUTBOX_ENTITY_INDEX, SCHEDULE_STATE_DDL, SCHEDULE_STATE_REBUILD, scheduleStateHasKind, VERTICAL_EVENTS_DDL, EXPORT_HOPS_SQL, emptyImportResult, IMPORT_CURSORS_SQL, IMPORT_CURSOR_OF_SQL, OUTBOX_MARK_SQL, emittedSinceQuery, emittedReportOf, EMITTED_REPORT_CAP, exportedSinceQuery, IMPORT_CURSOR_ADVANCE_SQL, IMPORT_RECORD_SQL, moveImportCursor, importCursorSourceOf, exportBreaksOf, exportBreakRefusal, bindExportBreaksOf, bindExportBreakRefusal, scopeMoveOf, runningVersionOf, isPrimaryScope, PROVISIONED_VERSIONS_SQL, installsReconciledOf, strandJudgmentsOf, provisionedVersionsParams, boundShapesColumn, boundShapesOfColumn, installReconciled, CrossVerticalRegistry, exportReadPlan, exportReadQuery, planExportBatch, withheldNote, JOB_RUN_DDL, JOB_RUN_DUE_AT, jobRunListLimit, jobRunOf, runDueJobRuns, startJobRun, IDEMPOTENCY_DDL, REFUSALS_TABLE_DDL, REFUSALS_INDEX, refusalInsert, refusalOf, markGuardRefusal, REFUSALS_REBUILD, refusalsAdmitGuards, assertIdempotencyKey, idempotencyLookupQuery, idempotencyPruneStatement, idempotencyRecordStatement, idempotencyOptedOutMessage, replayFor, globalFetch, createUlid, facetEvents, readHistory, walkEventCause, walkEventEffects, assertRedrainWindow, readInvocation, readDeadLetters, readLifecycleFlow, readOperationSeries, domainEventOf, readUndrainedOutbox, undrainedEventsOf, connectorCallRecord, noopConnectorCallRecorder, recordConnectorCall, settleConnectionUse, unknownRoleError, } from '@substrat-run/kernel';
5
+ import { actorOf, asPrincipal, assertAllowed, assertNoSecret, assertPermissionKey, CAPABILITY_DDL, COPY_ORIGIN_DDL, ENTITY_STATE_MOVES_DDL, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_BECOME_MINT_OPERATION, becomeMintCheck, mintBecomeCapabilityAsPrincipal, revokeBecomeCapabilityAsPrincipal, readBecomeLinkStates, ENTITY_UNBIND_OPERATION, allowedFor, unbindEntityHolderBounded, capabilityAttachmentWriteRefused, capabilityTokenHash, createCapabilityVerbs, createEntityEdgeVerbs, createEntityStateVerbs, createTrashedReads, CONTINUATION_POSITION_CAP, visibleContinuation, searchStateWhere, uncheckedView, addStatePlans, addUpdatedStampPlans, watchUpdatedStamps, entityStateMigrations, assertNoCallerPurge, isUnreachableParent, heldPurgePass, purgeDueOf, purgeHeldBy, lifecycleRefusal, purgeOnlyKeysOf, purgeReportOf, purgeStillDue, refuseTrashedTarget, assertBoundOperations, registerTrashTargets, runPurgePass, withheldKeysFor, statefulTablesOf, afterMigration, afterRuntimeDdl, derivesAnything, repairDerivedObjects, StateColumnLost, exchangeCapability as exchangeCapabilitySecret, guardSecrets, mintBecomeCapability, plausibleSessionToken, readCapabilityPage, redactSecrets, redactSecretText, moduleLog, consoleLogSink, asyncInvocationId, asyncLinePass, consoleInvocationLineSink, resolveCapabilitySession, revokeCapabilityAsPlatform, assertReadOnlyQuery, attachmentBlobKey, attachmentSha256, entitlementDenial, requiredEntitlementFor, foldMeterReading, guardSpine, guardSqlLimits, DO_SQL_LIMITS, tooManyResultColumns, tooManyTableColumns, parseValidationRecords, resolveScopeRecord, ulid, ISSUE_RETENTION_DAYS, telemetryRetentionStatements, FINDINGS_DDL, SCOPE_STORAGE_DDL, forgetScopeStorage, listScopeStorageAttemptRows, listScopeStorageRows, listScopeStoreStorageRows, pruneScopeStorageRows, recordScopeStorageRows, CONNECT_LINKS_DDL, consumeConnectLinkRow, insertConnectLink, listConnectLinks as listConnectLinkRows, readConnectLink, restoreConnectLinkRow, revokeConnectLinkRow, createFindingRule, findingOfOpsFailure, findingOfSweepRun, pruneFindings, listFindingRules, listFindings, observeFinding, revokeFindingRule, setFindingStatus, assertRowLimit, assertRowOffset, OPS_FAILURE_RETENTION_DAYS, SWEEP_RUN_RETENTION_DAYS, SWEEP_RUNS_INTENT_INDEX, sweepRunsIntentHasKind, MODEL_USAGE_RETENTION_DAYS, foldModelUsage, backoffAt, platformRequestHistoryQuery, platformRequestOf, PLATFORM_REQUEST_COLUMNS, PLATFORM_REQUEST_REDACTION_SQL, platformRequestRedactionParams, platformRequestRedactionQuery, intentPayloadCarriesSubject, redactSubjectJobRuns, eraseSubjectFromModules, moduleRowsErased, moduleErasurePlan, redactSubjectScopeText, redactSubjectDirectoryText, ISSUE_EXEMPLAR_OWNER_BACKFILL_SQL, issueExemplarOwner, JOB_RUN_PATCH_SQL, JOB_RUN_CLAIM_SQL, JOB_RUN_RENEW_SQL, JOB_RUN_BEGIN_SQL, JOB_RUN_MISS_SQL, JOB_RUN_MISS_SETTLE_SQL, admissionMissOutcome, JOB_STEP_RECORD_SQL, JOB_LEASE_EXPIRED_NOTE, assertLeaseMs, DELIVERY_ERROR_REDACTION_SQL, REDACTED_DELIVERY_NOTE, seatScopeTuple, applyScopeRoleChange, changeScopeRole, revokeScopeRoles, scopeRoleHolders, admitPeer, peerCallerAt, collectPeers, peerSeats, resolveVerticalInstanceFrom, resolvePeerInstanceFrom, peerVerticalSpellings, samePeerVertical, peerGrantsStatus, systemGrantsStatus, systemScheduleState, systemSwitchedOff, systemSwitchedOffMessage, tenantSystemSwitchedOffMessage, PEER_SWITCHES_DDL, PEER_BINDINGS_DDL, SWITCH_OWED_DDL, SWITCH_FENCES_DDL, TABLE_OWNERS_DDL, assertMigrationLeavesLedgerAlone, recordOwnershipSteps, runMigrationStatements, executableSqlStatements, blankSqlComments, recordWriteSuperseded, switchFencesOf, switchSupersededMessage, SWITCH_KINDS, SYSTEM_SWITCHES_DDL, forgetSwitchesOf, listSystemSwitchRecords, moveSwitch, reassertActionOf, reassertEntry, reassertOffRow, recordSwitchedOff, recordSwitchedOn, restoreSwitchRecord, scopesSwitchedOffFor, switchActionOf, switchAuditSubject, recordAuditOutcome, auditedCapabilityRevoke, auditWarningOf, switchNotFoundMessage, switchRecordsOf, switchedOffOf, switchesBackfillSqlOf, switchesTableExists, tenantHeldOf, tenantHoldsGrant, inUnitMovesToAudit, staleCarryRevertRow, staleCarryReverts, withRecorded, VERSION_MIGRATIONS_DDL, splitManifestMigrations, splitVersionMigrationsBatch, versionMigrationsOf, writeVersionMigrations, denialListQuery, refusalListQuery, mapRefusalRow, denialSummaryQuery, denialTotalsQuery, DENIAL_WINDOW_QUERY, mapDenialRow, mapDenialSummaryBuckets, IMPERSONATION_COLUMNS, IMPERSONATION_DDL, ImpersonationRefused, assertImpersonationWrites, assertModuleEnqueueableKind, assertSessionUsable, impersonationByIdQuery, impersonationListQuery, impersonationRowValues, impersonationStampOf, mapImpersonationRow, newImpersonationSession, resolveRetryPolicy, executorOutcomeOf, isDeliveryRefusal, refusalJournalText, membershipFencesBackfillSql, MEMBERSHIP_FENCES_DDL, membershipFencesTableExists, MEMBERSHIP_FENCE_SINCE_SQL, RAISE_MEMBERSHIP_FENCE_SQL, memberAddedAudit, orgChangeBound, tenantCoverage, isSecretBoxConfigured, unconfiguredSecretBox, createSubjectKeys, generateSealingKeyPair, noSealingKeyMessage, openSealed, sealTo, ConnectionSealingKeyUnavailableError, PermissionDenied, createAtomic, NotSearchable, NotListable, listIndexMigrations, listIndexPlans, listQuery, cursorOf, moduleMigrations, MIGRATION_DIGEST_FENCE_DDL, MIGRATION_DIGEST_MARK_LEGACY, assertJournalDumpCoherent, assertMigrationSql, migrationDivergence, migrationFailedError, migrationSteps, planMigrations, isSearchIndexTable, searchIndexMigrations, searchIndexPlans, searchLimit, searchMatchExpression, searchQuery, ATTACHMENT_TEXT_DDL, assertAttachmentExtractors, resolveAttachmentTextBounds, assertJobRegistrable, attachmentRecordOfRow, attachmentTextJob, enqueueAttachmentText, ATTACHMENT_TEXT_BACKFILL_JOB, ATTACHMENT_TEXT_JOB, kernelJobFor, queueAttachmentTextBackfill, startAttachmentTextBackfill, attachmentTextBackfillJob, reconcileAttachmentText, recordAttachmentText, searchAttachments, entityVersionQuery, entityVersionOf, assertIfMatch, OUTBOX_ENTITY_INDEX, SCHEDULE_STATE_DDL, SCHEDULE_STATE_REBUILD, scheduleStateHasKind, VERTICAL_EVENTS_DDL, EXPORT_HOPS_SQL, emptyImportResult, IMPORT_CURSORS_SQL, IMPORT_CURSOR_OF_SQL, OUTBOX_MARK_SQL, emittedSinceQuery, emittedReportOf, EMITTED_REPORT_CAP, exportedSinceQuery, IMPORT_CURSOR_ADVANCE_SQL, IMPORT_RECORD_SQL, moveImportCursor, importCursorSourceOf, exportBreaksOf, exportBreakRefusal, bindExportBreaksOf, bindExportBreakRefusal, scopeMoveOf, runningVersionOf, isPrimaryScope, PROVISIONED_VERSIONS_SQL, installsReconciledOf, strandJudgmentsOf, provisionedVersionsParams, boundShapesColumn, boundShapesOfColumn, installReconciled, CrossVerticalRegistry, exportReadPlan, exportReadQuery, planExportBatch, withheldNote, JOB_RUN_DDL, JOB_RUN_DUE_AT, jobRunListLimit, jobRunOf, runDueJobRuns, startJobRun, IDEMPOTENCY_DDL, REFUSALS_TABLE_DDL, REFUSALS_INDEX, refusalInsert, refusalOf, markGuardRefusal, REFUSALS_REBUILD, refusalsAdmitGuards, assertIdempotencyKey, idempotencyLookupQuery, idempotencyPruneStatement, idempotencyRecordStatement, idempotencyOptedOutMessage, replayFor, globalFetch, createUlid, facetEvents, readHistory, walkEventCause, walkEventEffects, assertRedrainWindow, readInvocation, readDeadLetters, readLifecycleFlow, readOperationSeries, domainEventOf, readUndrainedOutbox, undrainedEventsOf, connectorCallRecord, noopConnectorCallRecorder, recordConnectorCall, settleConnectionUse, unknownRoleError, callReservedStoreOperation, callScopeStore, observeStoreCall, replayStoreErasures, scopeStoreLifecycleOf, scopeStoreRunnersOf, } from '@substrat-run/kernel';
6
6
  import { attributedView, delegatedRevokeSql, writeExplicitTupleIn, grantEntityShapeIn, shapeTopUpBatch, topUpEntityGrantShapes, settlePlatformRequestIn, } from '@substrat-run/kernel';
7
7
  import { ADMIN_LOG_INDEXES_SQL, SETTLE_INTENT_SQL, SETTLE_OUTCOME_SQL, settleOutcomeParamsOf, readAuditedOperations, unknownOutcomeOf, } from '@substrat-run/kernel';
8
8
  import { INERT_SCOPE_REASON, isPrimaryScopeRow } from '@substrat-run/kernel';
@@ -620,6 +620,9 @@ export class SqliteScopeHost {
620
620
  /** predicate name → the module-contributed implementation. Names are global. */
621
621
  predicates = new Map();
622
622
  /** operation names whose default binding some manifest withdrew (K-17). */
623
+ scopeStoreRunners;
624
+ scopeStoreVertical;
625
+ scopeStoreLifecycle;
623
626
  withdrawn = new Map(); // operation → withdrawing module
624
627
  relations = new Map();
625
628
  /** entityType → its derived FTS5 index (#827). One entity type, one index. */
@@ -712,6 +715,9 @@ export class SqliteScopeHost {
712
715
  this.connectorCalls = options.connectorCalls ?? noopConnectorCallRecorder;
713
716
  this.clock = options.clock ?? (() => instant.parse(new Date().toISOString()));
714
717
  this.versionId = options.versionId ?? null;
718
+ this.scopeStoreVertical = options.scopeStores?.vertical;
719
+ this.scopeStoreRunners = scopeStoreRunnersOf(options.scopeStores);
720
+ this.scopeStoreLifecycle = scopeStoreLifecycleOf(this.scopeStoreRunners);
715
721
  this.logSink = options.logSink ?? consoleLogSink;
716
722
  this.invocationLineSink = options.invocationLineSink ?? consoleInvocationLineSink;
717
723
  // Every option is read above and here, BEFORE the directory is claimed: an option that throws
@@ -2358,6 +2364,7 @@ export class SqliteScopeHost {
2358
2364
  };
2359
2365
  }
2360
2366
  async importScope(actor, input, dump) {
2367
+ this.refuseUnusableScopeStores(dump.stores, input.vertical ?? null);
2361
2368
  // Create the destination scope (directory row + storage). Its migration step
2362
2369
  // creates some tables; the dump then replaces them wholesale, so the end state
2363
2370
  // is the dump, not whatever the local module set would have built. Provenance is
@@ -2370,6 +2377,7 @@ export class SqliteScopeHost {
2370
2377
  });
2371
2378
  // A fork: its callers (snapshotScope) hand it a dump the platform exported.
2372
2379
  await this.loadDump(input.tenantId, input.scopeId, { ...dump, exact: true });
2380
+ await this.importScopeStores(input.tenantId, input.scopeId, dump.stores);
2373
2381
  await this.admin.activateScope(actor, input.tenantId, input.scopeId);
2374
2382
  this.recordAdmin(actor, 'importScope', { tenantId: input.tenantId, scopeId: input.scopeId }, null, { sourceScopeId: dump.scopeId, tables: dump.tables.length, capturedAt: dump.capturedAt });
2375
2383
  }
@@ -2522,6 +2530,7 @@ export class SqliteScopeHost {
2522
2530
  const existing = await this.admin.getScopeRecord(actor, tenantId, scopeId);
2523
2531
  if (!existing)
2524
2532
  throw substratError('not_found', `unknown scope ${scopeId} in tenant ${tenantId}`);
2533
+ this.refuseUnusableScopeStores(dump.stores, existing.vertical);
2525
2534
  // #1742: a dump from before a switch was pulled brings the module's grants back live, so
2526
2535
  // the directory's recorded-off modules go back off in the load's own turn, as a
2527
2536
  // provision's seat does — no schedule pass can run in between.
@@ -2530,9 +2539,17 @@ export class SqliteScopeHost {
2530
2539
  // #1869: the re-point's source is the separate hint when given; the dump is otherwise as sent.
2531
2540
  const source = { tables: dump.tables, scopeId: opts?.sourceScopeId ?? dump.scopeId };
2532
2541
  await this.loadDump(tenantId, scopeId, source, (rt) => this.reassertSwitchesInTurn(rt, actor, tenantId, scopeId, undefined, (action, after) => rows.push([action, after])));
2542
+ await this.importScopeStores(tenantId, scopeId, dump.stores);
2543
+ const replay = await this.replayShreddedStoreErasures(actor, tenantId, scopeId, (opts?.sourceScopeId ?? dump.scopeId));
2533
2544
  for (const [action, after] of rows)
2534
2545
  this.recordAdmin(actor, action, { tenantId, scopeId }, null, after);
2535
- this.recordAdmin(actor, 'restoreScope', { tenantId, scopeId }, null, { sourceScopeId: dump.scopeId, tables: dump.tables.length, capturedAt: dump.capturedAt });
2546
+ this.recordAdmin(actor, 'restoreScope', { tenantId, scopeId }, null, {
2547
+ sourceScopeId: dump.scopeId,
2548
+ tables: dump.tables.length,
2549
+ capturedAt: dump.capturedAt,
2550
+ ...replay,
2551
+ });
2552
+ return replay;
2536
2553
  }
2537
2554
  async snapshotScope(actor, tenantId, scopeId, opts) {
2538
2555
  const source = await this.admin.getScopeRecord(actor, tenantId, scopeId);
@@ -2554,6 +2571,7 @@ export class SqliteScopeHost {
2554
2571
  if (source.verticalVersionId) {
2555
2572
  await this.admin.bindScopeVersion(actor, tenantId, snapshotId, source.verticalVersionId);
2556
2573
  }
2574
+ await this.replayShreddedStoreErasures(actor, tenantId, snapshotId, scopeId);
2557
2575
  return snapshotId;
2558
2576
  }
2559
2577
  async deleteSnapshot(actor, tenantId, scopeId) {
@@ -2567,6 +2585,7 @@ export class SqliteScopeHost {
2567
2585
  throw substratError('forbidden', `scope ${scopeId} is not a fork or preview — only previews may be deleted; ` +
2568
2586
  `archive a primary scope instead`);
2569
2587
  }
2588
+ await this.wipeScopeStores(tenantId, scopeId);
2570
2589
  // Close and evict the runtime handle before touching the file.
2571
2590
  const rt = this.scopes.get(`${tenantId}/${scopeId}`);
2572
2591
  if (rt)
@@ -2635,6 +2654,195 @@ export class SqliteScopeHost {
2635
2654
  }
2636
2655
  return this.buildStub(tenantId, scopeId, rt, asPrincipal(principal), options);
2637
2656
  }
2657
+ async getScopeStore(principal, tenantId, scopeId, binding, options) {
2658
+ // The directory check is the same one `getScope` makes. With no runners
2659
+ // configured, the binding is refused after that check.
2660
+ await this.getScope(principal, tenantId, scopeId);
2661
+ if (this.scopeStoreRunners.size === 0) {
2662
+ throw substratError('unavailable', `no scope-store runner is configured for binding '${binding}'`);
2663
+ }
2664
+ const vertical = this.scopeStoreVerticalOf(scopeId);
2665
+ const runner = this.scopeStoreRunners.get(binding);
2666
+ if (!runner) {
2667
+ throw substratError('not_found', `no scope store is bound for '${binding}'`);
2668
+ }
2669
+ await this.scopeStoreLifecycle.start();
2670
+ return {
2671
+ tenantId,
2672
+ scopeId,
2673
+ subjectKind: 'principal',
2674
+ invoke: (operation, input, ...extra) => observeStoreCall(binding, operation, () => callScopeStore((request) => runner.invoke({ tenantId, vertical, scopeId, binding }, request), operation, input, ...extra), options?.onStoreCall),
2675
+ };
2676
+ }
2677
+ /** The scope's vertical when it has one. No vertical means this host has no store to touch. */
2678
+ scopeStoreVerticalIfPresent(scopeId) {
2679
+ const row = this.directory.prepare('SELECT vertical FROM scopes WHERE scope_id = ?').get(scopeId);
2680
+ const vertical = row?.vertical;
2681
+ if (!vertical)
2682
+ return undefined;
2683
+ if (this.scopeStoreVertical !== undefined && vertical !== this.scopeStoreVertical) {
2684
+ throw substratError('forbidden', `this host serves vertical '${this.scopeStoreVertical}', and scope ${scopeId} runs '${vertical}'`);
2685
+ }
2686
+ return vertical;
2687
+ }
2688
+ /** The scope's vertical, refused when this host is limited to another one. */
2689
+ scopeStoreVerticalOf(scopeId) {
2690
+ const vertical = this.scopeStoreVerticalIfPresent(scopeId);
2691
+ if (!vertical) {
2692
+ throw substratError('not_found', `scope ${scopeId} has no vertical, so it has no scope store`);
2693
+ }
2694
+ return vertical;
2695
+ }
2696
+ /**
2697
+ * One reserved call on a declared binding. The vertical's stub never reaches
2698
+ * this; `callReservedStoreOperation` refuses a name that is not reserved.
2699
+ */
2700
+ async invokeReservedStore(address, operation, input) {
2701
+ const runner = this.scopeStoreRunners.get(address.binding);
2702
+ if (!runner)
2703
+ throw substratError('not_found', `no scope store is bound for '${address.binding}'`);
2704
+ await this.scopeStoreLifecycle.start();
2705
+ return callReservedStoreOperation((request) => runner.invoke(address, request), operation, input);
2706
+ }
2707
+ /**
2708
+ * Each declared binding's `substrat.size`. No runners means an empty list,
2709
+ * and the scope is not opened to discover that.
2710
+ */
2711
+ async readScopeStoreSizes(tenantId, scopeId) {
2712
+ const bindings = [...this.scopeStoreRunners.keys()];
2713
+ if (bindings.length === 0)
2714
+ return [];
2715
+ this.scopeReadDbFor(tenantId, scopeId);
2716
+ const vertical = this.scopeStoreVerticalOf(scopeId);
2717
+ const sizes = [];
2718
+ for (const binding of bindings) {
2719
+ const { bytes } = await this.invokeReservedStore({ tenantId, vertical, scopeId, binding }, 'substrat.size');
2720
+ sizes.push({ binding, bytes });
2721
+ }
2722
+ return sizes;
2723
+ }
2724
+ /** The vertical whose stores this scope has on this host, or nothing when it has none. */
2725
+ storeVerticalOf(scopeId) {
2726
+ if (this.scopeStoreRunners.size === 0)
2727
+ return undefined;
2728
+ const row = this.directory.prepare('SELECT vertical FROM scopes WHERE scope_id = ?').get(scopeId);
2729
+ const vertical = row?.vertical ?? undefined;
2730
+ if (!vertical)
2731
+ return undefined;
2732
+ if (this.scopeStoreVertical !== undefined && vertical !== this.scopeStoreVertical)
2733
+ return undefined;
2734
+ return vertical;
2735
+ }
2736
+ /**
2737
+ * `substrat.erase` on each declared binding. A store error throws, so the caller
2738
+ * can leave the subject key untouched. Fail closed (#2242): an empty answer means
2739
+ * this host KNOWS it holds nothing for the scope. It always can tell — the
2740
+ * directory names the scope's vertical, and the runners are this host's own — so
2741
+ * unlike a Cloudflare host with no control plane it has no "cannot tell" case.
2742
+ */
2743
+ async eraseScopeStores(tenantId, scopeId, subjectId) {
2744
+ const bindings = [...this.scopeStoreRunners.keys()];
2745
+ // Shred calls this for every scope. No vertical names no store object, and a
2746
+ // vertical this host is not pinned to is one its runners never served: both hold
2747
+ // nothing here, and the key is still destroyed.
2748
+ const vertical = this.storeVerticalOf(scopeId);
2749
+ if (!vertical)
2750
+ return [];
2751
+ const erasures = [];
2752
+ for (const binding of bindings) {
2753
+ const { erased } = await this.invokeReservedStore({ tenantId, vertical, scopeId, binding }, 'substrat.erase', { subjectId });
2754
+ erasures.push({ binding, erased });
2755
+ }
2756
+ return erasures;
2757
+ }
2758
+ /**
2759
+ * A dump's stores this host cannot load are refused before any write (#2211, L8): a
2760
+ * binding that is not bound, a store with no kind or a kind other than the bound runner's,
2761
+ * any store at all for a destination with no vertical (no store object can be named for
2762
+ * it, so loading would drop them), or a destination on a vertical other than the one this
2763
+ * host is pinned to.
2764
+ */
2765
+ refuseUnusableScopeStores(stores, vertical) {
2766
+ const listed = stores ?? [];
2767
+ if (listed.length === 0)
2768
+ return;
2769
+ if (vertical === null) {
2770
+ throw substratError('conflict', 'dump carries scope stores, and the destination scope has no vertical to hold them');
2771
+ }
2772
+ if (this.scopeStoreVertical !== undefined && vertical !== this.scopeStoreVertical) {
2773
+ throw substratError('forbidden', `this host serves vertical '${this.scopeStoreVertical}', and the destination scope runs '${vertical}'`);
2774
+ }
2775
+ for (const store of listed) {
2776
+ const runner = this.scopeStoreRunners.get(store.binding);
2777
+ if (!runner) {
2778
+ throw substratError('not_found', `dump names scope store '${store.binding}', which is not bound`);
2779
+ }
2780
+ if (!store.kind) {
2781
+ throw substratError('validation_failed', `dump's scope store '${store.binding}' names no kind`);
2782
+ }
2783
+ if (store.kind !== runner.kind) {
2784
+ throw substratError('conflict', `dump's scope store '${store.binding}' is kind '${store.kind}', and this host binds kind '${runner.kind}'`);
2785
+ }
2786
+ }
2787
+ }
2788
+ async exportScopeStores(tenantId, scopeId) {
2789
+ const bindings = [...this.scopeStoreRunners.keys()];
2790
+ if (bindings.length === 0)
2791
+ return [];
2792
+ const vertical = this.scopeStoreVerticalIfPresent(scopeId);
2793
+ if (!vertical)
2794
+ return [];
2795
+ const stores = [];
2796
+ for (const binding of bindings) {
2797
+ const runner = this.scopeStoreRunners.get(binding);
2798
+ if (!runner)
2799
+ throw substratError('not_found', `no scope store is bound for '${binding}'`);
2800
+ const exported = await this.invokeReservedStore({ tenantId, vertical, scopeId, binding }, 'substrat.export');
2801
+ stores.push({ binding, kind: runner.kind, tables: exported.tables });
2802
+ }
2803
+ return stores;
2804
+ }
2805
+ async importScopeStores(tenantId, scopeId, stores) {
2806
+ const listed = stores ?? [];
2807
+ if (listed.length === 0)
2808
+ return;
2809
+ const vertical = this.scopeStoreVerticalIfPresent(scopeId);
2810
+ if (!vertical) {
2811
+ throw substratError('conflict', `dump carries scope stores, and scope ${scopeId} has no vertical to hold them`);
2812
+ }
2813
+ for (const store of listed) {
2814
+ await this.invokeReservedStore({ tenantId, vertical, scopeId, binding: store.binding }, 'substrat.import', { tables: store.tables });
2815
+ }
2816
+ }
2817
+ /**
2818
+ * `substrat.erase` again for every tombstoned subject (#2207), on the target's and the
2819
+ * source's marks (`replayStoreErasures`). A target this host names no store for (no
2820
+ * runner, or no vertical a store is kept for) has nothing to replay into: nothing is read.
2821
+ */
2822
+ async replayShreddedStoreErasures(actor, tenantId, target, source) {
2823
+ if (!this.storeVerticalOf(target))
2824
+ return undefined;
2825
+ return replayStoreErasures({
2826
+ admin: this.admin,
2827
+ actor,
2828
+ tenantId,
2829
+ target,
2830
+ source,
2831
+ erase: async (subjectId) => (await this.eraseScopeStores(tenantId, target, subjectId)).length,
2832
+ });
2833
+ }
2834
+ /** `substrat.wipe` on each declared binding, before the scope's own storage goes. */
2835
+ async wipeScopeStores(tenantId, scopeId) {
2836
+ const bindings = [...this.scopeStoreRunners.keys()];
2837
+ if (bindings.length === 0)
2838
+ return;
2839
+ const vertical = this.scopeStoreVerticalIfPresent(scopeId);
2840
+ if (!vertical)
2841
+ return;
2842
+ for (const binding of bindings) {
2843
+ await this.invokeReservedStore({ tenantId, vertical, scopeId, binding }, 'substrat.wipe');
2844
+ }
2845
+ }
2638
2846
  /**
2639
2847
  * A scope stub whose authority is a CONNECTION (#97).
2640
2848
  *
@@ -4072,10 +4280,15 @@ export class SqliteScopeHost {
4072
4280
  }
4073
4281
  }
4074
4282
  async close() {
4075
- for (const rt of [...this.scopes.values()])
4076
- this.closeRuntime(rt);
4077
- this.directory.close();
4078
- this.owner.release();
4283
+ try {
4284
+ await this.scopeStoreLifecycle.stop();
4285
+ }
4286
+ finally {
4287
+ for (const rt of [...this.scopes.values()])
4288
+ this.closeRuntime(rt);
4289
+ this.directory.close();
4290
+ this.owner.release();
4291
+ }
4079
4292
  }
4080
4293
  // -------------------------------------------------------------------------
4081
4294
  // Event dispatch (testrun spec §9.2.3): at-least-once, kernel-journaled,
@@ -7227,6 +7440,11 @@ export class SqliteScopeHost {
7227
7440
  this.recordAccess(actor, 'scopeDatabaseSize', { tenantId, scopeId }, null, 1);
7228
7441
  return bytes;
7229
7442
  },
7443
+ scopeStoreSizes: async (actor, tenantId, scopeId) => {
7444
+ const sizes = await this.readScopeStoreSizes(tenantId, scopeId);
7445
+ this.recordAccess(actor, 'scopeStoreSizes', { tenantId, scopeId }, null, sizes.length);
7446
+ return sizes;
7447
+ },
7230
7448
  rewindScope: async () => {
7231
7449
  throw new Error('point-in-time rewind is not available on this host (PITR is a Durable-Object-plane mechanism) — use the backup restore path');
7232
7450
  },
@@ -7622,7 +7840,8 @@ export class SqliteScopeHost {
7622
7840
  return { name, ddl: sql, columns, rows };
7623
7841
  });
7624
7842
  this.recordAccess(actor, 'exportScope', { tenantId, scopeId }, null, tables.length);
7625
- return { tenantId, scopeId, capturedAt: new Date().toISOString(), tables };
7843
+ const stores = await this.exportScopeStores(tenantId, scopeId);
7844
+ return { tenantId, scopeId, capturedAt: new Date().toISOString(), tables, stores };
7626
7845
  },
7627
7846
  // -- directory disaster recovery (#40) ----------------------------------
7628
7847
  // The self-hosted half of the same story. A self-host has no DO point-in-time
@@ -7762,6 +7981,7 @@ export class SqliteScopeHost {
7762
7981
  const rt = this.scopes.get(`${tenantId}/${scopeId}`);
7763
7982
  if (rt)
7764
7983
  this.closeRuntime(rt);
7984
+ await this.wipeScopeStores(tenantId, scopeId);
7765
7985
  rmSync(join(this.dir, `${tenantId}__${scopeId}.sqlite`), { force: true });
7766
7986
  // The recoverable copy the caller stored first (#493), named in the audit entry so
7767
7987
  // the trail answers "was there a backup" without correlating two timestamps.
@@ -7789,7 +8009,19 @@ export class SqliteScopeHost {
7789
8009
  },
7790
8010
  // `stamp` is the erasure epoch an orchestrated erasure's claim compared (#1722). A direct shred
7791
8011
  // claims nothing and records the epoch it ran under: the backfill orders erasures by them.
7792
- shredSubject: async (actor, tenantId, scopeId, subjectId, stamp) => {
8012
+ listShreddedSubjects: async (actor, tenantId, scopeId, cursor) => {
8013
+ this.assertScope(tenantId, scopeId);
8014
+ const rows = this.directory
8015
+ .prepare(`SELECT subject_id FROM _substrat_subject_keys
8016
+ WHERE scope_id = ? AND tenant_id = ? AND shredded_at IS NOT NULL AND subject_id > ?
8017
+ ORDER BY subject_id LIMIT 101`)
8018
+ .all(scopeId, tenantId, cursor ?? '');
8019
+ const subjects = rows.slice(0, 100).map((row) => row.subject_id);
8020
+ const nextCursor = rows.length > 100 ? (subjects[99] ?? null) : null;
8021
+ this.recordAccess(actor, 'listShreddedSubjects', { tenantId, scopeId }, null, subjects.length);
8022
+ return { subjects, nextCursor };
8023
+ },
8024
+ shredSubject: async (actor, tenantId, scopeId, subjectId, stamp, storeErasures) => {
7793
8025
  this.assertScope(tenantId, scopeId);
7794
8026
  const before = stamp ?? {
7795
8027
  erasureEpoch: this.directory.prepare(COPY_BACKFILL_SCOPE_SQL).get(tenantId, scopeId)
@@ -7864,6 +8096,11 @@ export class SqliteScopeHost {
7864
8096
  // intents, an issue's exemplar, a sweep record's error. Before the key, for the
7865
8097
  // ordering reason above.
7866
8098
  redactSubjectDirectoryText(redactionSqlOf(this.directory), { tenantId, scopeId, subjectId, intentIds });
8099
+ // Scope stores after the scope-side redaction and before the key (#2068). A store
8100
+ // that errors throws here, so the key below is untouched and a retry converges.
8101
+ // An orchestrated caller passes the serving script's result and this host does
8102
+ // not erase again.
8103
+ const erasures = storeErasures ?? (await this.eraseScopeStores(tenantId, scopeId, subjectId));
7867
8104
  const { existed } = await this.subjectKeysFor(tenantId, scopeId).destroy(subjectId, at);
7868
8105
  const receipt = subjectShredReceipt.parse({
7869
8106
  subjectId,
@@ -7871,6 +8108,7 @@ export class SqliteScopeHost {
7871
8108
  intentsRedacted,
7872
8109
  jobRunsRedacted,
7873
8110
  ...vertical,
8111
+ storeErasures: erasures,
7874
8112
  keyDestroyed: existed,
7875
8113
  tombstoned: true,
7876
8114
  });
@@ -7891,7 +8129,7 @@ export class SqliteScopeHost {
7891
8129
  throw substratError('not_found', `unknown scope ${scopeId} in tenant ${tenantId}`);
7892
8130
  return row.erasure_epoch;
7893
8131
  },
7894
- finalizeSubjectShred: async (actor, tenantId, scopeId, subjectId, redactions, expected) => {
8132
+ finalizeSubjectShred: async (actor, tenantId, scopeId, subjectId, redactions, expected, storeErasures) => {
7895
8133
  if (redactions.length === 0)
7896
8134
  throw substratError('conflict', 'subject erasure has no confirmed scope redaction');
7897
8135
  const claimed = this.directory.prepare(`UPDATE scopes SET erasure_epoch = COALESCE(erasure_epoch, 0) + 1
@@ -7907,7 +8145,7 @@ export class SqliteScopeHost {
7907
8145
  // The pure adapter has one co-located scope store. Its existing atomic shred is
7908
8146
  // the final local redaction and key destruction, after remote copies confirmed.
7909
8147
  const shred = this.admin.shredSubject;
7910
- return shred(actor, tenantId, scopeId, subjectId, { erasureEpoch: expected.epoch, path: 'orchestrated' });
8148
+ return shred(actor, tenantId, scopeId, subjectId, { erasureEpoch: expected.epoch, path: 'orchestrated' }, storeErasures);
7911
8149
  },
7912
8150
  // -- impersonation (K-42, #868) ----------------------------------------
7913
8151
  beginImpersonation: async (actor, input) => {
@@ -7983,6 +8221,7 @@ export class SqliteScopeHost {
7983
8221
  '_substrat_finding_rules', // #1748: the tenant's suppress rules
7984
8222
  '_substrat_scope_storage', // #1524: storage samples of scopes whose storage is gone
7985
8223
  '_substrat_scope_storage_attempts', // #1524: and the phase's last try at each
8224
+ '_substrat_scope_store_storage', // #2212: scope-store samples, gone with the tenant
7986
8225
  ];
7987
8226
  const clear = this.directory.transaction(() => {
7988
8227
  for (const table of tables) {
@@ -8091,6 +8330,7 @@ export class SqliteScopeHost {
8091
8330
  // #1524: the stored gauge's latest sample per non-reaped scope. A directory read only.
8092
8331
  storage: listScopeStorageRows(redactionSqlOf(this.directory), { tenantId: only, latest: true }),
8093
8332
  storageAttempts: listScopeStorageAttemptRows(redactionSqlOf(this.directory), only),
8333
+ storeStorage: listScopeStoreStorageRows(redactionSqlOf(this.directory), only),
8094
8334
  });
8095
8335
  // The count that matters for K-24 is how many TENANTS this reading covered —
8096
8336
  // "read the meter for one tenant" and "metered the whole fleet" are different