@githolon/dsl 0.102.4 → 0.103.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 (131) hide show
  1. package/compile_package.mjs +43 -2
  2. package/compile_proof.d.mts +47 -0
  3. package/compile_proof.mjs +343 -0
  4. package/dart/CHANGELOG.md +7 -0
  5. package/dart/lib/src/dev_cloud.dart +8 -8
  6. package/dart/lib/src/nms_generated_runtime.dart +2 -0
  7. package/dart/lib/src/runner/node-entry.mjs +5504 -1236
  8. package/dart/lib/src/runner/offline-install.mjs +4578 -528
  9. package/dart/lib/src/test_harness.dart +206 -152
  10. package/dart/lib/src/webview_bridge.dart +196 -89
  11. package/dart/pubspec.lock +1 -1
  12. package/dart/pubspec.yaml +2 -2
  13. package/dart/test/acquire_session_credentials_test.dart +4 -3
  14. package/dart/test/adv_realm_interference_test.dart +7 -6
  15. package/dart/test/cloud_bound_topology_test.dart +3 -3
  16. package/dart/test/cluster_births_test.dart +4 -3
  17. package/dart/test/cluster_device_keyed_acceptance_test.dart +10 -16
  18. package/dart/test/cluster_local_autosync_test.dart +3 -2
  19. package/dart/test/cluster_scale_test.dart +3 -2
  20. package/dart/test/dlq_session_surface_test.dart +7 -6
  21. package/dart/test/first_app_gauntlet_test.dart +14 -21
  22. package/dart/test/fixtures/wedge/fake-install.mjs +1 -1
  23. package/dart/test/four_layer_nested_topology_test.dart +4 -4
  24. package/dart/test/harness_phase_timeout_test.dart +2 -2
  25. package/dart/test/local_sync_inert_test.dart +1 -1
  26. package/dart/test/parent_signer_recovery_test.dart +2 -2
  27. package/dart/test/sealing_client_test.dart +4 -3
  28. package/dart/test/session_bound_test.dart +8 -7
  29. package/dart/test/test_harness_test.dart +13 -12
  30. package/dart/test/vo_read_typing_test.dart +4 -3
  31. package/dart/test/watch_after_offer_stall_test.dart +4 -3
  32. package/dart/test/webview_bridge_test.dart +102 -5
  33. package/dart_types/CHANGELOG.md +5 -0
  34. package/dart_types/lib/nomos_types.dart +9 -0
  35. package/dart_types/lib/src/nomos_ref.dart +20 -0
  36. package/dart_types/lib/src/optional_ref.dart +85 -0
  37. package/dart_types/lib/src/sha256_digest.dart +41 -0
  38. package/dart_types/lib/src/versioned_nomos_ref.dart +81 -0
  39. package/dart_types/pubspec.yaml +1 -1
  40. package/dart_types/test/optional_ref_test.dart +44 -0
  41. package/dart_types/test/sha256_digest_test.dart +18 -0
  42. package/package.json +9 -5
  43. package/runtime/generated-application-host.js +5365 -1105
  44. package/src/aggregate.ts +18 -0
  45. package/src/application_composition.ts +6 -32
  46. package/src/attested_core.ts +6 -3
  47. package/src/birth_meter.ts +1 -0
  48. package/src/birth_meter_ensure.ts +28 -2
  49. package/src/births.ts +1 -1
  50. package/src/build_package.ts +162 -538
  51. package/src/business_birth.ts +19 -3
  52. package/src/canonical_json.ts +21 -0
  53. package/src/check_package_main.ts +76 -35
  54. package/src/clear_directive.ts +19 -8
  55. package/src/codegen_dart.ts +305 -22
  56. package/src/codegen_dart_application.ts +844 -292
  57. package/src/codegen_dart_client.ts +1084 -407
  58. package/src/codegen_dart_scenario.ts +12 -12
  59. package/src/codegen_proof.ts +169 -39
  60. package/src/codegen_provider_dart.ts +17 -1
  61. package/src/codegen_ts.ts +298 -106
  62. package/src/compat_manifest.ts +2 -2
  63. package/src/compat_package_main.ts +8 -12
  64. package/src/compile_package_main.ts +1866 -597
  65. package/src/compose.ts +1 -1
  66. package/src/directive.ts +208 -15
  67. package/src/engine_entry.ts +165 -111
  68. package/src/evolve_preview.ts +43 -81
  69. package/src/extremum.ts +1 -1
  70. package/src/fields.ts +183 -4
  71. package/src/flow_gate.ts +75 -2
  72. package/src/framework/application_home.ts +2 -0
  73. package/src/framework/auth_provider_law.ts +2 -2
  74. package/src/framework/birth_meter.ts +7 -19
  75. package/src/framework/bootstrap.ts +0 -2
  76. package/src/framework/business_corrections.ts +9 -5
  77. package/src/framework/domain_lifecycle.ts +15 -29
  78. package/src/framework/encryption_scope.ts +2 -1
  79. package/src/framework/framework_aggregates.ts +2 -0
  80. package/src/framework/genesis.ts +16 -14
  81. package/src/framework/home.ts +20 -14
  82. package/src/framework/owned_custody.ts +9 -3
  83. package/src/framework/platform_admin.ts +3 -3
  84. package/src/framework/relations.ts +21 -13
  85. package/src/framework/signing_identity.ts +45 -40
  86. package/src/framework/workspace_invariant.ts +245 -0
  87. package/src/framework/workspaces.ts +23 -29
  88. package/src/index.ts +36 -16
  89. package/src/intent.ts +178 -6
  90. package/src/law_check.ts +32 -11
  91. package/src/law_graph.ts +2902 -0
  92. package/src/law_graph_usda.ts +1799 -0
  93. package/src/law_identity.ts +435 -0
  94. package/src/law_value_type.ts +230 -0
  95. package/src/lsp_server.ts +61 -31
  96. package/src/ops.ts +7 -0
  97. package/src/package_config.ts +141 -0
  98. package/src/package_dependencies.ts +108 -0
  99. package/src/package_dependency_usage.ts +150 -0
  100. package/src/package_source_imports.ts +71 -0
  101. package/src/plan_source_slice.ts +335 -0
  102. package/src/point_guard.ts +192 -0
  103. package/src/precondition.ts +44 -9
  104. package/src/read_projection_namespace.ts +1 -1
  105. package/src/runtime_zod.ts +44 -0
  106. package/src/secondary_ensure.ts +67 -14
  107. package/src/shape_compat.ts +1 -1
  108. package/src/stable_id_identity_bridge.ts +149 -0
  109. package/src/stable_id_lockfile.ts +278 -0
  110. package/src/stable_ids.ts +7 -2
  111. package/src/stable_ids_for_module.ts +348 -0
  112. package/src/stable_ids_types.ts +1 -1
  113. package/src/sum.ts +1 -1
  114. package/src/usd_state.ts +1 -1
  115. package/src/usda_relationship_integrity.ts +66 -0
  116. package/src/usda_text.ts +18 -0
  117. package/src/usdz.ts +78 -0
  118. package/src/value_object.ts +95 -0
  119. package/src/wire.ts +19 -0
  120. package/src/wire_encode.ts +22 -0
  121. package/src/workspace_sharding.ts +52 -36
  122. package/src/workspace_sharing.ts +28 -4
  123. package/src/zod_introspection.ts +1 -1
  124. package/dart/test/cluster_attested_test.dart +0 -201
  125. package/src/compile_engine.ts +0 -595
  126. package/src/manifest.ts +0 -1476
  127. package/src/read_projection_composition.ts +0 -117
  128. package/src/read_projection_manifest.ts +0 -115
  129. package/src/relation_composition.ts +0 -286
  130. package/src/usd.ts +0 -1967
  131. package/src/usd_layers.ts +0 -1776
