@substrat-run/adapter-sqlite 0.141.0 → 0.142.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,4 +1,4 @@
1
- import { type BlobStoreHandle, type ImportBatch, type ImportResult, type Coverage, type PeerCoverage, type VerticalCaller, type CapabilityExchange, type ConnectionId, type ModuleId, type DomainEvent, type PlatformRequestId, type PlatformRequest, type PlatformRequestFilter, type ProjectedConnectionGrant, type PermissionKey, type PlatformActorId, type OnBehalfOf, type PrincipalId, type ScopeDump, type ScopeId, type ImpersonationSessionId, type TenantId, type TenantStoreHandle } from '@substrat-run/contracts';
1
+ import { type BlobStoreHandle, type ImportBatch, type ImportResult, type Coverage, type PeerCoverage, type VerticalCaller, type BoundedBecomeMint, type BoundedBecomeRevoke, type BecomeLinkState, type PrincipalBecomeCapabilityInput, type CapabilityExchange, type CapabilityId, type ConnectionId, type ModuleId, type DomainEvent, type PlatformRequestId, type PlatformRequest, type PlatformRequestFilter, type ProjectedConnectionGrant, type PermissionKey, type PlatformActorId, type OnBehalfOf, type PrincipalId, type ScopeDump, type ScopeId, type ImpersonationSessionId, type TenantId, type TenantStoreHandle } from '@substrat-run/contracts';
2
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';
3
3
  import { type PlatformRequestSettle } from '@substrat-run/kernel';
4
4
  /**
@@ -482,6 +482,27 @@ export declare class SqliteScopeHost implements ScopeHost {
482
482
  coverage: Coverage;
483
483
  revoked: string[];
484
484
  }>;
485
+ /**
486
+ * A principal's `become` mint (#1686) — a member invite's link. The kernel's `becomeMintCheck`
487
+ * and the write in ONE scope turn and one transaction, so nothing the target or the caller
488
+ * holds can move between the check and the mint; a refusal writes nothing. The mint is on the
489
+ * spine as `capability.become-minted`, the caller its actor.
490
+ */
491
+ mintBecomeCapabilityBounded(tenantId: TenantId, scopeId: ScopeId, caller: PrincipalId, input: PrincipalBecomeCapabilityInput): Promise<BoundedBecomeMint>;
492
+ /**
493
+ * Revoke a `become` capability a principal minted (#1686) — withdrawing a member invite's
494
+ * link, recorded with `by` as the revoker. `revoked` is false for anything else: a platform-minted
495
+ * or an `act` capability is not this verb's. The kernel bounds `by` in the same turn: the link's
496
+ * minter, or someone holding everything its principal holds now.
497
+ */
498
+ revokeBecomeCapability(tenantId: TenantId, scopeId: ScopeId, capabilityId: CapabilityId, by: PrincipalId): Promise<BoundedBecomeRevoke>;
499
+ /**
500
+ * Where each named `become` link stands (#1686) — what a pending-invite list shows, so a link the
501
+ * kernel revoked or that expired is never shown as open. A read in the scope's task.
502
+ */
503
+ becomeLinkStates(tenantId: TenantId, scopeId: ScopeId, ids: readonly CapabilityId[]): Promise<BecomeLinkState[]>;
504
+ /** What a principal holds at this scope, for a `become` exchange (#1686); absent with a checker that cannot say. */
505
+ private holdingsAt;
485
506
  /** The caller's bound per role at the scope, `null` for a role this tenant does not define (#1150). */
486
507
  private roleBound;
487
508
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAmBL,KAAK,eAAe,EAcpB,KAAK,WAAW,EAEhB,KAAK,YAAY,EAwBjB,KAAK,QAAQ,EACb,KAAK,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;IACH,OAAO,CAAC,yBAAyB;IAWjC,OAAO,CAAC,sBAAsB;IA0I9B,OAAO,CAAC,SAAS;IAejB;;;;OAIG;IACH,qGAAqG;IACrG,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,gBAAgB;IA6hBxB,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;IAyG1B,OAAO,CAAC,OAAO;CAsChB"}
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
2
2
  import { dirname, join } from 'node:path';
