@githolon/dsl 0.100.5 → 0.101.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 (97) hide show
  1. package/dart/CHANGELOG.md +12 -0
  2. package/dart/lib/src/dev_cloud.dart +46 -15
  3. package/dart/lib/src/test_harness.dart +220 -71
  4. package/dart/lib/src/webview_bridge.dart +640 -126
  5. package/dart/pubspec.lock +1 -1
  6. package/dart/pubspec.yaml +2 -2
  7. package/dart/test/acquire_session_credentials_test.dart +1 -1
  8. package/dart/test/adv_realm_interference_test.dart +1 -1
  9. package/dart/test/bundle_version_pairing_test.dart +11 -22
  10. package/dart/test/cluster_attested_test.dart +1 -1
  11. package/dart/test/cluster_births_test.dart +1 -1
  12. package/dart/test/cluster_device_keyed_acceptance_test.dart +1 -1
  13. package/dart/test/cluster_local_autosync_test.dart +1 -1
  14. package/dart/test/cluster_scale_test.dart +1 -1
  15. package/dart/test/co2_product_gauntlet_test.dart +228 -0
  16. package/dart/test/dlq_session_surface_test.dart +1 -1
  17. package/dart/test/errors_test.dart +63 -12
  18. package/dart/test/first_app_gauntlet_test.dart +132 -87
  19. package/dart/test/local_sync_inert_test.dart +10 -5
  20. package/dart/test/parent_signer_recovery_test.dart +1 -1
  21. package/dart/test/sealing_client_test.dart +1 -1
  22. package/dart/test/session_bound_test.dart +1 -1
  23. package/dart/test/test_harness_test.dart +2 -2
  24. package/dart/test/vo_read_typing_test.dart +1 -1
  25. package/dart/test/watch_after_offer_stall_test.dart +1 -1
  26. package/dart/test/webview_bridge_test.dart +274 -0
  27. package/dart_types/CHANGELOG.md +6 -0
  28. package/dart_types/lib/src/errors.dart +136 -30
  29. package/dart_types/lib/src/surfaced.dart +48 -2
  30. package/dart_types/lib/src/wire.dart +3 -1
  31. package/dart_types/pubspec.yaml +1 -1
  32. package/dart_types/test/surfaced_test.dart +19 -0
  33. package/package.json +1 -1
  34. package/src/activity.ts +43 -4
  35. package/src/aggregate.ts +132 -22
  36. package/src/attested_core.ts +1 -1
  37. package/src/authoring.ts +119 -6
  38. package/src/birth_meter.ts +4 -4
  39. package/src/birth_meter_ensure.ts +165 -29
  40. package/src/births.ts +53 -22
  41. package/src/build_package.ts +96 -20
  42. package/src/business_birth.ts +79 -16
  43. package/src/codegen_dart.ts +267 -37
  44. package/src/codegen_dart_client.ts +930 -87
  45. package/src/codegen_openapi.ts +28 -5
  46. package/src/codegen_proof.ts +107 -11
  47. package/src/codegen_ts.ts +961 -135
  48. package/src/compile_package_main.ts +172 -53
  49. package/src/conflicts.ts +252 -0
  50. package/src/describe_model.ts +448 -0
  51. package/src/directive.ts +5 -38
  52. package/src/drivers.ts +12 -4
  53. package/src/engine_entry.ts +4 -0
  54. package/src/evolve_preview.ts +72 -11
  55. package/src/fields.ts +201 -55
  56. package/src/framework/application_home.ts +103 -0
  57. package/src/framework/application_home_domain.ts +2 -0
  58. package/src/framework/attested_receipts.ts +2 -2
  59. package/src/framework/auth_provider_law.ts +51 -24
  60. package/src/framework/business_corrections.ts +170 -0
  61. package/src/framework/disclosure.ts +1 -1
  62. package/src/framework/domain_lifecycle.ts +250 -16
  63. package/src/framework/encryption_identity.ts +1 -1
  64. package/src/framework/encryption_scope.ts +21 -13
  65. package/src/framework/era_certification.ts +1 -1
  66. package/src/framework/framework_aggregates.ts +2 -0
  67. package/src/framework/genesis.ts +1 -1
  68. package/src/framework/home.ts +22 -9
  69. package/src/framework/identity.ts +5 -5
  70. package/src/framework/impure_capability.ts +2 -2
  71. package/src/framework/owned_custody.ts +561 -0
  72. package/src/framework/platform_admin.ts +1 -1
  73. package/src/framework/relations.ts +9 -1
  74. package/src/framework/repair.ts +1 -1
  75. package/src/framework/signing_identity.ts +2 -2
  76. package/src/framework/source_roster.ts +1 -1
  77. package/src/framework/workspaces.ts +17 -10
  78. package/src/generated_client_names.ts +39 -0
  79. package/src/index.ts +20 -15
  80. package/src/kernel_capabilities.ts +25 -1
  81. package/src/law_check.ts +4 -1
  82. package/src/manifest.ts +356 -63
  83. package/src/read_projection_manifest.ts +8 -0
  84. package/src/read_projection_namespace.ts +4 -0
  85. package/src/relation.ts +1 -1
  86. package/src/shape_compat.ts +61 -5
  87. package/src/stable_ids.ts +38 -6
  88. package/src/stable_ids_types.ts +30 -0
  89. package/src/surfaced_lint.ts +0 -0
  90. package/src/usd.ts +62 -11
  91. package/src/usd_layers.ts +54 -3
  92. package/src/value_object.ts +23 -19
  93. package/src/wire.ts +1 -0
  94. package/src/wire_encode.ts +48 -4
  95. package/src/workspace_routing.ts +57 -0
  96. package/src/workspace_sharding.ts +9 -9
  97. package/src/certified_read.ts +0 -313
