@substrat-run/adapter-sqlite 0.143.0 → 0.145.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.
@@ -1 +1 @@
1
- {"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../src/checker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAQ,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAKL,KAAK,KAAK,EACV,KAAK,iBAAiB,EAItB,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,kFAAkF;IAClF,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,GAAG,SAAS,CAAC;IACxD,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IACnE;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AA0DD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,GACzD,qBAAqB,CAWvB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,iBAAiB,CAYvE"}
1
+ {"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../src/checker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAQ,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAML,KAAK,KAAK,EACV,KAAK,iBAAiB,EAItB,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,kFAAkF;IAClF,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,GAAG,SAAS,CAAC;IACxD,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IACnE;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAgED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,GACzD,qBAAqB,CAWvB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,iBAAiB,CAYvE"}
package/dist/checker.js CHANGED
@@ -1,4 +1,4 @@
1
- import { capabilityByIdQuery, createTupleEvaluator, SYSTEM_SWITCH_OFF_QUERY, } from '@substrat-run/kernel';
1
+ import { capabilityByIdQuery, createTupleEvaluator, shapeProtectedTypesQuery, SYSTEM_SWITCH_OFF_QUERY, } from '@substrat-run/kernel';
2
2
  const TUPLE_COLUMNS = 'subject, relation, object, expires_at, revoked_at';
3
3
  /**
4
4
  * The scope-local reads. Each statement is compiled at most once per decision and only if
@@ -11,6 +11,7 @@ const scopeReader = (db) => {
11
11
  let tuplesStmt;
12
12
  let grantStmt;
13
13
  let parentsStmt;
14
+ let protectedStmt;
14
15
  let capabilityStmt;
15
16
  let switchedOffStmt;
16
17
  let nextGrantStmt;
@@ -26,6 +27,11 @@ const scopeReader = (db) => {
26
27
  WHERE subject = ? AND relation = ? AND object = ?`)).get(subject, relation, object),
27
28
  parents: (object) => (parentsStmt ??= db.prepare(`SELECT ${TUPLE_COLUMNS} FROM _substrat_tuples
28
29
  WHERE subject = ? AND relation = 'parent'`)).all(object),
30
+ // #2177: the types whose shape protects a key — where the entity walk stops climbing for it.
31
+ shapeProtectedTypes: (relation) => {
32
+ const q = shapeProtectedTypesQuery(relation);
33
+ return (protectedStmt ??= db.prepare(q.sql)).all(...q.params).map((r) => r.entity_type);
34
+ },
29
35
  // #1672: a capability subject is resolved against its own directory row, which lives
30
36
  // in this scope's spine beside the entities it reaches.
31
37
  capability: (id) => (capabilityStmt ??= db.prepare(capabilityByIdQuery(id).sql)).get(...capabilityByIdQuery(id).params),
@@ -1 +1 @@
1
- {"version":3,"file":"checker.js","sourceRoot":"","sources":["../src/checker.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,GAQxB,MAAM,sBAAsB,CAAC;AAiC9B,MAAM,aAAa,GAAG,mDAAmD,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,CAAC,EAAqB,EAAoB,EAAE;IAC9D,IAAI,UAA0C,CAAC;IAC/C,IAAI,SAAyC,CAAC;IAC9C,IAAI,WAA2C,CAAC;IAChD,IAAI,cAA8C,CAAC;IACnD,IAAI,eAA+C,CAAC;IACpD,IAAI,aAA6C,CAAC;IAClD,IAAI,aAA6C,CAAC;IAClD,OAAO;QACL,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,CACtC,CAAC,aAAa,KAAK,EAAE,CAAC,OAAO,CAC3B;mFAC2E,CAC5E,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAmC;QACpE,SAAS,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAC3B,CAAC,aAAa,KAAK,EAAE,CAAC,OAAO,CAC3B;2FACmF,CACpF,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAmC;QACzD,MAAM,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,CAClC,CAAC,UAAU,KAAK,EAAE,CAAC,OAAO,CACxB,UAAU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,EAAE,EAAE;YACvB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACjE,OAAO,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1C,CAAC;KACF,CAAC;IAEF,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC"}
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 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';
1
+ import { type BlobStoreHandle, type ImportBatch, type ImportResult, type Coverage, type PeerCoverage, type VerticalCaller, type BoundedBecomeMint, type BoundedBecomeRevoke, type BoundedUnbind, type BecomeLinkState, type PrincipalBecomeCapabilityInput, type CapabilityExchange, type CapabilityId, type ConnectionId, type ModuleId, type DomainEvent, type PlatformRequestId, type PlatformRequestEntry, type PlatformRequestFilter, type ProjectedConnectionGrant, type EntityRef, type PermissionKey, type PlatformActorId, type OnBehalfOf, type PrincipalId, type ScopeDump, type ScopeId, type ImpersonationSessionId, type TenantId, type TenantStoreHandle } from '@substrat-run/contracts';
2
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
  /**
@@ -165,6 +165,8 @@ export declare class SqliteScopeHost implements ScopeHost {
165
165
  private readonly listPlans;
166
166
  /** #119: entity type → its archive/trash plan, from every registered module. */
167
167
  private readonly statePlans;
168
+ /** #2166: entity type → the updated stamps the host holds, from every registered module. */
169
+ private readonly updatedStampPlans;
168
170
  /** #2068: each registered module's erasure, in registration order — what `shredSubject` runs. */
169
171
  private readonly erasurePlans;
170
172
  /** entityType → the declared attachment gate (#473): read key + write key (default: read). */