3
3
  import Database from 'better-sqlite3';
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, 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, 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, capabilityAttachmentWriteRefused, capabilityTokenHash, createCapabilityVerbs, createEntityEdgeVerbs, createEntityStateVerbs, createTrashedReads, CONTINUATION_POSITION_CAP, visibleContinuation, searchStateWhere, uncheckedView, addStatePlans, entityStateMigrations, assertNoCallerPurge, isUnreachableParent, heldPurgePass, purgeDueOf, purgeHeldBy, lifecycleRefusal, purgeOnlyKeysOf, purgeReportOf, purgeStillDue, refuseTrashedTarget, 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, 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, collectPeers, peerSeats, resolveVerticalInstanceFrom, resolvePeerInstanceFrom, 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, 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, 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';
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, 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, capabilityAttachmentWriteRefused, capabilityTokenHash, createCapabilityVerbs, createEntityEdgeVerbs, createEntityStateVerbs, createTrashedReads, CONTINUATION_POSITION_CAP, visibleContinuation, searchStateWhere, uncheckedView, addStatePlans, entityStateMigrations, assertNoCallerPurge, isUnreachableParent, heldPurgePass, purgeDueOf, purgeHeldBy, lifecycleRefusal, purgeOnlyKeysOf, purgeReportOf, purgeStillDue, refuseTrashedTarget, 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, collectPeers, peerSeats, resolveVerticalInstanceFrom, resolvePeerInstanceFrom, 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, 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, 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';
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';
9
- import { COPY_CLAIM_SQL, COPY_EXPIRED_SQL, COPY_MOVE_CONFIRM_SQL, COPY_MOVE_LIVE_PREDICATE, SCOPE_COPY_LEASE_MS, SCOPE_SCRIPT_COPY_COLUMNS, copyMoveConfirmParams, copyMoveLiveParams, scopeScriptCopyOf, } from '@substrat-run/kernel';
9
+ import { COPY_BACKFILL_SCOPE_SQL, COPY_BACKFILL_SQL, COPY_BACKFILL_SUPERSEDE_SQL, COPY_CLAIM_SQL, COPY_EXPIRED_SQL, copyBackfillParams, copyBackfillRefusal, COPY_MOVE_CONFIRM_SQL, COPY_MOVE_LIVE_PREDICATE, SCOPE_COPY_LEASE_MS, SCOPE_SCRIPT_COPY_COLUMNS, copyMoveConfirmParams, copyMoveLiveParams, scopeScriptCopyOf, } from '@substrat-run/kernel';
10
10
  import { GRANT_CHILDREN_INDEX_DDL, grantedEntitiesForContext } from '@substrat-run/kernel';
11
11
  import { LEGACY_SCOPE_ROWS_BACKFILL, assertSpineTablesBuilt, capabilitiesForLoad, dumpRowsInsert, isSpineTable, loadDirectoryDump, repointScopeGrants, settleCopiedWork, emittedHere, spineColumnAdditions } from '@substrat-run/kernel';
12
12
  import { ScopeActor } from './actor.js';
@@ -836,6 +836,9 @@ export class SqliteScopeHost {
836
836
  -- When the scope last entered the archived state (§4.4). Drives the reap sweep's
837
837
  -- age filter; null for scopes that never archived, cleared on unarchive.
838
838
  archived_at TEXT,
839
+ -- #1524: the status it was archived FROM. 'provisioning' = it never held data, so the
840
+ -- storage gauge neither reads nor counts it. Written with archived_at, cleared with it.
841
+ archived_from_status TEXT,
839
842
  created_at TEXT NOT NULL
840
843
  );
841
844
  -- #1722: additive copy inventory; historical audit backfill is a separate act.
@@ -1381,6 +1384,8 @@ export class SqliteScopeHost {
1381
1384
  );
1382
1385
  CREATE INDEX IF NOT EXISTS _substrat_model_usage_tenant ON _substrat_model_usage (tenant_id, at);
1383
1386
  CREATE INDEX IF NOT EXISTS _substrat_model_usage_at ON _substrat_model_usage (at);
1387
+ -- #1524: the stored storage gauge — one row per (scope, UTC day), kernel-owned DDL.
1388
+ ${SCOPE_STORAGE_DDL}
1384
1389
  CREATE INDEX IF NOT EXISTS scopes_tenant ON scopes (tenant_id, scope_id);
