@githolon/dsl 0.101.5 → 0.102.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.
- package/dart/CHANGELOG.md +13 -0
- package/dart/lib/nomos_client.dart +3 -52
- package/dart/lib/src/dev_cloud.dart +5 -0
- package/dart/lib/src/home.dart +10 -15
- package/dart/lib/src/nms_conformance_runtime.dart +12 -0
- package/dart/lib/src/nms_generated_runtime.dart +29 -0
- package/dart/lib/src/nms_test_environment.dart +8 -0
- package/dart/lib/src/node_runner_transport.dart +56 -18
- package/dart/lib/src/provider.dart +5 -1
- package/dart/lib/src/record_origin.dart +55 -0
- package/dart/lib/src/runner/node-entry.mjs +9105 -0
- package/dart/lib/src/runner/offline-install.mjs +4729 -0
- package/dart/lib/src/session_bound.dart +23 -10
- package/dart/lib/src/source_trust.dart +51 -0
- package/dart/lib/src/test_harness.dart +490 -58
- package/dart/lib/src/webview_bridge.dart +167 -58
- package/dart/lib/src/workspace_name.dart +7 -1
- package/dart/pubspec.lock +3 -3
- package/dart/pubspec.yaml +4 -2
- package/dart/test/acquire_session_credentials_test.dart +34 -17
- package/dart/test/acquire_session_test.dart +109 -24
- package/dart/test/adv_realm_interference_test.dart +227 -99
- package/dart/test/bundle_version_pairing_test.dart +1 -1
- package/dart/test/cloud_bound_topology_test.dart +1 -1
- package/dart/test/cluster_attested_test.dart +52 -35
- package/dart/test/cluster_births_test.dart +5 -2
- package/dart/test/cluster_device_keyed_acceptance_test.dart +5 -2
- package/dart/test/cluster_local_autosync_test.dart +5 -2
- package/dart/test/cluster_scale_test.dart +5 -2
- package/dart/test/compat_test.dart +1 -1
- package/dart/test/dlq_session_surface_test.dart +2 -1
- package/dart/test/errors_test.dart +1 -1
- package/dart/test/first_app_gauntlet_test.dart +78 -51
- package/dart/test/four_layer_nested_topology_test.dart +1 -1
- package/dart/test/harness_phase_timeout_test.dart +1 -1
- package/dart/test/home_parity_test.dart +9 -5
- package/dart/test/local_sync_inert_test.dart +22 -14
- package/dart/test/node_runner_transport_test.dart +9 -5
- package/dart/test/null_slot_test.dart +1 -1
- package/dart/test/parent_signer_recovery_test.dart +5 -2
- package/dart/test/schema_validation_test.dart +1 -1
- package/dart/test/sealing_client_test.dart +2 -1
- package/dart/test/session_bound_test.dart +92 -119
- package/dart/test/stale_bundle_test.dart +1 -1
- package/dart/test/test_harness_test.dart +77 -22
- package/dart/test/vo_read_typing_test.dart +32 -14
- package/dart/test/watch_after_offer_stall_test.dart +2 -1
- package/dart/test/webview_bridge_test.dart +17 -4
- package/dart/test/wire_test.dart +1 -1
- package/dart_types/CHANGELOG.md +8 -0
- package/dart_types/lib/nomos_types.dart +7 -6
- package/dart_types/lib/src/activity.dart +23 -13
- package/dart_types/lib/src/foreign_ref.dart +61 -112
- package/dart_types/lib/src/invitation.dart +96 -0
- package/dart_types/lib/src/nomos_ref.dart +97 -59
- package/dart_types/pubspec.yaml +1 -1
- package/dart_types/test/surfaced_test.dart +125 -19
- package/package.json +7 -3
- package/runtime/generated-application-host.js +8851 -0
- package/src/activity.ts +2 -2
- package/src/aggregate.ts +24 -1
- package/src/application_composition.ts +282 -0
- package/src/application_topology.ts +151 -0
- package/src/attested_core.ts +2 -2
- package/src/authoring_context.ts +9 -0
- package/src/birth_meter_ensure.ts +1 -1
- package/src/births.ts +53 -5
- package/src/build_package.ts +79 -71
- package/src/business_birth.ts +93 -10
- package/src/clear_directive.ts +3 -1
- package/src/codegen_dart.ts +369 -420
- package/src/codegen_dart_application.ts +1508 -0
- package/src/codegen_dart_client.ts +156 -95
- package/src/codegen_dart_scenario.ts +299 -0
- package/src/codegen_openapi.ts +8 -3
- package/src/codegen_proof.ts +1113 -1137
- package/src/codegen_provider_dart.ts +12 -1
- package/src/codegen_ts.ts +1176 -496
- package/src/compat_package_main.ts +22 -10
- package/src/compile_package_main.ts +1536 -337
- package/src/contract.ts +10 -4
- package/src/dart_barrel_guard.ts +5 -1
- package/src/describe_model.ts +13 -5
- package/src/directive.ts +244 -5
- package/src/engine_entry.ts +56 -13
- package/src/engine_javascript.ts +31 -0
- package/src/evolve_preview.ts +3 -12
- package/src/framework/application_home.ts +24 -10
- package/src/framework/capability.ts +15 -1
- package/src/framework/domain_lifecycle.ts +8 -0
- package/src/framework/framework_aggregates.ts +2 -2
- package/src/framework/genesis.ts +11 -1
- package/src/framework/home.ts +178 -75
- package/src/framework/impure_capability.ts +24 -7
- package/src/framework/relations.ts +13 -5
- package/src/framework/workspaces.ts +13 -12
- package/src/generated_client_names.ts +42 -3
- package/src/idof_lint.ts +65 -13
- package/src/index.ts +46 -12
- package/src/intent.ts +587 -0
- package/src/law_check.ts +64 -16
- package/src/precondition.ts +16 -4
- package/src/read_projection_namespace.ts +2 -7
- package/src/recipient.ts +33 -0
- package/src/relation_schema.ts +93 -0
- package/src/secondary_ensure.ts +11 -2
- package/src/shape_compat.ts +11 -1
- package/src/usd.ts +30 -8
- package/src/usd_layers.ts +447 -246
- package/src/usd_state.ts +1 -1
- package/src/value_object.ts +49 -13
- package/src/wire_encode.ts +124 -26
- package/src/workspace_sharing.ts +269 -0
- package/src/zod_introspection.ts +84 -0
- package/dart/example/nomos_secure_key_store.dart +0 -82
- package/dart/example/nomos_webview_transport.dart +0 -63
- package/dart/lib/nomos_headless.dart +0 -50
- package/dart/lib/testing.dart +0 -14
- package/dart/test/co2_product_gauntlet_test.dart +0 -244
- package/src/framework/identity.ts +0 -537
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
/// * [DomainNotInstalledForSession] — the context-rich replacement for the kernel's generic
|
|
22
22
|
/// "no active installed law declares domain 'x'" refusal, thrown wherever that error used to
|
|
23
23
|
/// surface (bridge dispatch, birth lanes) with the full session context.
|
|
24
|
+
@internal
|
|
24
25
|
library;
|
|
25
26
|
|
|
27
|
+
import 'package:meta/meta.dart' show internal;
|
|
28
|
+
|
|
26
29
|
import 'dart:convert';
|
|
27
30
|
|
|
28
31
|
import 'webview_bridge.dart';
|
|
@@ -221,15 +224,18 @@ extension NomosSessionCompat on NomosSession {
|
|
|
221
224
|
// co2 blocker #2: a PROJECTION READ FAILURE (an unmountable/failing query shape — the runner surfaces
|
|
222
225
|
// `nomos.projection.read_failed` carrying the failed query) is NOT "not reachable" and MUST NOT be
|
|
223
226
|
// reclassified as trulyNotDeployed downstream — surface it as its own cause with the real fault text.
|
|
224
|
-
final isProjectionFault =
|
|
225
|
-
e.toString().contains('projection
|
|
227
|
+
final isProjectionFault =
|
|
228
|
+
e.toString().contains('nomos.projection.read_failed') ||
|
|
229
|
+
e.toString().contains('projection read failed');
|
|
226
230
|
throw DomainClientSessionMismatch(
|
|
227
231
|
expectedDomainKey: iface.domain,
|
|
228
232
|
expectedDomainHash: iface.expectedDomainHash,
|
|
229
233
|
expectedInterfaceHash: iface.expectedInterfaceHash,
|
|
230
234
|
sessionId: workspace,
|
|
231
235
|
sessionWorkspace: workspace,
|
|
232
|
-
cause: isProjectionFault
|
|
236
|
+
cause: isProjectionFault
|
|
237
|
+
? SessionMismatchCause.projectionReadFailed
|
|
238
|
+
: null,
|
|
233
239
|
hint: isProjectionFault
|
|
234
240
|
? 'the workspace law could NOT be READ — a projection/mount failure (NOT undeployed law): $e'
|
|
235
241
|
: 'the session workspace is not reachable/mounted on this plane: $e',
|
|
@@ -244,7 +250,9 @@ extension NomosSessionCompat on NomosSession {
|
|
|
244
250
|
(jsonDecode(iface.compatJson!) as Map).cast<String, Object?>(),
|
|
245
251
|
iface.requirement);
|
|
246
252
|
if (c != null) activeHashes = c.workspaceRuns;
|
|
247
|
-
} catch (_) {
|
|
253
|
+
} catch (_) {
|
|
254
|
+
/* diagnosis only — never fail the preflight on the hash axis */
|
|
255
|
+
}
|
|
248
256
|
}
|
|
249
257
|
|
|
250
258
|
// 3. THE SHAPE AXIS (#72) — the one compatibility notion. No baked interface ⇒ nothing more to check.
|
|
@@ -272,19 +280,22 @@ extension NomosSessionCompat on NomosSession {
|
|
|
272
280
|
|
|
273
281
|
final missing =
|
|
274
282
|
((verdict['missing'] as List?) ?? const []).map((e) => '$e').toList();
|
|
275
|
-
final incompatible =
|
|
276
|
-
|
|
283
|
+
final incompatible = ((verdict['incompatible'] as List?) ?? const [])
|
|
284
|
+
.map((e) => '$e')
|
|
285
|
+
.toList();
|
|
277
286
|
|
|
278
287
|
// 4. CLASSIFY the four causes (ask 9).
|
|
279
288
|
SessionMismatchCause cause;
|
|
280
289
|
String hint;
|
|
281
290
|
if (incompatible.isNotEmpty) {
|
|
282
291
|
cause = SessionMismatchCause.clientExpectsNewerInterface;
|
|
283
|
-
hint =
|
|
292
|
+
hint =
|
|
293
|
+
'the domain is installed but type-divergent from what this client requires '
|
|
284
294
|
'(${incompatible.join('; ')}) — recompile the client against the deployed law, or evolve the law';
|
|
285
295
|
} else if (activeKeys.isNotEmpty && !activeKeys.contains(iface.domain)) {
|
|
286
296
|
cause = SessionMismatchCause.wrongPackageMounted;
|
|
287
|
-
hint =
|
|
297
|
+
hint =
|
|
298
|
+
'this workspace runs a DIFFERENT package (${activeKeys.join(', ')}) — '
|
|
288
299
|
'bind this client to the session whose workspace holds "${iface.domain}"';
|
|
289
300
|
} else {
|
|
290
301
|
// The domain (or its whole offer) is absent here. Stale-vs-never-deployed: if this session is
|
|
@@ -300,11 +311,13 @@ extension NomosSessionCompat on NomosSession {
|
|
|
300
311
|
} catch (_) {/* best-effort */}
|
|
301
312
|
if (cloudBound && behind > 0) {
|
|
302
313
|
cause = SessionMismatchCause.liveCloudHasLawButLocalStale;
|
|
303
|
-
hint =
|
|
314
|
+
hint =
|
|
315
|
+
'local custody is $behind commit(s) behind its cloud — sync/pull, then re-bind '
|
|
304
316
|
'(missing: ${missing.join('; ')})';
|
|
305
317
|
} else {
|
|
306
318
|
cause = SessionMismatchCause.trulyNotDeployed;
|
|
307
|
-
hint =
|
|
319
|
+
hint =
|
|
320
|
+
'no installed law on this workspace declares "${iface.domain}" — '
|
|
308
321
|
'deploy the domain package first (missing: ${missing.join('; ')})';
|
|
309
322
|
}
|
|
310
323
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@internal
|
|
2
|
+
library;
|
|
3
|
+
|
|
4
|
+
import 'package:meta/meta.dart' show internal;
|
|
5
|
+
|
|
6
|
+
import 'dart:convert';
|
|
7
|
+
|
|
8
|
+
import 'package:crypto/crypto.dart';
|
|
9
|
+
|
|
10
|
+
/// Private support for generated business actions that consume an attested
|
|
11
|
+
/// record from another application. Tenant packages never export this type.
|
|
12
|
+
final class NmsInternalSourceTrust {
|
|
13
|
+
const NmsInternalSourceTrust._();
|
|
14
|
+
|
|
15
|
+
static Map<String, Object?> entry(Map<String, Object?> served) {
|
|
16
|
+
final raw = served['entry'] ?? served;
|
|
17
|
+
if (raw is! Map) {
|
|
18
|
+
throw StateError(
|
|
19
|
+
'Nomos source did not return an attested business record.');
|
|
20
|
+
}
|
|
21
|
+
return raw.cast<String, Object?>();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static Map<String, Object?> attestation(Map<String, Object?> entry) {
|
|
25
|
+
final raw = entry['attestation'];
|
|
26
|
+
if (raw is! Map) {
|
|
27
|
+
throw StateError('Nomos source omitted its signed identity.');
|
|
28
|
+
}
|
|
29
|
+
return raw.cast<String, Object?>();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static String genesis(Map<String, Object?> attestation) {
|
|
33
|
+
final value = (attestation['source_genesis'] ?? '').toString();
|
|
34
|
+
if (value.isEmpty) {
|
|
35
|
+
throw StateError('Nomos source omitted its genesis identity.');
|
|
36
|
+
}
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static String keyHash(Map<String, Object?> attestation) {
|
|
41
|
+
final publicKey = (attestation['public_key'] ?? '').toString();
|
|
42
|
+
if (publicKey.isEmpty) {
|
|
43
|
+
throw StateError('Nomos source omitted its attestation key.');
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
return sha256.convert(base64.decode(publicKey)).toString();
|
|
47
|
+
} on FormatException {
|
|
48
|
+
throw StateError('Nomos source returned an invalid attestation key.');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|