@githolon/dsl 0.90.1 → 0.91.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.
|
@@ -400,6 +400,46 @@ class EncryptionRosterMismatch implements Exception {
|
|
|
400
400
|
'EncryptionRosterMismatch: roster for "$scope" != expected (the fan-out gate would refuse): missing $missing, unexpected $extra';
|
|
401
401
|
}
|
|
402
402
|
|
|
403
|
+
/// Thrown when a `.births()` offer ADMITTED on the parent (a head, a 200) but a child workspace did NOT come
|
|
404
|
+
/// up — its `birthOutcomes` entry carried a `status` other than "born" (e.g. `"failed"`/`"refused"` with code
|
|
405
|
+
/// `BirthLawPackageUnavailable`, when the child's law package is not resolvable from the parent's custody).
|
|
406
|
+
/// Without this, the app would open the child and poll `head:null` until timeout with no reason. Callers catch
|
|
407
|
+
/// it to see the child name(s), the kernel [code], and the [reason]. [head] is the parent write that landed.
|
|
408
|
+
class BirthIncomplete implements Exception {
|
|
409
|
+
/// The raw failed birth outcomes (`{ workspace, status, reason, code }`), status != "born".
|
|
410
|
+
final List<Map<String, Object?>> failedBirths;
|
|
411
|
+
|
|
412
|
+
/// The parent write's local head — the parent offer itself sealed; only the child did not come up.
|
|
413
|
+
final String head;
|
|
414
|
+
|
|
415
|
+
BirthIncomplete(this.failedBirths, {this.head = ''});
|
|
416
|
+
|
|
417
|
+
/// The first failed child's kernel code (e.g. `BirthLawPackageUnavailable`), or `BirthFailed`.
|
|
418
|
+
String get code =>
|
|
419
|
+
(failedBirths.isNotEmpty ? failedBirths.first['code']?.toString() : null) ?? 'BirthFailed';
|
|
420
|
+
|
|
421
|
+
/// The child workspace name(s) that did not come up.
|
|
422
|
+
List<String> get workspaces => failedBirths
|
|
423
|
+
.map((o) => (o['workspace'] ?? '').toString())
|
|
424
|
+
.where((s) => s.isNotEmpty)
|
|
425
|
+
.toList();
|
|
426
|
+
|
|
427
|
+
@override
|
|
428
|
+
String toString() {
|
|
429
|
+
final list = failedBirths
|
|
430
|
+
.map((o) =>
|
|
431
|
+
'${o['workspace'] ?? '?'} [${o['status']}${o['code'] != null ? ': ${o['code']}' : ''}]'
|
|
432
|
+
'${o['reason'] != null ? ' — ${o['reason']}' : ''}')
|
|
433
|
+
.join('; ');
|
|
434
|
+
final lawUnavailable =
|
|
435
|
+
failedBirths.any((o) => o['code'] == 'BirthLawPackageUnavailable');
|
|
436
|
+
return 'BirthIncomplete: ${failedBirths.length} child workspace(s) did NOT come up — $list. '
|
|
437
|
+
'The parent offer admitted, but the child was not fully born, so opening it would poll head:null '
|
|
438
|
+
'until timeout. ${lawUnavailable ? "The child's law package is not resolvable from the parent's "
|
|
439
|
+
"custody — deploy it to the parent (POST /v2/workspaces/<parent>/domains) BEFORE birthing." : "See the outcome's reason/code."}';
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
403
443
|
/// The outcome of an epoch-advancing ceremony verb: the new local [head], the [epoch] opened, and the
|
|
404
444
|
/// [roster] the key was wrapped to.
|
|
405
445
|
class NomosEpochResult {
|
|
@@ -1348,6 +1388,16 @@ class NomosBridge {
|
|
|
1348
1388
|
.whereType<Map>()
|
|
1349
1389
|
.map((m) => m.cast<String, Object?>())
|
|
1350
1390
|
.toList();
|
|
1391
|
+
// FAIL FAST on a birth that did NOT come up. The JS holon (index.mjs) already throws on this, so we
|
|
1392
|
+
// normally never see it here — but a runner/bundle skew (an older runner that passes birthOutcomes
|
|
1393
|
+
// through without throwing) must NOT let a silent partial birth reach the app to strand on head:null.
|
|
1394
|
+
// A `status` other than "born" is a failure; throw the typed [BirthIncomplete].
|
|
1395
|
+
final failedBirths = births
|
|
1396
|
+
.where((m) => m['status'] != null && m['status'] != 'born')
|
|
1397
|
+
.toList();
|
|
1398
|
+
if (failedBirths.isNotEmpty) {
|
|
1399
|
+
throw BirthIncomplete(failedBirths, head: (r['head'] ?? '').toString());
|
|
1400
|
+
}
|
|
1351
1401
|
// `born` elements may be plain workspace-name strings OR `{workspace,…}` objects (both shapes ship);
|
|
1352
1402
|
// fall back to the birth outcomes' workspace names when no bare `born` list was sent.
|
|
1353
1403
|
final bornRaw = (r['born'] as List?);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@githolon/dsl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.91.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Nomos 2 domain-authoring DSL: aggregates + directives in TS, executed and encoded to the Rust kernel's wire shapes.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|