@githolon/dsl 0.113.4 → 0.114.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 (58) hide show
  1. package/assets/operation-contract.wasm +0 -0
  2. package/compile_package.mjs +23 -3
  3. package/compile_proof.d.mts +7 -0
  4. package/compile_proof.mjs +38 -3
  5. package/dart/CHANGELOG.md +20 -0
  6. package/dart/lib/src/application_framework_calls.dart +9 -5
  7. package/dart/lib/src/generated_call.dart +14 -3
  8. package/dart/lib/src/nms_generated_runtime.dart +7 -0
  9. package/dart/lib/src/node_runner_transport.dart +77 -8
  10. package/dart/lib/src/nomos_trace.dart +107 -0
  11. package/dart/lib/src/reception/dart_reception.dart +148 -11
  12. package/dart/lib/src/rows_watch.dart +390 -0
  13. package/dart/lib/src/runner/node-entry.mjs +2803 -690
  14. package/dart/lib/src/sync_status_projection.dart +94 -1
  15. package/dart/lib/src/sync_status_reducer.dart +5 -2
  16. package/dart/lib/src/test_harness.dart +107 -41
  17. package/dart/lib/src/testing/test_peer.dart +107 -99
  18. package/dart/lib/src/testing/test_peer_host.dart +305 -0
  19. package/dart/lib/src/typed_watch_registry.dart +26 -3
  20. package/dart/pubspec.lock +1 -1
  21. package/dart/pubspec.yaml +2 -2
  22. package/dart/test/background_model_adoption_test.dart +1 -0
  23. package/dart/test/custodian_warming_test.dart +105 -0
  24. package/dart/test/fixtures/offer_watch_order_peer.dart +74 -0
  25. package/dart/test/kernel_author_after_read_test.dart +6 -3
  26. package/dart/test/kernel_fence_test.dart +4 -1
  27. package/dart/test/model_adoption_test.dart +17 -0
  28. package/dart/test/nomos_trace_test.dart +91 -0
  29. package/dart/test/own_offer_watch_order_test.dart +90 -0
  30. package/dart/test/receiving_group_open_test.dart +4 -8
  31. package/dart/test/replica_readiness_test.dart +14 -4
  32. package/dart/test/rows_watch_test.dart +331 -0
  33. package/dart/test/test_peer_host_selection_test.dart +49 -0
  34. package/dart_types/CHANGELOG.md +15 -0
  35. package/dart_types/lib/src/approved_model.dart +22 -5
  36. package/dart_types/lib/src/proto/nomos/kernel/v1/kernel.pb.dart +535 -1
  37. package/dart_types/lib/src/proto/nomos/kernel/v1/kernel.pbenum.dart +65 -0
  38. package/dart_types/lib/src/proto/nomos/runtime/v2/application_desk.pb.dart +14 -0
  39. package/dart_types/lib/src/proto/nomos/runtime/v2/correspondence_desk.pb.dart +359 -2
  40. package/dart_types/lib/src/proto/nomos/runtime/v2/correspondence_desk.pbenum.dart +65 -0
  41. package/dart_types/lib/src/proto/nomos/runtime/v2/model_adoption_desk.pb.dart +20 -2
  42. package/dart_types/lib/src/proto/nomos/runtime/v2/observability_desk.pb.dart +278 -9
  43. package/dart_types/lib/src/proto/nomos/runtime/v2/receiving_group_desk.pb.dart +7 -85
  44. package/dart_types/lib/src/proto/nomos/runtime/v2/residency_desk.pb.dart +35 -0
  45. package/dart_types/pubspec.yaml +1 -1
  46. package/package.json +4 -2
  47. package/src/build_provenance.ts +7 -2
  48. package/src/codegen_dart_client.ts +21 -9
  49. package/src/codegen_dart_facade.ts +1 -0
  50. package/src/codegen_dart_framework_calls.ts +12 -9
  51. package/src/codegen_dart_scenario.ts +7 -0
  52. package/src/codegen_ts.ts +26 -24
  53. package/src/compile_package_main.ts +65 -61
  54. package/src/engine_entry.ts +4 -48
  55. package/src/law_unit_set_identity.ts +44 -0
  56. package/src/query/compile.ts +0 -0
  57. package/src/release_inspection.ts +24 -0
  58. package/src/release_publication.ts +298 -0
@@ -346,6 +346,71 @@ class KernelRefusalCode extends $pb.ProtobufEnum {
346
346
  const KernelRefusalCode._(super.value, super.name);
347
347
  }
348
348
 
