@serve.zone/interfaces 31.9.0 → 32.0.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.
Files changed (204) hide show
  1. package/.smartconfig.json +1 -0
  2. package/changelog.md +467 -0
  3. package/dist_ts/00_commitinfo_data.js +3 -3
  4. package/dist_ts/appstore/types.d.ts +4 -6
  5. package/dist_ts/appstore/types.js +5 -5
  6. package/dist_ts/data/backup.d.ts +3 -26
  7. package/dist_ts/data/cluster.d.ts +36 -11
  8. package/dist_ts/data/cluster.js +33 -22
  9. package/dist_ts/data/clusteringress.d.ts +8 -0
  10. package/dist_ts/data/clusteringress.js +13 -8
  11. package/dist_ts/data/clusternode.d.ts +121 -74
  12. package/dist_ts/data/clusternode.js +109 -132
  13. package/dist_ts/data/coremail.d.ts +3 -7
  14. package/dist_ts/data/coremail.js +2 -2
  15. package/dist_ts/data/coremail.runtime.d.ts +0 -1
  16. package/dist_ts/data/coremail.runtime.js +5 -22
  17. package/dist_ts/data/deploymentadoption.d.ts +0 -2
  18. package/dist_ts/data/deploymentadoption.js +40 -6
  19. package/dist_ts/data/deploymentoperation.js +16 -3
  20. package/dist_ts/data/deploymentpreflight.d.ts +0 -2
  21. package/dist_ts/data/deploymentpreflight.js +1 -1
  22. package/dist_ts/data/immutableimage.d.ts +38 -21
  23. package/dist_ts/data/immutableimage.js +45 -5
  24. package/dist_ts/data/index.d.ts +1 -1
  25. package/dist_ts/data/isolatedrestore.d.ts +139 -21
  26. package/dist_ts/data/isolatedrestore.golden.d.ts +0 -1
  27. package/dist_ts/data/isolatedrestore.golden.js +6 -9
  28. package/dist_ts/data/isolatedrestore.js +176 -40
  29. package/dist_ts/data/mail.d.ts +1 -1
  30. package/dist_ts/data/networkaddressplan.d.ts +8 -8
  31. package/dist_ts/data/networkaddressplan.js +4 -4
  32. package/dist_ts/data/networkauthority.d.ts +20 -22
  33. package/dist_ts/data/networkauthority.js +26 -28
  34. package/dist_ts/data/networkcredential.d.ts +10 -10
  35. package/dist_ts/data/networkcredential.js +16 -16
  36. package/dist_ts/data/networkdelivery.d.ts +18 -18
  37. package/dist_ts/data/networkdelivery.js +16 -16
  38. package/dist_ts/data/networklease.d.ts +18 -7
  39. package/dist_ts/data/networklease.js +29 -7
  40. package/dist_ts/data/networknode.d.ts +2 -2
  41. package/dist_ts/data/networkprojection.d.ts +59 -60
  42. package/dist_ts/data/networkprojection.js +53 -57
  43. package/dist_ts/data/networkprotection.d.ts +27 -28
  44. package/dist_ts/data/networkprotection.js +36 -36
  45. package/dist_ts/data/networkrouter.d.ts +11 -11
  46. package/dist_ts/data/networkrouter.js +1 -1
  47. package/dist_ts/data/networksigning.d.ts +16 -18
  48. package/dist_ts/data/networksigning.js +20 -21
  49. package/dist_ts/data/nodecredential.d.ts +4 -6
  50. package/dist_ts/data/nodeenrollment.d.ts +35 -40
  51. package/dist_ts/data/nodeenrollment.js +57 -72
  52. package/dist_ts/data/privatenetwork.d.ts +21 -24
  53. package/dist_ts/data/privatenetwork.js +39 -54
  54. package/dist_ts/data/runtimeassignment.d.ts +50 -34
  55. package/dist_ts/data/runtimeassignment.js +79 -45
  56. package/dist_ts/data/runtimeconfig.d.ts +21 -22
  57. package/dist_ts/data/runtimeconfig.js +24 -24
  58. package/dist_ts/data/runtimesession.d.ts +100 -62
  59. package/dist_ts/data/runtimesession.js +98 -79
  60. package/dist_ts/data/runtimeterminalreceipt.d.ts +28 -29
  61. package/dist_ts/data/runtimeterminalreceipt.js +42 -42
  62. package/dist_ts/data/secret.d.ts +18 -25
  63. package/dist_ts/data/secret.js +12 -52
  64. package/dist_ts/data/servicecredential.d.ts +14 -16
  65. package/dist_ts/data/servicecredential.js +17 -28
  66. package/dist_ts/data/serviceruntime.d.ts +7 -7
  67. package/dist_ts/data/serviceruntime.js +4 -4
  68. package/dist_ts/data/sparknodereport.d.ts +27 -14
  69. package/dist_ts/data/sparknodereport.js +35 -28
  70. package/dist_ts/data/webpush.d.ts +0 -1
  71. package/dist_ts/index.d.ts +2 -1
  72. package/dist_ts/index.js +3 -2
  73. package/dist_ts/platform/objectstorageretention.d.ts +21 -24
  74. package/dist_ts/platform/objectstorageretention.js +6 -18
  75. package/dist_ts/platform/storage.d.ts +1 -3
  76. package/dist_ts/platform/storagemigration.d.ts +0 -7
  77. package/dist_ts/platform/storagemigration.golden.d.ts +0 -1
  78. package/dist_ts/platform/storagemigration.golden.js +8 -12
  79. package/dist_ts/platform/storagemigration.js +6 -51
  80. package/dist_ts/platform/types.d.ts +2 -2
  81. package/dist_ts/private/canonicaljson.d.ts +9 -1
  82. package/dist_ts/private/canonicaljson.js +14 -2
  83. package/dist_ts/private/dataproperties.d.ts +62 -0
  84. package/dist_ts/private/dataproperties.js +117 -0
  85. package/dist_ts/private/networkcontract.d.ts +10 -10
  86. package/dist_ts/private/networkcontract.js +1 -1
  87. package/dist_ts/private/releaseversion.d.ts +37 -0
  88. package/dist_ts/private/releaseversion.js +48 -0
  89. package/dist_ts/private/runtimepolicy.d.ts +2 -2
  90. package/dist_ts/private/runtimepolicy.js +1 -1
  91. package/dist_ts/private/tokenlist.d.ts +9 -0
  92. package/dist_ts/private/tokenlist.js +23 -0
  93. package/dist_ts/protocol.d.ts +137 -0
  94. package/dist_ts/protocol.js +255 -0
  95. package/dist_ts/requests/admin.d.ts +8 -8
  96. package/dist_ts/requests/backup.d.ts +102 -112
  97. package/dist_ts/requests/cluster.d.ts +10 -10
  98. package/dist_ts/requests/clusteringress.d.ts +9 -0
  99. package/dist_ts/requests/clusteringress.js +1 -1
  100. package/dist_ts/requests/config.d.ts +3 -3
  101. package/dist_ts/requests/corestore.d.ts +0 -3
  102. package/dist_ts/requests/corestore.js +5 -9
  103. package/dist_ts/requests/network.d.ts +30 -30
  104. package/dist_ts/requests/node.d.ts +15 -28
  105. package/dist_ts/requests/pallet.d.ts +13 -13
  106. package/dist_ts/requests/runtimesession.d.ts +53 -41
  107. package/dist_ts/requests/secret.d.ts +4 -5
  108. package/dist_ts/requests/secret.js +1 -5
  109. package/dist_ts/runtime.corestore.d.ts +56 -74
  110. package/dist_ts/runtime.corestore.databaseexportpackage.d.ts +30 -36
  111. package/dist_ts/runtime.corestore.databaseexportpackage.golden.d.ts +11 -12
  112. package/dist_ts/runtime.corestore.databaseexportpackage.golden.js +54 -71
  113. package/dist_ts/runtime.corestore.databaseexportpackage.js +9 -25
  114. package/dist_ts/runtime.corestore.js +35 -135
  115. package/dist_ts/runtime.corestore.relay.js +2 -7
  116. package/dist_ts/runtime.d.ts +38 -48
  117. package/dist_ts/runtime.js +20 -77
  118. package/dist_ts/runtime.networkprojection.d.ts +4 -4
  119. package/dist_ts/runtime.networkprojection.js +18 -18
  120. package/dist_ts/runtime.workloadinit.d.ts +23 -24
  121. package/dist_ts/runtime.workloadinit.js +6 -13
  122. package/package.json +2 -2
  123. package/readme.md +421 -270
  124. package/ts/00_commitinfo_data.ts +3 -3
  125. package/ts/appstore/types.ts +4 -6
  126. package/ts/data/backup.ts +3 -38
  127. package/ts/data/cluster.ts +51 -34
  128. package/ts/data/clusteringress.ts +12 -12
  129. package/ts/data/clusternode.ts +204 -232
  130. package/ts/data/coremail.runtime.ts +4 -21
  131. package/ts/data/coremail.ts +3 -7
  132. package/ts/data/deploymentadoption.ts +46 -4
  133. package/ts/data/deploymentoperation.ts +16 -1
  134. package/ts/data/deploymentpreflight.ts +0 -2
  135. package/ts/data/immutableimage.ts +71 -24
  136. package/ts/data/index.ts +1 -1
  137. package/ts/data/isolatedrestore.golden.ts +5 -9
  138. package/ts/data/isolatedrestore.ts +339 -54
  139. package/ts/data/mail.ts +1 -1
  140. package/ts/data/networkaddressplan.ts +13 -13
  141. package/ts/data/networkauthority.ts +42 -46
  142. package/ts/data/networkcredential.ts +24 -24
  143. package/ts/data/networkdelivery.ts +27 -27
  144. package/ts/data/networklease.ts +40 -13
  145. package/ts/data/networknode.ts +2 -2
  146. package/ts/data/networkprojection.ts +119 -124
  147. package/ts/data/networkprotection.ts +54 -55
  148. package/ts/data/networkrouter.ts +14 -14
  149. package/ts/data/networksigning.ts +29 -32
  150. package/ts/data/nodecredential.ts +4 -6
  151. package/ts/data/nodeenrollment.ts +96 -114
  152. package/ts/data/privatenetwork.ts +58 -74
  153. package/ts/data/runtimeassignment.ts +143 -94
  154. package/ts/data/runtimeconfig.ts +45 -46
  155. package/ts/data/runtimesession.ts +185 -138
  156. package/ts/data/runtimeterminalreceipt.ts +72 -73
  157. package/ts/data/secret.ts +28 -76
  158. package/ts/data/servicecredential.ts +33 -43
  159. package/ts/data/serviceruntime.ts +11 -11
  160. package/ts/data/sparknodereport.ts +48 -36
  161. package/ts/data/webpush.ts +0 -1
  162. package/ts/index.ts +2 -0
  163. package/ts/platform/objectstorageretention.ts +36 -55
  164. package/ts/platform/storage.ts +1 -3
  165. package/ts/platform/storagemigration.golden.ts +7 -11
  166. package/ts/platform/storagemigration.ts +5 -55
  167. package/ts/platform/types.ts +2 -2
  168. package/ts/private/canonicaljson.ts +13 -1
  169. package/ts/private/dataproperties.ts +139 -0
  170. package/ts/private/networkcontract.ts +9 -9
  171. package/ts/private/releaseversion.ts +70 -0
  172. package/ts/private/runtimepolicy.ts +2 -2
  173. package/ts/private/tokenlist.ts +30 -0
  174. package/ts/protocol.ts +364 -0
  175. package/ts/requests/admin.ts +11 -11
  176. package/ts/requests/backup.ts +112 -117
  177. package/ts/requests/cluster.ts +13 -13
  178. package/ts/requests/clusteringress.ts +9 -0
  179. package/ts/requests/config.ts +3 -3
  180. package/ts/requests/corestore.ts +4 -16
  181. package/ts/requests/network.ts +40 -40
  182. package/ts/requests/node.ts +21 -38
  183. package/ts/requests/pallet.ts +17 -17
  184. package/ts/requests/runtimesession.ts +63 -51
  185. package/ts/requests/secret.ts +5 -10
  186. package/ts/runtime.corestore.databaseexportpackage.golden.ts +77 -95
  187. package/ts/runtime.corestore.databaseexportpackage.ts +51 -73
  188. package/ts/runtime.corestore.relay.ts +1 -10
  189. package/ts/runtime.corestore.ts +118 -268
  190. package/ts/runtime.networkprojection.ts +30 -30
  191. package/ts/runtime.ts +83 -158
  192. package/ts/runtime.workloadinit.ts +36 -48
  193. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.d.ts +0 -902
  194. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.golden.d.ts +0 -35
  195. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.golden.js +0 -315
  196. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.js +0 -3315
  197. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.d.ts +0 -291
  198. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.golden.d.ts +0 -30
  199. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.golden.js +0 -408
  200. package/dist_ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.js +0 -1126
  201. package/ts/runtime.cloudlylegacydeploymentsettlement.golden.ts +0 -421
  202. package/ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.golden.ts +0 -510
  203. package/ts/runtime.cloudlylegacydeploymentsettlement.offlineexport.ts +0 -2470
  204. package/ts/runtime.cloudlylegacydeploymentsettlement.ts +0 -6630
