@githolon/dsl 0.115.0 → 0.116.4

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 (39) hide show
  1. package/assets/operation-contract.wasm +0 -0
  2. package/dart/CHANGELOG.md +19 -0
  3. package/dart/lib/src/nms_generated_runtime.dart +1 -0
  4. package/dart/lib/src/result_usda.dart +64 -27
  5. package/dart/lib/src/runner/node-entry.mjs +701 -207
  6. package/dart/lib/src/sync_status_projection.dart +11 -0
  7. package/dart/pubspec.lock +1 -1
  8. package/dart/pubspec.yaml +2 -2
  9. package/dart/test/kernel_refused_follow_test.dart +36 -0
  10. package/dart/test/result_usda_test.dart +67 -0
  11. package/dart_types/CHANGELOG.md +6 -0
  12. package/dart_types/lib/src/proto/nomos/runtime/v2/observability_desk.pbenum.dart +11 -1
  13. package/dart_types/lib/src/vo_canonical.dart +185 -0
  14. package/dart_types/pubspec.lock +1 -1
  15. package/dart_types/pubspec.yaml +3 -1
  16. package/dart_types/test/vo_canonical_test.dart +91 -0
  17. package/package.json +2 -2
  18. package/src/aggregate.ts +3 -1
  19. package/src/baseline_usda.ts +2 -3
  20. package/src/build_package.ts +47 -7
  21. package/src/codegen_call_usda.ts +6 -3
  22. package/src/codegen_dart.ts +19 -57
  23. package/src/codegen_result_usda.ts +8 -4
  24. package/src/compile_package_main.ts +11 -4
  25. package/src/engine_entry.ts +12 -4
  26. package/src/identity_usda.ts +3 -52
  27. package/src/index.ts +10 -0
  28. package/src/intent.ts +28 -3
  29. package/src/law_check.ts +34 -0
  30. package/src/law_graph_usda.ts +2 -3
  31. package/src/law_layer_prims.ts +3 -28
  32. package/src/law_units.ts +7 -6
  33. package/src/law_version.ts +2 -1
  34. package/src/point_guard.ts +5 -1
  35. package/src/release_inspection.ts +6 -4
  36. package/src/release_publication.ts +6 -5
  37. package/src/usda_text.ts +78 -3
  38. package/src/value_identity.ts +355 -0
  39. package/src/value_object.ts +29 -1
Binary file
package/dart/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## 0.70.2
2
+
3
+ - Carries the restaged peer runner for the native host 0.68.1 selection (CAP-874); its runtime identity moves with the runtime's patch release.
4
+
5
+ ## 0.70.1
6
+
7
+ - Carries the 2026.10.2 runtime in the bundled Node peer (CAP-870, CAP-799, CAP-689): a copy whose saved bookmark is stale first asks its workspace's stream to level from its own head, so sync never re-lists history the custodian already holds; a complete custodian answers `off_main` at once for a head it does not hold, so a device with local work offers within seconds instead of a minute; kernel selection streams the download and times fetch, verify and store separately.
8
+
9
+ ## 0.70.0
10
+
11
+ - `WorkspaceFollowPhase.kernelRefused`: the kernel refused the follow's last round at the same local head and remote frontier, so its sync is blocked. No timer re-runs it. It runs again on new local work, an upstream head change, a socket reopen, or a changed kernel or runtime. `retryAt` is set only once such an event has made the follow due, and `detail` carries the kernel's refusal. If you switch exhaustively over `WorkspaceFollowPhase`, add this case.
12
+
13
+ - The bundled Node peer (`--discovery-provider`) keeps its last verified kernel selection under `<custody>/runtime/boot`. A restart while the channel is unreachable boots from it, with the attestation chain checked again (CAP-839).
14
+
15
+ - Read results decode USDA strings with OpenUSD's escape rules (CAP-862): `\a \b \f \n \r \t \v`, `\xHH`, octal `\NNN`, and any other escaped character as itself. The legacy `\uXXXX` that older kernels wrote still decodes. A raw U+2028 or U+2029 inside a string value no longer fails the parse.
16
+ - Generated Dart call encoders write controls as `\xHH` (U+0000–U+001F except the named escapes, and U+007F) and write C1 characters raw. They throw `ArgumentError` on a lone surrogate. Before, a lone surrogate was silently replaced in the UTF-8 bytes.
17
+
18
+ - The generated runtime surface exports `NmsInternalValueIdentity`, which generated value-object `==` and `hashCode` now use (CAP-853).
19
+
1
20
  ## 0.69.0