349
+ /// Typed premise for answering a delta request with the complete result.
350
+ class FullResultReason extends $pb.ProtobufEnum {
351
+ static const FullResultReason FULL_RESULT_REASON_UNSPECIFIED =
352
+ FullResultReason._(
353
+ 0, _omitEnumNames ? '' : 'FULL_RESULT_REASON_UNSPECIFIED');
354
+
355
+ /// The request named no base position.
356
+ static const FullResultReason FULL_RESULT_REASON_NO_BASE =
357
+ FullResultReason._(1, _omitEnumNames ? '' : 'FULL_RESULT_REASON_NO_BASE');
358
+
359
+ /// The installed law changed between the two positions.
360
+ static const FullResultReason FULL_RESULT_REASON_LAW_CHANGED =
361
+ FullResultReason._(
362
+ 2, _omitEnumNames ? '' : 'FULL_RESULT_REASON_LAW_CHANGED');
363
+
364
+ /// The principal, or the workspace-wide grant the read relied on, changed.
365
+ static const FullResultReason FULL_RESULT_REASON_READ_AUTHORITY_CHANGED =
366
+ FullResultReason._(
367
+ 3, _omitEnumNames ? '' : 'FULL_RESULT_REASON_READ_AUTHORITY_CHANGED');
368
+
369
+ /// The principal reads this type record by record; visibility is not a function of the rows.
370
+ static const FullResultReason FULL_RESULT_REASON_PER_RECORD_REFUSAL =
371
+ FullResultReason._(
372
+ 4, _omitEnumNames ? '' : 'FULL_RESULT_REASON_PER_RECORD_REFUSAL');
373
+
374
+ /// An ordered read is selected by its declared order and limit, not by membership.
375
+ static const FullResultReason FULL_RESULT_REASON_ORDERED_READ =
376
+ FullResultReason._(
377
+ 5, _omitEnumNames ? '' : 'FULL_RESULT_REASON_ORDERED_READ');
378
+
379
+ /// The rows carry clock-derived fields whose value changes without a state change.
380
+ static const FullResultReason FULL_RESULT_REASON_TEMPORAL_FIELDS =
381
+ FullResultReason._(
382
+ 6, _omitEnumNames ? '' : 'FULL_RESULT_REASON_TEMPORAL_FIELDS');
383
+
384
+ /// This replica no longer holds the base position's state.
385
+ static const FullResultReason FULL_RESULT_REASON_BASE_UNAVAILABLE =
386
+ FullResultReason._(
387
+ 7, _omitEnumNames ? '' : 'FULL_RESULT_REASON_BASE_UNAVAILABLE');
388
+
389
+ /// One of the positions predates the state-tree format, which has no exact change set.
390
+ static const FullResultReason FULL_RESULT_REASON_LEGACY_STATE =
391
+ FullResultReason._(
392
+ 8, _omitEnumNames ? '' : 'FULL_RESULT_REASON_LEGACY_STATE');
393
+
394
+ static const $core.List<FullResultReason> values = <FullResultReason>[
395
+ FULL_RESULT_REASON_UNSPECIFIED,
396
+ FULL_RESULT_REASON_NO_BASE,
397
+ FULL_RESULT_REASON_LAW_CHANGED,
398
+ FULL_RESULT_REASON_READ_AUTHORITY_CHANGED,
399
+ FULL_RESULT_REASON_PER_RECORD_REFUSAL,
400
+ FULL_RESULT_REASON_ORDERED_READ,
401
+ FULL_RESULT_REASON_TEMPORAL_FIELDS,
402
+ FULL_RESULT_REASON_BASE_UNAVAILABLE,
403
+ FULL_RESULT_REASON_LEGACY_STATE,
404
+ ];
405
+
406
+ static final $core.List<FullResultReason?> _byValue =
407
+ $pb.ProtobufEnum.$_initByValueList(values, 8);
408
+ static FullResultReason? valueOf($core.int value) =>
409
+ value < 0 || value >= _byValue.length ? null : _byValue[value];
410
+
411
+ const FullResultReason._(super.value, super.name);
412
+ }
413
+
349
414
  /// VINTF-inspired compatibility algebra over Nomos's canonical OpenUSD law.
350
415
  /// The application matrix is USDA; Protobuf carries only the closed request and
351
416
  /// typed verdict across the kernel ABI.