1385
1390
  `);
1386
1391
  this.ensureDirectoryColumns();
@@ -2570,6 +2575,7 @@ export class SqliteScopeHost {
2570
2575
  forgetSwitchesOf(switchSqlOf(this.directory), scopeId);
2571
2576
  this.directory.prepare('DELETE FROM private_continuation_positions WHERE scope_id = ?').run(scopeId);
2572
2577
  this.directory.prepare('DELETE FROM private_continuation_keys WHERE scope_id = ?').run(scopeId);
2578
+ forgetScopeStorage(redactionSqlOf(this.directory), scopeId);
2573
2579
  this.directory.prepare('DELETE FROM scopes WHERE scope_id = ?').run(scopeId);
2574
2580
  })();
2575
2581
  this.recordAdmin(actor, 'deleteSnapshot', { tenantId, scopeId }, null, {
@@ -3048,6 +3054,7 @@ export class SqliteScopeHost {
3048
3054
  // pseudo-operation name — the actor is the capability, as on every event it
3049
3055
  // goes on to cause.
3050
3056
  emit: (capability, event) => kernelEmit(this.operationContext(rt, { kind: 'capability', id: capability }, undefined, undefined, undefined, CAPABILITY_EXCHANGE_OPERATION, [], now), event),
3057
+ holdings: this.holdingsAt(tenantId, scopeId),
3051
3058
  }, secret, options?.mode);
3052
3059
  rt.db.exec('COMMIT');
3053
3060
  }
@@ -3160,6 +3167,65 @@ export class SqliteScopeHost {
3160
3167
  const rt = await this.openActiveScope(tenantId, scopeId);
3161
3168
  return rt.actor.turn(() => revokeScopeRoles(switchSqlOf(rt.db), scopeId, principalId.parse(principal), this.clock(), this.roleBound(caller, tenantId, scopeId), (run) => rt.db.transaction(run)()));
3162
3169
  }
3170
+ /**
3171
+ * A principal's `become` mint (#1686) — a member invite's link. The kernel's `becomeMintCheck`
3172
+ * and the write in ONE scope turn and one transaction, so nothing the target or the caller
3173
+ * holds can move between the check and the mint; a refusal writes nothing. The mint is on the
3174
+ * spine as `capability.become-minted`, the caller its actor.
3175
+ */
3176
+ async mintBecomeCapabilityBounded(tenantId, scopeId, caller, input) {
3177
+ const rt = await this.openActiveScope(tenantId, scopeId);
3178
+ const minter = principalId.parse(caller);
3179
+ const parsed = principalBecomeCapabilityInput.parse(input);
3180
+ const outcome = await rt.actor.turn(async () => {
3181
+ const checked = await becomeMintCheck({ sql: spineSql(rt.db), checker: this.checker }, minter, parsed.principal, { tenantId, scopeId });
3182
+ if (!checked.ok)
3183
+ return checked;
3184
+ const now = this.clock();
3185
+ rt.db.exec('BEGIN IMMEDIATE');
3186
+ try {
3187
+ const minted = await mintBecomeCapabilityAsPrincipal({
3188
+ sql: spineSql(rt.db),
3189
+ now,
3190
+ emit: (event) => kernelEmit(this.operationContext(rt, asPrincipal(minter), undefined, undefined, undefined, CAPABILITY_BECOME_MINT_OPERATION, [], now), event),
3191
+ }, minter, parsed, checked.targetDigest);
3192
+ rt.db.exec('COMMIT');
3193
+ return { ok: true, minted };
3194
+ }
3195
+ catch (err) {
3196
+ rt.db.exec('ROLLBACK');
3197
+ throw err;
3198
+ }
3199
+ });
3200
+ if (outcome.ok) {
3201
+ await this.dispatch(rt, null);
3202
+ await this.dispatchExecutors(rt, null);
3203
+ }
3204
+ return outcome;
3205
+ }
3206
+ /**
3207
+ * Revoke a `become` capability a principal minted (#1686) — withdrawing a member invite's
3208
+ * link, recorded with `by` as the revoker. `revoked` is false for anything else: a platform-minted
3209
+ * or an `act` capability is not this verb's. The kernel bounds `by` in the same turn: the link's
3210
+ * minter, or someone holding everything its principal holds now.
3211
+ */
3212
+ async revokeBecomeCapability(tenantId, scopeId, capabilityId, by) {
3213
+ const rt = await this.openActiveScope(tenantId, scopeId);
3214
+ return rt.actor.turn(() => revokeBecomeCapabilityAsPrincipal({ sql: spineSql(rt.db), checker: this.checker, node: { tenantId, scopeId }, now: this.clock() }, capabilityId, principalId.parse(by)));
3215
+ }
3216
+ /**
3217
+ * Where each named `become` link stands (#1686) — what a pending-invite list shows, so a link the
3218
+ * kernel revoked or that expired is never shown as open. A read in the scope's task.
3219
+ */
3220
+ async becomeLinkStates(tenantId, scopeId, ids) {
3221
+ const rt = await this.openActiveScope(tenantId, scopeId);
3222
+ return rt.actor.enqueue(() => readBecomeLinkStates(spineSql(rt.db), ids, this.clock(), this.holdingsAt(tenantId, scopeId)));
3223
+ }
3224
+ /** What a principal holds at this scope, for a `become` exchange (#1686); absent with a checker that cannot say. */
3225
+ holdingsAt(tenantId, scopeId) {
3226
+ const checker = this.checker;
3227
+ return checker.holdings ? (principal) => checker.holdings(asPrincipal(principal), { tenantId, scopeId }) : undefined;
3228
+ }
3163
3229
  /** The caller's bound per role at the scope, `null` for a role this tenant does not define (#1150). */
3164
3230
  roleBound(caller, tenantId, scopeId) {
3165
3231
  const subject = asPrincipal(principalId.parse(caller));
@@ -5128,6 +5194,7 @@ export class SqliteScopeHost {
5128
5194
  expiresAt: r.expires_at,
5129
5195
  ...(r.serving_ref ? { servingRef: r.serving_ref } : {}),
5130
5196
  archivedAt: r.archived_at ?? null,
5197
+ archivedFromStatus: (r.archived_from_status ?? null),
5131
5198
  createdAt: r.created_at,
5132
5199
  });
5133
5200
  // The (version, scope) pair a bind and its impact read both start from, and the refusals
@@ -5178,14 +5245,15 @@ export class SqliteScopeHost {
5178
5245
  // Stamp/clear archived_at so the reap sweep can age scopes (§4.4). Entering
5179
5246
  // `archived` records when; `unarchive` (→ active, a restore) clears it so a later
5180
5247
  // re-archive dates from the new event; `reaped` keeps it as terminal history.
5248
+ // #1524: the status it left is recorded beside the stamp and cleared with it.
5181
5249
  if (to === 'archived') {
5182
5250
  this.directory
5183
- .prepare('UPDATE scopes SET status = ?, archived_at = ? WHERE scope_id = ?')
5184
- .run(to, new Date().toISOString(), scopeId);
5251
+ .prepare('UPDATE scopes SET status = ?, archived_at = ?, archived_from_status = ? WHERE scope_id = ?')
5252
+ .run(to, new Date().toISOString(), row.status, scopeId);
5185
5253
  }
5186
5254
  else if (to === 'active') {
5187
5255
  this.directory
5188
- .prepare('UPDATE scopes SET status = ?, archived_at = NULL WHERE scope_id = ?')
5256
+ .prepare('UPDATE scopes SET status = ?, archived_at = NULL, archived_from_status = NULL WHERE scope_id = ?')
5189
5257
  .run(to, scopeId);
5190
5258
  }
5191
5259
  else {
@@ -5194,8 +5262,11 @@ export class SqliteScopeHost {
5194
5262
  if (to === 'archived' || to === 'reaped') {
5195
5263
  this.directory.prepare('UPDATE peer_bindings SET invalidated = 1 WHERE tenant_id = ? AND target_scope_id = ?').run(tenantId, scopeId);
5196
5264
  }
5197
- if (to === 'reaped')
5265
+ if (to === 'reaped') {
5198
5266
  forgetSwitchesOf(switchSqlOf(this.directory), scopeId);
5267
+ // #1524: its storage is gone, so its samples describe nothing.
5268
+ forgetScopeStorage(redactionSqlOf(this.directory), scopeId);
5269
+ }
5199
5270
  // The audit target carries the scope's vertical (control-plane.md §4.4:
5200
5271
  // "vertical stays null until §4.2 lifecycle actions that name one"). It is
5201
5272
  // read from the scope rather than passed in, so the trail cannot disagree
@@ -6551,6 +6622,19 @@ export class SqliteScopeHost {
6551
6622
  if (scope.reap_claimed_at !== null)
6552
6623
  throw substratError('precondition_failed', `scope ${scopeId} is being reaped`);
6553
6624
  },
6625
+ backfillScopeScriptCopy: async (actor, tenantId, scopeId, scriptRef, opts) => {
6626
+ if (!scriptRef)
6627
+ throw substratError('conflict', 'a backfilled copy must name a real script');
6628
+ // The audit row commits with the entry, stamped with the erasure epoch read in the same unit.
6629
+ return this.directory.transaction(() => {
6630
+ const written = this.directory.prepare(COPY_BACKFILL_SQL).run(...copyBackfillParams(tenantId, scopeId, scriptRef)).changes > 0;
6631
+ const scope = this.directory.prepare(COPY_BACKFILL_SCOPE_SQL).get(tenantId, scopeId);
6632
+ if (!written)
6633
+ return copyBackfillRefusal(scope);
6634
+ this.recordAdmin(actor, 'backfillScopeCopy', { tenantId, scopeId }, { erasureEpoch: scope.erasure_epoch }, { scriptRef, fromLogId: opts?.fromLogId ?? null });
6635
+ return 'recorded';
6636
+ })();
6637
+ },
6554
6638
  claimExpiredScopeScriptCopies: async (_actor, input) => {
6555
6639
  const limit = assertRowLimit('limit', input.limit);
6556
6640
  return this.directory.transaction(() => {
@@ -6581,11 +6665,16 @@ export class SqliteScopeHost {
6581
6665
  return; // a reaper resumes its earlier claim
6582
6666
  throw substratError('precondition_failed', `scope ${scopeId} has a copy move in flight; retry reap after it settles`);
6583
6667
  },
6584
- settleScopeScriptCopy: async (_actor, tenantId, scopeId, scriptRef, moveId, state, marker, opts) => this.directory.prepare(`UPDATE scope_script_copies SET state = ?, load_stamp = ?, revision = ?,
6585
- last_attempt_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
6586
- WHERE tenant_id = ? AND scope_id = ? AND script_ref = ? AND move_id = ?
6587
- AND (state <> 'done' OR ? = 'done')
6588
- ${opts?.claimedBy === undefined ? '' : "AND state = 'pending' AND lease_owner = ?"}`).run(state, marker?.loadStamp ?? null, marker?.revision ?? null, tenantId, scopeId, scriptRef, moveId, state, ...(opts?.claimedBy === undefined ? [] : [opts.claimedBy])).changes > 0,
6668
+ settleScopeScriptCopy: async (_actor, tenantId, scopeId, scriptRef, moveId, state, marker, opts) => this.directory.transaction(() => {
6669
+ const settled = this.directory.prepare(`UPDATE scope_script_copies SET state = ?, load_stamp = ?, revision = ?,
6670
+ last_attempt_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
6671
+ WHERE tenant_id = ? AND scope_id = ? AND script_ref = ? AND move_id = ?
6672
+ AND (state <> 'done' OR ? = 'done')
6673
+ ${opts?.claimedBy === undefined ? '' : "AND state = 'pending' AND lease_owner = ?"}`).run(state, marker?.loadStamp ?? null, marker?.revision ?? null, tenantId, scopeId, scriptRef, moveId, state, ...(opts?.claimedBy === undefined ? [] : [opts.claimedBy])).changes > 0;
6674
+ if (settled && state === 'done')
6675
+ this.directory.prepare(COPY_BACKFILL_SUPERSEDE_SQL).run(tenantId, scopeId);
6676
+ return settled;
6677
+ })(),
6589
6678
  touchScopeScriptCopy: async (_actor, tenantId, scopeId, scriptRef, moveId) => {
6590
6679
  this.directory.prepare(`UPDATE scope_script_copies SET last_attempt_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