@@ -9,11 +9,11 @@
9
9
  export interface NomosCompat {
10
10
  /** The package name (`cfg.name`). */
11
11
  readonly packageName: string;
12
- /** The deploy domainHash — sha256 of the package bytes (`policy:{hash}`). */
12
+ /** The deploy domainHash — the composed typed USDA closure identity. */
13
13
  readonly lawHash: string;
14
14
  /** sha256 over the CANONICAL serialization of the package structural interface. */
15
15
  readonly interfaceHash: string;
16
- /** Per domain key → its admission-identity hash (absent for identity-excluded domains). */
16
+ /** Per domain key → its canonical typed USDA layer identity. */
17
17
  readonly domains: Record<string, { readonly identityHash?: string }>;
18
18
  /** The generator provenance — the `@githolon/dsl` version + this manifest's schema. */
19
19
  readonly generator: { readonly dsl: string; readonly schema: number };
@@ -9,8 +9,7 @@
9
9
  * REQUIREMENT) against a TARGET's installed law (the workspace OFFER), PER MEMBER, via the #72
10
10
  * subtype relation (`memberVerdicts`). Exits NON-ZERO on any incompatible member — so a client/law
11
11
  * mismatch is caught in CI, before it ships. The target is:
12
- * • a deploy.json (`build/<name>.deploy.json`) — its staged `.interface` is the offer;
13
- * • an `.interface.json` (or a build/package DIR containing one) — the offer directly;
12
+ * • an `.interface.json` (or a build/package DIR containing one) — the diagnostic offer directly;
14
13
  * • a LIVE workspace URL (`https://host/v2/workspaces/<ws>` or `https://host --workspace <ws>`) —