@@ -419,6 +421,26 @@ export declare class SqliteScopeHost implements ScopeHost {
419
421
  * move, the one case it decides anything.
420
422
  */
421
423
  private bindBreaks;
424
+ /**
425
+ * The serving pointer of `scope`'s vertical, read only when the scope is on a serving script
426
+ * before or after a move (`servingRef`), the one case it decides what the scope runs.
427
+ */
428
+ private servingPointerOf;
429
+ /** What `slug` serves in place, or null when nothing is. */
430
+ private servingPointerOfVertical;
431
+ /**
432
+ * #2178: refuse running `incomingId` where any of `froms` ran, each distinct version judged once,
433
+ * and where installs last reconciled one of `receipts` — a refusal from those names them.
434
+ */
435
+ private assertNoStrandFrom;
436
+ /**
437
+ * #2178: refuse moving `scope` (a bind, or a route with `servingRef`) onto code that strands
438
+ * people a link bound — any scope, fork or preview included, since bound people live in its own
439
+ * spine. No acknowledgement passes it.
440
+ */
441
+ private assertBindingShapesKept;
442
+ /** `PROVISIONED_VERSIONS_SQL` over the directory. */
443
+ private provisionedVersionsOf;
422
444
  /** What one version of `slug` imports, from the registry; `not_found` for a version it does not know. */
423
445
  private versionImports;
424
446
  /** #1705 PR 3: the promote gate's question, over two stored versions (`exportBreaksOf`). */
@@ -501,6 +523,13 @@ export declare class SqliteScopeHost implements ScopeHost {
501
523
  * kernel revoked or that expired is never shown as open. A read in the scope's task.
502
524
  */
503
525
  becomeLinkStates(tenantId: TenantId, scopeId: ScopeId, ids: readonly CapabilityId[]): Promise<BecomeLinkState[]>;
526
+ /**
527
+ * Unbind a binding shape's record (#1686) — its column cleared, and the shape its person held
528
+ * there through it taken back — as `caller`, who must hold the binding's key on the record. The
529
+ * kernel's bound and the write in ONE scope turn and one transaction; a refusal writes nothing.
530
+ * On the spine as `entity.holder-unbound`, the caller its actor.
531
+ */
532
+ unbindEntityHolderBounded(tenantId: TenantId, scopeId: ScopeId, caller: PrincipalId, entity: EntityRef): Promise<BoundedUnbind>;
504
533
  /** What a principal holds at this scope, for a `become` exchange (#1686); absent with a checker that cannot say. */
505
534
  private holdingsAt;
506
535
  /** The caller's bound per role at the scope, `null` for a role this tenant does not define (#1150). */
@@ -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,EA4CnB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,8BAA8B,EAGnC,KAAK,kBAAkB,EAEvB,KAAK,YAAY,EAMjB,KAAK,YAAY,EAOjB,KAAK,QAAQ,EAeb,KAAK,WAAW,EAIhB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAM1B,KAAK,wBAAwB,EAW7B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK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IAKlB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,cAAc;IAKtB;;;;;OAKG;IACH,OAAO,CAAC,MAAM;IAuBd;;;OAGG;IACH,OAAO,CAAC,YAAY;IAUpB;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IA2G1B,OAAO,CAAC,OAAO;CAsChB"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
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, 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';
4
+ import { accessLogEntry, adminLogEntry, delegatedReadParams, operationSeriesCount, opsFailureEntry, opsFailureFingerprint, issueEntry, FRESHNESS_HEARTBEAT_MINUTES, sweepRunEntry, modelUsageEntry, ATTACHMENT_ADDED, ATTACHMENT_REMOVED, attachmentRecord, createTenantInput, domainEvent, domainEventInput, exportReadInput, importBatch, importCursorMove, exportsOfManifestJson, assertNoBindingShapeBreak, importsOfManifestJson, entitlementGrant, entitlementGrantInput, eventId, meterReading, platformRequestInput, platformRequestId, MAX_PENDING_PLATFORM_REQUESTS, identityLink, identityPool, instant, isSubstratError, connection, capabilityGrant, connectionGrant, connectionGrantRecord, connectionSecret, systemGrant, systemSwitch, systemSwitchRecord, peerSwitch, verticalCaller, verticalSlug as verticalSlugOf, subjectRef, requestFingerprint, createConnectionInput, connectLinkFilter, connectLinkKey, consumeConnectLinkInput, mintConnectLinkInput, projectedConnectionGrant, projectedConnectionKey, moduleManifest, createOrgInput, promotionAcknowledgement, bindAcknowledgement, bindHostnameInput, channelHistoryEntry, hostnameBinding, publishVersionInput, AUTO_ADMISSION_NOTE, routeTarget, ROUTE_SCOPE_HOSTNAMES_MAX, registerVerticalInput, vertical as verticalSchema, verticalChannel, verticalVersion, objectRef, entityObjectRef, assertModuleEmittableType, assertKernelAuthoredType, grantRefFromProof, org as orgSchema, orgMembership, principalId, resolvedIdentity, identityMembership, roleDefinition, scope as scopeSchema, tenant as tenantSchema, tenantRole, principalBecomeCapabilityInput, subjectShredReceipt, SCOPE_TABLE_PAGE_DEFAULT, SCOPE_TABLE_PAGE_MAX, SCOPE_QUERY_ROW_MAX, verticalServingState, callsOfManifestJson, outboundOfManifestJson, listLimitOf, pageOf, countedPageOf, SCOPE_GATE_REASONS, substratError, assertReplayableDump, delegatedReadRecord, ownerTransferAudit, memberChangeAudit, peerBindingAudit, copyMarkAudit, redrainEventsInput, REDRAIN_BATCH, } from '@substrat-run/contracts';
5
+ import { actorOf, asPrincipal, assertAllowed, assertNoSecret, assertPermissionKey, CAPABILITY_DDL, COPY_ORIGIN_DDL, ENTITY_STATE_MOVES_DDL, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_BECOME_MINT_OPERATION, becomeMintCheck, mintBecomeCapabilityAsPrincipal, revokeBecomeCapabilityAsPrincipal, readBecomeLinkStates, ENTITY_UNBIND_OPERATION, allowedFor, unbindEntityHolderBounded, capabilityAttachmentWriteRefused, capabilityTokenHash, createCapabilityVerbs, createEntityEdgeVerbs, createEntityStateVerbs, createTrashedReads, CONTINUATION_POSITION_CAP, visibleContinuation, searchStateWhere, uncheckedView, addStatePlans, addUpdatedStampPlans, watchUpdatedStamps, entityStateMigrations, assertNoCallerPurge, isUnreachableParent, heldPurgePass, purgeDueOf, purgeHeldBy, lifecycleRefusal, purgeOnlyKeysOf, purgeReportOf, purgeStillDue, refuseTrashedTarget, assertBoundOperations, registerTrashTargets, runPurgePass, withheldKeysFor, statefulTablesOf, afterMigration, afterRuntimeDdl, derivesAnything, repairDerivedObjects, StateColumnLost, exchangeCapability as exchangeCapabilitySecret, guardSecrets, mintBecomeCapability, plausibleSessionToken, readCapabilityPage, redactSecrets, redactSecretText, moduleLog, consoleLogSink, asyncInvocationId, asyncLinePass, consoleInvocationLineSink, resolveCapabilitySession, revokeCapabilityAsPlatform, assertReadOnlyQuery, attachmentBlobKey, attachmentSha256, entitlementDenial, requiredEntitlementFor, foldMeterReading, guardSpine, guardSqlLimits, DO_SQL_LIMITS, tooManyResultColumns, tooManyTableColumns, parseValidationRecords, resolveScopeRecord, ulid, ISSUE_RETENTION_DAYS, telemetryRetentionStatements, FINDINGS_DDL, SCOPE_STORAGE_DDL, forgetScopeStorage, listScopeStorageAttemptRows, listScopeStorageRows, pruneScopeStorageRows, recordScopeStorageRows, CONNECT_LINKS_DDL, consumeConnectLinkRow, insertConnectLink, listConnectLinks as listConnectLinkRows, readConnectLink, restoreConnectLinkRow, revokeConnectLinkRow, createFindingRule, findingOfOpsFailure, findingOfSweepRun, pruneFindings, listFindingRules, listFindings, observeFinding, revokeFindingRule, setFindingStatus, assertRowLimit, assertRowOffset, OPS_FAILURE_RETENTION_DAYS, SWEEP_RUN_RETENTION_DAYS, SWEEP_RUNS_INTENT_INDEX, sweepRunsIntentHasKind, MODEL_USAGE_RETENTION_DAYS, foldModelUsage, backoffAt, platformRequestHistoryQuery, platformRequestOf, PLATFORM_REQUEST_COLUMNS, PLATFORM_REQUEST_REDACTION_SQL, platformRequestRedactionParams, platformRequestRedactionQuery, intentPayloadCarriesSubject, redactSubjectJobRuns, eraseSubjectFromModules, moduleRowsErased, moduleErasurePlan, redactSubjectScopeText, redactSubjectDirectoryText, ISSUE_EXEMPLAR_OWNER_BACKFILL_SQL, issueExemplarOwner, JOB_RUN_PATCH_SQL, JOB_RUN_CLAIM_SQL, JOB_RUN_RENEW_SQL, JOB_RUN_BEGIN_SQL, JOB_RUN_MISS_SQL, JOB_RUN_MISS_SETTLE_SQL, admissionMissOutcome, JOB_STEP_RECORD_SQL, JOB_LEASE_EXPIRED_NOTE, assertLeaseMs, DELIVERY_ERROR_REDACTION_SQL, REDACTED_DELIVERY_NOTE, seatScopeTuple, applyScopeRoleChange, changeScopeRole, revokeScopeRoles, scopeRoleHolders, admitPeer, 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, scopeMoveOf, runningVersionOf, isPrimaryScope, PROVISIONED_VERSIONS_SQL, installsReconciledOf, strandJudgmentsOf, provisionedVersionsParams, boundShapesColumn, boundShapesOfColumn, installReconciled, CrossVerticalRegistry, exportReadPlan, exportReadQuery, planExportBatch, withheldNote, JOB_RUN_DDL, JOB_RUN_DUE_AT, jobRunListLimit, jobRunOf, runDueJobRuns, startJobRun, IDEMPOTENCY_DDL, REFUSALS_TABLE_DDL, REFUSALS_INDEX, refusalInsert, refusalOf, markGuardRefusal, REFUSALS_REBUILD, refusalsAdmitGuards, assertIdempotencyKey, idempotencyLookupQuery, idempotencyPruneStatement, idempotencyRecordStatement, idempotencyOptedOutMessage, replayFor, globalFetch, createUlid, facetEvents, readHistory, walkEventCause, walkEventEffects, assertRedrainWindow, readInvocation, readDeadLetters, readLifecycleFlow, readOperationSeries, domainEventOf, readUndrainedOutbox, undrainedEventsOf, connectorCallRecord, noopConnectorCallRecorder, recordConnectorCall, settleConnectionUse, unknownRoleError, } from '@substrat-run/kernel';
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';
@@ -318,9 +318,9 @@ const KERNEL_DDL = `
318
318
  -- #1575: attachment text and its FTS5 index, shared from @substrat-run/kernel. After
319
319
  -- _substrat_attachments, whose delete trigger it adds.
320
320
  ${ATTACHMENT_TEXT_DDL}
321
- -- #901: an entity's version is the ULID of the last event about it, so
322
- -- MAX(id) per (entity_type, entity_id) is the read. The id column sits last so
323
- -- SQLite walks to the end of the matched range instead of aggregating over it.
321
+ -- #901: an entity's version is the ULID of the last event about it (a state move
322
+ -- excepted, #2191), so the newest id per (entity_type, entity_id) is the read. The id
323
+ -- column sits last so SQLite walks the matched range backwards instead of aggregating.
324
324
  ${OUTBOX_ENTITY_INDEX}
325
325
  `;
326
326
  /** Row → contract shape. Never reads the secrets table — that is the point of the split. */
@@ -628,6 +628,8 @@ export class SqliteScopeHost {
628
628
  listPlans = new Map();
629
629
  /** #119: entity type → its archive/trash plan, from every registered module. */
630
630
  statePlans = new Map();
631
+ /** #2166: entity type → the updated stamps the host holds, from every registered module. */
632
+ updatedStampPlans = new Map();
631
633
  /** #2068: each registered module's erasure, in registration order — what `shredSubject` runs. */
632
634
  erasurePlans = [];
633
635
  /** entityType → the declared attachment gate (#473): read key + write key (default: read). */
@@ -1654,6 +1656,7 @@ export class SqliteScopeHost {
1654
1656
  seen.add(m.version);
1655
1657
  }
1656
1658
  addStatePlans(this.statePlans, manifest.id, manifest.entityStates, manifest.permissions);
1659
+ addUpdatedStampPlans(this.updatedStampPlans, manifest.id, manifest.updatedStamps);
1657
1660
  for (const plan of listIndexPlans(manifest.id, manifest.lists, manifest.entityStates)) {
1658
1661
  const existing = this.listPlans.get(plan.entityType);
1659
1662
  if (existing) {
@@ -2905,7 +2908,10 @@ export class SqliteScopeHost {
2905
2908
  // `{ vertical, scope }` and the authorization they passed (K-34). What it emits was
2906
2909
  // emitted BECAUSE of the producer's event (#1237); the id resolves through
2907
2910
  // `_substrat_imports`, which the row above has just written.
2908
- await imp.handler(this.deliveryContext(rt, subject, undefined, { causedBy: e.id, invocationId: unit.invocationId }), event);
2911
+ const ctx = this.deliveryContext(rt, subject, undefined, { causedBy: e.id, invocationId: unit.invocationId });
2912
+ const stamps = watchUpdatedStamps(spineSql(rt.db), this.updatedStampPlans);
2913
+ await imp.handler(ctx, event);
2914
+ stamps?.assertHeld(ctx, `${imp.moduleId} consuming ${e.type}`);
2909
2915
  rt.db
2910
2916
  .prepare(`INSERT INTO _substrat_deliveries (event_id, consumer_module, delivered_at, invocation_id)
2911
2917
  VALUES (?, ?, ?, NULL)`)
@@ -2956,24 +2962,63 @@ export class SqliteScopeHost {
2956
2962
  * move, the one case it decides anything.
2957
2963
  */
2958
2964
  bindBreaks(actor, scope, incoming, servingRef) {
2959
- const vertical = scope.vertical && (scope.servingRef || servingRef)
2960
- ? this.directory
2961
- .prepare('SELECT serving_ref, serving_version_id FROM verticals WHERE slug = ?')
2962
- .get(scope.vertical)
2963
- : undefined;
2964
2965
  return bindExportBreaksOf({
2965
2966
  admin: this.admin,
2966
2967
  actor,
2967
2968
  scope,
2968
2969
  incoming: { id: incoming.id, verticalSlug: incoming.verticalSlug },
2969
2970
  ...(servingRef !== undefined ? { servingRef } : {}),
2970
- serving: vertical?.serving_ref && vertical.serving_version_id
2971
- ? { ref: vertical.serving_ref, versionId: vertical.serving_version_id }
2972
- : null,
2971
+ serving: this.servingPointerOf(scope, servingRef),
2973
2972
  readExports: async (versionId) => exportsOfManifestJson(this.manifestJsonOf(versionId) ?? null),
2974
2973
  readImports: async (slug, versionId) => this.versionImports(slug, versionId),
2975
2974
  });
2976
2975
  }
2976
+ /**
2977
+ * The serving pointer of `scope`'s vertical, read only when the scope is on a serving script
2978
+ * before or after a move (`servingRef`), the one case it decides what the scope runs.
2979
+ */
2980
+ servingPointerOf(scope, servingRef) {
2981
+ return scope.vertical && (scope.servingRef || servingRef) ? this.servingPointerOfVertical(scope.vertical) : null;
2982
+ }
2983
+ /** What `slug` serves in place, or null when nothing is. */
2984
+ servingPointerOfVertical(slug) {
2985
+ const v = this.directory
2986
+ .prepare('SELECT serving_ref, serving_version_id FROM verticals WHERE slug = ?')
2987
+ .get(slug);
2988
+ return v?.serving_ref && v.serving_version_id ? { ref: v.serving_ref, versionId: v.serving_version_id } : null;
2989
+ }
2990
+ /**
2991
+ * #2178: refuse running `incomingId` where any of `froms` ran, each distinct version judged once,
2992
+ * and where installs last reconciled one of `receipts` — a refusal from those names them.
2993
+ */
2994
+ assertNoStrandFrom(froms, incomingId, receipts = []) {
2995
+ const incoming = this.manifestJsonOf(incomingId);
2996
+ const judged = [...new Set(froms)].filter((f) => !!f && f !== incomingId);
2997
+ for (const from of judged)
2998
+ assertNoBindingShapeBreak(this.manifestJsonOf(from), incoming);
2999
+ // What each group of installs is judged from, and how (`strandJudgmentsOf`, one rule for both adapters).
3000
+ for (const r of receipts)
3001
+ for (const j of strandJudgmentsOf(r, judged, incomingId))
3002
+ assertNoBindingShapeBreak(this.manifestJsonOf(j.from), incoming, j.opts);
3003
+ }
3004
+ /**
3005
+ * #2178: refuse moving `scope` (a bind, or a route with `servingRef`) onto code that strands
3006
+ * people a link bound — any scope, fork or preview included, since bound people live in its own
3007
+ * spine. No acknowledgement passes it.
3008
+ */
3009
+ assertBindingShapesKept(scope, incomingId, servingRef) {
3010
+ const move = scopeMoveOf(scope, incomingId, servingRef, this.servingPointerOf(scope, servingRef));
3011
+ // A primary scope is also judged from the version it last reconciled: until then, a retirement
3012
+ // the running version declares has not reached it (`PROVISIONED_VERSIONS_SQL`).
3013
+ if (!move)
3014
+ return;
3015
+ const receipt = isPrimaryScope(scope) ? [installReconciled(scope, move.before)] : [];
3016
+ this.assertNoStrandFrom([move.before], move.after, receipt);
3017
+ }
3018
+ /** `PROVISIONED_VERSIONS_SQL` over the directory. */
3019
+ provisionedVersionsOf(vertical, serving, ownerTenant) {
3020
+ return installsReconciledOf(this.directory.prepare(PROVISIONED_VERSIONS_SQL).all(...provisionedVersionsParams(vertical, serving, ownerTenant)));
3021
+ }
2977
3022
  /** What one version of `slug` imports, from the registry; `not_found` for a version it does not know. */
2978
3023
  versionImports(slug, versionId) {
2979
3024
  const manifest = this.manifestJsonOf(versionId, slug);
@@ -3059,6 +3104,7 @@ export class SqliteScopeHost {
3059
3104
  // goes on to cause.
3060
3105
  emit: (capability, event) => kernelEmit(this.operationContext(rt, { kind: 'capability', id: capability }, undefined, undefined, undefined, CAPABILITY_EXCHANGE_OPERATION, [], now), event),
3061
3106
  holdings: this.holdingsAt(tenantId, scopeId),
3107
+ allowed: (principal, permission, entity) => allowedFor(this.checker, principal, { tenantId, scopeId })(permission, entity),
3062
3108
  }, secret, options?.mode);
3063
3109
  rt.db.exec('COMMIT');
3064
3110
  }
@@ -3182,7 +3228,7 @@ export class SqliteScopeHost {
3182
3228
  const minter = principalId.parse(caller);
3183
3229
  const parsed = principalBecomeCapabilityInput.parse(input);
3184
3230
  const outcome = await rt.actor.turn(async () => {
3185
- const checked = await becomeMintCheck({ sql: spineSql(rt.db), checker: this.checker }, minter, parsed.principal, { tenantId, scopeId });
3231
+ const checked = await becomeMintCheck({ sql: spineSql(rt.db), checker: this.checker }, minter, parsed.principal, { tenantId, scopeId }, parsed.bind);
3186
3232
  if (!checked.ok)
3187
3233
  return checked;
3188
3234
  const now = this.clock();
@@ -3225,6 +3271,39 @@ export class SqliteScopeHost {
3225
3271
  const rt = await this.openActiveScope(tenantId, scopeId);
3226
3272
  return rt.actor.enqueue(() => readBecomeLinkStates(spineSql(rt.db), ids, this.clock(), this.holdingsAt(tenantId, scopeId)));
3227
3273
  }
3274
+ /**
3275
+ * Unbind a binding shape's record (#1686) — its column cleared, and the shape its person held
3276
+ * there through it taken back — as `caller`, who must hold the binding's key on the record. The
3277
+ * kernel's bound and the write in ONE scope turn and one transaction; a refusal writes nothing.
3278
+ * On the spine as `entity.holder-unbound`, the caller its actor.
3279
+ */
3280
+ async unbindEntityHolderBounded(tenantId, scopeId, caller, entity) {
3281
+ const rt = await this.openActiveScope(tenantId, scopeId);
3282
+ const by = principalId.parse(caller);
3283
+ const outcome = await rt.actor.turn(async () => {
3284
+ const now = this.clock();
3285
+ rt.db.exec('BEGIN IMMEDIATE');
3286
+ try {
3287
+ const answer = await unbindEntityHolderBounded({
3288
+ sql: spineSql(rt.db),
3289
+ now,
3290
+ allowed: allowedFor(this.checker, by, { tenantId, scopeId }),
3291
+ emit: (event) => kernelEmit(this.operationContext(rt, asPrincipal(by), undefined, undefined, undefined, ENTITY_UNBIND_OPERATION, [], now), event),
3292
+ }, entity);
3293
+ rt.db.exec('COMMIT');
3294
+ return answer;
3295
+ }
3296
+ catch (err) {
3297
+ rt.db.exec('ROLLBACK');
3298
+ throw err;
3299
+ }
3300
+ });
3301
+ if (outcome.ok && outcome.unbound.length > 0) {
3302
+ await this.dispatch(rt, null);
3303
+ await this.dispatchExecutors(rt, null);
3304
+ }
3305
+ return outcome;
3306
+ }
3228
3307
  /** What a principal holds at this scope, for a `become` exchange (#1686); absent with a checker that cannot say. */
3229
3308
  holdingsAt(tenantId, scopeId) {
3230
3309
  const checker = this.checker;
@@ -3792,15 +3871,18 @@ export class SqliteScopeHost {
3792
3871
  // so the only loss is effort on a path that was already failing.
3793
3872
  const ref = guarded ? this.concurrencyRef(operation, guarded, parsed) : undefined;
3794
3873
  const seen = ref && invokeOptions?.ifMatch !== undefined ? this.versionAt(rt, ref) : undefined;
3874
+ // #2166: what the guards and the handler emit about a stamped entity, held below.
3875
+ const stamps = watchUpdatedStamps(spineSql(rt.db), this.updatedStampPlans);
3795
3876
  // #119: an operation on a TRASHED entity it did not declare it reaches is refused
3796
3877
  // here, before the guards and the handler — the declared key first, so a caller
3797
3878
  // without it meets the same `forbidden` an active entity gives (`entity-trash.ts`).
3798
- await refuseTrashedTarget({ sql: spineSql(rt.db), plans: this.statePlans, check: ctx.check }, operation, target, parsed, purging ? { now: this.clock(), gate: this.purgeGateFacts(rt, subject.id, tenantId, scopeId) } : undefined);
3879
+ await refuseTrashedTarget({ sql: spineSql(rt.db), plans: this.statePlans, check: ctx.check, now: ctx.now() }, operation, target, parsed, purging ? { gate: this.purgeGateFacts(rt, subject.id, tenantId, scopeId) } : undefined);
3799
3880
  // Manifest guards (K-17): pre-conditions, inside the operation's own
3800
3881
  // transaction, before the handler. A throw here blocks the operation
3801
3882
  // and rolls back exactly like a handler throw — fail closed.
3802
3883
  await this.runGuards(operation, ctx, parsed);
3803
3884
  result = await handler(ctx, parsed);
3885
+ stamps?.assertHeld(ctx, operation);
3804
3886
  // #119: the purge gate's AUTHORITATIVE read. Lifecycle, primacy and tenant live in the
3805
3887
  // directory, which this transaction does not cover and whose writers (a suspend, a
3806
3888
  // tenant status, a reclassification) do not take the scope's actor — so a hold could
@@ -4648,7 +4730,9 @@ export class SqliteScopeHost {
4648
4730
  });
4649
4731
  rt.db.exec('BEGIN IMMEDIATE');
4650
4732
  try {
4733
+ const stamps = watchUpdatedStamps(spineSql(rt.db), this.updatedStampPlans);
4651
4734
  await consumer.handler(ctx, event);
4735
+ stamps?.assertHeld(ctx, `${mod.id} consuming ${event.type}`);
4652
4736
  rt.db
4653
4737
  .prepare(`INSERT INTO _substrat_deliveries
4654
4738
  (event_id, consumer_module, delivered_at, invocation_id)
@@ -5192,6 +5276,8 @@ export class SqliteScopeHost {
5192
5276
  schemaVersion: r.schema_version,
5193
5277
  verticalVersionId: r.vertical_version_id,
5194
5278
  provisionedVersionId: r.provisioned_version_id ?? null,
5279
+ retirementsFinishedVersionId: r.retirements_finished_version_id ?? null,
5280
+ boundShapes: boundShapesOfColumn(r.bound_shapes),
5195
5281
  migrationFailure: mapMigrationFailure(r),
5196
5282
  forkedFrom: r.forked_from,
5197
5283
  forkedAt: r.forked_at,
@@ -6450,6 +6536,27 @@ export class SqliteScopeHost {
6450
6536
  .get(verticalSlug, channel);
6451
6537
  const outgoing = current ? readVersion(current.version_id) : undefined;
6452
6538
  const ack = promotionAcknowledgement.parse(acknowledge ?? {});
6539
+ // The owning tenant's live scopes a PRIVATE prod promote re-points — below for an embedded
6540
+ // vertical, after the in-place serve for a dispatch-backed one (#321) — read before
6541
+ // anything moves so the #2178 gate can judge each one.
6542
+ const owning = channel === 'prod' ? readVertical(verticalSlug) : undefined;
6543
+ const owned = owning && owning.ownerTenant !== null && !owning.listed
6544
+ ? this.directory
6545
+ .prepare(`SELECT * FROM scopes
6546
+ WHERE vertical = ? AND tenant_id = ? AND status = 'active' AND forked_from IS NULL AND kind != 'preview'`)
6547
+ .all(verticalSlug, owning.ownerTenant)
6548
+ : [];
6549
+ // #2178, ahead of the acknowledgements below because none of them passes it. What the promote
6550
+ // moves something from: the channel's version, the version served in place (a prod promote
6551
+ // serves the incoming one next, and a failed serve leaves it behind the channel), and what each
6552
+ // re-pointed scope RUNS (`runningVersionOf`: on the serving script, the served version).
6553
+ const served = channel === 'prod' ? this.servingPointerOfVertical(verticalSlug) : null;
6554
+ // And what each scope it moves last reconciled (`PROVISIONED_VERSIONS_SQL`).
6555
+ this.assertNoStrandFrom([
6556
+ outgoing?.id,
6557
+ served?.versionId,
6558
+ ...owned.map((s) => runningVersionOf(mapScope(s), served)),
6559
+ ], versionId, served || owned.length > 0 ? this.provisionedVersionsOf(verticalSlug, served, owned.length > 0 ? owning.ownerTenant : null) : []);
6453
6560
  // §4's two checkpoints, fired where the blast radius is. A FIRST promotion
6454
6561
  // has nothing to diff against, so there is nothing to acknowledge — the
6455
6562
  // gate is about change, not about existence.
@@ -6498,26 +6605,17 @@ export class SqliteScopeHost {
6498
6605
  // adopt-then-rebind for those (serve → adopt legacy scopes → advance versions),
6499
6606
  // so we skip the rebind here. An EMBEDDED vertical (deploymentRef null) has no
6500
6607
  // per-version script and keeps the rebind here. See adapter-cloudflare parity.
6501
- if (channel === 'prod' && !incoming.deploymentRef) {
6502
- const owning = readVertical(verticalSlug);
6503
- if (owning && owning.ownerTenant !== null && !owning.listed) {
6504
- const bound = this.directory
6505
- .prepare(`SELECT scope_id, tenant_id, vertical_version_id FROM scopes
6506
- WHERE vertical = ? AND tenant_id = ? AND status = 'active' AND forked_from IS NULL AND kind != 'preview'`)
6507
- .all(verticalSlug, owning.ownerTenant);
6508
- for (const s of bound) {
6509
- if (s.vertical_version_id === versionId)
6510
- continue;
6511
- const prev = s.vertical_version_id ? readVersion(s.vertical_version_id) : undefined;
6512
- if (prev && prev.migrationDigest !== incoming.migrationDigest) {
6513
- await this.snapshotScope(actor, s.tenant_id, s.scope_id);
6514
- }
6515
- this.directory
6516
- .prepare('UPDATE scopes SET vertical_version_id = ?, vertical = ? WHERE scope_id = ?')
6517
- .run(versionId, verticalSlug, s.scope_id);
6518
- this.recordAdmin(actor, 'bindScopeVersion', { tenantId: s.tenant_id, scopeId: s.scope_id }, prev ? { versionId: prev.id, version: prev.version } : null, { versionId, vertical: verticalSlug, version: incoming.version, via: 'promoteVersion' });
6519
- }
6608
+ for (const s of incoming.deploymentRef ? [] : owned) {
6609
+ if (s.vertical_version_id === versionId)
6610
+ continue;
6611
+ const prev = s.vertical_version_id ? readVersion(s.vertical_version_id) : undefined;
6612
+ if (prev && prev.migrationDigest !== incoming.migrationDigest) {
6613
+ await this.snapshotScope(actor, s.tenant_id, s.scope_id);
6520
6614
  }
6615
+ this.directory
6616
+ .prepare('UPDATE scopes SET vertical_version_id = ?, vertical = ? WHERE scope_id = ?')
6617
+ .run(versionId, verticalSlug, s.scope_id);
6618
+ this.recordAdmin(actor, 'bindScopeVersion', { tenantId: s.tenant_id, scopeId: s.scope_id }, prev ? { versionId: prev.id, version: prev.version } : null, { versionId, vertical: verticalSlug, version: incoming.version, via: 'promoteVersion' });
6521
6619
  }
6522
6620
  // The acknowledgement is recorded, not just enforced: that is what turns
6523
6621
  // "someone reviewed the permission change" into evidence.
@@ -6573,6 +6671,9 @@ export class SqliteScopeHost {
6573
6671
  },
6574
6672
  bindingImpact: async (actor, tenantId, scopeId, versionId, opts) => {
6575
6673
  const { v, scope } = bindTarget(tenantId, scopeId, versionId);
6674
+ // #2178: a move no acknowledgement passes is refused here too, so a caller asking first
6675
+ // (an adopt, an Update) stops before anything is copied.
6676
+ this.assertBindingShapesKept(mapScope(scope), versionId, opts?.servingRef);
6576
6677
  const breaks = await this.bindBreaks(actor, mapScope(scope), v, opts?.servingRef);
6577
6678
  this.recordAccess(actor, 'bindingImpact', { tenantId, scopeId }, { versionId, ...opts }, breaks.length);
6578
6679
  return breaks;
@@ -6588,6 +6689,8 @@ export class SqliteScopeHost {
6588
6689
  throw substratError('precondition_failed', 'scope erasure changed; reload the scope and retry');
6589
6690
  }
6590
6691
  const ack = bindAcknowledgement.parse(opts?.acknowledge ?? {});
6692
+ // #2178 first: no acknowledgement passes it, so none should be asked for ahead of it.
6693
+ this.assertBindingShapesKept(mapScope(scope), versionId);
6591
6694
  // #1756: an export an app in this tenant imports, dropped or re-versioned by what this
6592
6695
  // scope would run. Before the snapshot, so a refused bind leaves nothing behind.
6593
6696
  if (!ack.exportBreak) {
@@ -6719,17 +6822,25 @@ export class SqliteScopeHost {
6719
6822
  * Record that this scope's provision has now run against `versionId` (#1172).
6720
6823
  * Written only after a provision or reconcile succeeded — a receipt, never a hope.
6721
6824
  */
6722
- markScopeProvisioned: async (actor, tenantId, scopeId, versionId) => {
6825
+ markScopeProvisioned: async (actor, tenantId, scopeId, versionId, outcome) => {
6723
6826
  const scope = this.directory
6724
6827
  .prepare('SELECT tenant_id FROM scopes WHERE scope_id = ?')
6725
6828
  .get(scopeId);
6726
6829
  if (!scope || scope.tenant_id !== tenantId) {
6727
6830
  throw substratError('not_found', `unknown scope ${scopeId} in tenant ${tenantId}`);
6728
6831
  }
6832
+ // #2185: both in one write — the retirements count as finished only for the version
6833
+ // this receipt names, and a receipt written without that answer clears them.
6834
+ const finished = versionId !== null && outcome?.retirementsFinished === true ? versionId : null;
6835
+ // #2184: and the binding shapes it reported bound, paired with this receipt's version.
6729
6836
  this.directory
6730
- .prepare('UPDATE scopes SET provisioned_version_id = ? WHERE scope_id = ?')
6731
- .run(versionId, scopeId);
6732
- this.recordAdmin(actor, 'markScopeProvisioned', { tenantId, scopeId }, null, { versionId });
6837
+ .prepare('UPDATE scopes SET provisioned_version_id = ?, retirements_finished_version_id = ?, bound_shapes = ? WHERE scope_id = ?')
6838
+ .run(versionId, finished, boundShapesColumn(versionId, outcome?.boundShapes), scopeId);
6839
+ this.recordAdmin(actor, 'markScopeProvisioned', { tenantId, scopeId }, null, {
6840
+ versionId,
6841
+ ...(finished ? { retirementsFinished: true } : {}),
6842
+ ...(versionId !== null && outcome?.boundShapes ? { boundShapes: outcome.boundShapes } : {}),
6843
+ });
6733
6844
  },
6734
6845
  verticalServing: async (actor, verticalSlug) => {
6735
6846
  const r = this.directory
@@ -6754,6 +6865,8 @@ export class SqliteScopeHost {
6754
6865
  .get(verticalSlug);
6755
6866
  if (!r)
6756
6867
  throw substratError('not_found', `unknown vertical '${verticalSlug}'`);
6868
+ // #2178: every install on the serving script runs the new version from this moment.
6869
+ this.assertNoStrandFrom([r.serving_version_id], parsed.versionId, r.serving_ref ? this.provisionedVersionsOf(verticalSlug, r.serving_version_id ? { ref: r.serving_ref, versionId: r.serving_version_id } : null, null) : []);
6757
6870
  this.directory
6758
6871
  .prepare(`UPDATE verticals SET serving_ref = ?, serving_version_id = ?,
6759
6872
  serving_do_classes = ?, serving_migration_tag = ? WHERE slug = ?`)
@@ -6787,6 +6900,8 @@ export class SqliteScopeHost {
6787
6900
  // #1756: onto (or off) a serving script, the scope runs other code before its pointer
6788
6901
  // moves. Judged here, so no caller that routes first and binds second passes unasked.
6789
6902
  const bound = scope.vertical_version_id ? readVersion(scope.vertical_version_id) : undefined;
6903
+ if (bound)
6904
+ this.assertBindingShapesKept(mapScope(scope), bound.id, servingRef);
6790
6905
  if (!ack.exportBreak && bound) {
6791
6906
  const breaks = await this.bindBreaks(actor, mapScope(scope), bound, servingRef);
6792
6907
  if (breaks.length > 0)
@@ -9078,6 +9193,11 @@ export class SqliteScopeHost {
9078
9193
  // #1172: which version this scope's provision hook last ran against. Null on every
9079
9194
  // existing row, which reads as "unknown, reconcile once" rather than "up to date".
9080
9195
  this.ensureColumn(this.directory, 'scopes', 'provisioned_version_id', 'provisioned_version_id TEXT');
9196
+ // #2185: the version whose reconcile finished its retirements here. Null on every existing
9197
+ // row, which reads as "not finished": the sweep reconciles each such install once more.
9198
+ this.ensureColumn(this.directory, 'scopes', 'retirements_finished_version_id', 'retirements_finished_version_id TEXT');
9199
+ // #2184: null on every existing row, which reads as unknown (the sweep reconciles it once more).
9200
+ this.ensureColumn(this.directory, 'scopes', 'bound_shapes', 'bound_shapes TEXT');
9081
9201
  this.ensureColumn(this.directory, 'scopes', 'erasure_epoch', 'erasure_epoch INTEGER');
9082
9202
  this.ensureColumn(this.directory, 'scopes', 'reap_claimed_at', 'reap_claimed_at TEXT');
9083
9203
  // §4.8's grace-window timestamp on tenants (mirrors scopes' archived_at).
@@ -9936,6 +10056,8 @@ export class SqliteScopeHost {
9936
10056
  // #1686: NULL on every row already there — none is a principal-minted become.
9937
10057
  this.ensureColumn(db, '_substrat_capabilities', 'target_digest', 'target_digest TEXT');
9938
10058
  this.ensureColumn(db, '_substrat_capabilities', 'revoked_reason', 'revoked_reason TEXT');
10059
+ // #1686: NULL on every row already there — none carries an action.
10060
+ this.ensureColumn(db, '_substrat_capabilities', 'action', 'action TEXT');
9939
10061
  db.exec(GRANT_CHILDREN_INDEX_DDL);
9940
10062
  // Executor retry state (#100), same reasoning: scopes provisioned before it
9941
10063
  // already have the table. Defaults read as "terminal", which is exactly right