@substrat-run/adapter-sqlite 0.141.0 → 0.143.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 PlatformRequestEntry, 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
  /**
@@ -651,8 +672,8 @@ export declare class SqliteScopeHost implements ScopeHost {
651
672
  */
652
673
  migrateScope(tenantId: TenantId, scopeId: ScopeId): Promise<MigrateScopeOutcome>;
653
674
  executorDeadLetters(tenantId: TenantId, scopeId: ScopeId): Promise<ExecutorDeadLetter[]>;
654
- listPlatformRequests(tenantId: TenantId, scopeId: ScopeId): Promise<PlatformRequest[]>;
655
- listPlatformRequestHistory(tenantId: TenantId, scopeId: ScopeId, filter?: PlatformRequestFilter): Promise<PlatformRequest[]>;
675
+ listPlatformRequests(tenantId: TenantId, scopeId: ScopeId): Promise<PlatformRequestEntry[]>;
676
+ listPlatformRequestHistory(tenantId: TenantId, scopeId: ScopeId, filter?: PlatformRequestFilter): Promise<PlatformRequestEntry[]>;
656
677
  settlePlatformRequest(tenantId: TenantId, scopeId: ScopeId, id: PlatformRequestId, outcome: PlatformRequestSettle): Promise<void>;
657
678
  private dispatch;
658
679
  private dispatchRounds;
@@ -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,YAAY,EAIjB,KAAK,cAAc,EA6CnB,KAAK,kBAAkB,EAQvB,KAAK,YAAY,EAOjB,KAAK,QAAQ,EAeb,KAAK,WAAW,EAIhB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAM1B,KAAK,wBAAwB,EAW7B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,WAAW,EAehB,KAAK,SAAS,EAEd,KAAK,OAAO,EAcZ,KAAK,sBAAsB,EAG3B,KAAK,QAAQ,EAGb,KAAK,iBAAiB,EAsBvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAyDL,KAAK,aAAa,EAKlB,KAAK,kBAAkB,EA+CvB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAc1B,KAAK,uBAAuB,EAG5B,KAAK,gBAAgB,EAGrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAEpB,KAAK,mB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CAAC,OAAO;CAsChB"}
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
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, 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, 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, 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, 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';
10
- import { GRANT_CHILDREN_INDEX_DDL, grantedEntitiesForContext } 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
+ import { GRANT_CHILDREN_INDEX_DDL, SHAPE_MARKER_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';
13
13
  import { createTupleChecker, directoryTenantReader } from './checker.js';
@@ -268,6 +268,7 @@ const KERNEL_DDL = `
268
268
  PRIMARY KEY (subject, relation, object)
269
269
  );
270
270
  ${GRANT_CHILDREN_INDEX_DDL};
271
+ ${SHAPE_MARKER_INDEX_DDL};
271
272
  CREATE TABLE IF NOT EXISTS _substrat_deliveries (
272
273
  event_id TEXT NOT NULL,
273
274
  consumer_module TEXT NOT NULL,
@@ -836,6 +837,9 @@ export class SqliteScopeHost {
836
837
  -- When the scope last entered the archived state (§4.4). Drives the reap sweep's
837
838
  -- age filter; null for scopes that never archived, cleared on unarchive.
838
839
  archived_at TEXT,
840
+ -- #1524: the status it was archived FROM. 'provisioning' = it never held data, so the
841
+ -- storage gauge neither reads nor counts it. Written with archived_at, cleared with it.
842
+ archived_from_status TEXT,
839
843
  created_at TEXT NOT NULL
840
844
  );
841
845
  -- #1722: additive copy inventory; historical audit backfill is a separate act.
@@ -1381,6 +1385,8 @@ export class SqliteScopeHost {
1381
1385
  );
1382
1386
  CREATE INDEX IF NOT EXISTS _substrat_model_usage_tenant ON _substrat_model_usage (tenant_id, at);
1383
1387
  CREATE INDEX IF NOT EXISTS _substrat_model_usage_at ON _substrat_model_usage (at);
1388
+ -- #1524: the stored storage gauge — one row per (scope, UTC day), kernel-owned DDL.
1389
+ ${SCOPE_STORAGE_DDL}
1384
1390
  CREATE INDEX IF NOT EXISTS scopes_tenant ON scopes (tenant_id, scope_id);
1385
1391
  `);