@@ -1,12 +1,12 @@
1
1
  import { isPlausibleUnicastIpv4 } from '../private/ipv4.js';
2
2
  import type { TSha256Digest } from './immutableimage.js';
3
- import type { IRuntimeAuthorityReferenceV1 } from './runtimeassignment.js';
4
- import type { IRuntimeNetworkNodeScopeV1 } from './networkprojection.js';
5
- import { snapshotRuntimeNetworkNodeScopeV1 } from './networkprojection.js';
6
- import type { IRuntimeNetworkProtectedAuthorityV1 } from './networkauthority.js';
7
- import { computeRuntimeNetworkProtectedAuthorityV1Digest, snapshotRuntimeNetworkProtectedAuthorityV1 } from './networkauthority.js';
8
- import type { IRuntimeSessionBindingV1 } from './runtimesession.js';
9
- import { snapshotRuntimeSessionBindingV1 } from './runtimesession.js';
3
+ import type { IRuntimeAuthorityReference } from './runtimeassignment.js';
4
+ import type { IRuntimeNetworkNodeScope } from './networkprojection.js';
5
+ import { snapshotRuntimeNetworkNodeScope } from './networkprojection.js';
6
+ import type { IRuntimeNetworkProtectedAuthority } from './networkauthority.js';
7
+ import { computeRuntimeNetworkProtectedAuthorityDigest, snapshotRuntimeNetworkProtectedAuthority } from './networkauthority.js';
8
+ import type { IRuntimeSessionBinding } from './runtimesession.js';
9
+ import { snapshotRuntimeSessionBinding } from './runtimesession.js';
10
10
  import { captureNetwork, failNetwork, networkCanonical, networkDigest, networkEqual, networkHash,
11
11
  networkId, networkList, networkRecord, networkReference, networkReferenceOf, networkRevision,
12
12
  networkSafe, networkSorted, requireNetwork } from '../private/networkcontract.js';
