@substrat-run/kernel 0.160.0 → 0.161.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.
@@ -81,11 +81,12 @@ export function reservedRoleRefusal(role, reserved, door) {
81
81
  * does not erase it.
82
82
  * - **A system-held definition of a key anyone but a system principal holds a seat in** is refused
83
83
  * unless a system-held definition is stored for it. What kind of principal holds a seat is not
84
- * recorded, so a seat made before any definition, under a person's definition, or under one a
85
- * projection since dropped may be a person's, and relabelling the role would make it a system
86
- * principal's. A K-55 host principal's seat in a system-held role a release dropped and a later
87
- * one adds back cannot be told apart from that, so it is refused too. Taking the seats back first, or defining a new key, is the
88
- * way. The seats decide for a role stored before the holder was recorded (#2480: no holder) too:
84
+ * recorded, so a seat made before any definition, under a person's definition, or under a
85
+ * person's definition a projection since dropped may be a person's, and relabelling the role
86
+ * would make it a system principal's. Taking the seats back first, or defining a new key, is the
87
+ * way. A system-held role a release dropped is the exception: its tombstone (#2531) is passed in
88
+ * `tenantRoles` as the stored system-held definition (`reservedRoleSetRefusal`), so adding it back
89
+ * is judged as if it had stayed defined. The seats decide for a role stored before the holder was recorded (#2480: no holder) too:
89
90
  * it may be declared `holder: 'system'` only while nobody but a system principal holds a seat in
90
91
  * it, since an upgrade admitted beside such a seat would let a later system-held definition add
91
92
  * keys to it.
@@ -102,6 +103,13 @@ export function reservedRoleRefusal(role, reserved, door) {
102
103
  * working. A definition is never refused for a key it takes out, only for what it still holds.
103
104
  */
104
105
  export function reservedRoleDefinitionRefusal(role, host, tenantRoles, seated = false) {
106
+ return definitionRefusal(role, host, tenantRoles, seated)?.refusal ?? null;
107
+ }
108
+ /**
109
+ * `reservedRoleDefinitionRefusal` with why it refused (#2555): `seated`, a system-held definition of a
110
+ * key someone holds a seat in with no system-held definition stored; `keys`, a key the role may not hold.
111
+ */
112
+ function definitionRefusal(role, host, tenantRoles, seated) {
105
113
  const stored = tenantRoles.find((r) => r.key === role.key);
106
114
  const others = tenantRoles.filter((r) => r.key !== role.key);
107
115
  const personKey = (p) => host.declared.has(p) && !host.reserved.has(p);
@@ -113,14 +121,19 @@ export function reservedRoleDefinitionRefusal(role, host, tenantRoles, seated =
113
121
  bySystemRole.set(p, `the system-held role '${r.key}'`);
114
122
  if (role.holder === 'system') {
115
123
  // Judged against the seats of the key, whether or not a definition is stored: a projection can
116
- // drop a role's row and leave its seats live, and a later definition must not relabel them.
124
+ // drop a role's row and leave its seats live, and a later definition must not relabel a seat
125
+ // made under a person's definition. A dropped SYSTEM-held row is no relabelling: its tombstone
126
+ // arrives here as `stored` (#2531, `storedDefinitionOf`), so its re-add passes this check.
117
127
  // A row stored before the holder was recorded (#2480) is no exception: an upgrade admitted beside
118
128
  // a person's seat would leave a system-held row a later definition widens unjudged by its seats.
119
129
  if (stored?.holder !== 'system' && seated) {
120
- return (`role '${role.key}' is held by a principal (${storedAs(stored)}), so it cannot be declared holder: 'system': what kind ` +
121
- `of principal holds a seat is not recorded, so the seat may be a person\'s. Take that seat back first, wherever it is ` +
122
- `held (a scope, or the tenant; a host principal\'s seat can be given again after), keep the role defined across ` +
123
- `releases, or define the system-held role under a new key (K-55)`);
130
+ return {
131
+ reason: 'seated',
132
+ refusal: `role '${role.key}' is held by a principal (${storedAs(stored)}), so it cannot be declared holder: 'system': what kind ` +
133
+ `of principal holds a seat is not recorded, so the seat may be a person\'s. Take that seat back first, wherever it is ` +
134
+ `held (a scope, or the tenant; a host principal\'s seat can be given again after), keep the role defined across ` +
135
+ `releases, or define the system-held role under a new key (K-55)`,
136
+ };
124
137
  }
125
138
  const personsKeys = new Map();
126
139
  for (const r of others)
@@ -138,14 +151,20 @@ export function reservedRoleDefinitionRefusal(role, host, tenantRoles, seated =
138
151
  });
139
152
  if (offences.length === 0)
140
153
  return null;
141
- return (`role '${role.key}' is declared holder: 'system' but holds ${offences.join(', ')}: a system-held role holds only ` +
142
- `keys reserved to a system principal (K-55)`);
154
+ return {
155
+ reason: 'keys',
156
+ refusal: `role '${role.key}' is declared holder: 'system' but holds ${offences.join(', ')}: a system-held role holds only ` +
157
+ `keys reserved to a system principal (K-55)`,
158
+ };
143
159
  }
144
160
  // The stored system-held definition this one replaces is evidence too: its keys are reserved.
161
+ // A tombstone is no row a role listing shows (#2531), so the refusal says what it is: the role was
162
+ // defined system-held, and has since been dropped.
163
+ const evidence = stored && DROPPED.has(stored) ? 'its definition as a system-held role, since dropped' : 'its stored system-held definition';
145
164
  if (stored?.holder === 'system')
146
165
  for (const p of stored.permissions)
147
166
  if (!bySystemRole.has(p))
148
- bySystemRole.set(p, `its stored system-held definition`);
167
+ bySystemRole.set(p, evidence);
149
168
  const held = role.permissions.flatMap((p) => {
150
169
  if (host.reserved.has(p))
151
170
  return [`${p} (${RESERVED_BY})`];
@@ -156,8 +175,11 @@ export function reservedRoleDefinitionRefusal(role, host, tenantRoles, seated =
156
175
  });
157
176
  if (held.length === 0)
158
177
  return null;
159
- return (`role '${role.key}' is a person's role and would hold ${held.join(', ')}, reserved to a system principal: take the key ` +
160
- `out, or declare a role made only of reserved keys holder: 'system' (K-55)`);
178
+ return {
179
+ reason: 'keys',
180
+ refusal: `role '${role.key}' is a person's role and would hold ${held.join(', ')}, reserved to a system principal: take the key ` +
181
+ `out, or declare a role made only of reserved keys holder: 'system' (K-55)`,
182
+ };
161
183
  }
162
184
  /** How the seated-key refusal names the stored row of the key, so it says only what is true of it. */
163
185
  function storedAs(stored) {
@@ -167,22 +189,92 @@ function storedAs(stored) {
167
189
  return 'stored with no holder, from before holders were recorded (#2480)';
168
190
  return "stored as a person's role";
169
191
  }
192
+ /**
193
+ * The definition a key's stored row is judged as (#2531): its live row, or else a tombstone the
194
+ * projection left when it dropped a SYSTEM-held role. Such a tombstone counts as the stored
195
+ * system-held definition it was, in both branches: a re-add as system-held is not refused for a
196
+ * seat, and a re-add as a person's counts its keys as reserved. That is parity with keeping the
197
+ * role defined across releases, not proof the seat is a host principal's: the platform's door can
198
+ * seat a person in a system-held role whether its row is live or dropped. A tombstone of a person's
199
+ * role, or of a row with no holder, is no evidence of anything a system principal holds, so the key
200
+ * is judged as having no definition stored, as before.
201
+ */
202
+ function storedDefinitionOf(stored, key) {
203
+ const live = stored?.roles.find((r) => r.key === key);
204
+ if (live)
205
+ return live;
206
+ const found = stored?.dropped?.find((r) => r.key === key && r.holder === 'system');
207
+ if (!found)
208
+ return undefined;
209
+ // A copy, so the mark is this one judgement's and never the caller's object, which it may pass
210
+ // again as a live role.
211
+ const tomb = { ...found };
212
+ DROPPED.add(tomb);
213
+ return tomb;
214
+ }
215
+ /** The copies of tombstones `storedDefinitionOf` handed on as a stored definition, so a refusal can name them as dropped. */
216
+ const DROPPED = new WeakSet();
170
217
  /**
171
218
  * `reservedRoleDefinitionRefusal` over a whole role set defined at once (a provision's or a
172
219
  * restore's projection, which replaces the tenant's roles in a scope): each role judged against the
173
- * rest of the set and the definition of its own key stored there now (`stored`), with its seats.
174
- * The first refusal, or null.
220
+ * rest of the set and the definition of its own key stored there now (`stored`; a system-held
221
+ * tombstone counts, `storedDefinitionOf`), with its seats. The first refusal, or null.
175
222
  */
176
223
  export function reservedRoleSetRefusal(roles, host, stored) {
224
+ return firstRefusedRole(roles, host, stored)?.refusal ?? null;
225
+ }
226
+ /**
227
+ * `reservedRoleSetRefusal`'s walk: the first role of the set refused, with the refusal, or null.
228
+ * `judged` narrows which roles are asked about; every role of the set stays their context.
229
+ */
230
+ function firstRefusedRole(roles, host, stored, judged = () => true) {
177
231
  for (const role of roles) {
178
- const own = stored?.roles.find((r) => r.key === role.key);
232
+ if (!judged(role))
233
+ continue;
234
+ const own = storedDefinitionOf(stored, role.key);
179
235
  const tenantRoles = [...roles.filter((r) => r.key !== role.key), ...(own ? [own] : [])];
180
- const refusal = reservedRoleDefinitionRefusal(role, host, tenantRoles, stored?.seated.has(role.key) ?? false);
181
- if (refusal)
182
- return refusal;
236
+ const refused = definitionRefusal(role, host, tenantRoles, stored?.seated.has(role.key) ?? false);
237
+ if (refused)
238
+ return { key: role.key, ...refused };
183
239
  }
184
240
  return null;
185
241
  }
242
+ /**
243
+ * #2555: why a dump may not be loaded into a scope of a host the control plane runs (`restoreScope`,
244
+ * `importScope`), or null. The load brings the dump's scope-level seats, and the roles that apply to
245
+ * them are the tenant's roles as the directory stores them NOW (`roles`). So that set is judged as a
246
+ * restore's projection is (`reservedRoleSetRefusal`), against the dump's own role rows and seats for
247
+ * the tenant it was captured from (`dumpRoleState`). A seat the dump holds in a role the directory
248
+ * has since made system-held is refused, unless the dump stores that role system-held itself. A dump
249
+ * with no role rows (a pure-SQLite scope file, or a scope that read its roles over RPC) says nothing
250
+ * about the definition its seats were made under, so such a seat is judged as a person's, the rule's
251
+ * reading of a seat whose holder is not recorded. A scope holding a seat in a system-held role
252
+ * therefore cannot be restored from its own export on a host whose dump carries no role rows.
253
+ *
254
+ * Only the roles the dump seats or stores are asked about, so a directory role the dump has no part
255
+ * in never refuses a load (the directory's own doors judge it); the whole set stays their context.
256
+ *
257
+ * Asked before anything is replaced, so a refused load moves nothing. The answer is one of two fixed
258
+ * sentences naming the role key only: the rule's own wording is kept out of it, since it is read by
259
+ * whoever sent the dump. The second is chosen from the rule's reason, not from the dump's shape: the
260
+ * seat rule refused, and the dump carries no definition of the role to show its seats were made as a
261
+ * system principal's. A refusal over the keys the tenant's definition holds takes the first.
262
+ */
263
+ export function dumpRoleRefusal(roles, host, dump, now) {
264
+ // #2531: the dump's tombstones come with it (`dumpRoleState`), so the walk reads a system-held one as
265
+ // the stored definition it was (`storedDefinitionOf`), and a role the dump keeps only as a tombstone
266
+ // is one it defines: judged, and answered as defined rather than as having no definition.
267
+ const stored = dumpRoleState(dump.tables, dump.tenantId, now);
268
+ const inDump = (key) => stored.roles.some((r) => r.key === key) || (stored.dropped ?? []).some((r) => r.key === key);
269
+ const refused = firstRefusedRole(roles, host, stored, (r) => stored.seated.has(r.key) || inDump(r.key));
270
+ if (!refused)
271
+ return null;
272
+ if (refused.reason === 'seated' && !inDump(refused.key)) {
273
+ return (`restore refused: the dump seats role '${refused.key}' but carries no definition of it, so its seats cannot be told ` +
274
+ `from a person's, and the tenant now defines the role for a system principal (K-55); nothing was loaded`);
275
+ }
276
+ return `restore refused: role '${refused.key}', which the dump seats or defines, cannot be applied as the tenant defines it now (K-55); nothing was loaded`;
277
+ }
186
278
  /**
187
279
  * #2446: the reservations a pushed registry's rows mark — `reserved`, every key marked
188
280
  * `holder: 'system'`; `declared`, every key it lists. The push boundary holds those marks to the
@@ -202,7 +294,11 @@ export function registryReservations(registry) {
202
294
  * reconcile is refused instead.
203
295
  */
204
296
  export function releaseRoleSetRefusal(registry, state) {
205
- return reservedRoleSetRefusal(registry.roles, registryReservations(registry), { roles: state.roles, seated: new Set(state.seated) });
297
+ return reservedRoleSetRefusal(registry.roles, registryReservations(registry), {
298
+ roles: state.roles,
299
+ seated: new Set(state.seated),
300
+ ...(state.dropped ? { dropped: state.dropped } : {}),
301
+ });
206
302
  }
207
303
  /**
208
304
  * #2446: whether a release's role set can be refused by any scope's stored state, so its promote
@@ -233,18 +329,20 @@ export function dumpRoleState(tables, tenantId, now) {
233
329
  return t ? t.rows.map((r) => Object.fromEntries(t.columns.map((c, i) => [c, r[i]]))) : [];
234
330
  };
235
331
  const live = (r) => r.revoked_at == null && (r.expires_at == null || String(r.expires_at) > now);
236
- const roles = read('_substrat_roles')
237
- .filter((r) => r.tenant_id === tenantId && r.revoked_at == null)
238
- .map((r) => ({
332
+ const shapeOf = (r) => ({
239
333
  key: String(r.role_key),
240
334
  permissions: JSON.parse(String(r.permissions)),
241
335
  ...(r.holder === 'person' || r.holder === 'system' ? { holder: r.holder } : {}),
242
- }));
336
+ });
337
+ const tenantRows = read('_substrat_roles').filter((r) => r.tenant_id === tenantId);
338
+ const roles = tenantRows.filter((r) => r.revoked_at == null).map(shapeOf);
339
+ // #2531: a dropped role's tombstone travels with the dump, as the evidence it is in the scope.
340
+ const dropped = tenantRows.filter((r) => r.revoked_at != null).map(shapeOf);
243
341
  const seats = read('_substrat_tuples');
244
342
  const seated = new Set(seats
245
343
  .filter((r) => String(r.relation).startsWith('role:') && !String(r.subject).startsWith('system:') && live(r))
246
344
  .map((r) => String(r.relation).slice('role:'.length)));
247
- return { roles, seated };
345
+ return { roles, seated, dropped };
248
346
  }
249
347
  /**
250
348
  * #2447: the scope statuses whose seats count as held when a role definition is judged: every one
@@ -1 +1 @@
1
- {"version":3,"file":"reserved-roles.js","sourceRoot":"","sources":["../src/reserved-roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA0B,MAAM,yBAAyB,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAe,EACf,QAA6B,EAC7B,IAA2B;IAE3B,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAClD,OAAO,CACL,SAAS,IAAI,CAAC,GAAG,iGAAiG;YAClH,yCAAyC,CAC1C,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,CACL,SAAS,IAAI,CAAC,GAAG,WAAW,IAAI,yEAAyE;YACzG,gCAAgC,WAAW,GAAG,CAC/C,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,IAAI,MAAM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tJ;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAqB,EAAE,QAA0B;IAChF,KAAK,MAAM,GAAG,IAAI,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC3I,CAAC;AAED,gHAAgH;AAChH,MAAM,UAAU,gBAAgB,CAAC,QAAqB,EAAE,QAA0B;IAChF,KAAK,MAAM,CAAC,IAAI,QAAQ,CAAC,WAAW,IAAI,EAAE;QAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAClE,CAAC;AAeD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAA4C,EAAE,QAAgB;IACjG,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,QAAQ,CAAC;QAAE,OAAO;IACxF,MAAM,IAAI,KAAK,CACb,mBAAmB,QAAQ,oFAAoF;QAC7G,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,WAAW,8BAA8B;QACxG,mGAAmG;QACnG,wEAAwE,CAC3E,CAAC;AACJ,CAAC"}
@@ -6,7 +6,7 @@ import type { DeliveryRefusal } from './delivery-refusal.js';
6
6
  import type { ScopeRoleHolder } from './scope-role-admin.js';
7
7
  import type { ScopeCopyBackfillResult, SubjectErasureFence } from './scope-copy-ledger.js';
8
8
  import type { VerticalScopeStore } from './vertical-scope-stores.js';
9
- import type { DeploymentWireAuthFilter, DeploymentWireAuthInput } from './deployment-wire-auth.js';
9
+ import type { DeploymentWireAuthFilter, DeploymentWireAuthInput, WireWalkAudit } from './deployment-wire-auth.js';
10
10
  import type { StoreDriverHoldMode, StoreDriverRebuildFailure, StoreDriverRebuildRecord, StoreDriverReleaseRecord, StoreDriverRolloutAction, StoreDriverRolloutRecord, StoreDriverRolloutState, StoreDriverRolloutTarget, StoreDriverState } from './store-driver-releases.js';
11
11
  import type { SubjectRedactionCounts } from './subject-redaction.js';
12
12
  import type { OnBehalfOf, ExportReadInput, ExportedBatch, ImportBatch, ImportedEvent, ImportResult, ImportState, ImportCursorMove, ImportCursorMoved, AdminAction, BecomeCapabilityInput, CapabilityExchange, CapabilityFilter, CapabilityId, CapabilityPage, MintedCapability, ListPage, ConnectLink, ConnectLinkConsume, ConnectLinkFilter, ConnectLinkKey, ConsumeConnectLinkInput, MintConnectLinkInput, Connection, ConnectionFilter, ConnectionId, ConnectionGrant, ConnectionGrantRecord, ConnectionSecret, CreateConnectionInput, OpenConnection, ProjectedConnectionGrant, ProjectedConnectionKey, AccessLogEntry, DelegatedReadRecord, OwnerTransferAudit, MemberChangeAudit, PeerBindingAudit, ConnectionBindingAudit, CopyMarkAudit, OrphanSweepAudit, BindHostnameInput, AdminLogEntry, OpsFailureEntry, PlatformRequestDrainTotalsEntry, SweepRunEntry, SweepRunKind, SweepRunOutcome, ModelUsageEntry, ModelUsageSummary, CapabilityGrant, CreateTenantInput, Decision, Instant, DomainEvent, DomainEventInput, PlatformRequestInput, PlatformRequestId, PlatformRequestEntry, PlatformRequestFilter, PlatformRequestStatus, PlatformRequestFailure, PlatformOutcomeEvent, EntitlementGrant, EntitlementGrantInput, EntitlementView, MeterReading, MeterDay, MeterDayTake, VerticalOwnerPeriod, ScopeStorageSample, RequestDay, RequestRollupDay, EntityRef, IdentityLink, IdentityPool, Jurisdiction, ModuleId, ModuleManifest, ScheduleSpec, SystemGrant, PeerGrantsStatusEntry, SystemGrantsStatusEntry, SystemSwitchRecord, SystemSwitch, SystemSwitchResult, PeerCoverage, PeerSwitch, PeerSwitchResult, VerticalCaller, VerticalResolution, PeerBinding, PeerInstanceResolution, CreateOrgInput, Node, Org, OrgId, OrgMembership, PermissionKey, PlatformActorId, ChannelName, ExportBreak, ChannelHistoryEntry, DnsRecord, HostnameBinding, HostnameStatus, PromotionAcknowledgement, BindAcknowledgement, PublishVersionInput, RegisterVerticalInput, VerticalServingState, DeploymentWireAuth, RouteTarget, DirectoryDump, IdentityMembership, PrincipalId, ResolvedIdentity, RoleAssignment, RoleDefinition, QueryScopeInput, ReadScopeTableInput, Scope, ScopeDump, ScopeDumpInput, SubjectShredReceipt, ScopeQueryResult, ScopeId, ScopeStatus, ScopeTable, DenialFilter, DenialSummary, RefusalFilter, RefusalRecord, PermissionDenial, Coverage, BeginImpersonationInput, ImpersonationFilter, ImpersonationSession, ImpersonationSessionId, ScopeTablePage, StorageShape, Tenant, TenantId, TenantRole, TenantStoreHandle, AttachmentRecord, UploadLinkView, BlobStoreHandle, Visibility, Vertical, VerticalChannel, VerticalVersion, TenantStatus, Page, CountedPage, FreshnessSpec, EntityHistoryInput, EventFacetInput, EventCauseInput, EventEffectsInput, EffectsTree, InvocationEventsInput, InvocationEvents, DeadLettersInput, DeadLetter, LifecycleFlowInput, LifecycleFlowResult, OperationSeriesInput, OperationSeriesResult, CauseChain, EventFacetResult, HistoryEntry, ErrorCode, PlatformRequestFailureOrigin, IssueEntry, IssueStatus, IssueStatusInput, FindingEntry, FindingFilter, FindingRuleEntry, FindingRuleInput, FindingStatusInput, DeclaredMigration, CheckSubject, EntityGrantShape } from '@substrat-run/contracts';
@@ -1452,6 +1452,15 @@ export interface ScopedConnectorConnection extends ConnectorConnection {
1452
1452
  * falls back rather than failing a dispatch over a missing file.
1453
1453
  */
1454
1454
  openAttachment(attachmentId: string): Promise<OpenedAttachment | null>;
1455
+ /**
1456
+ * `openAttachment`, with the bytes as a stream that is never held whole (#2514), for a connector
1457
+ * that sends a file on to a provider. Gated the same way, before any byte is read. The sha256 is
1458
+ * checked as the bytes flow, and a mismatch errors the stream before its last chunk is handed on
1459
+ * (see {@link OpenedAttachmentStream}), so a connector that sends what it read must treat a stream
1460
+ * error as "nothing was read", never as a shorter file. A stream it decides not to read is
1461
+ * cancelled (`body.stream.getReader().cancel()`), which releases the stored object at once.
1462
+ */
1463
+ openAttachmentStream(attachmentId: string): Promise<OpenedAttachmentStream | null>;
1455
1464
  /**
1456
1465
  * What this connection may do in the scope this delivery is for (#726 gap 1) —
1457
1466
  * `connectionGrantsInScope`, narrowed to this connection.
@@ -2511,6 +2520,12 @@ export interface HostAdmin {
2511
2520
  * only today.
2512
2521
  */
2513
2522
  listWireAuth?(actor: PlatformActorId, filter: DeploymentWireAuthFilter): Promise<DeploymentWireAuth[]>;
2523
+ /**
2524
+ * Audit one pass of the fleet walk (RFC wire-signing follow-on 4) as `walkWireAuth`: a person's act,
2525
+ * dry run or applied. Each script the pass changed writes its own `recordWireAuth` row as well, with
2526
+ * its record, in one directory transaction.
2527
+ */
2528
+ recordWireWalk?(actor: PlatformActorId, entry: WireWalkAudit): Promise<void>;
2514
2529
  /**
2515
2530
  * Point a scope's ROUTING at the serving script its data now lives in. Per-scope
2516
2531
  * truth, deliberately not derived from the vertical: rerouting a scope whose DOs
@@ -4223,6 +4238,17 @@ export interface TenantBlobStore {
4223
4238
  body: Uint8Array;
4224
4239
  contentType?: string;
4225
4240
  } | null>;
4241
+ /**
4242
+ * The object under `key` as a stream (#2514), with the size the store holds for it, read as the
4243
+ * consumer reads it and never collected first. Optional, so a store written before it still
4244
+ * satisfies this interface: an open over such a store reads the object with `get` and hands it on
4245
+ * as a stream, which works but holds the object whole.
4246
+ */
4247
+ getStream?(key: string): Promise<{
4248
+ stream: ByteStream;
4249
+ size: number;
4250
+ contentType?: string;
4251
+ } | null>;
4226
4252
  delete(key: string): Promise<void>;
4227
4253
  /** Keys under `prefix` — the GC/ops walk. */
4228
4254
  list(prefix: string): Promise<string[]>;
@@ -4267,6 +4293,19 @@ export declare function attachmentSha256(body: Uint8Array): Promise<string>;
4267
4293
  * its object deleted and is refused: no record may witness bytes nobody saw.
4268
4294
  */
4269
4295
  export declare function putAttachmentBytes(store: TenantBlobStore, key: string, fields: AttachmentRecordFields, body: ByteBody, sha256: () => IncrementalSha256): Promise<AttachmentRecord>;
4296
+ /**
4297
+ * The bytes of an attachment the scope has already AUTHORIZED, as a stream held to its record (#2514):
4298
+ * the "bytes" half of every streamed open, one path for both adapters, as {@link putAttachmentBytes}
4299
+ * is for the write. The caller checks the read permission first and calls this only once it passed,
4300
+ * so a refused read never reaches the store.
4301
+ *
4302
+ * The length is the record's `size`, which the upload took from the bytes themselves. The store's own
4303
+ * size for the object is held to it before the first byte, so an object that is not the recorded one
4304
+ * is refused up front. The sha256 is checked as the bytes flow ({@link verifiedStream}): a mismatch
4305
+ * errors the stream before its last chunk is handed on. A store without `getStream` is read whole with
4306
+ * `get` and handed on the same way.
4307
+ */
4308
+ export declare function openAttachmentByteStream(store: TenantBlobStore, key: string, record: AttachmentRecord, sha256: () => IncrementalSha256): Promise<OpenedAttachmentStream>;
4270
4309
  /**
4271
4310
  * Who binds an operation, as the §4.3 entitlement gate needs to know it: the owning
4272
4311
  * module, the SKU flag its manifest declares, and the operations that module declares
@@ -4404,6 +4443,18 @@ export interface OpenedAttachment {
4404
4443
  body: Uint8Array;
4405
4444
  contentType: string;
4406
4445
  }
4446
+ /**
4447
+ * An opened attachment whose bytes are a stream (#2514): the metadata fact, and its bytes at the
4448
+ * record's `size`, read as the consumer reads them. The sha256 is checked as they pass, so a
4449
+ * mismatch errors the stream before its last chunk instead of refusing up front: a consumer that
4450
+ * has received all `size` bytes has received bytes that matched the record. One-shot: read it once,
4451
+ * or cancel it, which releases the stored object; a stream that is neither holds it until collected.
4452
+ */
4453
+ export interface OpenedAttachmentStream {
4454
+ record: AttachmentRecord;
4455
+ body: SizedByteStream;
4456
+ contentType: string;
4457
+ }
4407
4458
  /**
4408
4459
  * The attachment surface a host mints per (principal, scope) — `attachmentTargets`
4409
4460
  * finally consumed (#473). Every method is gated INSIDE the platform by the declared
@@ -4420,6 +4471,12 @@ export interface ScopeAttachments {
4420
4471
  list(entity: EntityRef): Promise<AttachmentRecord[]>;
4421
4472
  /** Record + bytes, or null for an id this scope does not know. Gated per entity. */
4422
4473
  open(attachmentId: string): Promise<OpenedAttachment | null>;
4474
+ /**
4475
+ * `open`, with the bytes as a stream that is never held whole (#2514). The same gate, checked
4476
+ * before the store is touched, and the same `null`; the integrity check moves to the stream (see
4477
+ * {@link OpenedAttachmentStream}).
4478
+ */
4479
+ openStream(attachmentId: string): Promise<OpenedAttachmentStream | null>;
4423
4480
  /** Delete row (and event) first, then bytes; returns the removed record, null if unknown. */
4424
4481
  remove(attachmentId: string): Promise<AttachmentRecord | null>;
4425
4482
  /**