@substrat-run/vertical-host 0.134.0 → 0.136.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,4 +1,4 @@
1
- import { PLATFORM_SECRET_HEADER } from '@substrat-run/kernel';
1
+ import { PLATFORM_SECRET_HEADER } from '@substrat-run/contracts';
2
2
  /** The relay refused, or could not be reached. Carries the status so a caller can map it. */
3
3
  export class ConnectUrlRequestError extends Error {
4
4
  status;
@@ -1 +1 @@
1
- {"version":3,"file":"connect-url.js","sourceRoot":"","sources":["../src/connect-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAiF9D,6FAA6F;AAC7F,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAGpC,MAAM;IAFjB,YACE,OAAe,EACN,MAAc;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;sBAFN,MAAM;QAGf,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAA0B;IAChE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzE,MAAM,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACzD,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,IAAI,mCAAmC,EAAE;QACtE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC,cAAc;SACjD;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,QAAQ,EAAE,OAAO,CAAC,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zB,MAAM,IAAI,sBAAsB,CAC9B,mCAAmC,OAAO,CAAC,QAAQ,mBAAmB,GAAG,CAAC,MAAM,MAAM,IAAI,CAAC,KAAK,IAAI,eAAe,EAAE,EACrH,GAAG,CAAC,MAAM,CACX,CAAC;IACJ,CAAC;IACD,OAAO,IAA6B,CAAC;AACvC,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { OutputFieldsReport } from '@substrat-run/kernel';
1
+ import type { OutputFieldsReport } from './invocation-log.js';
2
2
  /** How a response is walked: the names to ask about, and whether its first entry answers. */
3
3
  export interface OutputWalk {
4
4
  readonly fields: readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"field-coverage.d.ts","sourceRoot":"","sources":["../src/field-coverage.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,6FAA6F;AAC7F,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CA2BpF;AAQD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,kBAAkB,GAAG,SAAS,CA+CrG"}
1
+ {"version":3,"file":"field-coverage.d.ts","sourceRoot":"","sources":["../src/field-coverage.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,6FAA6F;AAC7F,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CA2BpF;AAQD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,kBAAkB,GAAG,SAAS,CA+CrG"}
package/dist/index.d.ts CHANGED
@@ -23,8 +23,8 @@
23
23
  * adapter satisfies the same interface.
24
24
  */
25
25
  import type { Hono } from 'hono';
26
- import { type InvokeOptions, type AppliedMigration, type SwitchedOff, type UndrainedEvents } from '@substrat-run/kernel';
27
- import { z, ownerSeat, ownerTransferRecord, ownerTransferAbandon, type DenialFilter, type DenialSummary, type PermissionDenial, readScopeTableInput, type EntityHistoryInput, type EventFacetInput, type EventCauseInput, type EventEffectsInput, type EffectsTree, type InvocationEventsInput, type InvocationEvents, type DeadLettersInput, type DeadLetter, type LifecycleFlowInput, type LifecycleFlowResult, type CauseChain, type EventFacetResult, type HistoryEntry, type Page, type ScopeId, type TenantId, type PrincipalId, type ConnectionId, type PermissionKey, type EntityRef, type Visibility, type RoleDefinition, type ScopeDumpTable, type ScopeTable, type ScopeQueryResult, type EntitlementGrant, type ProjectedConnectionGrant, type ProjectedConnectionKey, type ProjectedIdentityLink, type OwnerClaimLink, type PlatformRequest, type PlatformRequestFilter, type PlatformRequestId, type PlatformRequestStatus, type PlatformRequestFailure, type ModuleId, type SystemSwitchOutcome, type PeerGrantsEntry, type SystemScheduleEntry, type PeerSwitchOutcome, type VerticalCaller, type ImportCursorMoveAt, type ImportCursorMoved, type ExportReadInput, type ExportedBatch, type ImportBatch, type ImportResult, type ImportState } from '@substrat-run/contracts';
26
+ import { type CarriedAway, type KeptCopy, type LoadMarker, type InvokeOptions, type AppliedMigration, type SwitchedOff, type UndrainedEvents } from '@substrat-run/kernel';
27
+ import { z, type ScopeLineage, ownerSeat, ownerTransferRecord, ownerTransferAbandon, type CapabilityFilter, type CapabilityPage, type DenialFilter, type DenialSummary, type PermissionDenial, readScopeTableInput, type EntityHistoryInput, type EventFacetInput, type EventCauseInput, type EventEffectsInput, type EffectsTree, type InvocationEventsInput, type InvocationEvents, type DeadLettersInput, type DeadLetter, type LifecycleFlowInput, type LifecycleFlowResult, type CauseChain, type EventFacetResult, type HistoryEntry, type Page, type ScopeId, type TenantId, type PrincipalId, type ConnectionId, type PermissionKey, type EntityRef, type Visibility, type RoleDefinition, type ScopeDumpTable, type ScopeTable, type ScopeQueryResult, type EntitlementGrant, type ProjectedConnectionGrant, type ProjectedConnectionKey, type ProjectedIdentityLink, type OwnerClaimLink, type PlatformRequest, type PlatformRequestFilter, type PlatformRequestId, type PlatformRequestStatus, type PlatformRequestFailure, type ModuleId, type SystemSwitchOutcome, type LifecycleDelivery, type ScopeLifecycle, type PeerGrantsEntry, type SystemScheduleEntry, type PeerSwitchOutcome, type VerticalCaller, type ImportCursorMoveAt, type ImportCursorMoved, type ExportReadInput, type ExportedBatch, type ImportBatch, type ImportResult, type ImportState } from '@substrat-run/contracts';
28
28
  /**
29
29
  * The slice of the scope host the platform surface delegates to. Structural on purpose:
30
30
  * this package names behaviour, never the concrete `CloudflareScopeHost`. Every method
@@ -54,16 +54,75 @@ export interface VerticalScopeHost {
54
54
  /** `opts.switchedOff` (#1742): as on `provisionScopeLocal`, applied in the restore's own event.
55
55
  * `opts.sourceScopeId` (#1869): the scope the dump was captured from, whose grants move, and
56
56
  * `opts.exact`: the platform exported the dump itself, so the re-point never falls back. */
57
- restoreScopeLocal(scopeId: ScopeId, tables: ScopeDumpTable[], opts?: {
57
+ restoreScopeLocal(scopeId: ScopeId, tables: ScopeDumpTable[],
58
+ /** #1722: `opts.loadStamp`, the stamp a carry leaves on the copy it lands, and `opts.expect`,
59
+ * the marker the carry read: the load is refused if the store moved since. A host built
60
+ * before them has no `loadMarkerLocal` either, so the platform never sends `expect` there.
61
+ * #2005: `opts.markCopy`, the directory's classification when the scope is not primary. */
62
+ opts?: {
58
63
  switchedOff?: ModuleId[];
59
64
  sourceScopeId?: ScopeId;
60
65
  exact?: boolean;
66
+ loadStamp?: string;
67
+ expect?: LoadMarker;
68
+ markCopy?: ScopeLineage;
61
69
  }): Promise<{
62
70
  tables: number;
63
71
  switchedOff?: SwitchedOff[];
64
72
  }>;
73
+ /** #2005: mark one scope a copy in its own storage, given the directory's classification of it,
74
+ * which must be non-primary — the repair of a copy that predates the marker. */
75
+ markCopyLocal(scopeId: ScopeId, lineage: ScopeLineage): Promise<{
76
+ marked: boolean;
77
+ }>;
78
+ /** #2005: remove a mistaken copy marker, given the directory's classification, which must be
79
+ * primary. */
80
+ clearCopyMarkLocal(scopeId: ScopeId, lineage: ScopeLineage, expect?: LoadMarker): Promise<{
81
+ cleared: boolean;
82
+ }>;
83
+ /** #1722: what a carry's restore into this store expects to find unchanged. Optional, like
84
+ * `wipeCarriedLocal`; the route answers 501 without it, and the platform then cannot fence. */
85
+ loadMarkerLocal?(scopeId: ScopeId): Promise<LoadMarker>;
86
+ /**
87
+ * #1722: wipe the copy a carry left in this deployment, only if nothing was loaded into the
88
+ * scope since the stamp the carry read. Optional, like `redrainCountLocal`: a host built
89
+ * before it satisfies this interface without it, and the route answers 501, which the
90
+ * platform reads as "this script cannot fence the wipe" and falls back to an unconditional one.
91
+ */
92
+ wipeCarriedLocal?(scopeId: ScopeId, expectLoadStamp: string | null, carriedAway: CarriedAway, opts?: {
93
+ expectRevision?: string | null;
94
+ protectIfChanged?: boolean;
95
+ markCopy?: ScopeLineage;
96
+ }): Promise<boolean>;
97
+ /** #1722: clear the marker of a kept copy that is the live store after all, at the revision read.
98
+ * #2005: `markCopy`, the directory's classification when the scope is not primary. */
99
+ releaseKeptCopyLocal?(scopeId: ScopeId, revision: string | null, markCopy?: ScopeLineage,
100
+ /** #1722 (Codex #2008 r13): the load stamp read with `revision`. */
101
+ loadStamp?: string | null): Promise<{
102
+ released: true;
103
+ } | {
104
+ refused: 'changed' | 'not-kept';
105
+ }>;
65
106
  projectRolesLocal(tenantId: TenantId, scopeId: ScopeId, roles: RoleDefinition[]): Promise<void>;
66
107
  exportScopeLocal(scopeId: ScopeId): Promise<ScopeDumpTable[]>;
108
+ /** #1722: the export and the store's load stamp, read together. Optional: a host built before
109
+ * it answers the export alone, and the platform then has no stamp to fence a wipe on. */
110
+ exportScopeStampedLocal?(scopeId: ScopeId): Promise<{
111
+ tables: ScopeDumpTable[];
112
+ loadStamp: string | null;
113
+ revision: string | null;
114
+ }>;
115
+ /** #1722: the kept-copy marker of this scope here, or null. Optional, like `wipeCarriedLocal`:
116
+ * a host built before it has no kept copies, since only the fenced wipe makes one. */
117
+ keptCopyLocal?(scopeId: ScopeId): Promise<KeptCopy | null>;
118
+ /** #1722: the staff discard of a kept copy, at the write revision the operator acted on. */
119
+ discardKeptCopyLocal?(scopeId: ScopeId, revision: string | null, carriedAway: CarriedAway, markCopy?: ScopeLineage,
120
+ /** #1722 (Codex #2008 r13): the load stamp read with `revision`. */
121
+ loadStamp?: string | null): Promise<{
122
+ discarded: true;
123
+ } | {
124
+ refused: 'changed' | 'not-kept';
125
+ }>;
67
126
  snapshotScopeLocal(source: ScopeId, dest: ScopeId): Promise<{
68
127
  tables: number;
69
128
  }>;
@@ -119,6 +178,8 @@ export interface VerticalScopeHost {
119
178
  }): Promise<ScopeQueryResult>;
120
179
  listDenialsLocal(scopeId: ScopeId, filter?: DenialFilter): Promise<PermissionDenial[]>;
121
180
  summarizeDenialsLocal(scopeId: ScopeId, filter?: DenialFilter): Promise<DenialSummary>;
181
+ /** The operator's capability read (#1686): records, never a secret or a hash. */
182
+ listCapabilitiesLocal(scopeId: ScopeId, filter?: CapabilityFilter): Promise<CapabilityPage>;
122
183
  listPlatformRequests(tenantId: TenantId, scopeId: ScopeId): Promise<PlatformRequest[]>;
123
184
  listPlatformRequestHistory(tenantId: TenantId, scopeId: ScopeId, filter?: PlatformRequestFilter): Promise<PlatformRequest[]>;
124
185
  settlePlatformRequest(tenantId: TenantId, scopeId: ScopeId, id: PlatformRequestId, outcome: {
@@ -152,6 +213,13 @@ export interface VerticalScopeHost {
152
213
  * control plane reports as "redeploy", never as a switch that moved.
153
214
  */
154
215
  systemSwitchLocal?(scopeId: ScopeId, moduleId: ModuleId, to: 'on' | 'off'): Promise<SystemSwitchOutcome>;
216
+ /**
217
+ * The far end of the lifecycle delivery (#1713): store the scope's lifecycle as the directory
218
+ * holds it, unless the scope already holds a newer one. Optional for the reason
219
+ * `systemSwitchLocal` is, and the route answers 501, which the platform records as a delivery
220
+ * that did not land, so its heal sweep keeps asking.
221
+ */
222
+ setLifecycleLocal?(scopeId: ScopeId, lifecycle: ScopeLifecycle): Promise<LifecycleDelivery>;
155
223
  /**
156
224
  * The far end of the schedule kill switch's status read (#1674): every module this
157
225
  * scope holds or has held system authority for, and where each stands. Optional for the
@@ -381,6 +449,10 @@ export * from './public-surface.js';
381
449
  export * from './capability-exchange.js';
382
450
  export * from './peer-client.js';
383
451
  export * from './live.js';
452
+ export * from './invocation-log.js';
453
+ export * from './routed-node.js';
454
+ export * from './platform-call.js';
455
+ export * from './scope-sweep-host.js';
384
456
  export { classifyError, isPlatformFault, messageOf, problemFor, problemOf, problemResponse, } from './errors.js';
385
457
  export type { ClassifiedProblem, ErrorClassification } from './errors.js';
386
458
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAIjC,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OA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;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAC9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,SAAS,MAAM,EACrD,GAAG,EAAE,IAAI,CAAC;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC,EAC5B,IAAI,EAAE,mBAAmB,CAAC,GAAG,CAAC,GAC7B,IAAI,CAo+BN;AAED,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AAEpC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,WAAW,CAAC;AAG1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACL,aAAa,EACb,eAAe,EACf,SAAS,EACT,UAAU,EACV,SAAS,EACT,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import { HTTPException } from 'hono/http-exception';
2
2
  import { classifyError, messageOf, problemOf } from './errors.js';
3
- import { assertPlatformCall, CONNECTOR_ATTACHMENT_RECORD_HEADER, PlatformCallError, } from '@substrat-run/kernel';
4
- import { z, PROBLEM_CONTENT_TYPE, scopeId as scopeIdOf, tenantId as tenantIdOf, principalId as principalIdOf, connectionId as connectionIdOf, permissionKey as permissionKeyOf, moduleId as moduleIdOf, switchedOffInUnit, entityRef, visibility, instant, entitlementGrant, projectedConnectionGrant, projectedConnectionKey, projectedIdentityLink, ownerSeat, ownerClaimLink, ownerTransferPair, distinctOwnerTransfer, ownerTransferRecord, ownerTransferAbandon, platformRequestFilter, denialFilter, platformRequestId, platformRequestStatus, platformRequestFailure, readScopeTableInput, entityHistoryInput, eventFacetInput, eventCauseInput, eventEffectsInput, invocationEventsInput, deadLettersInput, lifecycleFlowInput, queryScopeInput, verticalCaller, verticalSlug as verticalSlugOf, exportReadInput, importBatch, importCursorMoveAt, } from '@substrat-run/contracts';
3
+ import {} from '@substrat-run/kernel';
4
+ import { assertPlatformCall, PlatformCallError } from './platform-call.js';
5
+ import { platformSweeperOf, registerScopeSweepHost } from './scope-sweep-host.js';
6
+ import { z, PROBLEM_CONTENT_TYPE, scopeLineage, scopeId as scopeIdOf, tenantId as tenantIdOf, principalId as principalIdOf, connectionId as connectionIdOf, permissionKey as permissionKeyOf, moduleId as moduleIdOf, switchedOffInUnit, entityRef, visibility, instant, entitlementGrant, projectedConnectionGrant, projectedConnectionKey, projectedIdentityLink, ownerSeat, ownerClaimLink, ownerTransferPair, distinctOwnerTransfer, ownerTransferRecord, ownerTransferAbandon, platformRequestFilter, denialFilter, capabilityFilterQuery, platformRequestId, platformRequestStatus, platformRequestFailure, readScopeTableInput, entityHistoryInput, eventFacetInput, eventCauseInput, eventEffectsInput, invocationEventsInput, deadLettersInput, lifecycleFlowInput, queryScopeInput, scopeLifecycle, verticalCaller, verticalSlug as verticalSlugOf, exportReadInput, importBatch, importCursorMoveAt, CONNECTOR_ATTACHMENT_RECORD_HEADER, LOAD_STAMP_HEADER, WRITE_REVISION_HEADER, } from '@substrat-run/contracts';
5
7
  /**
6
8
  * The denial-log filter, off the query string (#867). Both denial routes take the same
7
9
  * one, and it is PARSED here rather than forwarded: what arrives is text, and what it
@@ -54,6 +56,34 @@ const switchedOffAnswer = (switched) => {
54
56
  const parsed = switched ? z.array(switchedOffInUnit).safeParse(switched) : undefined;
55
57
  return parsed?.success ? { switchedOff: parsed.data } : {};
56
58
  };
59
+ const discardKeptBody = z.object({
60
+ scopeId: scopeIdOf,
61
+ /** The kept copy's write revision as the operator read it; the discard is refused if it moved. */
62
+ revision: z.string().min(1).nullable(),
63
+ /** Where the scope runs now, and when, for the tombstone the discard leaves. */
64
+ carriedTo: z.string().min(1),
65
+ at: z.string().min(1),
66
+ /** #2005: the directory's classification, sent when the scope is not primary. */
67
+ markCopy: scopeLineage.optional(),
68
+ /** #1722 (Codex #2008 r13): the load stamp read with `revision`; absent from an older platform. */
69
+ loadStamp: z.string().min(1).nullable().optional(),
70
+ });
71
+ const wipeCarriedBody = z.object({
72
+ scopeId: scopeIdOf,
73
+ /** The stamp the carry read from its export; null for a store no load has stamped. */
74
+ expectLoadStamp: z.string().min(1).nullable(),
75
+ /** The write revision the carry read with it; null for a store never written. A platform that
76
+ * predates the field sends none, and the wipe is fenced on the stamp alone. */
77
+ expectRevision: z.string().min(1).nullable().optional(),
78
+ /** The scope does not route here: a copy changed in any way since the export is kept. */
79
+ protectIfChanged: z.boolean().optional(),
80
+ /** The script the data went to, and when, for the tombstone. */
81
+ carriedTo: z.string().min(1),
82
+ at: z.string().min(1),
83
+ /** #2005 (Codex #2008 r10): the directory's classification, sent when the scope is not primary,
84
+ * so a copy made before the marker is marked by the wipe, whether it tombstones or keeps it. */
85
+ markCopy: scopeLineage.optional(),
86
+ });
57
87
  const restoreBody = z.object({
58
88
  tenantId: tenantIdOf.optional(),
59
89
  scopeId: scopeIdOf,
@@ -65,6 +95,14 @@ const restoreBody = z.object({
65
95
  /** #1869: the platform exported these tables itself, so `sourceScopeId` is a fact and the
66
96
  * re-point never falls back. Absent for a dump a caller supplied. */
67
97
  exact: z.boolean().optional(),
98
+ /** #1722: the stamp a carry leaves on the copy it lands, so a later wipe of it can be fenced. */
99
+ loadStamp: z.string().min(1).optional(),
100
+ /** #1722: the marker the carry read from this store; the load is refused if the store moved since. */
101
+ expect: z.object({ loadStamp: z.string().min(1).nullable(), revision: z.string().min(1).nullable() }).optional(),
102
+ /** #2005: the platform directory's classification of this scope, sent when it is not primary,
103
+ * so the restore marks it a copy in its own storage (and refuses if it classifies a primary).
104
+ * Absent from a platform that predates it: nothing is marked. */
105
+ markCopy: scopeLineage.optional(),
68
106
  tables: z.array(z.object({
69
107
  name: z.string(),
70
108
  ddl: z.string(),
@@ -156,6 +194,11 @@ const systemSwitchBody = z.object({
156
194
  moduleId: moduleIdOf,
157
195
  to: z.enum(['on', 'off']),
158
196
  });
197
+ /** `/internal/lifecycle` body (#1713) — the scope's lifecycle as the platform read it. */
198
+ const lifecycleBody = z.object({
199
+ scopeId: scopeIdOf,
200
+ lifecycle: scopeLifecycle,
201
+ });
159
202
  /**
160
203
  * `/internal/vertical-invoke` body (#1706) — one operation, invoked as a PEER vertical.
161
204
  *
@@ -206,6 +249,10 @@ const connectorGrantBody = z.object({
206
249
  * own user-facing surface (`/api/auth`, `/me`, `/op`, …) on the same `app`.
207
250
  */
208
251
  export function mountPlatformSurface(app, deps) {
252
+ // #1902: the host the platform's sweeper runs passes through, when the upload supplied one
253
+ // (`scope-sweep-host.ts`). Registered on every mount, since nothing at mount time can tell
254
+ // a hosted script from a local one, and a registration nobody reads costs nothing.
255
+ registerScopeSweepHost(deps.hostFor);
209
256
  // ── ONE gate for the entire surface (replaces the per-route copy-pasted try/catch) ──
210
257
  app.use('/internal/*', async (c, next) => {
211
258
  try {
@@ -221,7 +268,22 @@ export function mountPlatformSurface(app, deps) {
221
268
  // ── Generic host-delegating routes: zero vertical-specific behaviour, cannot drift ──
222
269
  // The full dump behind a governed `scope pull` (preview-and-snapshots.md §8): the one
223
270
  // /internal verb that deliberately moves scope bytes out; the control plane is the gate.
224
- app.get('/internal/export', async (c) => c.json(await deps.hostFor(c.env).exportScopeLocal(scopeIdOf.parse(c.req.query('scopeId')))));
271
+ // #1722: `stamp=1` is a carry's export. The store's load stamp then rides a header, read with
272
+ // the dump in one DO call (and minted when the store has none, which is a write: only a carry
273
+ // asks for it), so the body stays the bare table list every platform reads.
274
+ app.get('/internal/export', async (c) => {
275
+ const scopeId = scopeIdOf.parse(c.req.query('scopeId'));
276
+ const host = deps.hostFor(c.env);
277
+ if (c.req.query('stamp') !== '1' || !host.exportScopeStampedLocal) {
278
+ return c.json(await host.exportScopeLocal(scopeId));
279
+ }
280
+ const { tables, loadStamp, revision } = await host.exportScopeStampedLocal(scopeId);
281
+ if (loadStamp)
282
+ c.header(LOAD_STAMP_HEADER, loadStamp);
283
+ if (revision)
284
+ c.header(WRITE_REVISION_HEADER, revision);
285
+ return c.json(tables);
286
+ });
225
287
  // The write half (§8): load a dump into one scope, replacing its data — the governed
226
288
  // restore/backout, and the data hop of adopt-serving (#286). After the import the
227
289
  // vertical's OWN role definitions are re-projected: a dump from a CP-full world carries
@@ -234,11 +296,101 @@ export function mountPlatformSurface(app, deps) {
234
296
  switchedOff: body.switchedOff,
235
297
  sourceScopeId: body.sourceScopeId,
236
298
  exact: body.exact,
299
+ loadStamp: body.loadStamp,
300
+ expect: body.expect,
301
+ markCopy: body.markCopy,
237
302
  });
238
303
  if (body.tenantId)
239
304
  await host.projectRolesLocal(body.tenantId, body.scopeId, deps.roles);
240
305
  return c.json({ tables: result.tables, ...switchedOffAnswer(result.switchedOff) });
241
306
  });
307
+ // #1722: what a carry's restore into this scope expects to find unchanged (the load stamp and
308
+ // the store's write revision). Read before the carry checks the binding again; the restore
309
+ // then sends it back as `expect`, so a store the winning carry loaded, or that took a write
310
+ // since it went live, is never overwritten. Metadata only: no scope bytes cross.
311
+ app.get('/internal/load-marker', async (c) => {
312
+ const host = deps.hostFor(c.env);
313
+ if (!host.loadMarkerLocal) {
314
+ return c.json({ error: 'this deployment cannot fence a carry\'s restore (#1722) — redeploy it' }, 501);
315
+ }
316
+ return c.json(await host.loadMarkerLocal(scopeIdOf.parse(c.req.query('scopeId'))));
317
+ });
318
+ // #1722 (Codex #2008 r7): a kept copy, one the carry's wipe refused because it took a write the
319
+ // carry never copied. The read says whether this scope's store here is one; the discard is the
320
+ // staff resolution that wipes it, fenced on the revision the operator read. Both behind the
321
+ // same platform gate; the control plane's staff-only route is the only caller.
322
+ app.get('/internal/kept-copy', async (c) => {
323
+ const host = deps.hostFor(c.env);
324
+ if (!host.keptCopyLocal)
325
+ return c.json({ error: 'this deployment keeps no copies (#1722) — redeploy it' }, 501);
326
+ return c.json({ kept: await host.keptCopyLocal(scopeIdOf.parse(c.req.query('scopeId'))) });
327
+ });
328
+ app.post('/internal/kept-copy/release', async (c) => {
329
+ const body = z
330
+ .object({
331
+ scopeId: scopeIdOf,
332
+ revision: z.string().min(1).nullable(),
333
+ markCopy: scopeLineage.optional(),
334
+ // #1722 (Codex #2008 r13): the load stamp read with `revision`; absent from an older platform.
335
+ loadStamp: z.string().min(1).nullable().optional(),
336
+ })
337
+ .parse(await c.req.json());
338
+ const host = deps.hostFor(c.env);
339
+ if (!host.releaseKeptCopyLocal)
340
+ return c.json({ error: 'this deployment keeps no copies (#1722) — redeploy it' }, 501);
341
+ return c.json(await host.releaseKeptCopyLocal(body.scopeId, body.revision, body.markCopy, ...(body.loadStamp !== undefined ? [body.loadStamp] : [])));
342
+ });
343
+ app.post('/internal/kept-copy/discard', async (c) => {
344
+ const body = discardKeptBody.parse(await c.req.json());
345
+ const host = deps.hostFor(c.env);
346
+ if (!host.discardKeptCopyLocal)
347
+ return c.json({ error: 'this deployment keeps no copies (#1722) — redeploy it' }, 501);
348
+ return c.json(await host.discardKeptCopyLocal(body.scopeId, body.revision, { to: body.carriedTo, at: body.at }, body.markCopy, ...(body.loadStamp !== undefined ? [body.loadStamp] : [])));
349
+ });
350
+ // #1722: wipe the copy a carry left here, after the scope's route moved to another script.
351
+ // Conditional on the load stamp the carry read, compared inside the wipe's own transaction,
352
+ // so a rollback that restored into this scope since is never destroyed. `wiped: false` is
353
+ // that refusal. Non-terminal: the store keeps a `carried_away` tombstone and takes a later
354
+ // restore like any scope, which `/internal/delete-scope` (a reap) would not.
355
+ app.post('/internal/wipe-carried', async (c) => {
356
+ const body = wipeCarriedBody.parse(await c.req.json());
357
+ const host = deps.hostFor(c.env);
358
+ if (!host.wipeCarriedLocal) {
359
+ return c.json({ error: 'this deployment cannot fence a carried copy\'s wipe (#1722) — redeploy it' }, 501);
360
+ }
361
+ return c.json({
362
+ wiped: await host.wipeCarriedLocal(body.scopeId, body.expectLoadStamp, { to: body.carriedTo, at: body.at }, {
363
+ ...(body.expectRevision !== undefined ? { expectRevision: body.expectRevision } : {}),
364
+ ...(body.protectIfChanged !== undefined ? { protectIfChanged: body.protectIfChanged } : {}),
365
+ ...(body.markCopy ? { markCopy: body.markCopy } : {}),
366
+ }),
367
+ });
368
+ });
369
+ // #2005: mark one scope a copy in its own storage, for a copy made before every copy carried
370
+ // the marker. The platform decides which (its directory says the scope is not primary) and
371
+ // audits; this end only stamps, idempotently, and says whether it did.
372
+ app.post('/internal/mark-copy', async (c) => {
373
+ const body = z.object({ scopeId: scopeIdOf, lineage: scopeLineage }).parse(await c.req.json());
374
+ return c.json(await deps.hostFor(c.env).markCopyLocal(body.scopeId, body.lineage));
375
+ });
376
+ // #2005: staff's correction of a MISTAKEN mark, for a scope the directory says IS primary. The
377
+ // host refuses a scope classified a copy, and keeps a load's copied-events mark (#2009).
378
+ app.post('/internal/clear-copy-mark', async (c) => {
379
+ const body = z
380
+ .object({
381
+ scopeId: scopeIdOf,
382
+ lineage: scopeLineage,
383
+ // #1722 (Codex #2008 r12–r13): the platform's reconcile of a carry's destination clears
384
+ // only the store that carry loaded (its stamp) as it read it (the revision); a 412 when
385
+ // either moved. Staff's correction sends none.
386
+ expect: z
387
+ .object({ loadStamp: z.string().min(1).nullable(), revision: z.string().min(1).nullable() })
388
+ .strict()
389
+ .optional(),
390
+ })
391
+ .parse(await c.req.json());
392
+ return c.json(await deps.hostFor(c.env).clearCopyMarkLocal(body.scopeId, body.lineage, ...(body.expect ? [body.expect] : [])));
393
+ });
242
394
  // #1239: facets over this scope's own outbox — narrow, group, count. Counts and
243
395
  // grouped VALUES cross here, which is less than the history route below sends,
244
396
  // but a payload field's values are still the tenant's own data on the tenant's
@@ -381,6 +533,8 @@ export function mountPlatformSurface(app, deps) {
381
533
  app.post('/internal/delete-scope', async (c) => {
382
534
  const body = z.object({ scopeId: scopeIdOf, tenantId: tenantIdOf.optional() }).parse(await c.req.json());
383
535
  await deps.hostFor(c.env).deleteScopeLocal(body.scopeId);
536
+ // #1902: a reaped scope's alarm must never wake it again.
537
+ await platformSweeperOf(c.env)?.forgetScope(body.scopeId);
384
538
  await deps.onDeleteScope?.(c.env, body.scopeId, body.tenantId);
385
539
  return c.json({ deleted: body.scopeId });
386
540
  });
@@ -433,6 +587,16 @@ export function mountPlatformSurface(app, deps) {
433
587
  const s = scopeIdOf.parse(c.req.query('scopeId'));
434
588
  return c.json(await deps.hostFor(c.env).summarizeDenialsLocal(s, denialQuery(c)));
435
589
  });
590
+ // The operator's capability read (#1686). The directory rows are in THIS deployment's scope
591
+ // DO (a capability is minted inside the scope's operation), so the control plane asks, as it
592
+ // does for the denial log. Records only: the query behind it selects no hash, and the record
593
+ // schema has no field to carry one. Platform-secret gated like the rest of the surface; the
594
+ // K-3 check and the K-24 entry are the platform's, made before this is reached.
595
+ app.get('/internal/capabilities', async (c) => {
596
+ const s = scopeIdOf.parse(c.req.query('scopeId'));
597
+ const { scopeId: _scope, ...rest } = c.req.query();
598
+ return c.json(await deps.hostFor(c.env).listCapabilitiesLocal(s, capabilityFilterQuery.parse(rest)));
599
+ });
436
600
  // Platform-intent drain surface (platform-intents.md): the control plane PULLS this
437
601
  // scope's pending intents — its DO lives HERE, not the platform's — executes each with
438
602
  // its own authority, and journals the outcome back. Platform-secret gated.
@@ -544,6 +708,18 @@ export function mountPlatformSurface(app, deps) {
544
708
  }
545
709
  return c.json(await host.systemSwitchLocal(body.scopeId, body.moduleId, body.to));
546
710
  });
711
+ // The lifecycle delivery (#1713): the platform's directory holds a scope's lifecycle, and a
712
+ // deployment serving it has no directory, so the platform pushes it here on every transition
713
+ // and its heal sweep re-pushes until this answers. A newer stored lifecycle wins over a late
714
+ // push (`applied: false`, still a 200). 501 is a deployment built before the route.
715
+ app.post('/internal/lifecycle', async (c) => {
716
+ const body = lifecycleBody.parse(await c.req.json());
717
+ const host = deps.hostFor(c.env);
718
+ if (!host.setLifecycleLocal) {
719
+ return c.json({ error: 'this deployment cannot hold a scope by its lifecycle (#1713) — redeploy it' }, 501);
720
+ }
721
+ return c.json(await host.setLifecycleLocal(body.scopeId, body.lifecycle));
722
+ });
547
723
  // The status read (#1674): the far end of `HostAdmin.systemGrantsStatus` for a scope
548
724
  // served HERE. Bare positions only — no admin-log join, since this deployment holds no
549
725
  // admin log; the platform joins its own onto this by moduleId once it returns. Same
@@ -673,6 +849,10 @@ export function mountPlatformSurface(app, deps) {
673
849
  switchedOff: body.switchedOff,
674
850
  });
675
851
  await deps.onProvision?.(c.env, body);
852
+ // #1902: onto the platform-supplied sweeper's roster, so the scope's schedules run. Last, so
853
+ // only a scope whose provision got this far — the vertical's hook included — is swept; the
854
+ // platform retries a failed provision, and the note is idempotent like the rest of it.
855
+ await platformSweeperOf(c.env)?.noteScope(body.tenantId, body.scopeId);
676
856
  return c.json({
677
857
  tenantId: body.tenantId,
678
858
  scopeId: body.scopeId,
@@ -727,6 +907,9 @@ export function mountPlatformSurface(app, deps) {
727
907
  * re-run it), so calling it here asks nothing new of a vertical. `slug` and `name`
728
908
  * are absent — the platform does not carry them on a reconcile, and both are
729
909
  * optional for exactly this kind of caller.
910
+ *
911
+ * The platform's sweeper is noted here for the same reason (#1902): a scope provisioned
912
+ * before its vertical's upload carried a sweeper joins the roster on its next reconcile.
730
913
  */
731
914
  await deps.onProvision?.(c.env, {
732
915
  tenantId: body.tenantId,
@@ -737,6 +920,7 @@ export function mountPlatformSurface(app, deps) {
737
920
  ...(body.connectionGrants ? { connectionGrants: body.connectionGrants } : {}),
738
921
  ...(body.connectionKeys ? { connectionKeys: body.connectionKeys } : {}),
739
922
  });
923
+ await platformSweeperOf(c.env)?.noteScope(body.tenantId, body.scopeId);
740
924
  return c.json({
741
925
  tenantId: body.tenantId,
742
926
  scopeId: body.scopeId,
@@ -925,5 +1109,11 @@ export * from './capability-exchange.js';
925
1109
  export * from './peer-client.js';
926
1110
  // #1859: the live-read route — the Origin gate and the pure host's 501, once.
927
1111
  export * from './live.js';
1112
+ // #1978: moving here from the kernel — the request log, the router assertion and the
1113
+ // platform-call check every deployed vertical mounts.
1114
+ export * from './invocation-log.js';
1115
+ export * from './routed-node.js';
1116
+ export * from './platform-call.js';
1117
+ export * from './scope-sweep-host.js';
928
1118
  export { classifyError, isPlatformFault, messageOf, problemFor, problemOf, problemResponse, } from './errors.js';
929
1119
  //# sourceMappingURL=index.js.map