1386
1392
  this.ensureDirectoryColumns();
@@ -1565,8 +1571,11 @@ export class SqliteScopeHost {
1565
1571
  if (this.modules.has(manifest.id)) {
1566
1572
  throw new Error(`module already registered: ${manifest.id}`);
1567
1573
  }
1574
+ // #1835: the operations are the binder's own value, or the maps beside the handlers are a
1575
+ // copy nothing bound to them.
1576
+ assertBoundOperations(manifest.id, registration.operations);
1568
1577
  // #119: refused before anything is recorded, so a module the trash rules refuse leaves nothing.
1569
- const trashTargets = registerTrashTargets(manifest.id, new Set(Object.keys(registration.operations ?? {})), registration.operationInputs, manifest.entityStates, manifest.schedules);
1578
+ const trashTargets = registerTrashTargets(manifest.id, new Set(Object.keys(registration.operations?.handlers ?? {})), registration.operations?.inputs, manifest.entityStates, manifest.schedules);
1570
1579
  // #2068: refused here, before anything is recorded, when the module claims an erasure it
1571
1580
  // cannot deliver (a hook with no reach declared, a `custom` entity with no hook).
1572
1581
  const erasure = moduleErasurePlan(registration);
@@ -1698,7 +1707,7 @@ export class SqliteScopeHost {
1698
1707
  // engine's in-scope FUNCTION is untouched — withdrawal removes the binding,
1699
1708
  // not the capability, which is how a vertical re-offers the same transition
1700
1709
  // behind its own guarded operation.
1701
- const ownOperations = new Set(Object.keys(registration.operations ?? {}));
1710
+ const ownOperations = new Set(Object.keys(registration.operations?.handlers ?? {}));
1702
1711
  for (const name of manifest.withdraws ?? []) {
1703
1712
  if (ownOperations.has(name)) {
1704
1713
  throw new Error(`${manifest.id} withdraws its own operation: ${name} (a module cannot withdraw itself — just don't register it)`);
@@ -1709,25 +1718,25 @@ export class SqliteScopeHost {
1709
1718
  // A declared input schema for an operation this module does not bind is a
1710
1719
  // schema that enforces nothing while reading as coverage — the same reason
1711
1720
  // `checksDeclaredElsewhere` refuses a stale exemption.
1712
- const declaredInputs = registration.operationInputs ?? {};
1721
+ const declaredInputs = registration.operations?.inputs ?? {};
1713
1722
  const unbound = Object.keys(declaredInputs).filter((name) => !ownOperations.has(name));
1714
1723
  if (unbound.length > 0) {
1715
- throw new Error(`${manifest.id} declares operationInputs for unbound operation(s): ` +
1724
+ throw new Error(`${manifest.id} declares operations.inputs for unbound operation(s): ` +
1716
1725
  `${unbound.sort().join(', ')} — a schema on nothing reads as a parse that is not there`);
1717
1726
  }
1718
1727
  // Same rule for a declared precondition, and it matters more: a `concurrency`
1719
1728
  // on an unbound name is a guarantee nothing enforces, which is exactly the
1720
1729
  // belief #129 exists to stop anyone holding.
1721
- const declaredConcurrency = registration.operationConcurrency ?? {};
1730
+ const declaredConcurrency = registration.operations?.concurrency ?? {};
1722
1731
  const unguarded = Object.keys(declaredConcurrency).filter((name) => !ownOperations.has(name));
1723
1732
  if (unguarded.length > 0) {
1724
- throw new Error(`${manifest.id} declares operationConcurrency for unbound operation(s): ` +
1733
+ throw new Error(`${manifest.id} declares operations.concurrency for unbound operation(s): ` +
1725
1734
  `${unguarded.sort().join(', ')} — a precondition on nothing reads as a guard that is not there`);
1726
1735
  }
1727
1736
  // #116: an opt-out on an unbound name is the same defect one paragraph up,
1728
1737
  // and reads worse — it looks like a deliberate exclusion of something that is
1729
1738
  // not there, so nobody goes looking for what actually honours the header.
1730
- const declaredOptOuts = registration.operationIdempotencyOptOuts ?? [];
1739
+ const declaredOptOuts = registration.operations?.idempotencyOptOuts ?? [];
1731
1740
  const unboundOptOuts = declaredOptOuts.filter((name) => !ownOperations.has(name));
1732
1741
  if (unboundOptOuts.length > 0) {
1733
1742
  throw new Error(`${manifest.id} declares idempotency: false for unbound operation(s): ` +
@@ -1739,7 +1748,7 @@ export class SqliteScopeHost {
1739
1748
  entitlementKey: manifest.entitlementKey,
1740
1749
  scheduledOperations: new Set((manifest.schedules ?? []).map((sch) => sch.operation)),
1741
1750
  };
1742
- for (const [name, handler] of Object.entries(registration.operations ?? {})) {
1751
+ for (const [name, handler] of Object.entries(registration.operations?.handlers ?? {})) {
1743
1752
  this.defineOperation(name, handler);
1744
1753
  // Record which SKU flag gates this operation (§4.3). Bare defineOperation
1745
1754
  // bindings (tests, glue) carry no manifest and stay ungated.
@@ -2570,6 +2579,7 @@ export class SqliteScopeHost {
2570
2579
  forgetSwitchesOf(switchSqlOf(this.directory), scopeId);
2571
2580
  this.directory.prepare('DELETE FROM private_continuation_positions WHERE scope_id = ?').run(scopeId);
2572
2581
  this.directory.prepare('DELETE FROM private_continuation_keys WHERE scope_id = ?').run(scopeId);
2582
+ forgetScopeStorage(redactionSqlOf(this.directory), scopeId);
2573
2583
  this.directory.prepare('DELETE FROM scopes WHERE scope_id = ?').run(scopeId);
2574
2584
  })();
2575
2585
  this.recordAdmin(actor, 'deleteSnapshot', { tenantId, scopeId }, null, {
@@ -3048,6 +3058,7 @@ export class SqliteScopeHost {
3048
3058
  // pseudo-operation name — the actor is the capability, as on every event it
3049
3059
  // goes on to cause.
3050
3060
  emit: (capability, event) => kernelEmit(this.operationContext(rt, { kind: 'capability', id: capability }, undefined, undefined, undefined, CAPABILITY_EXCHANGE_OPERATION, [], now), event),
3061
+ holdings: this.holdingsAt(tenantId, scopeId),
3051
3062
  }, secret, options?.mode);
3052
3063
  rt.db.exec('COMMIT');
3053
3064
  }
@@ -3160,6 +3171,65 @@ export class SqliteScopeHost {
3160
3171
  const rt = await this.openActiveScope(tenantId, scopeId);
3161
3172
  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
3173
  }
3174
+ /**
3175
+ * A principal's `become` mint (#1686) — a member invite's link. The kernel's `becomeMintCheck`
3176
+ * and the write in ONE scope turn and one transaction, so nothing the target or the caller
3177
+ * holds can move between the check and the mint; a refusal writes nothing. The mint is on the
3178
+ * spine as `capability.become-minted`, the caller its actor.
3179
+ */
3180
+ async mintBecomeCapabilityBounded(tenantId, scopeId, caller, input) {
3181
+ const rt = await this.openActiveScope(tenantId, scopeId);
3182
+ const minter = principalId.parse(caller);
3183
+ const parsed = principalBecomeCapabilityInput.parse(input);
3184
+ const outcome = await rt.actor.turn(async () => {
3185
+ const checked = await becomeMintCheck({ sql: spineSql(rt.db), checker: this.checker }, minter, parsed.principal, { tenantId, scopeId });
3186
+ if (!checked.ok)
3187
+ return checked;
3188
+ const now = this.clock();
3189
+ rt.db.exec('BEGIN IMMEDIATE');
3190
+ try {
3191
+ const minted = await mintBecomeCapabilityAsPrincipal({
3192
+ sql: spineSql(rt.db),
3193
+ now,
3194
+ emit: (event) => kernelEmit(this.operationContext(rt, asPrincipal(minter), undefined, undefined, undefined, CAPABILITY_BECOME_MINT_OPERATION, [], now), event),
3195
+ }, minter, parsed, checked.targetDigest);
3196
+ rt.db.exec('COMMIT');
3197
+ return { ok: true, minted };
3198
+ }
3199
+ catch (err) {
3200
+ rt.db.exec('ROLLBACK');
3201
+ throw err;
3202
+ }
3203
+ });
3204
+ if (outcome.ok) {
3205
+ await this.dispatch(rt, null);
3206
+ await this.dispatchExecutors(rt, null);
3207
+ }
3208
+ return outcome;
3209
+ }
3210
+ /**
3211
+ * Revoke a `become` capability a principal minted (#1686) — withdrawing a member invite's
3212
+ * link, recorded with `by` as the revoker. `revoked` is false for anything else: a platform-minted
3213
+ * or an `act` capability is not this verb's. The kernel bounds `by` in the same turn: the link's
3214
+ * minter, or someone holding everything its principal holds now.
3215
+ */
3216
+ async revokeBecomeCapability(tenantId, scopeId, capabilityId, by) {
3217
+ const rt = await this.openActiveScope(tenantId, scopeId);
3218
+ return rt.actor.turn(() => revokeBecomeCapabilityAsPrincipal({ sql: spineSql(rt.db), checker: this.checker, node: { tenantId, scopeId }, now: this.clock() }, capabilityId, principalId.parse(by)));
3219
+ }
3220
+ /**
3221
+ * Where each named `become` link stands (#1686) — what a pending-invite list shows, so a link the
3222
+ * kernel revoked or that expired is never shown as open. A read in the scope's task.
3223
+ */
3224
+ async becomeLinkStates(tenantId, scopeId, ids) {
3225
+ const rt = await this.openActiveScope(tenantId, scopeId);
3226
+ return rt.actor.enqueue(() => readBecomeLinkStates(spineSql(rt.db), ids, this.clock(), this.holdingsAt(tenantId, scopeId)));
3227
+ }
3228
+ /** What a principal holds at this scope, for a `become` exchange (#1686); absent with a checker that cannot say. */
3229
+ holdingsAt(tenantId, scopeId) {
3230
+ const checker = this.checker;
3231
+ return checker.holdings ? (principal) => checker.holdings(asPrincipal(principal), { tenantId, scopeId }) : undefined;
3232
+ }
3163
3233
  /** The caller's bound per role at the scope, `null` for a role this tenant does not define (#1150). */
3164
3234
  roleBound(caller, tenantId, scopeId) {
3165
3235
  const subject = asPrincipal(principalId.parse(caller));
@@ -4475,7 +4545,7 @@ export class SqliteScopeHost {
4475
4545
  .prepare(`SELECT ${PLATFORM_REQUEST_COLUMNS}
4476
4546
  FROM _substrat_platform_requests WHERE status = 'pending' ORDER BY id`)
4477
4547
  .all();
4478
- // Tolerant (#1588): one undecodable row comes back naming why, never throws for the list.
4548
+ // Tolerant (#1588, #1637): an undecodable row comes back naming why, never throws for the list.
4479
4549
  return rows.map(platformRequestOf);
4480
4550
  }
4481
4551
  async listPlatformRequestHistory(tenantId, scopeId, filter) {
@@ -5128,6 +5198,7 @@ export class SqliteScopeHost {
5128
5198
  expiresAt: r.expires_at,
5129
5199
  ...(r.serving_ref ? { servingRef: r.serving_ref } : {}),
5130
5200
  archivedAt: r.archived_at ?? null,
5201
+ archivedFromStatus: (r.archived_from_status ?? null),
5131
5202
  createdAt: r.created_at,
5132
5203
  });
5133
5204
  // The (version, scope) pair a bind and its impact read both start from, and the refusals
@@ -5178,14 +5249,15 @@ export class SqliteScopeHost {
5178
5249
  // Stamp/clear archived_at so the reap sweep can age scopes (§4.4). Entering
5179
5250
  // `archived` records when; `unarchive` (→ active, a restore) clears it so a later
5180
5251
  // re-archive dates from the new event; `reaped` keeps it as terminal history.
5252
+ // #1524: the status it left is recorded beside the stamp and cleared with it.
5181
5253
  if (to === 'archived') {
5182
5254
  this.directory
5183
- .prepare('UPDATE scopes SET status = ?, archived_at = ? WHERE scope_id = ?')
5184
- .run(to, new Date().toISOString(), scopeId);
5255
+ .prepare('UPDATE scopes SET status = ?, archived_at = ?, archived_from_status = ? WHERE scope_id = ?')
5256
+ .run(to, new Date().toISOString(), row.status, scopeId);
5185
5257
  }
5186
5258
  else if (to === 'active') {
5187
5259
  this.directory
5188
- .prepare('UPDATE scopes SET status = ?, archived_at = NULL WHERE scope_id = ?')
5260
+ .prepare('UPDATE scopes SET status = ?, archived_at = NULL, archived_from_status = NULL WHERE scope_id = ?')
5189
5261
  .run(to, scopeId);
5190
5262
  }
5191
5263
  else {
@@ -5194,8 +5266,11 @@ export class SqliteScopeHost {
5194
5266
  if (to === 'archived' || to === 'reaped') {
5195
5267
  this.directory.prepare('UPDATE peer_bindings SET invalidated = 1 WHERE tenant_id = ? AND target_scope_id = ?').run(tenantId, scopeId);
5196
5268
  }
5197
- if (to === 'reaped')
5269
+ if (to === 'reaped') {
5198
5270
  forgetSwitchesOf(switchSqlOf(this.directory), scopeId);
5271
+ // #1524: its storage is gone, so its samples describe nothing.
5272
+ forgetScopeStorage(redactionSqlOf(this.directory), scopeId);
5273
+ }
5199
5274
  // The audit target carries the scope's vertical (control-plane.md §4.4:
5200
5275
  // "vertical stays null until §4.2 lifecycle actions that name one"). It is
5201
5276
  // read from the scope rather than passed in, so the trail cannot disagree
@@ -5633,26 +5708,31 @@ export class SqliteScopeHost {
5633
5708
  const rt = this.runtime(tenantId, scopeId);
5634
5709
  let toppedUp = 0;
5635
5710
  let retired = 0;
5636
- // #2071: one bounded transaction per pass, so a large scope never holds one long; a pass
5637
- // that did not use its whole budget found everything.
5638
- for (let done = false; !done;) {
5711
+ let retirementsLeftOpen = 0;
5712
+ // #2071: one bounded transaction per pass, so a large scope never holds one long; each
5713
+ // pass resumes where the last one stopped (#2083), until one reports nothing left.
5714
+ let after = null;
5715
+ do {
5639
5716
  const pass = await rt.actor.turn(() => rt.db.transaction(() => topUpEntityGrantShapes(switchSqlOf(rt.db), {
5640
5717
  tenantId,
5641
5718
  scopeId,
5642
5719
  shapes,
5643
5720
  now: new Date().toISOString(),
5644
5721
  limit,
5722
+ after,
5645
5723
  mintEventId: (ms) => rt.mintEventId(ms),
5646
5724
  version: this.versionId,
5647
5725
  }))());
5648
5726
  toppedUp += pass.toppedUp;
5649
5727
  retired += pass.retired;
5650
- done = pass.done;
5651
- }
5728
+ retirementsLeftOpen += pass.retirementsLeftOpen;
5729
+ after = pass.next;
5730
+ } while (after);
5731
+ const result = { toppedUp, retired, ...(retirementsLeftOpen > 0 ? { retirementsLeftOpen } : {}) };
5652
5732
  if (toppedUp > 0 || retired > 0) {
5653
- this.recordAdmin(actor, 'reconcileEntityGrantShapes', { tenantId, scopeId }, null, { shapes, toppedUp, retired });
5733
+ this.recordAdmin(actor, 'reconcileEntityGrantShapes', { tenantId, scopeId }, null, { shapes, ...result });
5654
5734
  }
5655
- return { toppedUp, retired };
5735
+ return result;
5656
5736
  },
5657
5737
  grantToConnection: async (actor, raw) => {
5658
5738
  const grant = connectionGrant.parse(raw);
@@ -5809,13 +5889,13 @@ export class SqliteScopeHost {
5809
5889
  }
5810
5890
  const rt = this.runtime(tenantId, scopeId);
5811
5891
  await this.applyPendingMigrations(rt);
5812
- const before = await rt.actor.turn(() => rt.db.transaction(() => revokeCapabilityAsPlatform(spineSql(rt.db), capabilityId, actor, this.clock()))());
5813
- if (!before) {
5814
- throw substratError('not_found', `no capability ${capabilityId} in scope ${scopeId}`);
5815
- }
5816
- this.recordAdmin(actor, 'revokeCapability', { tenantId, scopeId }, before, {
5892
+ // #1686: the same intent-then-outcome rows the hosted adapter writes around its revoke.
5893
+ await auditedCapabilityRevoke({
5817
5894
  capabilityId,
5818
- revoked: true,
5895
+ scopeId,
5896
+ record: (before, after) => this.recordAdmin(actor, 'revokeCapability', { tenantId, scopeId }, before, after),
5897
+ revoke: async () => (await rt.actor.turn(() => rt.db.transaction(() => revokeCapabilityAsPlatform(spineSql(rt.db), capabilityId, actor, this.clock()))())) ?? null,
5898
+ logError: (message, fields) => console.error(message, fields),
5819
5899
  });
5820
5900
  },
5821
5901
  // #1686 — the operator's read of the directory `ctx.capabilities.list` reads. The
@@ -6551,6 +6631,19 @@ export class SqliteScopeHost {
6551
6631
  if (scope.reap_claimed_at !== null)
6552
6632
  throw substratError('precondition_failed', `scope ${scopeId} is being reaped`);
6553
6633
  },
6634
+ backfillScopeScriptCopy: async (actor, tenantId, scopeId, scriptRef, opts) => {
6635
+ if (!scriptRef)
6636
+ throw substratError('conflict', 'a backfilled copy must name a real script');
6637
+ // The audit row commits with the entry, stamped with the erasure epoch read in the same unit.
6638
+ return this.directory.transaction(() => {
6639
+ const written = this.directory.prepare(COPY_BACKFILL_SQL).run(...copyBackfillParams(tenantId, scopeId, scriptRef)).changes > 0;
6640
+ const scope = this.directory.prepare(COPY_BACKFILL_SCOPE_SQL).get(tenantId, scopeId);
6641
+ if (!written)
6642
+ return copyBackfillRefusal(scope);
6643
+ this.recordAdmin(actor, 'backfillScopeCopy', { tenantId, scopeId }, { erasureEpoch: scope.erasure_epoch }, { scriptRef, fromLogId: opts?.fromLogId ?? null });
6644
+ return 'recorded';
6645
+ })();
6646
+ },
6554
6647
  claimExpiredScopeScriptCopies: async (_actor, input) => {
6555
6648
  const limit = assertRowLimit('limit', input.limit);
6556
6649
  return this.directory.transaction(() => {
@@ -6581,11 +6674,16 @@ export class SqliteScopeHost {
6581
6674
  return; // a reaper resumes its earlier claim
6582
6675
  throw substratError('precondition_failed', `scope ${scopeId} has a copy move in flight; retry reap after it settles`);
6583
6676
  },
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,
6677
+ settleScopeScriptCopy: async (_actor, tenantId, scopeId, scriptRef, moveId, state, marker, opts) => this.directory.transaction(() => {
6678
+ const settled = this.directory.prepare(`UPDATE scope_script_copies SET state = ?, load_stamp = ?, revision = ?,
6679
+ last_attempt_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
6680
+ WHERE tenant_id = ? AND scope_id = ? AND script_ref = ? AND move_id = ?
6681
+ AND (state <> 'done' OR ? = 'done')
6682
+ ${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;
6683
+ if (settled && state === 'done')
6684
+ this.directory.prepare(COPY_BACKFILL_SUPERSEDE_SQL).run(tenantId, scopeId);
6685
+ return settled;
6686
+ })(),
6589
6687
  touchScopeScriptCopy: async (_actor, tenantId, scopeId, scriptRef, moveId) => {
6590
6688
  this.directory.prepare(`UPDATE scope_script_copies SET last_attempt_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
6591
6689
  WHERE tenant_id = ? AND scope_id = ? AND script_ref = ? AND move_id = ? AND state = 'eligible'`).run(tenantId, scopeId, scriptRef, moveId);
@@ -7563,8 +7661,15 @@ export class SqliteScopeHost {
7563
7661
  this.recordAccess(actor, 'openSubjectPayloads', { tenantId, scopeId }, { subjects: new Set(items.map((i) => i.subjectId)).size }, opened.filter((o) => o !== null).length);
7564
7662
  return opened;
7565
7663
  },
7566
- shredSubject: async (actor, tenantId, scopeId, subjectId) => {
7664
+ // `stamp` is the erasure epoch an orchestrated erasure's claim compared (#1722). A direct shred
7665
+ // claims nothing and records the epoch it ran under: the backfill orders erasures by them.
7666
+ shredSubject: async (actor, tenantId, scopeId, subjectId, stamp) => {
7567
7667
  this.assertScope(tenantId, scopeId);
7668
+ const before = stamp ?? {
7669
+ erasureEpoch: this.directory.prepare(COPY_BACKFILL_SCOPE_SQL).get(tenantId, scopeId)
7670
+ ?.erasure_epoch ?? 0,
7671
+ path: 'direct',
7672
+ };
7568
7673
  // Redact the live spine FIRST. Both halves are idempotent and a crash between them
7569
7674
  // converges on retry, so the order is decided by which half-done state harms the
7570
7675
  // person: dying after this leaves ciphertext in a backup that no key opens; dying
@@ -7646,7 +7751,7 @@ export class SqliteScopeHost {
7646
7751
  // BOTH logs, which is unusual and deliberate: the admin log because this is a
7647
7752
  // mutation, the access log because it destroys evidence. An erasure is the one
7648
7753
  // action where "who asked for this to disappear" is itself the record.
7649
- this.recordAdmin(actor, 'shredSubject', { tenantId, scopeId }, null, receipt);
7754
+ this.recordAdmin(actor, 'shredSubject', { tenantId, scopeId }, before, receipt);
7650
7755
  // BOTH counts: the access log's number is "how much evidence this destroyed", and
7651
7756
  // an intent payload is a whole event's worth of it.
7652
7757
  this.recordAccess(actor, 'shredSubject', { tenantId, scopeId }, { subjectId }, redacted.changes + intentsRedacted + jobRunsRedacted + idempotencyResults + moduleRowsErased(vertical));
@@ -7675,7 +7780,8 @@ export class SqliteScopeHost {
7675
7780
  throw substratError('precondition_failed', 'scope route or copy inventory changed during subject erasure; retry after it settles');
7676
7781
  // The pure adapter has one co-located scope store. Its existing atomic shred is
7677
7782
  // the final local redaction and key destruction, after remote copies confirmed.
7678
- return this.admin.shredSubject(actor, tenantId, scopeId, subjectId);
7783
+ const shred = this.admin.shredSubject;
7784
+ return shred(actor, tenantId, scopeId, subjectId, { erasureEpoch: expected.epoch, path: 'orchestrated' });
7679
7785
  },
7680
7786
  // -- impersonation (K-42, #868) ----------------------------------------
7681
7787
  beginImpersonation: async (actor, input) => {
@@ -7749,6 +7855,8 @@ export class SqliteScopeHost {
7749
7855
  '_substrat_switch_owed', // #2045: subjects owed a re-assert, per scope
7750
7856
  '_substrat_findings', // #1748: the tenant's findings
7751
7857
  '_substrat_finding_rules', // #1748: the tenant's suppress rules
7858
+ '_substrat_scope_storage', // #1524: storage samples of scopes whose storage is gone
7859
+ '_substrat_scope_storage_attempts', // #1524: and the phase's last try at each
7752
7860
  ];
7753
7861
  const clear = this.directory.transaction(() => {
7754
7862
  for (const table of tables) {
@@ -7841,7 +7949,11 @@ export class SqliteScopeHost {
7841
7949
  const reading = foldMeterReading({
7842
7950
  readAt: instant.parse(new Date().toISOString()),
7843
7951
  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 })),
7952
+ scopes: this.directory.prepare(`SELECT tenant_id, status, archived_from_status FROM scopes${where}`).all(...args).map((r) => ({
7953
+ tenantId: r.tenant_id,
7954
+ status: r.status,
7955
+ archivedFromStatus: r.archived_from_status,
7956
+ })),
7845
7957
  entitlements: this.directory
7846
7958
  .prepare(`SELECT tenant_id, entitlement_key, plan, expires_at FROM _substrat_entitlements${where}`)
7847
7959
  .all(...args).map((r) => ({
@@ -7850,6 +7962,9 @@ export class SqliteScopeHost {
7850
7962
  plan: r.plan,
7851
7963
  expiresAt: r.expires_at,
7852
7964
  })),
7965
+ // #1524: the stored gauge's latest sample per non-reaped scope. A directory read only.
7966
+ storage: listScopeStorageRows(redactionSqlOf(this.directory), { tenantId: only, latest: true }),
7967
+ storageAttempts: listScopeStorageAttemptRows(redactionSqlOf(this.directory), only),
7853
7968
  });
7854
7969
  // The count that matters for K-24 is how many TENANTS this reading covered —
7855
7970
  // "read the meter for one tenant" and "metered the whole fleet" are different
@@ -8714,6 +8829,20 @@ export class SqliteScopeHost {
8714
8829
  this.directory.prepare('DELETE FROM _substrat_model_usage WHERE at < ?').run(horizon);
8715
8830
  return { recorded: res.changes > 0 };
8716
8831
  },
8832
+ recordScopeStorage: async (_actor, readings) => ({
8833
+ recorded: this.directory.transaction(() => recordScopeStorageRows(redactionSqlOf(this.directory), readings))(),
8834
+ }),
8835
+ listScopeStorage: async (actor, filter) => {
8836
+ const rows = listScopeStorageRows(redactionSqlOf(this.directory), filter);
8837
+ this.recordAccess(actor, 'listScopeStorage', { tenantId: filter?.tenantId ?? null, scopeId: filter?.scopeId ?? null }, filter ?? null, rows.length);
8838
+ return rows;
8839
+ },
8840
+ listScopeStorageAttempts: async (actor) => {
8841
+ const rows = listScopeStorageAttemptRows(redactionSqlOf(this.directory));
8842
+ this.recordAccess(actor, 'listScopeStorageAttempts', { tenantId: null }, null, rows.length);
8843
+ return rows;
8844
+ },
8845
+ pruneScopeStorage: async (_actor, limit) => pruneScopeStorageRows(redactionSqlOf(this.directory), Date.now(), limit),
8717
8846
  listModelUsage: async (actor, filter) => {
8718
8847
  const rows = this.selectModelUsage(filter);
8719
8848
  this.recordAccess(actor, 'listModelUsage', { tenantId: filter?.tenantId ?? null, scopeId: filter?.scopeId ?? null }, filter, rows.length);
@@ -8758,6 +8887,7 @@ export class SqliteScopeHost {
8758
8887
  return false;
8759
8888
  if (cond?.confirmMove) {
8760
8889
  this.directory.prepare(COPY_MOVE_CONFIRM_SQL).run(...copyMoveConfirmParams(cond.confirmMove, tenantId, scopeId, now));
8890
+ this.directory.prepare(COPY_BACKFILL_SUPERSEDE_SQL).run(tenantId, scopeId);
8761
8891
  }
8762
8892
  return true;
8763
8893
  })();
@@ -9036,6 +9166,7 @@ export class SqliteScopeHost {
9036
9166
  ['expires_at', 'expires_at TEXT'],
9037
9167
  ['serving_ref', 'serving_ref TEXT'],
9038
9168
  ['archived_at', 'archived_at TEXT'],
9169
+ ['archived_from_status', 'archived_from_status TEXT'],
9039
9170
  ]) {
9040
9171
  if (!existing.has(column))
9041
9172
  this.directory.exec(`ALTER TABLE scopes ADD COLUMN ${ddl}`);
@@ -9802,6 +9933,9 @@ export class SqliteScopeHost {
9802
9933
  this.ensureColumn(db, '_substrat_tuples', 'revoked_at', 'revoked_at TEXT');
9803
9934
  // #2126: NULL keeps every existing capability's attachment behavior unchanged.
9804
9935
  this.ensureColumn(db, '_substrat_capabilities', 'attachments', 'attachments TEXT');
9936
+ // #1686: NULL on every row already there — none is a principal-minted become.
9937
+ this.ensureColumn(db, '_substrat_capabilities', 'target_digest', 'target_digest TEXT');
9938
+ this.ensureColumn(db, '_substrat_capabilities', 'revoked_reason', 'revoked_reason TEXT');
9805
9939
  db.exec(GRANT_CHILDREN_INDEX_DDL);
9806
9940
  // Executor retry state (#100), same reasoning: scopes provisioned before it
9807
9941
  // already have the table. Defaults read as "terminal", which is exactly right