@substrat-run/kernel 0.118.0 → 0.119.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/capability.d.ts +22 -1
- package/dist/capability.d.ts.map +1 -1
- package/dist/capability.js +20 -0
- package/dist/capability.js.map +1 -1
- package/dist/connector-calls.d.ts +205 -0
- package/dist/connector-calls.d.ts.map +1 -0
- package/dist/connector-calls.js +192 -0
- package/dist/connector-calls.js.map +1 -0
- package/dist/idempotency.d.ts +7 -1
- package/dist/idempotency.d.ts.map +1 -1
- package/dist/idempotency.js +8 -2
- package/dist/idempotency.js.map +1 -1
- package/dist/index.d.ts +11 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/peer.d.ts +132 -0
- package/dist/peer.d.ts.map +1 -0
- package/dist/peer.js +177 -0
- package/dist/peer.js.map +1 -0
- package/dist/permission-checker.d.ts +1 -1
- package/dist/permission-checker.d.ts.map +1 -1
- package/dist/permission-checker.js +4 -1
- package/dist/permission-checker.js.map +1 -1
- package/dist/platform-sweep.d.ts +116 -1
- package/dist/platform-sweep.d.ts.map +1 -1
- package/dist/platform-sweep.js +209 -0
- package/dist/platform-sweep.js.map +1 -1
- package/dist/scope-host.d.ts +228 -7
- package/dist/scope-host.d.ts.map +1 -1
- package/dist/scope-host.js.map +1 -1
- package/dist/system-switch.d.ts +38 -0
- package/dist/system-switch.d.ts.map +1 -1
- package/dist/system-switch.js +50 -3
- package/dist/system-switch.js.map +1 -1
- package/dist/timeline.d.ts.map +1 -1
- package/dist/timeline.js +30 -3
- package/dist/timeline.js.map +1 -1
- package/dist/vertical-events.d.ts +162 -0
- package/dist/vertical-events.d.ts.map +1 -0
- package/dist/vertical-events.js +348 -0
- package/dist/vertical-events.js.map +1 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export type { AccessLogFilter, AttachmentUploadInput, AuditLogFilter, BlobStoreProvisionInput, BlobStoreRecord, ConsumerHandler, ExecutorDeadLetter, ExecutorDrainReport, ExecutorHandler, ExecutorRetryPolicy, ConnectorConnection, ScopedConnectorConnection, ConnectorContext, ConnectorHandler, ConnectorOptions, ConnectorRequestInit, ConnectorResponse, Clock, FetchLike, GuardPredicate, HostAdmin, MigrateScopeOutcome, MigrationFrontier, ModuleRegistration, ConsumersOf, EventContract, EventPayloadOf, EventTypeOf, TypedConsumerHandler, TypedConsumers, OpenedAttachment, OperationContext, PageParams, OperationHandler, AppliedMigration, OpsFailureFilter, OpsFailureInput, IssueFilter, SweepRunFilter, SweepRunInput, ProvisionScopeInput, RoleFilter, FreshnessRegistration, FreshnessReport, LiveChange, LiveReadSurface, LiveUpgradeRequest, ScheduleRegistration, ScheduleRunReport, ScopeAttachments, ScopedSql, ScopeFilter, ScopeHost, ScopeStub, ScopeStubOptions, InvokeOptions, SqlMigration, SqlValue, TenantBlobStore, TenantRelationalStore, TenantStoreProvisionInput, TenantStoreRecord, } from './scope-host.js';
|
|
1
|
+
export type { AccessLogFilter, AttachmentUploadInput, AuditLogFilter, BlobStoreProvisionInput, BlobStoreRecord, ConsumerHandler, ImportHandler, ExecutorDeadLetter, ExecutorDrainReport, ExecutorHandler, ExecutorRetryPolicy, ConnectorConnection, ScopedConnectorConnection, ConnectorContext, ConnectorHandler, ConnectorOptions, ConnectorRequestInit, ConnectorResponse, Clock, FetchLike, GuardPredicate, HostAdmin, MigrateScopeOutcome, MigrationFrontier, ModuleRegistration, ConsumersOf, EventContract, EventPayloadOf, EventTypeOf, TypedConsumerHandler, TypedConsumers, OpenedAttachment, OperationContext, PageParams, OperationHandler, AppliedMigration, OpsFailureFilter, OpsFailureInput, IssueFilter, SweepRunFilter, SweepRunInput, ProvisionScopeInput, RoleFilter, FreshnessRegistration, FreshnessReport, LiveChange, LiveReadSurface, LiveUpgradeRequest, ScheduleRegistration, ScheduleRunReport, ScopeAttachments, ScopedSql, ScopeFilter, ScopeHost, ScopeStub, ScopeStubOptions, InvokeOptions, SqlMigration, SqlValue, TenantBlobStore, TenantRelationalStore, TenantStoreProvisionInput, TenantStoreRecord, } from './scope-host.js';
|
|
2
|
+
export type { AnalyticsEngineDatasetLike, ConnectionUseOutcome, ConnectionUseTiming, ConnectorCallErrorType, ConnectorCallRecord, ConnectorCallRecorder, CountingConnectorCallRecorder, } from './connector-calls.js';
|
|
3
|
+
export { CONNECTOR_CALL_DATA_POINT_LAYOUT, CONNECTOR_CALL_ERROR_TYPES, analyticsEngineConnectorCallRecorder, connectorCallDataPoint, connectorCallErrorType, connectorCallRecord, noopConnectorCallRecorder, recordConnectorCall, settleConnectionUse, } from './connector-calls.js';
|
|
2
4
|
export { assertRedrainWindow, attachmentBlobKey, consumersFor, entitlementDenial, backoffAt, globalFetch, parseValidationRecords, resolveRetryPolicy, OPS_FAILURE_RETENTION_DAYS, SWEEP_RUN_RETENTION_DAYS, SWEEP_RUNS_INTENT_INDEX, sweepRunsIntentHasKind, ISSUE_RETENTION_DAYS, } from './scope-host.js';
|
|
3
5
|
export { isSecretBoxConfigured, SecretBoxUnconfiguredError, unconfiguredSecretBox, webCryptoSecretBox, } from './secret-box.js';
|
|
4
6
|
export type { SealedSecret, SecretBox } from './secret-box.js';
|
|
@@ -13,7 +15,7 @@ export { actorOf, asPrincipal } from './permission-checker.js';
|
|
|
13
15
|
export type { PermissionChecker } from './permission-checker.js';
|
|
14
16
|
export { createTupleEvaluator } from './permission-eval.js';
|
|
15
17
|
export type { PermissionTupleReader, PermissionTupleRow, ScopeTupleReader, } from './permission-eval.js';
|
|
16
|
-
export { CAPABILITY_COLUMNS, CAPABILITY_DDL, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_SESSION_PRUNE_BATCH, WITHHELD_SECRET, assertNoSecret, capabilityByIdQuery, capabilityExchangeable, capabilityGrantOf, capabilityLive, capabilityRecordOf, capabilityTokenHash, carriesSecret, checkBecomeInput, createCapabilityVerbs, exchangeCapability, guardSecrets, mintBecomeCapability, mintCapabilitySecret, mintCapabilitySessionToken, persistedText, plausibleSessionToken, redactSecrets, resolveCapabilitySession, revokeCapabilityAsPlatform, } from './capability.js';
|
|
18
|
+
export { CAPABILITY_COLUMNS, CAPABILITY_DDL, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_SESSION_PRUNE_BATCH, WITHHELD_SECRET, assertNoSecret, capabilityAttachmentWriteRefused, capabilityByIdQuery, capabilityExchangeable, capabilityGrantOf, capabilityLive, capabilityRecordOf, capabilityTokenHash, carriesSecret, checkBecomeInput, createCapabilityVerbs, exchangeCapability, guardSecrets, mintBecomeCapability, mintCapabilitySecret, mintCapabilitySessionToken, persistedText, plausibleSessionToken, redactSecrets, resolveCapabilitySession, revokeCapabilityAsPlatform, } from './capability.js';
|
|
17
19
|
export type { CapabilityGrantView, CapabilityRow, CapabilityVerbDeps, CapabilityVerbs, } from './capability.js';
|
|
18
20
|
export { createAtomic } from './sub-transaction.js';
|
|
19
21
|
export type { RunSub, AtomicMarks } from './sub-transaction.js';
|
|
@@ -38,8 +40,10 @@ export type { PlatformRequestRawRow } from './platform-request-query.js';
|
|
|
38
40
|
export { CANCELLED_INTENT_NOTE, CANCELLED_JOB_NOTE, DELIVERY_ERROR_REDACTION_SQL, intentPayloadCarriesSubject, JOB_RUN_REDACTION_SQL, JOB_STEP_REDACTION_SQL, PLATFORM_REQUEST_REDACTION_SQL, platformRequestRedactionParams, platformRequestRedactionQuery, REDACTED_DELIVERY_NOTE, REDACTED_INTENT_MARKER, REDACTED_INTENT_NOTE, REDACTED_JOB_NOTE, redactedIntentPayload, redactSubjectJobRuns, } from './subject-redaction.js';
|
|
39
41
|
export type { LegacySubjectRedactionCounts, PlatformRequestRedactionCandidate, RedactionSql, SubjectRedactionCounts, } from './subject-redaction.js';
|
|
40
42
|
export { effectiveRoleGrantQuery, seatScopeTuple } from './scope-tuple-seat.js';
|
|
41
|
-
export { SYSTEM_SWITCH_OFF_PREDICATE, SYSTEM_SWITCH_OFF_RELATION, switchSystemSchedules, systemScheduleState, systemSwitchedOff, systemSwitchedOffMessage, } from './system-switch.js';
|
|
42
|
-
export type { SwitchOutcome, SwitchSql, SystemScheduleState } from './system-switch.js';
|
|
43
|
+
export { SYSTEM_SWITCH_OFF_PREDICATE, SYSTEM_SWITCH_OFF_RELATION, subjectSwitchedOff, switchSubjectGrants, switchSystemSchedules, subjectGrantState, systemGrantsStatus, systemScheduleState, systemSwitchedOff, systemSwitchedOffMessage, } from './system-switch.js';
|
|
44
|
+
export type { SwitchOutcome, SwitchSql, SystemGrantsEntry, SystemScheduleState } from './system-switch.js';
|
|
45
|
+
export { PEER_SUBJECT_PREFIX, admitPeer, collectPeers, peerGrantsStatus, peerSeats, peerSubjectRef, peerSwitchedOff, resolveVerticalInstanceFrom, switchPeer, } from './peer.js';
|
|
46
|
+
export type { PeerDeclaration, PeerDeclarations, PeerGrantsRow, PeerSeat, VerticalInstanceCandidate } from './peer.js';
|
|
43
47
|
export { DENIAL_COLUMNS, DENIAL_WINDOW_QUERY, denialListQuery, denialSummaryQuery, denialTotalsQuery, mapDenialRow, mapDenialBucketRow, mapDenialOperationBucketRow, mapDenialSummaryBuckets, storedActor, type DenialRow, type DenialBucketRow, type DenialOperationBucketRow, type DenialSummaryBuckets, type DenialWindowRow, } from './denial-query.js';
|
|
44
48
|
export { entityVersionQuery, entityVersionOf, assertIfMatch, OUTBOX_ENTITY_INDEX, type EntityVersion, type EntityVersionRow, } from './entity-version.js';
|
|
45
49
|
export { IMPERSONATION_COLUMNS, IMPERSONATION_DDL, ImpersonationRefused, assertImpersonationWrites, assertSessionUsable, impersonationByIdQuery, impersonationListQuery, impersonationRowValues, impersonationStampOf, mapImpersonationRow, newImpersonationSession, type ImpersonationRow, } from './impersonation.js';
|
|
@@ -55,8 +59,8 @@ export type { JobDriveReport, JobHandler, JobPassContext, JobPassOutcome, JobPas
|
|
|
55
59
|
export { isTerminalDispatchFailure, isTerminalProviderError, providerErrorStatus, RETRYABLE_CLIENT_STATUSES, } from './provider-error.js';
|
|
56
60
|
export { runPlatformSweep, startPlatformSweeper, SCHEDULE_STATE_DDL, SCHEDULE_STATE_REBUILD, scheduleStateHasKind, } from './platform-sweep.js';
|
|
57
61
|
export type { AccessLogSink, EventSink, EventDrainReport, EventDrainSkipped, AccessLogSweepReport, ConnectorSweeper, MigrationSweepReport, PlatformSweepOptions, PlatformSweepReport, PlatformSweeperHandle, ScheduleSweepReport, ScheduleStateKind, StartPlatformSweeperOptions, } from './platform-sweep.js';
|
|
58
|
-
export { isPrimaryScope, runningVersionOf, PROVISION_RECONCILE_BATCH, PROVISION_RECONCILE_REPORTED_IDS, } from './platform-sweep.js';
|
|
59
|
-
export type { ProvisionReconcileReport, ServingPointer } from './platform-sweep.js';
|
|
62
|
+
export { isPrimaryScope, runningVersionOf, PROVISION_RECONCILE_BATCH, PROVISION_RECONCILE_REPORTED_IDS, CROSS_VERTICAL_CONSUMERS_PER_PASS, } from './platform-sweep.js';
|
|
63
|
+
export type { CrossVerticalEdge, CrossVerticalOptions, CrossVerticalReach, CrossVerticalReport, ProvisionReconcileReport, ServingPointer, } from './platform-sweep.js';
|
|
60
64
|
export { MIGRATION_FLAG_THRESHOLD, migrationFleet, migrationProgress, migrationSummary, scopeMigrationState, } from './migration-progress.js';
|
|
61
65
|
export type { ScopeMigrationState } from './migration-progress.js';
|
|
62
66
|
export { foldMeterReading } from './meters.js';
|
|
@@ -64,4 +68,5 @@ export { MODEL_USAGE_RETENTION_DAYS, foldModelUsage, type ModelUsageFilter, type
|
|
|
64
68
|
export type { MeterEntitlementInput, MeterInput, MeterScopeInput, MeterTenantInput, } from './meters.js';
|
|
65
69
|
export { invocationLog } from './invocation-log.js';
|
|
66
70
|
export type { InvocationLogLine, InvocationLogContext } from './invocation-log.js';
|
|
71
|
+
export { VERTICAL_EVENTS_DDL, EXPORT_HOPS_SQL, IMPORT_CURSORS_SQL, IMPORT_CURSOR_OF_SQL, IMPORT_CURSOR_ADVANCE_SQL, IMPORT_RECORD_SQL, exportReadQuery, exportReadPlan, exportsOf, planExportBatch, withheldNote, CrossVerticalRegistry, type ExportRow, type RegisteredImport, } from './vertical-events.js';
|
|
67
72
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAw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C;AAC5B,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gCAAgC,EAChC,0BAA0B,EAC1B,oCAAoC,EACpC,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACn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qBAAqB,EACrB,KAAK,SAAS,EACd,KAAK,gBAAgB,GACtB,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { CONNECTOR_CALL_DATA_POINT_LAYOUT, CONNECTOR_CALL_ERROR_TYPES, analyticsEngineConnectorCallRecorder, connectorCallDataPoint, connectorCallErrorType, connectorCallRecord, noopConnectorCallRecorder, recordConnectorCall, settleConnectionUse, } from './connector-calls.js';
|
|
1
2
|
export { assertRedrainWindow, attachmentBlobKey, consumersFor, entitlementDenial, backoffAt, globalFetch, parseValidationRecords, resolveRetryPolicy, OPS_FAILURE_RETENTION_DAYS, SWEEP_RUN_RETENTION_DAYS, SWEEP_RUNS_INTENT_INDEX, sweepRunsIntentHasKind, ISSUE_RETENTION_DAYS, } from './scope-host.js';
|
|
2
3
|
export { isSecretBoxConfigured, SecretBoxUnconfiguredError, unconfiguredSecretBox, webCryptoSecretBox, } from './secret-box.js';
|
|
3
4
|
export { ConnectionSealingKeyUnavailableError, generateSealingKeyPair, noSealingKeyMessage, openSealed, sealTo, SealedKeyUnavailableError, } from './sealed-box.js';
|
|
@@ -6,7 +7,7 @@ export { resolveScopeRecord } from './scope-record.js';
|
|
|
6
7
|
export { assertAllowed, denyAllChecker, PermissionDenied, UNSAFE_allowAllChecker, } from './permission-checker.js';
|
|
7
8
|
export { actorOf, asPrincipal } from './permission-checker.js';
|
|
8
9
|
export { createTupleEvaluator } from './permission-eval.js';
|
|
9
|
-
export { CAPABILITY_COLUMNS, CAPABILITY_DDL, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_SESSION_PRUNE_BATCH, WITHHELD_SECRET, assertNoSecret, capabilityByIdQuery, capabilityExchangeable, capabilityGrantOf, capabilityLive, capabilityRecordOf, capabilityTokenHash, carriesSecret, checkBecomeInput, createCapabilityVerbs, exchangeCapability, guardSecrets, mintBecomeCapability, mintCapabilitySecret, mintCapabilitySessionToken, persistedText, plausibleSessionToken, redactSecrets, resolveCapabilitySession, revokeCapabilityAsPlatform, } from './capability.js';
|
|
10
|
+
export { CAPABILITY_COLUMNS, CAPABILITY_DDL, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_SESSION_PRUNE_BATCH, WITHHELD_SECRET, assertNoSecret, capabilityAttachmentWriteRefused, capabilityByIdQuery, capabilityExchangeable, capabilityGrantOf, capabilityLive, capabilityRecordOf, capabilityTokenHash, carriesSecret, checkBecomeInput, createCapabilityVerbs, exchangeCapability, guardSecrets, mintBecomeCapability, mintCapabilitySecret, mintCapabilitySessionToken, persistedText, plausibleSessionToken, redactSecrets, resolveCapabilitySession, revokeCapabilityAsPlatform, } from './capability.js';
|
|
10
11
|
export { createAtomic } from './sub-transaction.js';
|
|
11
12
|
export { DEFAULT_SEARCH_LIMIT, MAX_SEARCH_LIMIT, MIN_SEARCH_TERM, NotSearchable, SEARCH_INDEX_PREFIX, SearchTermTooShort, isSearchIndexTable, searchIndexDdl, searchIndexMigrations, searchIndexPlans, searchLimit, searchMatchExpression, searchPlansByEntityType, searchQuery, } from './search-index.js';
|
|
12
13
|
export { FilterNotDeclared, LIST_INDEX_PREFIX, NotListable, SortNotDeclared, cursorOf, isListIndexName, listIndexColumns, listIndexDdl, listIndexMigrations, listIndexPlans, listPlansByEntityType, listQuery, splitCursor, } from './list-index.js';
|
|
@@ -22,7 +23,8 @@ export { signConnectState, verifyConnectState, ConnectStateError, CONNECT_STATE_
|
|
|
22
23
|
export { PLATFORM_REQUEST_COLUMNS, platformRequestHistoryQuery, platformRequestOf, UNDECODED_REQUESTER, } from './platform-request-query.js';
|
|
23
24
|
export { CANCELLED_INTENT_NOTE, CANCELLED_JOB_NOTE, DELIVERY_ERROR_REDACTION_SQL, intentPayloadCarriesSubject, JOB_RUN_REDACTION_SQL, JOB_STEP_REDACTION_SQL, PLATFORM_REQUEST_REDACTION_SQL, platformRequestRedactionParams, platformRequestRedactionQuery, REDACTED_DELIVERY_NOTE, REDACTED_INTENT_MARKER, REDACTED_INTENT_NOTE, REDACTED_JOB_NOTE, redactedIntentPayload, redactSubjectJobRuns, } from './subject-redaction.js';
|
|
24
25
|
export { effectiveRoleGrantQuery, seatScopeTuple } from './scope-tuple-seat.js';
|
|
25
|
-
export { SYSTEM_SWITCH_OFF_PREDICATE, SYSTEM_SWITCH_OFF_RELATION, switchSystemSchedules, systemScheduleState, systemSwitchedOff, systemSwitchedOffMessage, } from './system-switch.js';
|
|
26
|
+
export { SYSTEM_SWITCH_OFF_PREDICATE, SYSTEM_SWITCH_OFF_RELATION, subjectSwitchedOff, switchSubjectGrants, switchSystemSchedules, subjectGrantState, systemGrantsStatus, systemScheduleState, systemSwitchedOff, systemSwitchedOffMessage, } from './system-switch.js';
|
|
27
|
+
export { PEER_SUBJECT_PREFIX, admitPeer, collectPeers, peerGrantsStatus, peerSeats, peerSubjectRef, peerSwitchedOff, resolveVerticalInstanceFrom, switchPeer, } from './peer.js';
|
|
26
28
|
export { DENIAL_COLUMNS, DENIAL_WINDOW_QUERY, denialListQuery, denialSummaryQuery, denialTotalsQuery, mapDenialRow, mapDenialBucketRow, mapDenialOperationBucketRow, mapDenialSummaryBuckets, storedActor, } from './denial-query.js';
|
|
27
29
|
export { entityVersionQuery, entityVersionOf, assertIfMatch, OUTBOX_ENTITY_INDEX, } from './entity-version.js';
|
|
28
30
|
export { IMPERSONATION_COLUMNS, IMPERSONATION_DDL, ImpersonationRefused, assertImpersonationWrites, assertSessionUsable, impersonationByIdQuery, impersonationListQuery, impersonationRowValues, impersonationStampOf, mapImpersonationRow, newImpersonationSession, } from './impersonation.js';
|
|
@@ -36,9 +38,10 @@ export { isTerminalDispatchFailure, isTerminalProviderError, providerErrorStatus
|
|
|
36
38
|
export { runPlatformSweep, startPlatformSweeper, SCHEDULE_STATE_DDL, SCHEDULE_STATE_REBUILD, scheduleStateHasKind, } from './platform-sweep.js';
|
|
37
39
|
// #1653: which scopes are the real install, and which version runs on them — shared so
|
|
38
40
|
// every receipt writer and the sweep answer both questions the same way.
|
|
39
|
-
export { isPrimaryScope, runningVersionOf, PROVISION_RECONCILE_BATCH, PROVISION_RECONCILE_REPORTED_IDS, } from './platform-sweep.js';
|
|
41
|
+
export { isPrimaryScope, runningVersionOf, PROVISION_RECONCILE_BATCH, PROVISION_RECONCILE_REPORTED_IDS, CROSS_VERTICAL_CONSUMERS_PER_PASS, } from './platform-sweep.js';
|
|
40
42
|
export { MIGRATION_FLAG_THRESHOLD, migrationFleet, migrationProgress, migrationSummary, scopeMigrationState, } from './migration-progress.js';
|
|
41
43
|
export { foldMeterReading } from './meters.js';
|
|
42
44
|
export { MODEL_USAGE_RETENTION_DAYS, foldModelUsage, } from './model-usage.js';
|
|
43
45
|
export { invocationLog } from './invocation-log.js';
|
|
46
|
+
export { VERTICAL_EVENTS_DDL, EXPORT_HOPS_SQL, IMPORT_CURSORS_SQL, IMPORT_CURSOR_OF_SQL, IMPORT_CURSOR_ADVANCE_SQL, IMPORT_RECORD_SQL, exportReadQuery, exportReadPlan, exportsOf, planExportBatch, withheldNote, CrossVerticalRegistry, } from './vertical-events.js';
|
|
44
47
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA0EA,OAAO,EACL,gCAAgC,EAChC,0BAA0B,EAC1B,oCAAoC,EACpC,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACt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0B,EAC1B,kBAAkB,EAClB,0BAA0B,EAC1B,SAAS,GAGV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,eAAe,EACf,QAAQ,EACR,aAAa,EACb,UAAU,EACV,WAAW,GACZ,MAAM,cAAc,CAAC;AAiBtB,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAgB7B,uFAAuF;AACvF,yEAAyE;AACzE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,0BAA0B,EAC1B,cAAc,GAIf,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,SAAS,EACT,eAAe,EACf,YAAY,EACZ,qBAAqB,GAGtB,MAAM,sBAAsB,CAAC"}
|
package/dist/peer.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Peers (#1706) — the kernel's half of one vertical calling another's operations, written once
|
|
3
|
+
* so both adapters (and the platform's resolver) cannot disagree about any of it.
|
|
4
|
+
*
|
|
5
|
+
* What lives here, and why each is one function:
|
|
6
|
+
*
|
|
7
|
+
* - **`collectPeers`** — the union of every registered module's `peers` declaration. A vertical
|
|
8
|
+
* is several modules on one host; the door reads them as one declaration per peer vertical.
|
|
9
|
+
* - **`peerSeats`** — the `vertical:<slug>` grants provisioning seats on a scope. The ONE place
|
|
10
|
+
* that decides "a declared peer holds its keys once installed" (decision F2 on #1706): if that
|
|
11
|
+
* decision flips to "a tenant admin enables each edge", this call moves from provisioning to
|
|
12
|
+
* the enabling verb and nothing else changes.
|
|
13
|
+
* - **`admitPeer`** — the door's admission, run inside the scope's own serialized task on every
|
|
14
|
+
* call: the peer is declared, its kill switch is on, and the operation is on its allowlist.
|
|
15
|
+
* None of those refusals is a K-35 denial (no key was checked), exactly as the capability
|
|
16
|
+
* door's are. `operation: null` admits a DELIVERY rather than an invocation (#1705's
|
|
17
|
+
* cross-vertical events) — the same declaration and the same switch, and no allowlist, since
|
|
18
|
+
* a delivery names no operation.
|
|
19
|
+
* - **`switchPeer`** — the per-(scope, peer) kill switch, which is #1666's switch applied to a
|
|
20
|
+
* `vertical:` subject (`switchSubjectGrants`): OFF tombstones every grant the peer holds on the
|
|
21
|
+
* scope and makes an OFF marker live. The checker reads only live `granted:`/`role:` tuples,
|
|
22
|
+
* so a switched-off peer holds nothing to ANY check — `covers` included — without the checker
|
|
23
|
+
* knowing the marker exists; and `seatScopeTuple` seats nothing for a subject whose marker is
|
|
24
|
+
* live, so no re-provision can hand the grants back. `restoreToPeer` is the only way back.
|
|
25
|
+
* - **`peerGrantsStatus`** — the read half of that switch: every peer this scope holds or has
|
|
26
|
+
* held grants for, and where each stands. The SAME predicate `admitPeer` gates on, so the
|
|
27
|
+
* status a tenant reads and the answer a call gets cannot disagree.
|
|
28
|
+
* - **`resolveVerticalInstanceFrom`** — "the instance of vertical Y in tenant T": one rule for
|
|
29
|
+
* every directory that is asked.
|
|
30
|
+
*
|
|
31
|
+
* What is deliberately NOT here: who is calling. The door is handed a `VerticalCaller` by the
|
|
32
|
+
* platform (the router on the hosted path, the local broker on the pure host), and trusts it the
|
|
33
|
+
* way `getConnectorScope` trusts the connection id the control plane hands it. The door's own
|
|
34
|
+
* guarantees are the ones above; the caller's liveness and tenancy are the platform's gate.
|
|
35
|
+
*/
|
|
36
|
+
import { type CheckSubject, type PeerSpec, type Scope, type TenantId, type VerticalCaller, type VerticalResolution } from '@substrat-run/contracts';
|
|
37
|
+
import { type SwitchOutcome, type SwitchSql } from './system-switch.js';
|
|
38
|
+
/** The tuple-subject prefix of a peer vertical — `vertical:acme/board-room`. */
|
|
39
|
+
export declare const PEER_SUBJECT_PREFIX = "vertical:";
|
|
40
|
+
/** The tuple subject a peer's grants are seated under. The slug only, never the instance. */
|
|
41
|
+
export declare const peerSubjectRef: (vertical: string) => string;
|
|
42
|
+
/** One peer vertical as every registered module declares it, together. */
|
|
43
|
+
export interface PeerDeclaration {
|
|
44
|
+
readonly vertical: string;
|
|
45
|
+
/** The door's allowlist. Empty for a receive-only peer. */
|
|
46
|
+
readonly operations: ReadonlySet<string>;
|
|
47
|
+
/** What `vertical:<slug>` is seated with at provisioning. */
|
|
48
|
+
readonly permissions: ReadonlySet<string>;
|
|
49
|
+
}
|
|
50
|
+
export type PeerDeclarations = ReadonlyMap<string, PeerDeclaration>;
|
|
51
|
+
/**
|
|
52
|
+
* The union of every module's `peers` declaration, keyed by peer slug. Two modules naming one
|
|
53
|
+
* peer contribute both of their allowlists and both of their key sets: each module speaks for
|
|
54
|
+
* its own operations, and a reviewer reads each entry in its own module's permission section.
|
|
55
|
+
*/
|
|
56
|
+
export declare function collectPeers(manifests: Iterable<{
|
|
57
|
+
peers?: readonly PeerSpec[];
|
|
58
|
+
}>): Map<string, PeerDeclaration>;
|
|
59
|
+
/** One grant provisioning seats — handed to `seatScopeTuple` by each adapter. */
|
|
60
|
+
export interface PeerSeat {
|
|
61
|
+
readonly subject: string;
|
|
62
|
+
readonly relation: string;
|
|
63
|
+
readonly object: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The grants a scope holds for its declared peers: `vertical:<slug>` / `granted:<perm>` /
|
|
67
|
+
* `scope:<id>`, one per declared key, in a stable order. Seated with `seatScopeTuple` — so a
|
|
68
|
+
* grant an operator's switch tombstoned stays tombstoned (#1659), and a peer whose switch is off
|
|
69
|
+
* gets nothing seated at all.
|
|
70
|
+
*/
|
|
71
|
+
export declare function peerSeats(peers: PeerDeclarations, scopeId: string): PeerSeat[];
|
|
72
|
+
/**
|
|
73
|
+
* The door's admission (#1706), run inside the scope's own serialized task on every call, so a
|
|
74
|
+
* switch pulled between two calls refuses the second. Throws `forbidden` — a door refusal, never
|
|
75
|
+
* a K-35 denial: no permission was checked, exactly as for a capability's allowlist. Returns the
|
|
76
|
+
* check subject the operation then runs as, with every ordinary `ctx.check` inside it.
|
|
77
|
+
*
|
|
78
|
+
* `operation: null` is a delivery (#1705), which names no operation and so meets no allowlist.
|
|
79
|
+
*/
|
|
80
|
+
export declare function admitPeer(db: SwitchSql, peers: PeerDeclarations, caller: VerticalCaller, operation: string | null): CheckSubject;
|
|
81
|
+
/**
|
|
82
|
+
* Move one peer's kill switch on one scope. Idempotent, and `held: false` with nothing written
|
|
83
|
+
* when the scope holds neither a grant nor a marker for that peer — a typo'd slug, or a peer this
|
|
84
|
+
* scope was never provisioned with, must not write a marker that silently blocks it the day a
|
|
85
|
+
* version declaring it lands. Run inside one transaction.
|
|
86
|
+
*/
|
|
87
|
+
export declare function switchPeer(db: SwitchSql, input: {
|
|
88
|
+
vertical: string;
|
|
89
|
+
scopeId: string;
|
|
90
|
+
to: 'on' | 'off';
|
|
91
|
+
at: string;
|
|
92
|
+
}): SwitchOutcome;
|
|
93
|
+
/** Is this peer switched off on the scope `db` is? */
|
|
94
|
+
export declare function peerSwitchedOff(db: SwitchSql, vertical: string): boolean;
|
|
95
|
+
/** One peer's position on one scope, as `peerGrantsStatus` enumerates them. */
|
|
96
|
+
export interface PeerGrantsRow {
|
|
97
|
+
vertical: string;
|
|
98
|
+
calls: 'on' | 'off' | 'ungranted';
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Every peer this scope holds or has held grants for, and where each stands (#1706) — the
|
|
102
|
+
* read half of the kill switch, and `systemGrantsStatus`'s shape with the subject swapped.
|
|
103
|
+
*
|
|
104
|
+
* One SELECT enumerating the `vertical:<slug>` subjects this scope's storage has a `granted:`
|
|
105
|
+
* tuple or an OFF marker for — revoked rows included, deliberately: a peer whose grants were
|
|
106
|
+
* tombstoned must keep appearing, as `ungranted`, rather than vanishing from the view that
|
|
107
|
+
* exists to say where it stands. A peer the scope never had any row for is absent, which is
|
|
108
|
+
* the honest answer to "what does this scope know about peers" — "not installed here" is a
|
|
109
|
+
* fact the DIRECTORY holds, not this storage, and the surfaces above join the two.
|
|
110
|
+
*
|
|
111
|
+
* Then `subjectGrantState` per subject: the SAME predicate `admitPeer` refuses on, so the
|
|
112
|
+
* status a tenant reads and the answer the next call gets cannot disagree.
|
|
113
|
+
*
|
|
114
|
+
* `substr` rather than `LIKE`, as everywhere on this table: `LIKE` is case-insensitive in
|
|
115
|
+
* SQLite and a Durable Object caps its patterns (#1655).
|
|
116
|
+
*/
|
|
117
|
+
export declare function peerGrantsStatus(db: SwitchSql, now: string): PeerGrantsRow[];
|
|
118
|
+
/** A directory row, as much of it as the resolution reads. */
|
|
119
|
+
export type VerticalInstanceCandidate = Pick<Scope, 'id' | 'tenantId' | 'vertical' | 'status' | 'kind' | 'forkedFrom'>;
|
|
120
|
+
/**
|
|
121
|
+
* "The instance of vertical Y in tenant T" (#1706) — the one rule every directory applies.
|
|
122
|
+
*
|
|
123
|
+
* A candidate is a scope of THAT tenant, bound to THAT vertical, primary (`isPrimaryScope`: not a
|
|
124
|
+
* fork, not a preview — a preview must never receive another app's production calls), and
|
|
125
|
+
* `active` (a suspended or archived instance answers nothing). Exactly one → `resolved`; none →
|
|
126
|
+
* `not-installed`; more than one → `ambiguous`, refused rather than guessed.
|
|
127
|
+
*
|
|
128
|
+
* The tenant is a parameter, and it is the ONLY tenant searched: nothing in a caller's request
|
|
129
|
+
* names a tenant, so a cross-tenant answer is not reachable from here.
|
|
130
|
+
*/
|
|
131
|
+
export declare function resolveVerticalInstanceFrom(scopes: Iterable<VerticalInstanceCandidate>, tenantId: TenantId, vertical: string): VerticalResolution;
|
|
132
|
+
//# sourceMappingURL=peer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../src/peer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAE5B,gFAAgF;AAChF,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAE/C,6FAA6F;AAC7F,eAAO,MAAM,cAAc,aAAc,MAAM,KAAG,MAA6C,CAAC;AAEhG,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,2DAA2D;IAC3D,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzC,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC3C;AACD,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAEpE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC;IAAE,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAA;CAAE,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G,YAAY,CAAC,CAAC;AAEvH;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,QAAQ,CAAC,yBAAyB,CAAC,EAC3C,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,GACf,kBAAkB,CAapB"}
|
package/dist/peer.js
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Peers (#1706) — the kernel's half of one vertical calling another's operations, written once
|
|
3
|
+
* so both adapters (and the platform's resolver) cannot disagree about any of it.
|
|
4
|
+
*
|
|
5
|
+
* What lives here, and why each is one function:
|
|
6
|
+
*
|
|
7
|
+
* - **`collectPeers`** — the union of every registered module's `peers` declaration. A vertical
|
|
8
|
+
* is several modules on one host; the door reads them as one declaration per peer vertical.
|
|
9
|
+
* - **`peerSeats`** — the `vertical:<slug>` grants provisioning seats on a scope. The ONE place
|
|
10
|
+
* that decides "a declared peer holds its keys once installed" (decision F2 on #1706): if that
|
|
11
|
+
* decision flips to "a tenant admin enables each edge", this call moves from provisioning to
|
|
12
|
+
* the enabling verb and nothing else changes.
|
|
13
|
+
* - **`admitPeer`** — the door's admission, run inside the scope's own serialized task on every
|
|
14
|
+
* call: the peer is declared, its kill switch is on, and the operation is on its allowlist.
|
|
15
|
+
* None of those refusals is a K-35 denial (no key was checked), exactly as the capability
|
|
16
|
+
* door's are. `operation: null` admits a DELIVERY rather than an invocation (#1705's
|
|
17
|
+
* cross-vertical events) — the same declaration and the same switch, and no allowlist, since
|
|
18
|
+
* a delivery names no operation.
|
|
19
|
+
* - **`switchPeer`** — the per-(scope, peer) kill switch, which is #1666's switch applied to a
|
|
20
|
+
* `vertical:` subject (`switchSubjectGrants`): OFF tombstones every grant the peer holds on the
|
|
21
|
+
* scope and makes an OFF marker live. The checker reads only live `granted:`/`role:` tuples,
|
|
22
|
+
* so a switched-off peer holds nothing to ANY check — `covers` included — without the checker
|
|
23
|
+
* knowing the marker exists; and `seatScopeTuple` seats nothing for a subject whose marker is
|
|
24
|
+
* live, so no re-provision can hand the grants back. `restoreToPeer` is the only way back.
|
|
25
|
+
* - **`peerGrantsStatus`** — the read half of that switch: every peer this scope holds or has
|
|
26
|
+
* held grants for, and where each stands. The SAME predicate `admitPeer` gates on, so the
|
|
27
|
+
* status a tenant reads and the answer a call gets cannot disagree.
|
|
28
|
+
* - **`resolveVerticalInstanceFrom`** — "the instance of vertical Y in tenant T": one rule for
|
|
29
|
+
* every directory that is asked.
|
|
30
|
+
*
|
|
31
|
+
* What is deliberately NOT here: who is calling. The door is handed a `VerticalCaller` by the
|
|
32
|
+
* platform (the router on the hosted path, the local broker on the pure host), and trusts it the
|
|
33
|
+
* way `getConnectorScope` trusts the connection id the control plane hands it. The door's own
|
|
34
|
+
* guarantees are the ones above; the caller's liveness and tenancy are the platform's gate.
|
|
35
|
+
*/
|
|
36
|
+
import { substratError, } from '@substrat-run/contracts';
|
|
37
|
+
import { isPrimaryScope } from './platform-sweep.js';
|
|
38
|
+
import { SYSTEM_SWITCH_OFF_RELATION, subjectGrantState, subjectSwitchedOff, switchSubjectGrants, } from './system-switch.js';
|
|
39
|
+
/** The tuple-subject prefix of a peer vertical — `vertical:acme/board-room`. */
|
|
40
|
+
export const PEER_SUBJECT_PREFIX = 'vertical:';
|
|
41
|
+
/** The tuple subject a peer's grants are seated under. The slug only, never the instance. */
|
|
42
|
+
export const peerSubjectRef = (vertical) => `${PEER_SUBJECT_PREFIX}${vertical}`;
|
|
43
|
+
/**
|
|
44
|
+
* The union of every module's `peers` declaration, keyed by peer slug. Two modules naming one
|
|
45
|
+
* peer contribute both of their allowlists and both of their key sets: each module speaks for
|
|
46
|
+
* its own operations, and a reviewer reads each entry in its own module's permission section.
|
|
47
|
+
*/
|
|
48
|
+
export function collectPeers(manifests) {
|
|
49
|
+
const out = new Map();
|
|
50
|
+
for (const manifest of manifests) {
|
|
51
|
+
for (const peer of manifest.peers ?? []) {
|
|
52
|
+
const entry = out.get(peer.vertical) ?? {
|
|
53
|
+
vertical: peer.vertical,
|
|
54
|
+
operations: new Set(),
|
|
55
|
+
permissions: new Set(),
|
|
56
|
+
};
|
|
57
|
+
for (const op of peer.operations)
|
|
58
|
+
entry.operations.add(op);
|
|
59
|
+
for (const p of peer.permissions)
|
|
60
|
+
entry.permissions.add(p);
|
|
61
|
+
out.set(peer.vertical, entry);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The grants a scope holds for its declared peers: `vertical:<slug>` / `granted:<perm>` /
|
|
68
|
+
* `scope:<id>`, one per declared key, in a stable order. Seated with `seatScopeTuple` — so a
|
|
69
|
+
* grant an operator's switch tombstoned stays tombstoned (#1659), and a peer whose switch is off
|
|
70
|
+
* gets nothing seated at all.
|
|
71
|
+
*/
|
|
72
|
+
export function peerSeats(peers, scopeId) {
|
|
73
|
+
const out = [];
|
|
74
|
+
for (const peer of [...peers.values()].sort((a, b) => a.vertical.localeCompare(b.vertical))) {
|
|
75
|
+
for (const permission of [...peer.permissions].sort()) {
|
|
76
|
+
out.push({ subject: peerSubjectRef(peer.vertical), relation: `granted:${permission}`, object: `scope:${scopeId}` });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The door's admission (#1706), run inside the scope's own serialized task on every call, so a
|
|
83
|
+
* switch pulled between two calls refuses the second. Throws `forbidden` — a door refusal, never
|
|
84
|
+
* a K-35 denial: no permission was checked, exactly as for a capability's allowlist. Returns the
|
|
85
|
+
* check subject the operation then runs as, with every ordinary `ctx.check` inside it.
|
|
86
|
+
*
|
|
87
|
+
* `operation: null` is a delivery (#1705), which names no operation and so meets no allowlist.
|
|
88
|
+
*/
|
|
89
|
+
export function admitPeer(db, peers, caller, operation) {
|
|
90
|
+
const declared = peers.get(caller.vertical);
|
|
91
|
+
if (!declared) {
|
|
92
|
+
throw substratError('forbidden', `vertical '${caller.vertical}' is not a declared peer of this vertical — a peer is declared in ` +
|
|
93
|
+
`the target's module manifest (\`peers\`), and reviewed in its PERMISSIONS.md`);
|
|
94
|
+
}
|
|
95
|
+
if (subjectSwitchedOff(db, peerSubjectRef(caller.vertical))) {
|
|
96
|
+
throw substratError('forbidden', `vertical '${caller.vertical}' is switched off on this scope — restoreToPeer turns it back on`);
|
|
97
|
+
}
|
|
98
|
+
if (operation !== null && !declared.operations.has(operation)) {
|
|
99
|
+
throw substratError('forbidden', `vertical '${caller.vertical}' may not invoke '${operation}' — it is not among the operations ` +
|
|
100
|
+
`this vertical's \`peers\` declaration allows it`);
|
|
101
|
+
}
|
|
102
|
+
return { kind: 'vertical', id: caller.vertical, scope: caller.scope };
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Move one peer's kill switch on one scope. Idempotent, and `held: false` with nothing written
|
|
106
|
+
* when the scope holds neither a grant nor a marker for that peer — a typo'd slug, or a peer this
|
|
107
|
+
* scope was never provisioned with, must not write a marker that silently blocks it the day a
|
|
108
|
+
* version declaring it lands. Run inside one transaction.
|
|
109
|
+
*/
|
|
110
|
+
export function switchPeer(db, input) {
|
|
111
|
+
return switchSubjectGrants(db, {
|
|
112
|
+
subject: peerSubjectRef(input.vertical),
|
|
113
|
+
scopeId: input.scopeId,
|
|
114
|
+
to: input.to,
|
|
115
|
+
at: input.at,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/** Is this peer switched off on the scope `db` is? */
|
|
119
|
+
export function peerSwitchedOff(db, vertical) {
|
|
120
|
+
return subjectSwitchedOff(db, peerSubjectRef(vertical));
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Every peer this scope holds or has held grants for, and where each stands (#1706) — the
|
|
124
|
+
* read half of the kill switch, and `systemGrantsStatus`'s shape with the subject swapped.
|
|
125
|
+
*
|
|
126
|
+
* One SELECT enumerating the `vertical:<slug>` subjects this scope's storage has a `granted:`
|
|
127
|
+
* tuple or an OFF marker for — revoked rows included, deliberately: a peer whose grants were
|
|
128
|
+
* tombstoned must keep appearing, as `ungranted`, rather than vanishing from the view that
|
|
129
|
+
* exists to say where it stands. A peer the scope never had any row for is absent, which is
|
|
130
|
+
* the honest answer to "what does this scope know about peers" — "not installed here" is a
|
|
131
|
+
* fact the DIRECTORY holds, not this storage, and the surfaces above join the two.
|
|
132
|
+
*
|
|
133
|
+
* Then `subjectGrantState` per subject: the SAME predicate `admitPeer` refuses on, so the
|
|
134
|
+
* status a tenant reads and the answer the next call gets cannot disagree.
|
|
135
|
+
*
|
|
136
|
+
* `substr` rather than `LIKE`, as everywhere on this table: `LIKE` is case-insensitive in
|
|
137
|
+
* SQLite and a Durable Object caps its patterns (#1655).
|
|
138
|
+
*/
|
|
139
|
+
export function peerGrantsStatus(db, now) {
|
|
140
|
+
const rows = db.all(`SELECT DISTINCT subject FROM _substrat_tuples
|
|
141
|
+
WHERE substr(subject, 1, ${PEER_SUBJECT_PREFIX.length}) = '${PEER_SUBJECT_PREFIX}'
|
|
142
|
+
AND (substr(relation, 1, 8) = 'granted:' OR relation = '${SYSTEM_SWITCH_OFF_RELATION}')
|
|
143
|
+
ORDER BY subject`);
|
|
144
|
+
return rows.map((row) => {
|
|
145
|
+
const vertical = row.subject.slice(PEER_SUBJECT_PREFIX.length);
|
|
146
|
+
return { vertical, calls: subjectGrantState(db, row.subject, now) };
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* "The instance of vertical Y in tenant T" (#1706) — the one rule every directory applies.
|
|
151
|
+
*
|
|
152
|
+
* A candidate is a scope of THAT tenant, bound to THAT vertical, primary (`isPrimaryScope`: not a
|
|
153
|
+
* fork, not a preview — a preview must never receive another app's production calls), and
|
|
154
|
+
* `active` (a suspended or archived instance answers nothing). Exactly one → `resolved`; none →
|
|
155
|
+
* `not-installed`; more than one → `ambiguous`, refused rather than guessed.
|
|
156
|
+
*
|
|
157
|
+
* The tenant is a parameter, and it is the ONLY tenant searched: nothing in a caller's request
|
|
158
|
+
* names a tenant, so a cross-tenant answer is not reachable from here.
|
|
159
|
+
*/
|
|
160
|
+
export function resolveVerticalInstanceFrom(scopes, tenantId, vertical) {
|
|
161
|
+
const matches = [];
|
|
162
|
+
for (const scope of scopes) {
|
|
163
|
+
if (scope.tenantId !== tenantId || scope.vertical !== vertical)
|
|
164
|
+
continue;
|
|
165
|
+
if (scope.status !== 'active' || !isPrimaryScope(scope))
|
|
166
|
+
continue;
|
|
167
|
+
matches.push(scope);
|
|
168
|
+
}
|
|
169
|
+
const [only] = matches;
|
|
170
|
+
if (only && matches.length === 1) {
|
|
171
|
+
return { outcome: 'resolved', instance: { tenantId: only.tenantId, scopeId: only.id, vertical } };
|
|
172
|
+
}
|
|
173
|
+
if (matches.length === 0)
|
|
174
|
+
return { outcome: 'not-installed', tenantId, vertical };
|
|
175
|
+
return { outcome: 'ambiguous', tenantId, vertical, count: matches.length };
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=peer.js.map
|
package/dist/peer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peer.js","sourceRoot":"","sources":["../src/peer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,aAAa,GAOd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GAGpB,MAAM,oBAAoB,CAAC;AAE5B,gFAAgF;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAE/C,6FAA6F;AAC7F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,GAAG,mBAAmB,GAAG,QAAQ,EAAE,CAAC;AAYhG;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,SAAoD;IAC/E,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,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC;IACpG,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAClF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -50,7 +50,7 @@ export declare const asPrincipal: (id: PrincipalId) => CheckSubject;
|
|
|
50
50
|
* The spine ACTOR a check subject is recorded as — on an event, a denial, a platform
|
|
51
51
|
* intent. One mapping, so the four places that record "who" cannot disagree about it: a
|
|
52
52
|
* principal is its bare id, and every subject that is not a person is the object form that
|
|
53
|
-
* says what it is instead (#97, #383, #1672).
|
|
53
|
+
* says what it is instead (#97, #383, #1672, #1706).
|
|
54
54
|
*/
|
|
55
55
|
export declare const actorOf: (subject: CheckSubject) => Actor;
|
|
56
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-checker.d.ts","sourceRoot":"","sources":["../src/permission-checker.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,KAAK,CACH,OAAO,EAAE,YAAY,EACrB,UAAU,EAAE,aAAa,EACzB,IAAI,EAAE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,aAAa;IACjD,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IACrB,YAAY,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,UAAU,EAAE,aAAa,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,EAS9E;CACF;AAED,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAC5E,QAAQ,EACR;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAClB,CAOA;AAED,4FAA4F;AAC5F,eAAO,MAAM,cAAc,EAAE,iBAa5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,iBAgBpC,CAAC"}
|
|
@@ -5,7 +5,7 @@ export const asPrincipal = (id) => ({ kind: 'principal', id });
|
|
|
5
5
|
* The spine ACTOR a check subject is recorded as — on an event, a denial, a platform
|
|
6
6
|
* intent. One mapping, so the four places that record "who" cannot disagree about it: a
|
|
7
7
|
* principal is its bare id, and every subject that is not a person is the object form that
|
|
8
|
-
* says what it is instead (#97, #383, #1672).
|
|
8
|
+
* says what it is instead (#97, #383, #1672, #1706).
|
|
9
9
|
*/
|
|
10
10
|
export const actorOf = (subject) => {
|
|
11
11
|
switch (subject.kind) {
|
|
@@ -17,6 +17,9 @@ export const actorOf = (subject) => {
|
|
|
17
17
|
return { connection: subject.id };
|
|
18
18
|
case 'capability':
|
|
19
19
|
return { capability: subject.id };
|
|
20
|
+
case 'vertical':
|
|
21
|
+
// #1706: the caller's slug AND the instance that called — see `verticalActor`.
|
|
22
|
+
return { vertical: subject.id, scope: subject.scope };
|
|
20
23
|
}
|
|
21
24
|
};
|
|
22
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-checker.js","sourceRoot":"","sources":["../src/permission-checker.ts"],"names":[],"mappings":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