@@ -115,6 +115,7 @@ class WatchRequest extends $pb.GeneratedMessage {
115
115
  WatchKind? kind,
116
116
  $0.QueryRequest? query,
117
117
  $core.int? intervalMillis,
118
+ $core.bool? acceptRowDelta,
118
119
  }) {
119
120
  final result = create();
120
121
  if (session != null) result.session = session;
@@ -122,6 +123,7 @@ class WatchRequest extends $pb.GeneratedMessage {
122
123
  if (kind != null) result.kind = kind;
123
124
  if (query != null) result.query = query;
124
125
  if (intervalMillis != null) result.intervalMillis = intervalMillis;
126
+ if (acceptRowDelta != null) result.acceptRowDelta = acceptRowDelta;
125
127
  return result;
126
128
  }
127
129
 
@@ -147,6 +149,7 @@ class WatchRequest extends $pb.GeneratedMessage {
147
149
  subBuilder: $0.QueryRequest.create)
148
150
  ..aI(5, _omitFieldNames ? '' : 'intervalMillis',
149
151
  fieldType: $pb.PbFieldType.OU3)
152
+ ..aOB(6, _omitFieldNames ? '' : 'acceptRowDelta')
150
153
  ..hasRequiredFields = false;
151
154
 
152
155
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
@@ -214,6 +217,17 @@ class WatchRequest extends $pb.GeneratedMessage {
214
217
  $core.bool hasIntervalMillis() => $_has(4);
215
218
  @$pb.TagNumber(5)
216
219
  void clearIntervalMillis() => $_clearField(5);
220
+
221
+ /// The consumer merges `WatchChanged.application_delta` itself (CAP-731). Without it the runtime
222
+ /// delivers only complete results, as before.
223
+ @$pb.TagNumber(6)
224
+ $core.bool get acceptRowDelta => $_getBF(5);
225
+ @$pb.TagNumber(6)
226
+ set acceptRowDelta($core.bool value) => $_setBool(5, value);
227
+ @$pb.TagNumber(6)
228
+ $core.bool hasAcceptRowDelta() => $_has(5);
229
+ @$pb.TagNumber(6)
230
+ void clearAcceptRowDelta() => $_clearField(6);
217
231
  }
218
232
 
219
233
  class WatchStarted extends $pb.GeneratedMessage {
@@ -1198,6 +1198,7 @@ class SyncWorkspaceResponse extends $pb.GeneratedMessage {
1198
1198
  $core.bool? mainAdvanced,
1199
1199
  $1.WorkspaceRebirth? rebornRemotely,
1200
1200
  $1.PreservedLocalCopy? preservedLocalCopy,
1201
+ $core.int? custodianWarmingRetryAfterMillis,
1201
1202
  }) {
1202
1203
  final result = create();
1203
1204
  if (workspace != null) result.workspace = workspace;
@@ -1232,6 +1233,9 @@ class SyncWorkspaceResponse extends $pb.GeneratedMessage {
1232
1233
  if (rebornRemotely != null) result.rebornRemotely = rebornRemotely;
1233
1234
  if (preservedLocalCopy != null)
1234
1235
  result.preservedLocalCopy = preservedLocalCopy;
1236
+ if (custodianWarmingRetryAfterMillis != null)
1237
+ result.custodianWarmingRetryAfterMillis =
1238
+ custodianWarmingRetryAfterMillis;
1235
1239
  return result;
1236
1240
  }
1237
1241
 
@@ -1292,6 +1296,8 @@ class SyncWorkspaceResponse extends $pb.GeneratedMessage {
1292
1296
  ..aOM<$1.PreservedLocalCopy>(
1293
1297
  27, _omitFieldNames ? '' : 'preservedLocalCopy',
1294
1298
  subBuilder: $1.PreservedLocalCopy.create)
1299
+ ..aI(28, _omitFieldNames ? '' : 'custodianWarmingRetryAfterMillis',
1300
+ fieldType: $pb.PbFieldType.OU3)
1295
1301
  ..hasRequiredFields = false;
1296
1302
 
1297
1303
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
@@ -1563,6 +1569,19 @@ class SyncWorkspaceResponse extends $pb.GeneratedMessage {
1563
1569
  void clearPreservedLocalCopy() => $_clearField(27);
1564
1570
  @$pb.TagNumber(27)
1565
1571
  $1.PreservedLocalCopy ensurePreservedLocalCopy() => $_ensure(26);
1572
+
1573
+ /// The custodian (or the edge relaying to it) answered that it is opening this workspace from
1574
+ /// verified custody: nothing was judged. This is the custodian's hint for when to ask again.
1575
+ /// Distinct from a refusal, a transport failure or an offline round.
1576
+ @$pb.TagNumber(28)
1577
+ $core.int get custodianWarmingRetryAfterMillis => $_getIZ(27);
1578
+ @$pb.TagNumber(28)
1579
+ set custodianWarmingRetryAfterMillis($core.int value) =>
1580
+ $_setUnsignedInt32(27, value);
1581
+ @$pb.TagNumber(28)
1582
+ $core.bool hasCustodianWarmingRetryAfterMillis() => $_has(27);
1583
+ @$pb.TagNumber(28)
1584
+ void clearCustodianWarmingRetryAfterMillis() => $_clearField(28);
1566
1585
  }
1567
1586
 
1568
1587
  enum CustodyOfferReceipt_Outcome { admission, failure, blocked, notSet }
@@ -7706,6 +7725,7 @@ class CustodyOfferBatchRequest extends $pb.GeneratedMessage {
7706
7725
  $core.String? observedHead,
7707
7726
  $core.bool? fastForwardOnly,
7708
7727
  $core.String? continuesAfter,
7728
+ $core.bool? acknowledgeAdmission,
7709
7729
  }) {
7710
7730
  final result = create();
7711
7731
  if (protocolVersion != null) result.protocolVersion = protocolVersion;
@@ -7717,6 +7737,8 @@ class CustodyOfferBatchRequest extends $pb.GeneratedMessage {
7717
7737
  if (observedHead != null) result.observedHead = observedHead;
7718
7738
  if (fastForwardOnly != null) result.fastForwardOnly = fastForwardOnly;
7719
7739
  if (continuesAfter != null) result.continuesAfter = continuesAfter;
7740
+ if (acknowledgeAdmission != null)
7741
+ result.acknowledgeAdmission = acknowledgeAdmission;
7720
7742
  return result;
7721
7743
  }
7722
7744
 
@@ -7754,6 +7776,7 @@ class CustodyOfferBatchRequest extends $pb.GeneratedMessage {
7754
7776
  ..aOS(7, _omitFieldNames ? '' : 'observedHead')
7755
7777
  ..aOB(8, _omitFieldNames ? '' : 'fastForwardOnly')
7756
7778
  ..aOS(9, _omitFieldNames ? '' : 'continuesAfter')
7779
+ ..aOB(10, _omitFieldNames ? '' : 'acknowledgeAdmission')
7757
7780
  ..hasRequiredFields = false;
7758
7781
 
7759
7782
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
@@ -7882,6 +7905,20 @@ class CustodyOfferBatchRequest extends $pb.GeneratedMessage {
7882
7905
  $core.bool hasContinuesAfter() => $_has(8);
7883
7906
  @$pb.TagNumber(9)
7884
7907
  void clearContinuesAfter() => $_clearField(9);
7908
+
7909
+ /// Set by the live link's relay (CAP-684): the custodian answers this batch with its admission as
7910
+ /// soon as it is judged, and `sealed_main` says how much of it is durable. Without it a custodian
7911
+ /// holds an admitted answer until its main is retained in custody (the HTTP lane). The sender keeps
7912
+ /// its recovery suffix above the sealed main, so a custodian that restarts without the unsealed
7913
+ /// admission is simply offered it again.
7914
+ @$pb.TagNumber(10)
7915
+ $core.bool get acknowledgeAdmission => $_getBF(9);
7916
+ @$pb.TagNumber(10)
7917
+ set acknowledgeAdmission($core.bool value) => $_setBool(9, value);
7918
+ @$pb.TagNumber(10)
7919
+ $core.bool hasAcknowledgeAdmission() => $_has(9);
7920
+ @$pb.TagNumber(10)
7921
+ void clearAcknowledgeAdmission() => $_clearField(10);
7885
7922
  }
7886
7923
 
7887
7924
  enum LiveOfferFrame_Message { frontier, offers, admission, notSet }
@@ -8248,7 +8285,7 @@ class PeerSocketEffect extends $pb.GeneratedMessage {
8248
8285
  void clearClose() => $_clearField(4);
8249
8286
  }
8250
8287
 
8251
- enum PeerSocketReceipt_Observation { opened, received, closed, notSet }
8288
+ enum PeerSocketReceipt_Observation { opened, received, closed, closure, notSet }
8252
8289
 
8253
8290
  class PeerSocketReceipt extends $pb.GeneratedMessage {
8254
8291
  factory PeerSocketReceipt({
@@ -8256,12 +8293,14 @@ class PeerSocketReceipt extends $pb.GeneratedMessage {
8256
8293
  $core.bool? opened,
8257
8294
  $core.List<$core.int>? received,
8258
8295
  $core.bool? closed,
8296
+ PeerSocketClosure? closure,
8259
8297
  }) {
8260
8298
  final result = create();
8261
8299
  if (connectionId != null) result.connectionId = connectionId;
8262
8300
  if (opened != null) result.opened = opened;
8263
8301
  if (received != null) result.received = received;
8264
8302
  if (closed != null) result.closed = closed;
8303
+ if (closure != null) result.closure = closure;
8265
8304
  return result;
8266
8305
  }
8267
8306
 
@@ -8279,6 +8318,7 @@ class PeerSocketReceipt extends $pb.GeneratedMessage {
8279
8318
  2: PeerSocketReceipt_Observation.opened,
8280
8319
  3: PeerSocketReceipt_Observation.received,
8281
8320
  4: PeerSocketReceipt_Observation.closed,
8321
+ 5: PeerSocketReceipt_Observation.closure,
8282
8322
  0: PeerSocketReceipt_Observation.notSet
8283
8323
  };
8284
8324
  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
@@ -8286,12 +8326,14 @@ class PeerSocketReceipt extends $pb.GeneratedMessage {
8286
8326
  package:
8287
8327
  const $pb.PackageName(_omitMessageNames ? '' : 'nomos.runtime.v2'),
8288
8328
  createEmptyInstance: create)
8289
- ..oo(0, [2, 3, 4])
8329
+ ..oo(0, [2, 3, 4, 5])
8290
8330
  ..aOS(1, _omitFieldNames ? '' : 'connectionId')
8291
8331
  ..aOB(2, _omitFieldNames ? '' : 'opened')
8292
8332
  ..a<$core.List<$core.int>>(
8293
8333
  3, _omitFieldNames ? '' : 'received', $pb.PbFieldType.OY)
8294
8334
  ..aOB(4, _omitFieldNames ? '' : 'closed')
8335
+ ..aOM<PeerSocketClosure>(5, _omitFieldNames ? '' : 'closure',
8336
+ subBuilder: PeerSocketClosure.create)
8295
8337
  ..hasRequiredFields = false;
8296
8338
 
8297
8339
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
@@ -8316,11 +8358,13 @@ class PeerSocketReceipt extends $pb.GeneratedMessage {
8316
8358
  @$pb.TagNumber(2)
8317
8359
  @$pb.TagNumber(3)
8318
8360
  @$pb.TagNumber(4)
8361
+ @$pb.TagNumber(5)
8319
8362
  PeerSocketReceipt_Observation whichObservation() =>
8320
8363
  _PeerSocketReceipt_ObservationByTag[$_whichOneof(0)]!;
8321
8364
  @$pb.TagNumber(2)
8322
8365
  @$pb.TagNumber(3)
8323
8366
  @$pb.TagNumber(4)
8367
+ @$pb.TagNumber(5)
8324
8368
  void clearObservation() => $_clearField($_whichOneof(0));
8325
8369
 
8326
8370
  @$pb.TagNumber(1)
@@ -8350,6 +8394,7 @@ class PeerSocketReceipt extends $pb.GeneratedMessage {
8350
8394
  @$pb.TagNumber(3)
8351
8395
  void clearReceived() => $_clearField(3);
8352
8396
 
8397
+ /// A shell that cannot say how the socket ended. Prefer `closure`.
8353
8398
  @$pb.TagNumber(4)
8354
8399
  $core.bool get closed => $_getBF(3);
8355
8400
  @$pb.TagNumber(4)
@@ -8358,6 +8403,318 @@ class PeerSocketReceipt extends $pb.GeneratedMessage {
8358
8403
  $core.bool hasClosed() => $_has(3);
8359
8404
  @$pb.TagNumber(4)
8360
8405
  void clearClosed() => $_clearField(4);
8406
+
8407
+ /// The socket ended, as the shell observed it (CAP-683).
8408
+ @$pb.TagNumber(5)
8409
+ PeerSocketClosure get closure => $_getN(4);
8410
+ @$pb.TagNumber(5)
8411
+ set closure(PeerSocketClosure value) => $_setField(5, value);
8412
+ @$pb.TagNumber(5)
8413
+ $core.bool hasClosure() => $_has(4);
8414
+ @$pb.TagNumber(5)
8415
+ void clearClosure() => $_clearField(5);
8416
+ @$pb.TagNumber(5)
8417
+ PeerSocketClosure ensureClosure() => $_ensure(4);
8418
+ }
8419
+
8420
+ /// How a live socket ended. Bounded: the reason is at most 123 bytes (RFC 6455's close reason).
8421
+ class PeerSocketClosure extends $pb.GeneratedMessage {
8422
+ factory PeerSocketClosure({
8423
+ $core.int? code,
8424
+ $core.String? reason,
8425
+ $core.bool? clean,
8426
+ PeerSocketCloseInitiator? initiator,
8427
+ }) {
8428
+ final result = create();
8429
+ if (code != null) result.code = code;
8430
+ if (reason != null) result.reason = reason;
8431
+ if (clean != null) result.clean = clean;
8432
+ if (initiator != null) result.initiator = initiator;
8433
+ return result;
8434
+ }
8435
+
8436
+ PeerSocketClosure._();
8437
+
8438
+ factory PeerSocketClosure.fromBuffer($core.List<$core.int> data,
8439
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
8440
+ create()..mergeFromBuffer(data, registry);
8441
+ factory PeerSocketClosure.fromJson($core.String json,
8442
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
8443
+ create()..mergeFromJson(json, registry);
8444
+
8445
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
8446
+ _omitMessageNames ? '' : 'PeerSocketClosure',
8447
+ package:
8448
+ const $pb.PackageName(_omitMessageNames ? '' : 'nomos.runtime.v2'),
8449
+ createEmptyInstance: create)
8450
+ ..aI(1, _omitFieldNames ? '' : 'code', fieldType: $pb.PbFieldType.OU3)
8451
+ ..aOS(2, _omitFieldNames ? '' : 'reason')
8452
+ ..aOB(3, _omitFieldNames ? '' : 'clean')
8453
+ ..aE<PeerSocketCloseInitiator>(4, _omitFieldNames ? '' : 'initiator',
8454
+ enumValues: PeerSocketCloseInitiator.values)
8455
+ ..hasRequiredFields = false;
8456
+
8457
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
8458
+ PeerSocketClosure clone() => deepCopy();
8459
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
8460
+ PeerSocketClosure copyWith(void Function(PeerSocketClosure) updates) =>
8461
+ super.copyWith((message) => updates(message as PeerSocketClosure))
8462
+ as PeerSocketClosure;
8463
+
8464
+ @$core.override
8465
+ $pb.BuilderInfo get info_ => _i;
8466
+
8467
+ @$core.pragma('dart2js:noInline')
8468
+ static PeerSocketClosure create() => PeerSocketClosure._();
8469
+ @$core.override
8470
+ PeerSocketClosure createEmptyInstance() => create();
8471
+ @$core.pragma('dart2js:noInline')
8472
+ static PeerSocketClosure getDefault() => _defaultInstance ??=
8473
+ $pb.GeneratedMessage.$_defaultFor<PeerSocketClosure>(create);
8474
+ static PeerSocketClosure? _defaultInstance;
8475
+
8476
+ /// The WebSocket close code, when the close carried one (1000, 1001, 1006, ...).
8477
+ @$pb.TagNumber(1)
8478
+ $core.int get code => $_getIZ(0);
8479
+ @$pb.TagNumber(1)
8480
+ set code($core.int value) => $_setUnsignedInt32(0, value);
8481
+ @$pb.TagNumber(1)
8482
+ $core.bool hasCode() => $_has(0);
8483
+ @$pb.TagNumber(1)
8484
+ void clearCode() => $_clearField(1);
8485
+
8486
+ @$pb.TagNumber(2)
8487
+ $core.String get reason => $_getSZ(1);
8488
+ @$pb.TagNumber(2)
8489
+ set reason($core.String value) => $_setString(1, value);
8490
+ @$pb.TagNumber(2)
8491
+ $core.bool hasReason() => $_has(1);
8492
+ @$pb.TagNumber(2)
8493
+ void clearReason() => $_clearField(2);
8494
+
8495
+ /// The closing handshake completed.
8496
+ @$pb.TagNumber(3)
8497
+ $core.bool get clean => $_getBF(2);
8498
+ @$pb.TagNumber(3)
8499
+ set clean($core.bool value) => $_setBool(2, value);
8500
+ @$pb.TagNumber(3)
8501
+ $core.bool hasClean() => $_has(2);
8502
+ @$pb.TagNumber(3)
8503
+ void clearClean() => $_clearField(3);
8504
+
8505
+ @$pb.TagNumber(4)
8506
+ PeerSocketCloseInitiator get initiator => $_getN(3);
8507
+ @$pb.TagNumber(4)
8508
+ set initiator(PeerSocketCloseInitiator value) => $_setField(4, value);
8509
+ @$pb.TagNumber(4)
8510
+ $core.bool hasInitiator() => $_has(3);
8511
+ @$pb.TagNumber(4)
8512
+ void clearInitiator() => $_clearField(4);
8513
+ }
8514
+
8515
+ /// One closed live connection, correlated with what that connection had carried (CAP-683). The
8516
+ /// runtime keeps a bounded record of recent closes; nothing here costs a history walk or a network
8517
+ /// call, and none of it is on the write path.
8518
+ class LiveLinkClosure extends $pb.GeneratedMessage {
8519
+ factory LiveLinkClosure({
8520
+ $core.String? connectionId,
8521
+ $core.String? workspace,
8522
+ LiveLinkRole? role,
8523
+ PeerSocketClosure? socket,
8524
+ $fixnum.Int64? closedAtUnixMillis,
8525
+ $fixnum.Int64? openMillis,
8526
+ $core.int? admissions,
8527
+ $core.String? lastAdmissionRequestId,
8528
+ $core.String? lastAdmittedMain,
8529
+ $core.String? lastSealedMain,
8530
+ $core.String? lastFrontier,
8531
+ $core.int? unansweredBatches,
8532
+ }) {
8533
+ final result = create();
8534
+ if (connectionId != null) result.connectionId = connectionId;
8535
+ if (workspace != null) result.workspace = workspace;
8536
+ if (role != null) result.role = role;
8537
+ if (socket != null) result.socket = socket;
8538
+ if (closedAtUnixMillis != null)
8539
+ result.closedAtUnixMillis = closedAtUnixMillis;
8540
+ if (openMillis != null) result.openMillis = openMillis;
8541
+ if (admissions != null) result.admissions = admissions;
8542
+ if (lastAdmissionRequestId != null)
8543
+ result.lastAdmissionRequestId = lastAdmissionRequestId;
8544
+ if (lastAdmittedMain != null) result.lastAdmittedMain = lastAdmittedMain;
8545
+ if (lastSealedMain != null) result.lastSealedMain = lastSealedMain;
8546
+ if (lastFrontier != null) result.lastFrontier = lastFrontier;
8547
+ if (unansweredBatches != null) result.unansweredBatches = unansweredBatches;
8548
+ return result;
8549
+ }
8550
+
8551
+ LiveLinkClosure._();
8552
+
8553
+ factory LiveLinkClosure.fromBuffer($core.List<$core.int> data,
8554
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
8555
+ create()..mergeFromBuffer(data, registry);
8556
+ factory LiveLinkClosure.fromJson($core.String json,
8557
+ [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
8558
+ create()..mergeFromJson(json, registry);
8559
+
8560
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(
8561
+ _omitMessageNames ? '' : 'LiveLinkClosure',
8562
+ package:
8563
+ const $pb.PackageName(_omitMessageNames ? '' : 'nomos.runtime.v2'),
8564
+ createEmptyInstance: create)
8565
+ ..aOS(1, _omitFieldNames ? '' : 'connectionId')
8566
+ ..aOS(2, _omitFieldNames ? '' : 'workspace')
8567
+ ..aE<LiveLinkRole>(3, _omitFieldNames ? '' : 'role',
8568
+ enumValues: LiveLinkRole.values)
8569
+ ..aOM<PeerSocketClosure>(4, _omitFieldNames ? '' : 'socket',
8570
+ subBuilder: PeerSocketClosure.create)
8571
+ ..a<$fixnum.Int64>(
8572
+ 5, _omitFieldNames ? '' : 'closedAtUnixMillis', $pb.PbFieldType.OU6,
8573
+ defaultOrMaker: $fixnum.Int64.ZERO)
8574
+ ..a<$fixnum.Int64>(
8575
+ 6, _omitFieldNames ? '' : 'openMillis', $pb.PbFieldType.OU6,
8576
+ defaultOrMaker: $fixnum.Int64.ZERO)
8577
+ ..aI(7, _omitFieldNames ? '' : 'admissions', fieldType: $pb.PbFieldType.OU3)
8578
+ ..aOS(8, _omitFieldNames ? '' : 'lastAdmissionRequestId')
8579
+ ..aOS(9, _omitFieldNames ? '' : 'lastAdmittedMain')
8580
+ ..aOS(10, _omitFieldNames ? '' : 'lastSealedMain')
8581
+ ..aOS(11, _omitFieldNames ? '' : 'lastFrontier')
8582
+ ..aI(12, _omitFieldNames ? '' : 'unansweredBatches',
8583
+ fieldType: $pb.PbFieldType.OU3)
8584
+ ..hasRequiredFields = false;
8585
+
8586
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
8587
+ LiveLinkClosure clone() => deepCopy();
8588
+ @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
8589
+ LiveLinkClosure copyWith(void Function(LiveLinkClosure) updates) =>
8590
+ super.copyWith((message) => updates(message as LiveLinkClosure))
8591
+ as LiveLinkClosure;
8592
+
8593
+ @$core.override
8594
+ $pb.BuilderInfo get info_ => _i;
8595
+
8596
+ @$core.pragma('dart2js:noInline')
8597
+ static LiveLinkClosure create() => LiveLinkClosure._();
8598
+ @$core.override
8599
+ LiveLinkClosure createEmptyInstance() => create();
8600
+ @$core.pragma('dart2js:noInline')
8601
+ static LiveLinkClosure getDefault() => _defaultInstance ??=
8602
+ $pb.GeneratedMessage.$_defaultFor<LiveLinkClosure>(create);
8603
+ static LiveLinkClosure? _defaultInstance;
8604
+
8605
+ @$pb.TagNumber(1)
8606
+ $core.String get connectionId => $_getSZ(0);
8607
+ @$pb.TagNumber(1)
8608
+ set connectionId($core.String value) => $_setString(0, value);
8609
+ @$pb.TagNumber(1)
8610
+ $core.bool hasConnectionId() => $_has(0);
8611
+ @$pb.TagNumber(1)
8612
+ void clearConnectionId() => $_clearField(1);
8613
+
8614
+ @$pb.TagNumber(2)
8615
+ $core.String get workspace => $_getSZ(1);
8616
+ @$pb.TagNumber(2)
8617
+ set workspace($core.String value) => $_setString(1, value);
8618
+ @$pb.TagNumber(2)
8619
+ $core.bool hasWorkspace() => $_has(1);
8620
+ @$pb.TagNumber(2)
8621
+ void clearWorkspace() => $_clearField(2);
8622
+
8623
+ @$pb.TagNumber(3)
8624
+ LiveLinkRole get role => $_getN(2);
8625
+ @$pb.TagNumber(3)
8626
+ set role(LiveLinkRole value) => $_setField(3, value);
8627
+ @$pb.TagNumber(3)
8628
+ $core.bool hasRole() => $_has(2);
8629
+ @$pb.TagNumber(3)
8630
+ void clearRole() => $_clearField(3);
8631
+
8632
+ @$pb.TagNumber(4)
8633
+ PeerSocketClosure get socket => $_getN(3);
8634
+ @$pb.TagNumber(4)
8635
+ set socket(PeerSocketClosure value) => $_setField(4, value);
8636
+ @$pb.TagNumber(4)
8637
+ $core.bool hasSocket() => $_has(3);
8638
+ @$pb.TagNumber(4)
8639
+ void clearSocket() => $_clearField(4);
8640
+ @$pb.TagNumber(4)
8641
+ PeerSocketClosure ensureSocket() => $_ensure(3);
8642
+
8643
+ @$pb.TagNumber(5)
8644
+ $fixnum.Int64 get closedAtUnixMillis => $_getI64(4);
8645
+ @$pb.TagNumber(5)
8646
+ set closedAtUnixMillis($fixnum.Int64 value) => $_setInt64(4, value);
8647
+ @$pb.TagNumber(5)
8648
+ $core.bool hasClosedAtUnixMillis() => $_has(4);
8649
+ @$pb.TagNumber(5)
8650
+ void clearClosedAtUnixMillis() => $_clearField(5);
8651
+
8652
+ /// How long the socket had been open; 0 when it never opened.
8653
+ @$pb.TagNumber(6)
8654
+ $fixnum.Int64 get openMillis => $_getI64(5);
8655
+ @$pb.TagNumber(6)
8656
+ set openMillis($fixnum.Int64 value) => $_setInt64(5, value);
8657
+ @$pb.TagNumber(6)
8658
+ $core.bool hasOpenMillis() => $_has(5);
8659
+ @$pb.TagNumber(6)
8660
+ void clearOpenMillis() => $_clearField(6);
8661
+
8662
+ /// Admissions this connection carried, and the last of them.
8663
+ @$pb.TagNumber(7)
8664
+ $core.int get admissions => $_getIZ(6);
8665
+ @$pb.TagNumber(7)
8666
+ set admissions($core.int value) => $_setUnsignedInt32(6, value);
8667
+ @$pb.TagNumber(7)
8668
+ $core.bool hasAdmissions() => $_has(6);
8669
+ @$pb.TagNumber(7)
8670
+ void clearAdmissions() => $_clearField(7);
8671
+
8672
+ @$pb.TagNumber(8)
8673
+ $core.String get lastAdmissionRequestId => $_getSZ(7);
8674
+ @$pb.TagNumber(8)
8675
+ set lastAdmissionRequestId($core.String value) => $_setString(7, value);
8676
+ @$pb.TagNumber(8)
8677
+ $core.bool hasLastAdmissionRequestId() => $_has(7);
8678
+ @$pb.TagNumber(8)
8679
+ void clearLastAdmissionRequestId() => $_clearField(8);
8680
+
8681
+ @$pb.TagNumber(9)
8682
+ $core.String get lastAdmittedMain => $_getSZ(8);
8683
+ @$pb.TagNumber(9)
8684
+ set lastAdmittedMain($core.String value) => $_setString(8, value);
8685
+ @$pb.TagNumber(9)
8686
+ $core.bool hasLastAdmittedMain() => $_has(8);
8687
+ @$pb.TagNumber(9)
8688
+ void clearLastAdmittedMain() => $_clearField(9);
8689
+
8690
+ @$pb.TagNumber(10)
8691
+ $core.String get lastSealedMain => $_getSZ(9);
8692
+ @$pb.TagNumber(10)
8693
+ set lastSealedMain($core.String value) => $_setString(9, value);
8694
+ @$pb.TagNumber(10)
8695
+ $core.bool hasLastSealedMain() => $_has(9);
8696
+ @$pb.TagNumber(10)
8697
+ void clearLastSealedMain() => $_clearField(10);
8698
+
8699
+ /// The last frontier the upstream announced on this connection.
8700
+ @$pb.TagNumber(11)
8701
+ $core.String get lastFrontier => $_getSZ(10);
8702
+ @$pb.TagNumber(11)
8703
+ set lastFrontier($core.String value) => $_setString(10, value);
8704
+ @$pb.TagNumber(11)
8705
+ $core.bool hasLastFrontier() => $_has(10);
8706
+ @$pb.TagNumber(11)
8707
+ void clearLastFrontier() => $_clearField(11);
8708
+
8709
+ /// This replica's own batches still awaiting their admission when it closed.
8710
+ @$pb.TagNumber(12)
8711
+ $core.int get unansweredBatches => $_getIZ(11);
8712
+ @$pb.TagNumber(12)
8713
+ set unansweredBatches($core.int value) => $_setUnsignedInt32(11, value);
8714
+ @$pb.TagNumber(12)
8715
+ $core.bool hasUnansweredBatches() => $_has(11);
8716
+ @$pb.TagNumber(12)
8717
+ void clearUnansweredBatches() => $_clearField(12);
8361
8718
  }
8362
8719
 
8363
8720
  class PeerSocketObserved extends $pb.GeneratedMessage {
@@ -129,5 +129,70 @@ class DeviceRecoveryAdmissionStage extends $pb.ProtobufEnum {
129
129
  const DeviceRecoveryAdmissionStage._(super.value, super.name);
130
130
  }
131
131
 
132
+ /// Who ended a live socket.
133
+ class PeerSocketCloseInitiator extends $pb.ProtobufEnum {
134
+ static const PeerSocketCloseInitiator
135
+ PEER_SOCKET_CLOSE_INITIATOR_UNSPECIFIED = PeerSocketCloseInitiator._(
136
+ 0, _omitEnumNames ? '' : 'PEER_SOCKET_CLOSE_INITIATOR_UNSPECIFIED');
137
+
138
+ /// The runtime asked for it: a PeerSocketEffect close (a timed-out open, a disconnect).
139
+ static const PeerSocketCloseInitiator PEER_SOCKET_CLOSE_INITIATOR_RUNTIME =
140
+ PeerSocketCloseInitiator._(
141
+ 1, _omitEnumNames ? '' : 'PEER_SOCKET_CLOSE_INITIATOR_RUNTIME');
142
+
143
+ /// The shell, on its own account: the origin fence refused the open, a send found no open
144
+ /// socket, a receipt could not be delivered, or the host shut down.
145
+ static const PeerSocketCloseInitiator PEER_SOCKET_CLOSE_INITIATOR_SHELL =
146
+ PeerSocketCloseInitiator._(
147
+ 2, _omitEnumNames ? '' : 'PEER_SOCKET_CLOSE_INITIATOR_SHELL');
148
+
149
+ /// The remote end or the network: a close frame, a reset, or a connect that failed.
150
+ static const PeerSocketCloseInitiator PEER_SOCKET_CLOSE_INITIATOR_REMOTE =
151
+ PeerSocketCloseInitiator._(
152
+ 3, _omitEnumNames ? '' : 'PEER_SOCKET_CLOSE_INITIATOR_REMOTE');
153
+
154
+ static const $core.List<PeerSocketCloseInitiator> values =
155
+ <PeerSocketCloseInitiator>[
156
+ PEER_SOCKET_CLOSE_INITIATOR_UNSPECIFIED,
157
+ PEER_SOCKET_CLOSE_INITIATOR_RUNTIME,
158
+ PEER_SOCKET_CLOSE_INITIATOR_SHELL,
159
+ PEER_SOCKET_CLOSE_INITIATOR_REMOTE,
160
+ ];
161
+
162
+ static final $core.List<PeerSocketCloseInitiator?> _byValue =
163
+ $pb.ProtobufEnum.$_initByValueList(values, 3);
164
+ static PeerSocketCloseInitiator? valueOf($core.int value) =>
165
+ value < 0 || value >= _byValue.length ? null : _byValue[value];
166
+
167
+ const PeerSocketCloseInitiator._(super.value, super.name);
168
+ }
169
+
170
+ /// Which side of the live link a connection served.
171
+ class LiveLinkRole extends $pb.ProtobufEnum {
172
+ static const LiveLinkRole LIVE_LINK_ROLE_UNSPECIFIED =
173
+ LiveLinkRole._(0, _omitEnumNames ? '' : 'LIVE_LINK_ROLE_UNSPECIFIED');
174
+
175
+ /// A replica following its upstream custodian.
176
+ static const LiveLinkRole LIVE_LINK_ROLE_PEER =
177
+ LiveLinkRole._(1, _omitEnumNames ? '' : 'LIVE_LINK_ROLE_PEER');
178
+
179
+ /// A hosted publisher relaying a custodian's frontier.
180
+ static const LiveLinkRole LIVE_LINK_ROLE_RELAY =
181
+ LiveLinkRole._(2, _omitEnumNames ? '' : 'LIVE_LINK_ROLE_RELAY');
182
+
183
+ static const $core.List<LiveLinkRole> values = <LiveLinkRole>[
184
+ LIVE_LINK_ROLE_UNSPECIFIED,
185
+ LIVE_LINK_ROLE_PEER,
186
+ LIVE_LINK_ROLE_RELAY,
187
+ ];
188
+
189
+ static final $core.List<LiveLinkRole?> _byValue =
190
+ $pb.ProtobufEnum.$_initByValueList(values, 2);
191
+ static LiveLinkRole? valueOf($core.int value) =>
192
+ value < 0 || value >= _byValue.length ? null : _byValue[value];
193
+
194
+ const LiveLinkRole._(super.value, super.name);
195
+ }
196
+
132
197
  const $core.bool _omitEnumNames =
133
198
  $core.bool.fromEnvironment('protobuf.omit_enum_names');