package/dart/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 0.63.0
2
+
3
+ - Generated clients now expose business-first conflict policy, schema-aware merge continuation and recursive
4
+ organisation descriptions. The client privately owns lifecycle discovery, parent/child traversal, signer
5
+ custody and replay; applications follow typed business references rather than framework routes.
6
+
7
+ ## 0.62.2
8
+
9
+ - Make `NomosTestHarness` own a complete, verifiable local trust lineage. Tests still bind a business actor
10
+ and call the generated birth method; the harness privately mints its test root, seats the signer and
11
+ delegation, lands the warrant in order, and refuses any child whose full chain does not replay to that root.
12
+
1
13
  ## 0.62.1
2
14
 
3
15
  - Align the public Dart documentation with the one Flutter application entry point: identity comes from the
@@ -49,10 +49,12 @@ class NomosTestCloud {
49
49
  final Uri _upstream; // the real dev-cloud origin the proxy forwards to
50
50
  final HttpClient _client;
51
51
  final void Function(String line)? _onDiagnostic;
52
+ final String? testKRootPublic;
52
53
  bool _online = true;
53
54
  bool _stopped = false;
54
55
 
55
- NomosTestCloud._(this._server, this._proxy, this._upstream, this._client, this._onDiagnostic);
56
+ NomosTestCloud._(this._server, this._proxy, this._upstream, this._client,
57
+ this._onDiagnostic, this.testKRootPublic);
56
58
 
57
59
  /// The base URL a cloud-BOUND session connects to (`connect(cloud: cloud.origin)`). Points at the PARTITION
58
60
  /// PROXY, so [setOnline] deterministically severs/heals the whole plane's link to custody.
@@ -63,7 +65,8 @@ class NomosTestCloud {
63
65
  /// cloud and peers converge. Deterministic: no timing races, the test decides exactly when the link exists.
64
66
  void setOnline(bool online) {
65
67
  _online = online;
66
- _log('partition: ${online ? "ONLINE (link up)" : "OFFLINE (link severed)"}');
68
+ _log(
69
+ 'partition: ${online ? "ONLINE (link up)" : "OFFLINE (link severed)"}');
67
70
  }
68
71
 
69
72
  bool get online => _online;
@@ -72,8 +75,10 @@ class NomosTestCloud {
72
75
  /// live cloud state DIRECTLY (bypassing the partition proxy) — a test assertion about custody must see the
73
76
  /// truth even while the app's link is partitioned OFFLINE.
74
77
  Future<RemoteWorkspaceState> remoteHead(String workspace) async {
75
- final body = await _getJson(_upstream.replace(path: '/v2/workspaces/$workspace'));
76
- final ledger = (body['ledgerState'] as Map?)?.cast<String, Object?>() ?? const {};
78
+ final body =
79
+ await _getJson(_upstream.replace(path: '/v2/workspaces/$workspace'));
80
+ final ledger =
81
+ (body['ledgerState'] as Map?)?.cast<String, Object?>() ?? const {};
77
82
  return RemoteWorkspaceState(
78
83
  workspace: workspace,
79
84
  initialized: body['initialized'] == true,
@@ -109,7 +114,8 @@ class NomosTestCloud {
109
114
  final chosenPort = port == 0 ? await _freePort() : port;
110
115
  final args = <String>[
111
116
  serverEntry,
112
- '--port', '$chosenPort',
117
+ '--port',
118
+ '$chosenPort',
113
119
  if (ephemeral) '--ephemeral',
114
120
  if (dataDir != null) ...['--data', dataDir],
115
121
  if (platform != null) ...['--platform', platform],
@@ -118,8 +124,14 @@ class NomosTestCloud {
118
124
  void log(String m) => onDiagnostic?.call('[nomos-test-cloud] $m');
119
125
  log('spawning: $node ${args.join(' ')}');
120
126
  final proc = await Process.start(node, args, mode: ProcessStartMode.normal);
121
- proc.stdout.transform(utf8.decoder).transform(const LineSplitter()).listen((l) => log('server: $l'));
122
- proc.stderr.transform(utf8.decoder).transform(const LineSplitter()).listen((l) => log('server!: $l'));
127
+ proc.stdout
128
+ .transform(utf8.decoder)
129
+ .transform(const LineSplitter())
130
+ .listen((l) => log('server: $l'));
131
+ proc.stderr
132
+ .transform(utf8.decoder)
133
+ .transform(const LineSplitter())
134
+ .listen((l) => log('server!: $l'));
123
135
 
124
136
  final upstream = Uri.parse('http://127.0.0.1:$chosenPort');
125
137
  final client = HttpClient();
@@ -128,6 +140,7 @@ class NomosTestCloud {
128
140
  // half-born platform's typed refusals.
129
141
  final deadline = DateTime.now().add(readyTimeout);
130
142
  var ready = false;
143
+ String? testKRootPublic;
131
144
  while (DateTime.now().isBefore(deadline)) {
132
145
  try {
133
146
  final req = await client.getUrl(upstream.replace(path: '/health'));
@@ -136,7 +149,11 @@ class NomosTestCloud {
136
149
  if (resp.statusCode == 200) {
137
150
  final health = jsonDecode(body) as Map<String, dynamic>;
138
151
  final platformReady = health['platformReady'];
139
- if (platform == null || platformReady == true) { ready = true; break; }
152
+ if (platform == null || platformReady == true) {
153
+ testKRootPublic = health['testKRootPublic']?.toString();
154
+ ready = true;
155
+ break;
156
+ }
140
157
  }
141
158
  } catch (_) {/* not up yet */}
142
159
  await Future<void>.delayed(const Duration(milliseconds: 200));
@@ -150,7 +167,8 @@ class NomosTestCloud {
150
167
 
151
168
  // The partition proxy — forwards to the dev cloud when ONLINE, fails fast when OFFLINE.
152
169
  final proxy = await HttpServer.bind(InternetAddress.loopbackIPv4, 0);
153
- final cloud = NomosTestCloud._(proc, proxy, upstream, client, onDiagnostic);
170
+ final cloud = NomosTestCloud._(
171
+ proc, proxy, upstream, client, onDiagnostic, testKRootPublic);
154
172
  proxy.listen(cloud._handleProxy);
155
173
  log('partition proxy at ${cloud.origin} → $upstream');
156
174
  return cloud;
@@ -168,16 +186,26 @@ class NomosTestCloud {
168
186
  return;
169
187
  }
170
188
  try {
171
- final target = _upstream.replace(path: req.uri.path, query: req.uri.query.isEmpty ? null : req.uri.query);
189
+ final target = _upstream.replace(
190
+ path: req.uri.path,
191
+ query: req.uri.query.isEmpty ? null : req.uri.query);
172
192
  final fwd = await _client.openUrl(req.method, target);
173
- req.headers.forEach((name, values) { if (name.toLowerCase() != 'host') for (final v in values) fwd.headers.add(name, v); });
193
+ req.headers.forEach((name, values) {
194
+ if (name.toLowerCase() != 'host')
195
+ for (final v in values) fwd.headers.add(name, v);
196
+ });
174
197
  await fwd.addStream(req); // forward the request body
175
198
  final resp = await fwd.close();
176
199
  req.response.statusCode = resp.statusCode;
177
- resp.headers.forEach((name, values) { for (final v in values) req.response.headers.add(name, v); });
200
+ resp.headers.forEach((name, values) {
201
+ for (final v in values) req.response.headers.add(name, v);
202
+ });
178
203
  await resp.pipe(req.response);
179
204
  } catch (e) {
180
- try { req.response.statusCode = 502; await req.response.close(); } catch (_) {}
205
+ try {
206
+ req.response.statusCode = 502;
207
+ await req.response.close();
208
+ } catch (_) {}
181
209
  }
182
210
  }
183
211
 
@@ -186,7 +214,8 @@ class NomosTestCloud {
186
214
  final resp = await req.close();
187
215
  final text = await resp.transform(utf8.decoder).join();
188
216
  if (resp.statusCode != 200) {
189
- throw NomosTestCloudException('GET $url → ${resp.statusCode}: ${text.substring(0, text.length.clamp(0, 200))}');
217
+ throw NomosTestCloudException(
218
+ 'GET $url → ${resp.statusCode}: ${text.substring(0, text.length.clamp(0, 200))}');
190
219
  }
191
220
  return (jsonDecode(text) as Map).cast<String, Object?>();
192
221
  }
@@ -198,7 +227,9 @@ class NomosTestCloud {
198
227
  if (_stopped) return;
199
228
  _stopped = true;
200
229
  _log('stopping');
201
- try { await _proxy.close(force: true); } catch (_) {}
230
+ try {
231
+ await _proxy.close(force: true);
232
+ } catch (_) {}
202
233
  _server.kill(ProcessSignal.sigterm);
203
234
  // Give it a moment, then SIGKILL if still alive.
204
235
  try {