15
14
  * connect()s and reads the on-ledger offer (`holon.interfaceOffer()`).
16
15
  *
@@ -42,7 +41,7 @@ function mergeInterfaces(byDomain: InterfaceMap | undefined): DomainInterface {
42
41
  return out;
43
42
  }
44
43
 
45
- /** The package name from `nomos.package.mjs` (only field we need — to locate `build/<name>.interface.json`). */
44
+ /** The package name from `nomos.project.ts` (only field we need — to locate `build/<name>.interface.json`). */
46
45
  async function loadPackageName(configArg: string): Promise<{ name: string; dir: string }> {
47
46
  const configPath = path.resolve(process.cwd(), configArg);
48
47
  if (!existsSync(configPath)) fail(`config not found: ${configPath} (pass the package config, or run from the package dir)`);
@@ -67,7 +66,7 @@ function loadCurrentInterface(pkgDir: string, name: string): InterfaceMap {
67
66
  }
68
67
  }
69
68
 
70
- /** Read a TARGET offer from a file path (deploy.json / interface.json / dir). Returns `{ offer, source }`. */
69
+ /** Read a TARGET diagnostic offer from an interface.json / directory. */
71
70
  function loadFileOffer(arg: string): { offer: InterfaceMap; source: string } {
72
71
  const abs = path.resolve(process.cwd(), arg);
73
72
  if (!existsSync(abs)) fail(`target not found: ${abs}`);
@@ -75,12 +74,11 @@ function loadFileOffer(arg: string): { offer: InterfaceMap; source: string } {
75
74
  if (statSync(abs).isDirectory()) {
76
75
  const scan = (d: string): string | undefined => {
77
76
  if (!existsSync(d)) return undefined;
78
- const hit =
79
- readdirSync(d).find((f) => f.endsWith(".deploy.json")) ?? readdirSync(d).find((f) => f.endsWith(".interface.json"));
77
+ const hit = readdirSync(d).find((f) => f.endsWith(".interface.json"));
80
78
  return hit !== undefined ? path.join(d, hit) : undefined;
81
79
  };
82
80
  const found = scan(abs) ?? scan(path.join(abs, "build"));
83
- if (found === undefined) fail(`no *.deploy.json or *.interface.json under ${abs}`);
81
+ if (found === undefined) fail(`no *.interface.json under ${abs}`);
84
82
  file = found;
85
83
  }
86
84
  let parsed: unknown;
@@ -89,9 +87,7 @@ function loadFileOffer(arg: string): { offer: InterfaceMap; source: string } {
89
87
  } catch (e) {
90
88
  fail(`could not parse ${file}: ${(e as Error).message}`);
91
89
  }
92
- const p = parsed as Record<string, unknown>;
93
- // A deploy.json carries `{ …, interface }`; a bare interface.json IS the {[domain]: interface} map.
94
- const offer = (p.interface !== undefined ? p.interface : p) as InterfaceMap;
90
+ const offer = parsed as InterfaceMap;
95
91
  if (offer === null || typeof offer !== "object") fail(`target ${file} carries no structural interface`);
96
92
  return { offer, source: file };
97
93
  }
@@ -153,13 +149,13 @@ async function main(): Promise<void> {
153
149
  return inline?.slice(name.length + 1);
154
150
  };
155
151
  const asJson = argv.includes("--json");
156
- const configArg = flagVal("--config") ?? "nomos.package.mjs";
152
+ const configArg = flagVal("--config") ?? "nomos.project.ts";
157
153
  const workspaceFlag = flagVal("--workspace");
158
154
  const domainFlag = flagVal("--domain");
159
155
  // The positional target = the first non-flag arg that isn't a flag VALUE.
160
156
  const flagsWithVals = new Set(["--config", "--workspace", "--domain"]);
161
157
  const target = argv.find((a, i) => !a.startsWith("--") && !(i > 0 && flagsWithVals.has(argv[i - 1]!)));
162
- if (!target) fail(`usage: githolon compat <workspace-url | deploy.json | interface.json | dir> [--config <cfg>] [--workspace <ws>] [--domain <name,...>] [--json]`);
158
+ if (!target) fail(`usage: githolon compat <workspace-url | interface.json | dir> [--config <cfg>] [--workspace <ws>] [--domain <name,...>] [--json]`);
163
159
 
164
160
  const { name, dir } = await loadPackageName(configArg);
165
161
  const allCurrent = loadCurrentInterface(dir, name);