@@ -18,21 +18,20 @@ import { captureNetwork, failNetwork, networkCanonical, networkDigest, networkEq
18
18
  * a single table inspection, a boot event or a caller-selected success flag.
19
19
  * A null nativeBarrier explicitly withdraws this node's allocation eligibility.
20
20
  */
21
- export interface IRuntimeNetworkProtectionReceiptV1 extends IRuntimeNetworkNodeScopeV1 {
22
- schemaVersion: 1;
21
+ export interface IRuntimeNetworkProtectionReceipt extends IRuntimeNetworkNodeScope {
23
22
  id: string;
24
23
  generation: number;
25
- previous: IRuntimeAuthorityReferenceV1 | null;
26
- protectedAuthority: IRuntimeAuthorityReferenceV1;
24
+ previous: IRuntimeAuthorityReference | null;
25
+ protectedAuthority: IRuntimeAuthorityReference;
27
26
  reporterSessionId: string;
28
27
  bootId: string;
29
- nativeBarrier: IRuntimeAuthorityReferenceV1 | null;
28
+ nativeBarrier: IRuntimeAuthorityReference | null;
30
29
  digest: TSha256Digest;
31
30
  }
32
31
 
33
- export interface IReportRuntimeNetworkProtectionRequestV1 {
34
- session: IRuntimeSessionBindingV1;
35
- receipt: IRuntimeNetworkProtectionReceiptV1;
32
+ export interface IReportRuntimeNetworkProtectionRequest {
33
+ session: IRuntimeSessionBinding;
34
+ receipt: IRuntimeNetworkProtectionReceipt;
36
35
  /**
37
36
  * The address this node answers on, as the node itself observed it.
38
37
  *
@@ -44,14 +43,14 @@ export interface IReportRuntimeNetworkProtectionRequestV1 {
44
43
  */
45
44
  uplinkAddress?: string;
46
45
  }
47
- export interface IReportRuntimeNetworkProtectionResponseV1 {
46
+ export interface IReportRuntimeNetworkProtectionResponse {
48
47
  status: 'accepted' | 'replay';
49
- receipt: IRuntimeAuthorityReferenceV1;
48
+ receipt: IRuntimeAuthorityReference;
50
49
  authorityUse: 'current' | 'historical';
51
50
  }
52
51
 
53
- export const runtimeNetworkProtectionV1Contract = Object.freeze({
54
- digestDomain: 'serve.zone/runtime-network-protection-receipt-v1',
52
+ export const runtimeNetworkProtectionContract = Object.freeze({
53
+ digestDomain: 'serve.zone/runtime-network-protection-receipt',
55
54
  maximumAuthorities: 256,
56
55
  allocation: 'all-current-affected-egress-receipts-before-reserving-any-lease',
57
56
  receiptSource: 'joined-complete-native-protection-journal',
@@ -60,45 +59,45 @@ export const runtimeNetworkProtectionV1Contract = Object.freeze({
60
59
  quarantine: 'no-release-authority',
61
60
  } as const);
62
61
 
63
- const scopeOf = (value: IRuntimeNetworkNodeScopeV1): IRuntimeNetworkNodeScopeV1 =>
62
+ const scopeOf = (value: IRuntimeNetworkNodeScope): IRuntimeNetworkNodeScope =>
64
63
  ({ controller: value.controller, nodeId: value.nodeId, runtimeNamespace: value.runtimeNamespace });
65
64
  const scopeKey = (value: { nodeId: string; runtimeNamespace: string }): string =>
66
65
  networkCanonical([value.nodeId, value.runtimeNamespace]);
67
66
 
68
- export const snapshotRuntimeNetworkProtectionReceiptV1 = (value: unknown): IRuntimeNetworkProtectionReceiptV1 => networkSafe(() => {
69
- const item = networkRecord(captureNetwork(value), ['schemaVersion', 'id', 'generation', 'previous',
67
+ export const snapshotRuntimeNetworkProtectionReceipt = (value: unknown): IRuntimeNetworkProtectionReceipt => networkSafe(() => {
68
+ const item = networkRecord(captureNetwork(value), ['id', 'generation', 'previous',
70
69
  'controller', 'nodeId', 'runtimeNamespace', 'protectedAuthority', 'reporterSessionId', 'bootId', 'nativeBarrier', 'digest']);
71
- requireNetwork(item.schemaVersion === 1 && typeof item.bootId === 'string'
70
+ requireNetwork(typeof item.bootId === 'string'
72
71
  && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(item.bootId)
73
72
  && item.bootId !== '00000000-0000-0000-0000-000000000000');
74
- const scope = snapshotRuntimeNetworkNodeScopeV1({ controller: item.controller, nodeId: item.nodeId, runtimeNamespace: item.runtimeNamespace });
75
- return { schemaVersion: 1, ...networkRevision(item), ...scope,
73
+ const scope = snapshotRuntimeNetworkNodeScope({ controller: item.controller, nodeId: item.nodeId, runtimeNamespace: item.runtimeNamespace });
74
+ return { ...networkRevision(item), ...scope,
76
75
  protectedAuthority: networkReference(item.protectedAuthority), reporterSessionId: networkId(item.reporterSessionId),
77
76
  bootId: item.bootId, nativeBarrier: item.nativeBarrier === null ? null : networkReference(item.nativeBarrier),
78
77
  digest: networkDigest(item.digest) };
79
78
  });
80
79
 
81
- export const computeRuntimeNetworkProtectionReceiptV1Digest = (value: IRuntimeNetworkProtectionReceiptV1): Promise<TSha256Digest> =>
82
- networkHash(runtimeNetworkProtectionV1Contract.digestDomain, snapshotRuntimeNetworkProtectionReceiptV1(value));
80
+ export const computeRuntimeNetworkProtectionReceiptDigest = (value: IRuntimeNetworkProtectionReceipt): Promise<TSha256Digest> =>
81
+ networkHash(runtimeNetworkProtectionContract.digestDomain, snapshotRuntimeNetworkProtectionReceipt(value));
83
82
 
84
83
  /** Pure revision binding. The owner must authenticate the reporter and fence all DB writes. */
85
- export const admitRuntimeNetworkProtectionReceiptV1 = async (
84
+ export const admitRuntimeNetworkProtectionReceipt = async (
86
85
  value: unknown, previousValue: unknown | null, trustedScopeValue: unknown, knownProtectionValue: unknown,
87
- ): Promise<{ status: 'accepted' | 'replay'; receipt: IRuntimeNetworkProtectionReceiptV1 }> => {
86
+ ): Promise<{ status: 'accepted' | 'replay'; receipt: IRuntimeNetworkProtectionReceipt }> => {
88
87
  try {
89
- const receipt = snapshotRuntimeNetworkProtectionReceiptV1(value);
90
- const previous = previousValue === null ? null : snapshotRuntimeNetworkProtectionReceiptV1(previousValue);
91
- const scope = snapshotRuntimeNetworkNodeScopeV1(captureNetwork(trustedScopeValue));
92
- const protection = snapshotRuntimeNetworkProtectedAuthorityV1(captureNetwork(knownProtectionValue));
88
+ const receipt = snapshotRuntimeNetworkProtectionReceipt(value);
89
+ const previous = previousValue === null ? null : snapshotRuntimeNetworkProtectionReceipt(previousValue);
90
+ const scope = snapshotRuntimeNetworkNodeScope(captureNetwork(trustedScopeValue));
91
+ const protection = snapshotRuntimeNetworkProtectedAuthority(captureNetwork(knownProtectionValue));
93
92
  requireNetwork(networkEqual(scopeOf(receipt), scope) && networkEqual(receipt.controller, protection.controller)
94
93
  && networkEqual(receipt.protectedAuthority, networkReferenceOf(protection))
95
94
  && protection.egressAuthorities.some(owner => scopeKey(owner) === scopeKey(receipt)));
96
- requireNetwork(receipt.digest === await computeRuntimeNetworkProtectionReceiptV1Digest(receipt)
97
- && protection.digest === await computeRuntimeNetworkProtectedAuthorityV1Digest(protection));
95
+ requireNetwork(receipt.digest === await computeRuntimeNetworkProtectionReceiptDigest(receipt)
96
+ && protection.digest === await computeRuntimeNetworkProtectedAuthorityDigest(protection));
98
97
  if (!previous) requireNetwork(receipt.generation === 1 && receipt.previous === null);
99
98
  else {
100
99
  requireNetwork(networkEqual(scopeOf(previous), scope)
101
- && previous.digest === await computeRuntimeNetworkProtectionReceiptV1Digest(previous));
100
+ && previous.digest === await computeRuntimeNetworkProtectionReceiptDigest(previous));
102
101
  if (networkEqual(receipt, previous)) return { status: 'replay', receipt };
103
102
  requireNetwork(receipt.id === previous.id && receipt.generation === previous.generation + 1
104
103
  && networkEqual(receipt.previous, networkReferenceOf(previous))
@@ -123,11 +122,11 @@ export const admitRuntimeNetworkProtectionReceiptV1 = async (
123
122
  } catch { return failNetwork(); }
124
123
  };
125
124
 
126
- export const snapshotReportRuntimeNetworkProtectionRequestV1 = (value: unknown): IReportRuntimeNetworkProtectionRequestV1 => networkSafe(() => {
125
+ export const snapshotReportRuntimeNetworkProtectionRequest = (value: unknown): IReportRuntimeNetworkProtectionRequest => networkSafe(() => {
127
126
  const item = networkRecord(captureNetwork(value), ['session', 'receipt'], ['uplinkAddress']);
128
- const request: IReportRuntimeNetworkProtectionRequestV1 = {
129
- session: snapshotRuntimeSessionBindingV1(item.session),
130
- receipt: snapshotRuntimeNetworkProtectionReceiptV1(item.receipt),
127
+ const request: IReportRuntimeNetworkProtectionRequest = {
128
+ session: snapshotRuntimeSessionBinding(item.session),
129
+ receipt: snapshotRuntimeNetworkProtectionReceipt(item.receipt),
131
130
  };
132
131
  if (Object.hasOwn(item, 'uplinkAddress')) {
133
132
  request.uplinkAddress = runtimeNodeUplinkAddress(item.uplinkAddress);
@@ -150,12 +149,12 @@ export const runtimeNodeUplinkAddress = (value: unknown): string => {
150
149
  };
151
150
 
152
151
  /** Both trusted bindings come from the receiver's fenced physical-session/history owner. */
153
- export const bindReportRuntimeNetworkProtectionRequestV1 = (
152
+ export const bindReportRuntimeNetworkProtectionRequest = (
154
153
  value: unknown, trustedCurrentSessionValue: unknown, trustedReporterSessionValue: unknown,
155
- ): { request: IReportRuntimeNetworkProtectionRequestV1; authorityUse: 'current' | 'historical' } => networkSafe(() => {
156
- const request = snapshotReportRuntimeNetworkProtectionRequestV1(value);
157
- const current = snapshotRuntimeSessionBindingV1(captureNetwork(trustedCurrentSessionValue));
158
- const reporter = snapshotRuntimeSessionBindingV1(captureNetwork(trustedReporterSessionValue));
154
+ ): { request: IReportRuntimeNetworkProtectionRequest; authorityUse: 'current' | 'historical' } => networkSafe(() => {
155
+ const request = snapshotReportRuntimeNetworkProtectionRequest(value);
156
+ const current = snapshotRuntimeSessionBinding(captureNetwork(trustedCurrentSessionValue));
157
+ const reporter = snapshotRuntimeSessionBinding(captureNetwork(trustedReporterSessionValue));
159
158
  requireNetwork(networkEqual(request.session, current) && networkEqual(scopeOf(request.receipt), scopeOf(current))
160
159
  && networkEqual(scopeOf(reporter), scopeOf(current)) && reporter.reporterSessionId === request.receipt.reporterSessionId);
161
160
  const authorityUse = reporter.reporterSessionId === current.reporterSessionId ? 'current' : 'historical';
@@ -164,15 +163,15 @@ export const bindReportRuntimeNetworkProtectionRequestV1 = (
164
163
  return { request, authorityUse };
165
164
  });
166
165
 
167
- export const snapshotReportRuntimeNetworkProtectionResponseV1 = (value: unknown): IReportRuntimeNetworkProtectionResponseV1 => networkSafe(() => {
166
+ export const snapshotReportRuntimeNetworkProtectionResponse = (value: unknown): IReportRuntimeNetworkProtectionResponse => networkSafe(() => {
168
167
  const item = networkRecord(captureNetwork(value), ['status', 'receipt', 'authorityUse']);
169
168
  requireNetwork((item.status === 'accepted' || item.status === 'replay')
170
169
  && (item.authorityUse === 'current' || item.authorityUse === 'historical'));
171
170
  return { status: item.status, receipt: networkReference(item.receipt), authorityUse: item.authorityUse };
172
171
  });
173
172
 
174
- export const bindReportRuntimeNetworkProtectionResponseV1 = (value: unknown, sentReceiptValue: unknown): IReportRuntimeNetworkProtectionResponseV1 => networkSafe(() => {
175
- const response = snapshotReportRuntimeNetworkProtectionResponseV1(value);
173
+ export const bindReportRuntimeNetworkProtectionResponse = (value: unknown, sentReceiptValue: unknown): IReportRuntimeNetworkProtectionResponse => networkSafe(() => {
174
+ const response = snapshotReportRuntimeNetworkProtectionResponse(value);
176
175
  requireNetwork(networkEqual(response.receipt, networkReference(captureNetwork(sentReceiptValue))));
177
176
  return response;
178
177
  });
@@ -185,14 +184,14 @@ export const bindReportRuntimeNetworkProtectionResponseV1 = (value: unknown, sen
185
184
  * cannot be omitted. Independent fences need their own verified owning contract;
186
185
  * this helper supplies no generic override, expiry or quorum escape hatch.
187
186
  */
188
- export const bindRuntimeNetworkAllocationProtectionV1 = async (
187
+ export const bindRuntimeNetworkAllocationProtection = async (
189
188
  protectionValue: unknown, receiptsValue: unknown, currentSessionsValue: unknown,
190
- ): Promise<{ protection: IRuntimeNetworkProtectedAuthorityV1; receipts: IRuntimeNetworkProtectionReceiptV1[] }> => {
189
+ ): Promise<{ protection: IRuntimeNetworkProtectedAuthority; receipts: IRuntimeNetworkProtectionReceipt[] }> => {
191
190
  try {
192
- const protection = snapshotRuntimeNetworkProtectedAuthorityV1(captureNetwork(protectionValue));
193
- const receipts = networkSorted(networkList(captureNetwork(receiptsValue), 256, snapshotRuntimeNetworkProtectionReceiptV1), scopeKey);
194
- const sessions = networkSorted(networkList(captureNetwork(currentSessionsValue), 256, snapshotRuntimeSessionBindingV1), scopeKey);
195
- requireNetwork(protection.digest === await computeRuntimeNetworkProtectedAuthorityV1Digest(protection)
191
+ const protection = snapshotRuntimeNetworkProtectedAuthority(captureNetwork(protectionValue));
192
+ const receipts = networkSorted(networkList(captureNetwork(receiptsValue), 256, snapshotRuntimeNetworkProtectionReceipt), scopeKey);
193
+ const sessions = networkSorted(networkList(captureNetwork(currentSessionsValue), 256, snapshotRuntimeSessionBinding), scopeKey);
194
+ requireNetwork(protection.digest === await computeRuntimeNetworkProtectedAuthorityDigest(protection)
196
195
  && receipts.length === protection.egressAuthorities.length && sessions.length === receipts.length);
197
196
  for (const [index, owner] of protection.egressAuthorities.entries()) {
198
197
  const receipt = receipts[index], session = sessions[index];
@@ -200,7 +199,7 @@ export const bindRuntimeNetworkAllocationProtectionV1 = async (
200
199
  && networkEqual(receipt.controller, protection.controller) && networkEqual(session.controller, protection.controller)
201
200
  && receipt.reporterSessionId === session.reporterSessionId && receipt.nativeBarrier !== null
202
201
  && networkEqual(receipt.protectedAuthority, networkReferenceOf(protection))
203
- && receipt.digest === await computeRuntimeNetworkProtectionReceiptV1Digest(receipt));
202
+ && receipt.digest === await computeRuntimeNetworkProtectionReceiptDigest(receipt));
204
203
  }
205
204
  return { protection, receipts };
206
205
  } catch { return failNetwork(); }
@@ -1,23 +1,23 @@
1
- import type { IRuntimeAuthorityReferenceV1 } from './runtimeassignment.js';
2
- import type { IRuntimeNetworkHandoffLeaseV1, IRuntimeNetworkProtectedAuthorityV1 } from './networkauthority.js';
1
+ import type { IRuntimeAuthorityReference } from './runtimeassignment.js';
2
+ import type { IRuntimeNetworkHandoffLease, IRuntimeNetworkProtectedAuthority } from './networkauthority.js';
3
3
  import { networkCanonical, networkCounter, networkId, networkIpv4, networkList,
4
4
  networkRecord, networkReference, networkReferenceOf, networkSorted, requireNetwork } from '../private/networkcontract.js';
5
5
 
6
6
  /** Exact router-origin flow authority; unrelated to workload connectivity or DNS names. */
7
- export interface IRuntimeNetworkRouterPacketGrantV1 {
8
- source: { handoff: IRuntimeAuthorityReferenceV1; address: string };
7
+ export interface IRuntimeNetworkRouterPacketGrant {
8
+ source: { handoff: IRuntimeAuthorityReference; address: string };
9
9
  destination: { kind: 'resolver' | 'platform'; id: string; address: string; protocol: 'tcp' | 'udp'; port: number };
10
10
  }
11
11
 
12
12
  /** Explicit selections from the current protected inventory plus retained denials. */
13
- export interface IRuntimeNetworkRouterProjectionV1 {
13
+ export interface IRuntimeNetworkRouterProjection {
14
14
  /** Each selected resolver authorizes its exact TCP and UDP endpoint. */
15
15
  resolverIds: string[];
16
16
  platformEndpointIds: string[];
17
- withdrawals: IRuntimeNetworkRouterPacketGrantV1[];
17
+ withdrawals: IRuntimeNetworkRouterPacketGrant[];
18
18
  }
19
19
 
20
- const grant = (value: unknown): IRuntimeNetworkRouterPacketGrantV1 => {
20
+ const grant = (value: unknown): IRuntimeNetworkRouterPacketGrant => {
21
21
  const item = networkRecord(value, ['source', 'destination']);
22
22
  const source = networkRecord(item.source, ['handoff', 'address']);
23
23
  const destination = networkRecord(item.destination, ['kind', 'id', 'address', 'protocol', 'port']);
@@ -29,7 +29,7 @@ const grant = (value: unknown): IRuntimeNetworkRouterPacketGrantV1 => {
29
29
  };
30
30
 
31
31
  /** Internal parser: the enclosing projection has already captured caller input. */
32
- export const snapshotRouterProjection = (value: unknown): IRuntimeNetworkRouterProjectionV1 => {
32
+ export const snapshotRouterProjection = (value: unknown): IRuntimeNetworkRouterProjection => {
33
33
  const item = networkRecord(value, ['resolverIds', 'platformEndpointIds', 'withdrawals']);
34
34
  return {
35
35
  resolverIds: networkSorted(networkList(item.resolverIds, 16, networkId), value => value),
@@ -40,16 +40,16 @@ export const snapshotRouterProjection = (value: unknown): IRuntimeNetworkRouterP
40
40
 
41
41
  /** Internal composition after capture. The public helper validates the whole projection. */
42
42
  export const routerPacketGrantsOf = (projection: {
43
- router?: IRuntimeNetworkRouterProjectionV1;
44
- handoff: IRuntimeNetworkHandoffLeaseV1 | null;
45
- protectedAuthority: IRuntimeNetworkProtectedAuthorityV1;
46
- }): IRuntimeNetworkRouterPacketGrantV1[] => {
43
+ router?: IRuntimeNetworkRouterProjection;
44
+ handoff: IRuntimeNetworkHandoffLease | null;
45
+ protectedAuthority: IRuntimeNetworkProtectedAuthority;
46
+ }): IRuntimeNetworkRouterPacketGrant[] => {
47
47
  const selected = projection.router;
48
48
  if (!selected || selected.resolverIds.length + selected.platformEndpointIds.length === 0) return [];
49
49
  const handoff = projection.handoff; requireNetwork(handoff);
50
50
  const source = { handoff: networkReferenceOf(handoff), address: handoff.transit.routerAddress };
51
- const result: IRuntimeNetworkRouterPacketGrantV1[] = [];
52
- const append = (destination: IRuntimeNetworkRouterPacketGrantV1['destination']) => {
51
+ const result: IRuntimeNetworkRouterPacketGrant[] = [];
52
+ const append = (destination: IRuntimeNetworkRouterPacketGrant['destination']) => {
53
53
  requireNetwork(handoff.sourcePortRanges.some(range => range.protocol === destination.protocol));
54
54
  result.push({ source: { handoff: { ...source.handoff }, address: source.address }, destination });
55
55
  };
@@ -1,23 +1,21 @@
1
1
  import type { TSha256Digest } from './immutableimage.js';
2
- import type { IRuntimeAuthorityReferenceV1, IRuntimeControllerV1 } from './runtimeassignment.js';
3
- import type { IRuntimeNetworkProjectionV1 } from './networkprojection.js';
4
- import { snapshotRuntimeNetworkProjectionV1 } from './networkprojection.js';
5
- import { snapshotRuntimeSessionBindingV1 } from './runtimesession.js';
2
+ import type { IRuntimeAuthorityReference, IRuntimeController } from './runtimeassignment.js';
3
+ import type { IRuntimeNetworkProjection } from './networkprojection.js';
4
+ import { snapshotRuntimeNetworkProjection } from './networkprojection.js';
5
+ import { snapshotRuntimeSessionBinding } from './runtimesession.js';
6
6
  import { captureNetwork, failNetwork, networkController, networkDigest, networkEqual, networkHash, networkRecord,
7
7
  networkReference, networkReferenceOf, networkRevision, networkSafe, networkSignature, requireNetwork } from '../private/networkcontract.js';
8
8
 
9
- export interface ISignedRuntimeNetworkProjectionV1 {
10
- schemaVersion: 1;
11
- authority: IRuntimeAuthorityReferenceV1;
12
- projection: IRuntimeNetworkProjectionV1;
9
+ export interface ISignedRuntimeNetworkProjection {
10
+ authority: IRuntimeAuthorityReference;
11
+ projection: IRuntimeNetworkProjection;
13
12
  /** Ed25519 signature of the complete domain-separated envelope, lowercase hex. */
14
13
  signature: string;
15
14
  }
16
15
 
17
- export const snapshotSignedRuntimeNetworkProjectionV1 = (value: unknown): ISignedRuntimeNetworkProjectionV1 => networkSafe(() => {
18
- const item = networkRecord(captureNetwork(value), ['schemaVersion', 'authority', 'projection', 'signature']);
19
- requireNetwork(item.schemaVersion === 1);
20
- return { schemaVersion: 1, authority: networkReference(item.authority), projection: snapshotRuntimeNetworkProjectionV1(item.projection),
16
+ export const snapshotSignedRuntimeNetworkProjection = (value: unknown): ISignedRuntimeNetworkProjection => networkSafe(() => {
17
+ const item = networkRecord(captureNetwork(value), ['authority', 'projection', 'signature']);
18
+ return { authority: networkReference(item.authority), projection: snapshotRuntimeNetworkProjection(item.projection),
21
19
  signature: networkSignature(item.signature) };
22
20
  });
23
21
 
@@ -27,54 +25,53 @@ export const snapshotSignedRuntimeNetworkProjectionV1 = (value: unknown): ISigne
27
25
  * null revokes signing; rotation requires a new complete signed projection for DNS.
28
26
  * Existing packet grants still require applied denial or independent fencing.
29
27
  */
30
- export interface IRuntimeNetworkSigningAuthorityV1 {
31
- schemaVersion: 1;
28
+ export interface IRuntimeNetworkSigningAuthority {
32
29
  id: string;
33
30
  generation: number;
34
- previous: IRuntimeAuthorityReferenceV1 | null;
35
- controller: IRuntimeControllerV1;
31
+ previous: IRuntimeAuthorityReference | null;
32
+ controller: IRuntimeController;
36
33
  algorithm: 'Ed25519';
37
34
  /** Canonical 32-byte raw public key, lowercase hex. No private material. */
38
35
  publicKey: string | null;
39
36
  digest: TSha256Digest;
40
37
  }
41
38
 
42
- export const runtimeNetworkSigningV1Contract = Object.freeze({
43
- authorityDigestDomain: 'serve.zone/runtime-network-signing-authority-v1',
44
- signatureDomain: 'serve.zone/runtime-network-projection-signature-v1',
39
+ export const runtimeNetworkSigningContract = Object.freeze({
40
+ authorityDigestDomain: 'serve.zone/runtime-network-signing-authority',
41
+ signatureDomain: 'serve.zone/runtime-network-projection-signature',
45
42
  trust: 'current-authenticated-physical-session-and-durable-revision-fence',
46
43
  rotation: 'replace-dns-authority-with-new-signed-projection',
47
44
  revocation: 'no-implicit-packet-denial-or-allocation-reuse',
48
45
  } as const);
49
46
 
50
- export const snapshotRuntimeNetworkSigningAuthorityV1 = (value: unknown): IRuntimeNetworkSigningAuthorityV1 => networkSafe(() => {
51
- const item = networkRecord(captureNetwork(value), ['schemaVersion', 'id', 'generation', 'previous', 'controller', 'algorithm', 'publicKey', 'digest']);
52
- requireNetwork(item.schemaVersion === 1 && item.algorithm === 'Ed25519');
47
+ export const snapshotRuntimeNetworkSigningAuthority = (value: unknown): IRuntimeNetworkSigningAuthority => networkSafe(() => {
48
+ const item = networkRecord(captureNetwork(value), ['id', 'generation', 'previous', 'controller', 'algorithm', 'publicKey', 'digest']);
49
+ requireNetwork(item.algorithm === 'Ed25519');
53
50
  requireNetwork(item.publicKey === null || (typeof item.publicKey === 'string'
54
51
  && /^[a-f0-9]{64}$/.test(item.publicKey) && item.publicKey !== '0'.repeat(64)));
55
- return { schemaVersion: 1, ...networkRevision(item), controller: networkController(item.controller),
52
+ return { ...networkRevision(item), controller: networkController(item.controller),
56
53
  algorithm: 'Ed25519', publicKey: item.publicKey, digest: networkDigest(item.digest) };
57
54
  });
58
55
 
59
- export const computeRuntimeNetworkSigningAuthorityV1Digest = (value: IRuntimeNetworkSigningAuthorityV1): Promise<TSha256Digest> =>
60
- networkHash(runtimeNetworkSigningV1Contract.authorityDigestDomain, snapshotRuntimeNetworkSigningAuthorityV1(value));
56
+ export const computeRuntimeNetworkSigningAuthorityDigest = (value: IRuntimeNetworkSigningAuthority): Promise<TSha256Digest> =>
57
+ networkHash(runtimeNetworkSigningContract.authorityDigestDomain, snapshotRuntimeNetworkSigningAuthority(value));
61
58
 
62
59
  /**
63
60
  * Detached content/CAS check. Caller must fence the live peer and commit atomically.
64
61
  * A newly enrolled node bootstraps the controller's CURRENT authority at any generation;
65
62
  * it must not fabricate local history or use this bootstrap path to erase existing trust.
66
63
  */
67
- export const admitRuntimeNetworkSigningAuthorityV1 = async (
64
+ export const admitRuntimeNetworkSigningAuthority = async (
68
65
  value: unknown, previousValue: unknown | null, trustedSessionValue: unknown,
69
- ): Promise<{ status: 'accepted' | 'replay'; authority: IRuntimeNetworkSigningAuthorityV1 }> => {
66
+ ): Promise<{ status: 'accepted' | 'replay'; authority: IRuntimeNetworkSigningAuthority }> => {
70
67
  try {
71
- const authority = snapshotRuntimeNetworkSigningAuthorityV1(value);
72
- const previous = previousValue === null ? null : snapshotRuntimeNetworkSigningAuthorityV1(previousValue);
73
- const session = snapshotRuntimeSessionBindingV1(trustedSessionValue);
68
+ const authority = snapshotRuntimeNetworkSigningAuthority(value);
69
+ const previous = previousValue === null ? null : snapshotRuntimeNetworkSigningAuthority(previousValue);
70
+ const session = snapshotRuntimeSessionBinding(trustedSessionValue);
74
71
  requireNetwork(networkEqual(authority.controller, session.controller));
75
- requireNetwork(authority.digest === await computeRuntimeNetworkSigningAuthorityV1Digest(authority));
72
+ requireNetwork(authority.digest === await computeRuntimeNetworkSigningAuthorityDigest(authority));
76
73
  if (previous === null) return { status: 'accepted', authority };
77
- requireNetwork(previous.digest === await computeRuntimeNetworkSigningAuthorityV1Digest(previous)
74
+ requireNetwork(previous.digest === await computeRuntimeNetworkSigningAuthorityDigest(previous)
78
75
  && authority.id === previous.id && networkEqual(previous.controller, authority.controller));
79
76
  if (authority.generation === previous.generation) {
80
77
  requireNetwork(networkEqual(authority, previous)); return { status: 'replay', authority };
@@ -6,8 +6,7 @@ export type TNodeCredentialPurpose = 'spark' | 'pallet';
6
6
  * hashes, socket peer IDs or controller process IDs. On replay this is historical
7
7
  * evidence, not an assertion that a credential or reporter session is still live.
8
8
  */
9
- export interface INodeCredentialMetadataV1 {
10
- schemaVersion: 1;
9
+ export interface INodeCredentialMetadata {
11
10
  nodeId: string;
12
11
  purpose: TNodeCredentialPurpose;
13
12
  state: 'active' | 'revoked';
@@ -25,8 +24,7 @@ export interface INodeCredentialMetadataV1 {
25
24
  * preconditions, not minimums. Retrying must retain this complete input and the
26
25
  * original mutationId; a changed request with the same ID must fail closed.
27
26
  */
28
- export interface INodeCredentialMutationPreconditionsV1 {
29
- schemaVersion: 1;
27
+ export interface INodeCredentialMutationPreconditions {
30
28
  nodeId: string;
31
29
  purpose: TNodeCredentialPurpose;
32
30
  mutationId: string;
@@ -34,8 +32,8 @@ export interface INodeCredentialMutationPreconditionsV1 {
34
32
  expectedSessionEpoch: number;
35
33
  }
36
34
 
37
- export interface INodeCredentialMutationResultV1 {
38
- metadata: INodeCredentialMetadataV1;
35
+ export interface INodeCredentialMutationResult {
36
+ metadata: INodeCredentialMetadata;
39
37
  /** A replay returns the original result without restoring its authority. */
40
38
  replayed: boolean;
41
39
  }