2
21
 
3
22
  - The test cloud's partition proxy (`NomosTestCloud`) carries live sockets: each workspace's catch-up
@@ -87,3 +87,4 @@ export 'runtime_v2_transport.dart'
87
87
  export 'reception/peer_office_connection.dart' show PeerOfficeConnection;
88
88
 
89
89
  export 'admission_decision.dart';
90
+ export 'package:nomos_types/src/vo_canonical.dart' show NmsInternalValueIdentity;
@@ -331,9 +331,13 @@ final class NmsUsdaResult {
331
331
  abstract final class NmsUsdaLayer {
332
332
  static NmsUsdaPrim parse(Uint8List bytes) => _parseLayer(bytes);
333
333
 
334
+ /// The canonical USDA string literal (CAP-862), byte-identical with the kernel's
335
+ /// `usda_string.rs` and the generated call encoders: `\"` `\\` `\n` `\r` `\t` `\b` `\f`; any
336
+ /// other U+0000–U+001F and U+007F as `\xHH`; C1 and everything else raw. A lone surrogate is
337
+ /// refused rather than silently replaced in the UTF-8 bytes.
334
338
  static String quote(String value) {
335
339
  final out = StringBuffer('"');
336
- for (final code in value.codeUnits) {
340
+ for (final code in value.runes) {
337
341
  switch (code) {
338
342
  case 0x22:
339
343
  out.write(r'\"');
@@ -350,9 +354,12 @@ abstract final class NmsUsdaLayer {
350
354
  case 0x0c:
351
355
  out.write(r'\f');
352
356
  default:
353
- if (code < 0x20) {
354
- out.write(r'\u');
355
- out.write(code.toRadixString(16).padLeft(4, '0'));
357
+ if (code < 0x20 || code == 0x7f) {
358
+ out.write(r'\x');
359
+ out.write(code.toRadixString(16).padLeft(2, '0'));
360
+ } else if (code >= 0xd800 && code <= 0xdfff) {
361
+ throw ArgumentError.value(
362
+ value, 'value', 'Nomos USDA strings cannot carry a lone surrogate');
356
363
  } else {
357
364
  out.writeCharCode(code);
358
365
  }
@@ -361,6 +368,7 @@ abstract final class NmsUsdaLayer {
361
368
  out.write('"');
362
369
  return out.toString();
363
370
  }
371
+
364
372
  }
365
373
 
366
374
  NmsUsdaPrim _parseLayer(Uint8List bytes) {
@@ -406,6 +414,8 @@ NmsUsdaPrim _parseLayer(Uint8List bytes) {
406
414
  }
407
415
  final property = RegExp(
408
416
  r'^custom(?:\s+uniform)?\s+(?:rel|[A-Za-z0-9_\[\]]+)\s+([A-Za-z0-9_:]+)\s*=\s*(.+)$',
417
+ // A raw U+2028/U+2029 inside a string literal is value, not a line break.
418
+ dotAll: true,
409
419
  ).firstMatch(line);
410
420
  if (property != null) {
411
421
  if (stack.isEmpty)
@@ -439,48 +449,75 @@ Object _atom(String source) {
439
449
  throw FormatException('Unsupported USDA value $value');
440
450
  }
441
451
 
452
+ /// Decodes one quoted USDA string with OpenUSD's escape rules (`TfEscapeString`): `\a \b \f \n \r
453
+ /// \t \v`, `\x` with up to two hex digits, `\NNN` with up to three octal digits, and any other
454
+ /// escaped character as itself. A LEGACY `\uXXXX` (written by pre-CAP-862 kernels; OpenUSD has no
455
+ /// `\u`) reads as the scalar it names, as the kernel normalises it.
442
456
  String _unquote(String source) {
443
457
  if (source.length < 2 || !source.startsWith('"') || !source.endsWith('"')) {
444
458
  throw const FormatException('Invalid USDA string');
445
459
  }
460
+ final body = source.substring(1, source.length - 1);
446
461
  final out = StringBuffer();
447
- for (var index = 1; index < source.length - 1; index++) {
448
- final character = source[index];
462
+ int digitsAt(int start, int max, int radix) {
463
+ var count = 0;
464
+ while (count < max &&
465
+ start + count < body.length &&
466
+ int.tryParse(body[start + count], radix: radix) != null) {
467
+ count++;
468
+ }
469
+ return count;
470
+ }
471
+
472
+ for (var index = 0; index < body.length; index++) {
473
+ final character = body[index];
449
474
  if (character != r'\') {
450
475
  out.write(character);
451
476
  continue;
452
477
  }
453
- if (++index >= source.length - 1) {
454
- throw const FormatException('Truncated USDA escape');
455
- }
456
- final escaped = source[index];
478
+ if (++index >= body.length) break;
479
+ final escaped = body[index];
457
480
  switch (escaped) {
481
+ case 'a':
482
+ out.writeCharCode(0x07);
483
+ case 'b':
484
+ out.write('\b');
485
+ case 'f':
486
+ out.write('\f');
458
487
  case 'n':
459
488
  out.write('\n');
460
489
  case 'r':
461
490
  out.write('\r');
462
491
  case 't':
463
492
  out.write('\t');
464
- case 'b':
465
- out.write('\b');
466
- case 'f':
467
- out.write('\f');
468
- case '"':
469
- out.write('"');
470
- case r'\':
471
- out.write(r'\');
493
+ case 'v':
494
+ out.writeCharCode(0x0b);
495
+ case 'x':
496
+ final count = digitsAt(index + 1, 2, 16);
497
+ out.writeCharCode(count == 0
498
+ ? 0
499
+ : int.parse(body.substring(index + 1, index + 1 + count), radix: 16));
500
+ index += count;
472
501
  case 'u':
473
- if (index + 4 >= source.length) {
474
- throw const FormatException('Truncated USDA unicode escape');
502
+ final count = digitsAt(index + 1, 4, 16);
503
+ final code = count == 4
504
+ ? int.parse(body.substring(index + 1, index + 5), radix: 16)
505
+ : null;
506
+ if (code != null && (code < 0xd800 || code > 0xdfff)) {
507
+ out.writeCharCode(code);
508
+ index += 4;
509
+ } else {
510
+ out.write('u');
475
511
  }
476
- final digits = source.substring(index + 1, index + 5);
477
- final code = int.tryParse(digits, radix: 16);
478
- if (code == null)
479
- throw const FormatException('Invalid USDA unicode escape');
480
- out.writeCharCode(code);
481
- index += 4;
482
512
  default:
483
- throw FormatException('Unsupported USDA escape $escaped');
513
+ if (escaped.codeUnitAt(0) >= 0x30 && escaped.codeUnitAt(0) <= 0x37) {
514
+ final count = digitsAt(index, 3, 8);
515
+ out.writeCharCode(
516
+ int.parse(body.substring(index, index + count), radix: 8));
517
+ index += count - 1;
518
+ } else {
519
+ out.write(escaped);
520
+ }
484
521
  }
485
522
  }
486
523
  return out.toString();