6591
6680
  WHERE tenant_id = ? AND scope_id = ? AND script_ref = ? AND move_id = ? AND state = 'eligible'`).run(tenantId, scopeId, scriptRef, moveId);
@@ -7563,8 +7652,15 @@ export class SqliteScopeHost {
7563
7652
  this.recordAccess(actor, 'openSubjectPayloads', { tenantId, scopeId }, { subjects: new Set(items.map((i) => i.subjectId)).size }, opened.filter((o) => o !== null).length);
7564
7653
  return opened;
7565
7654
  },
7566
- shredSubject: async (actor, tenantId, scopeId, subjectId) => {
7655
+ // `stamp` is the erasure epoch an orchestrated erasure's claim compared (#1722). A direct shred
7656
+ // claims nothing and records the epoch it ran under: the backfill orders erasures by them.
7657
+ shredSubject: async (actor, tenantId, scopeId, subjectId, stamp) => {
7567
7658
  this.assertScope(tenantId, scopeId);
7659
+ const before = stamp ?? {
7660
+ erasureEpoch: this.directory.prepare(COPY_BACKFILL_SCOPE_SQL).get(tenantId, scopeId)
7661
+ ?.erasure_epoch ?? 0,
7662
+ path: 'direct',
7663
+ };
7568
7664
  // Redact the live spine FIRST. Both halves are idempotent and a crash between them
7569
7665
  // converges on retry, so the order is decided by which half-done state harms the
7570
7666
  // person: dying after this leaves ciphertext in a backup that no key opens; dying
@@ -7646,7 +7742,7 @@ export class SqliteScopeHost {
7646
7742
  // BOTH logs, which is unusual and deliberate: the admin log because this is a
7647
7743
  // mutation, the access log because it destroys evidence. An erasure is the one
7648
7744
  // action where "who asked for this to disappear" is itself the record.
7649
- this.recordAdmin(actor, 'shredSubject', { tenantId, scopeId }, null, receipt);
7745
+ this.recordAdmin(actor, 'shredSubject', { tenantId, scopeId }, before, receipt);
7650
7746
  // BOTH counts: the access log's number is "how much evidence this destroyed", and
7651
7747
  // an intent payload is a whole event's worth of it.
7652
7748
  this.recordAccess(actor, 'shredSubject', { tenantId, scopeId }, { subjectId }, redacted.changes + intentsRedacted + jobRunsRedacted + idempotencyResults + moduleRowsErased(vertical));
@@ -7675,7 +7771,8 @@ export class SqliteScopeHost {
7675
7771
  throw substratError('precondition_failed', 'scope route or copy inventory changed during subject erasure; retry after it settles');
7676
7772
  // The pure adapter has one co-located scope store. Its existing atomic shred is
7677
7773
  // the final local redaction and key destruction, after remote copies confirmed.
7678
- return this.admin.shredSubject(actor, tenantId, scopeId, subjectId);
7774
+ const shred = this.admin.shredSubject;
7775
+ return shred(actor, tenantId, scopeId, subjectId, { erasureEpoch: expected.epoch, path: 'orchestrated' });
7679
7776
  },
7680
7777
  // -- impersonation (K-42, #868) ----------------------------------------
7681
7778
  beginImpersonation: async (actor, input) => {
@@ -7749,6 +7846,8 @@ export class SqliteScopeHost {
7749
7846
  '_substrat_switch_owed', // #2045: subjects owed a re-assert, per scope
7750
7847
  '_substrat_findings', // #1748: the tenant's findings
7751
7848
  '_substrat_finding_rules', // #1748: the tenant's suppress rules
7849
+ '_substrat_scope_storage', // #1524: storage samples of scopes whose storage is gone
7850
+ '_substrat_scope_storage_attempts', // #1524: and the phase's last try at each
7752
7851
  ];
7753
7852
  const clear = this.directory.transaction(() => {
7754
7853
  for (const table of tables) {
@@ -7841,7 +7940,11 @@ export class SqliteScopeHost {
7841
7940
  const reading = foldMeterReading({
7842
7941
  readAt: instant.parse(new Date().toISOString()),
7843
7942
  tenants: this.directory.prepare(`SELECT tenant_id, slug, status FROM tenants${where}`).all(...args).map((r) => ({ tenantId: r.tenant_id, slug: r.slug, status: r.status })),
7844
- scopes: this.directory.prepare(`SELECT tenant_id, status FROM scopes${where}`).all(...args).map((r) => ({ tenantId: r.tenant_id, status: r.status })),
7943
+ scopes: this.directory.prepare(`SELECT tenant_id, status, archived_from_status FROM scopes${where}`).all(...args).map((r) => ({
7944
+ tenantId: r.tenant_id,
7945
+ status: r.status,
7946
+ archivedFromStatus: r.archived_from_status,
7947
+ })),
7845
7948
  entitlements: this.directory
7846
7949
  .prepare(`SELECT tenant_id, entitlement_key, plan, expires_at FROM _substrat_entitlements${where}`)
7847
7950
  .all(...args).map((r) => ({
@@ -7850,6 +7953,9 @@ export class SqliteScopeHost {
7850
7953
  plan: r.plan,
7851
7954
  expiresAt: r.expires_at,
7852
7955
  })),
7956
+ // #1524: the stored gauge's latest sample per non-reaped scope. A directory read only.
7957
+ storage: listScopeStorageRows(redactionSqlOf(this.directory), { tenantId: only, latest: true }),
7958
+ storageAttempts: listScopeStorageAttemptRows(redactionSqlOf(this.directory), only),
7853
7959
  });
7854
7960
  // The count that matters for K-24 is how many TENANTS this reading covered —
7855
7961
  // "read the meter for one tenant" and "metered the whole fleet" are different
@@ -8714,6 +8820,20 @@ export class SqliteScopeHost {
8714
8820
  this.directory.prepare('DELETE FROM _substrat_model_usage WHERE at < ?').run(horizon);
8715
8821
  return { recorded: res.changes > 0 };
8716
8822
  },
8823
+ recordScopeStorage: async (_actor, readings) => ({
8824
+ recorded: this.directory.transaction(() => recordScopeStorageRows(redactionSqlOf(this.directory), readings))(),
8825
+ }),
8826
+ listScopeStorage: async (actor, filter) => {
8827
+ const rows = listScopeStorageRows(redactionSqlOf(this.directory), filter);
8828
+ this.recordAccess(actor, 'listScopeStorage', { tenantId: filter?.tenantId ?? null, scopeId: filter?.scopeId ?? null }, filter ?? null, rows.length);
8829
+ return rows;
8830
+ },
8831
+ listScopeStorageAttempts: async (actor) => {
8832
+ const rows = listScopeStorageAttemptRows(redactionSqlOf(this.directory));
8833
+ this.recordAccess(actor, 'listScopeStorageAttempts', { tenantId: null }, null, rows.length);
8834
+ return rows;
8835
+ },
8836
+ pruneScopeStorage: async (_actor, limit) => pruneScopeStorageRows(redactionSqlOf(this.directory), Date.now(), limit),
8717
8837
  listModelUsage: async (actor, filter) => {
8718
8838
  const rows = this.selectModelUsage(filter);
8719
8839
  this.recordAccess(actor, 'listModelUsage', { tenantId: filter?.tenantId ?? null, scopeId: filter?.scopeId ?? null }, filter, rows.length);
@@ -8758,6 +8878,7 @@ export class SqliteScopeHost {
8758
8878
  return false;
8759
8879
  if (cond?.confirmMove) {
8760
8880
  this.directory.prepare(COPY_MOVE_CONFIRM_SQL).run(...copyMoveConfirmParams(cond.confirmMove, tenantId, scopeId, now));
8881
+ this.directory.prepare(COPY_BACKFILL_SUPERSEDE_SQL).run(tenantId, scopeId);
8761
8882
  }
8762
8883
  return true;
8763
8884
  })();
@@ -9036,6 +9157,7 @@ export class SqliteScopeHost {
9036
9157
  ['expires_at', 'expires_at TEXT'],
9037
9158
  ['serving_ref', 'serving_ref TEXT'],
9038
9159
  ['archived_at', 'archived_at TEXT'],
9160
+ ['archived_from_status', 'archived_from_status TEXT'],
9039
9161
  ]) {
9040
9162
  if (!existing.has(column))
9041
9163
  this.directory.exec(`ALTER TABLE scopes ADD COLUMN ${ddl}`);
@@ -9802,6 +9924,9 @@ export class SqliteScopeHost {
9802
9924
  this.ensureColumn(db, '_substrat_tuples', 'revoked_at', 'revoked_at TEXT');
9803
9925
  // #2126: NULL keeps every existing capability's attachment behavior unchanged.
9804
9926
  this.ensureColumn(db, '_substrat_capabilities', 'attachments', 'attachments TEXT');
9927
+ // #1686: NULL on every row already there — none is a principal-minted become.
9928
+ this.ensureColumn(db, '_substrat_capabilities', 'target_digest', 'target_digest TEXT');
9929
+ this.ensureColumn(db, '_substrat_capabilities', 'revoked_reason', 'revoked_reason TEXT');
9805
9930
  db.exec(GRANT_CHILDREN_INDEX_DDL);
9806
9931
  // Executor retry state (#100), same reasoning: scopes provisioned before it
9807
9932
  // already have the table. Defaults read as "terminal", which is exactly right