@githolon/dsl 0.112.8 → 0.112.12

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/pubspec.yaml CHANGED
@@ -7,7 +7,7 @@ repository: https://github.com/Captain-App/nomos2
7
7
  description: >-
8
8
  Nomos 2 Dart client — generated domain values, intent payloads and application
9
9
  lifecycle types over the typed Nomos kernel protocol and USDA custody model.
10
- version: 0.66.12
10
+ version: 0.66.14
11
11
 
12
12
  environment:
13
13
  sdk: ^3.5.0
@@ -5,16 +5,22 @@ import { readFileSync } from 'node:fs';
5
5
  import path from 'node:path';
6
6
  import { fileURLToPath } from 'node:url';
7
7
 
8
- const input = process.argv[2];
9
- const descriptors = process.argv[3];
8
+ const deriveOffer = process.argv[2] === '--derive-interface-offer';
9
+ const input = process.argv[deriveOffer ? 3 : 2];
10
+ const descriptors = deriveOffer ? undefined : process.argv[3];
11
+ const output = deriveOffer ? process.argv[4] : undefined;
10
12
  if (!input) throw new Error('operation contract checker needs a compiled law package');
13
+ if (deriveOffer && !output) throw new Error('interface offer output path is required');
11
14
  const artifact = new URL('./assets/operation-contract.wasm', import.meta.url);
12
15
  const wasi = new WASI({
13
16
  version: 'preview1',
14
- args: ['operation-contract', 'validate-operation-contracts', `/input/${path.basename(input)}`,
15
- ...(descriptors === undefined ? [] : [`/descriptors/${path.basename(descriptors)}`])],
17
+ args: deriveOffer
18
+ ? ['operation-contract', 'derive-interface-offer', `/input/${path.basename(input)}`, `/output/${path.basename(output)}`]
19
+ : ['operation-contract', 'validate-operation-contracts', `/input/${path.basename(input)}`,
20
+ ...(descriptors === undefined ? [] : [`/descriptors/${path.basename(descriptors)}`])],
16
21
  env: {}, preopens: { '/input': path.dirname(path.resolve(input)),
17
- ...(descriptors === undefined ? {} : { '/descriptors': path.dirname(path.resolve(descriptors)) }) }, returnOnExit: true,
22
+ ...(descriptors === undefined ? {} : { '/descriptors': path.dirname(path.resolve(descriptors)) }),
23
+ ...(output === undefined ? {} : { '/output': path.dirname(path.resolve(output)) }) }, returnOnExit: true,
18
24
  });
19
25
  let bytes;
20
26
  try { bytes = readFileSync(artifact); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@githolon/dsl",
3
- "version": "0.112.8",
3
+ "version": "0.112.12",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Nomos 2 domain-authoring DSL: aggregates + directives in TS, executed and encoded to the Rust kernel's wire shapes.",
@@ -73,7 +73,7 @@
73
73
  "test": "vitest run"
74
74
  },
75
75
  "dependencies": {
76
- "@githolon/runtime": "^0.112.8",
76
+ "@githolon/runtime": "^0.112.12",
77
77
  "@bufbuild/protobuf": "^2.13.0",
78
78
  "@bufbuild/protoc-gen-es": "^2.13.0",
79
79
  "esbuild": "0.24.2",
@@ -3786,16 +3786,10 @@ export function generateDartDomainClient(
3786
3786
  ` /// route inside the offer gate, where readiness is shared by every host and cannot become a`,
3787
3787
  ` /// second foreground ceremony maintained by generated clients.`,
3788
3788
  ` Future<NomosOfferOutcome> _offer(NmsGeneratedCall call, {List<NomosConflictSnapshot> conflictSnapshots = const [], NomosOfferAuthenticationProof authenticationProof = NomosOfferAuthenticationProof.sessionCredentials}) async {`,
3789
- ...(clientInterface === undefined
3790
- ? []
3791
- : [
3792
- ` // PARTIAL COMPATIBILITY: examine the exact directive before dispatch. The`,
3793
- ` // session caches this compiler matrix until Peer Office reports law/custody`,
3794
- ` // movement, so repeated writes do no compatibility work. Unrelated reads and`,
3795
- ` // writes remain usable when another member is incompatible.`,
3796
- ` await session.assertOperationCompatible(compatibilityMatrixUsda, domain: call.domain, directive: call.directive);`,
3797
- ]),
3798
- ` Future<NomosOfferOutcome> attempt() => session.offerGeneratedCallOutcome(call: call, actor: actor, conflictSnapshots: conflictSnapshots, authenticationProof: authenticationProof);`,
3789
+ ` // Dispatch the exact generated command. Current-law route lookup, typed payload`,
3790
+ ` // validation and admission belong to the Kernel's author path. Full application`,
3791
+ ` // compatibility is an explicit preparation/diagnostic operation, not a write gate.`,
3792
+ ` Future<NomosOfferOutcome> attempt() => session.offerGeneratedCallOutcome(call: call, actor: actor, conflictSnapshots: conflictSnapshots, authenticationProof: authenticationProof);`,
3799
3793
  ` return attempt();`,
3800
3794
  ` }`,
3801
3795
  ``,
@@ -45,7 +45,7 @@ import type { Directive } from "./directive.js";
45
45
  */
46
46
  import { execFile, execFileSync } from "node:child_process";
47
47
  import { promisify } from "node:util";
48
- import { checkOperationContracts } from "./operation_contract_check.js";
48
+ import { checkOperationContracts, deriveInterfaceOffer } from "./operation_contract_check.js";
49
49
  import { compilerIntermediateCacheRoot, compilerSourceName, compilerSourceRoot } from "./compiler_cache.js";
50
50
  import {
51
51
  APPLICATION_CONTRACT_MODULE,
@@ -2543,8 +2543,8 @@ const NOMOS_TYPES_DEP = "^0.11.3";
2543
2543
  // 0.48.x: session-bound clients (XClient.bind/NomosClientInterface/DomainClientSessionMismatch/
2544
2544
  // DomainNotInstalledForSession, engine.follow, pendingConflicts lanes) — the generated client
2545
2545
  // REQUIRES this surface. 0.48.1 fixes NomosSession.watchPendingConflicts delegation.
2546
- const NOMOS_CLIENT_DEP = "^0.66.12";
2547
- const NOMOS_FLUTTER_DEP = "^0.65.21";
2546
+ const NOMOS_CLIENT_DEP = "^0.66.14";
2547
+ const NOMOS_FLUTTER_DEP = "^0.65.26";
2548
2548
  // DRIFT TRIPWIRE: pubspec_pins.test.ts asserts these equal the CURRENT versions in the Dart and Flutter
2549
2549
  // package pubspecs — a release without this bump fails the suite, so tenants never
2550
2550
  // land back in dependency_overrides (the exact co2 report this closes, third occurrence).
@@ -7806,6 +7806,7 @@ async function main(): Promise<void> {
7806
7806
  let readProjectionUsdc: Uint8Array;
7807
7807
  let commandProjectionText: string;
7808
7808
  let commandProjectionUsdc: Uint8Array;
7809
+ let interfaceOfferBytes: Uint8Array;
7809
7810
  try {
7810
7811
  writeFileSync(temporaryComposedLaw, composedLawText);
7811
7812
  const project = async (
@@ -7853,6 +7854,15 @@ async function main(): Promise<void> {
7853
7854
  "the authenticated command projection"
7854
7855
  ),
7855
7856
  ]);
7857
+ const offerSource = path.join(outDir, ".nomos-interface-offer-source.tmp.usdc");
7858
+ const offerOutput = path.join(outDir, ".nomos-interface-offer.tmp.cbor");
7859
+ try {
7860
+ writeFileSync(offerSource, composedLawUsdc);
7861
+ interfaceOfferBytes = deriveInterfaceOffer(offerSource, offerOutput, DSL_DIR);
7862
+ } finally {
7863
+ rmSync(offerSource, { force: true });
7864
+ rmSync(offerOutput, { force: true });
7865
+ }
7856
7866
  } catch (error) {
7857
7867
  fail(error instanceof Error ? error.message : String(error));
7858
7868
  } finally {
@@ -7891,6 +7901,11 @@ async function main(): Promise<void> {
7891
7901
  sha256: createHash("sha256").update(commandProjectionUsdc).digest("hex"),
7892
7902
  bytes: commandProjectionUsdc,
7893
7903
  };
7904
+ const interfaceOffer: EmittedBinaryLawClosureAsset = {
7905
+ logicalPath: "runtime/interface-offer.cbor",
7906
+ sha256: createHash("sha256").update(interfaceOfferBytes).digest("hex"),
7907
+ bytes: interfaceOfferBytes,
7908
+ };
7894
7909
  lawClosure = emitLawClosure(
7895
7910
  cfg.name,
7896
7911
  domainModules.map((module) => module.domain ?? module.name),
@@ -7905,6 +7920,7 @@ async function main(): Promise<void> {
7905
7920
  readProjectionCache,
7906
7921
  commandProjection,
7907
7922
  commandProjectionCache,
7923
+ interfaceOffer,
7908
7924
  ]
7909
7925
  );
7910
7926
  writeClosureAssets(lawClosure);
package/src/law_units.ts CHANGED
@@ -68,6 +68,7 @@ const DERIVED_LOGICAL_PATHS = new Set([
68
68
  "runtime/read-projection.usdc",
69
69
  "runtime/command-projection.usda",
70
70
  "runtime/command-projection.usdc",
71
+ "runtime/interface-offer.cbor",
71
72
  ]);
72
73
 
73
74
  /** Byte order on ASCII strings — the order Rust's `BTreeMap<String, _>` gives. */
@@ -30,3 +30,22 @@ export function checkOperationContracts(lawPath: string, descriptorPath: string,
30
30
  mkdirSync(cache, { recursive: true });
31
31
  writeFileSync(receipt, 'validated by the bundled kernel contract checker\n');
32
32
  }
33
+
34
+ /** Derive the installed public offer with the same kernel code used by compatibility reads.
35
+ * The returned bytes are packaged under the law root's authenticated inventory. */
36
+ export function deriveInterfaceOffer(composedLawPath: string, outputPath: string, compilerRoot: string): Uint8Array {
37
+ const checker = path.join(compilerRoot, 'operation_contract_check.mjs');
38
+ const artifact = path.join(compilerRoot, 'assets', 'operation-contract.wasm');
39
+ if (!existsSync(artifact)) throw new Error('Nomos compiler is missing its bundled kernel contract checker; rebuild/reinstall the compiler package');
40
+ try {
41
+ execFileSync(process.execPath, [checker, '--derive-interface-offer',
42
+ path.resolve(composedLawPath), path.resolve(outputPath)], {
43
+ encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], maxBuffer: 8 * 1024 * 1024,
44
+ });
45
+ return readFileSync(outputPath);
46
+ } catch (error) {
47
+ const detail = error instanceof Error && 'stderr' in error && error.stderr
48
+ ? String(error.stderr) : String(error);
49
+ throw new Error(`Installed interface offer derivation failed:\n${detail}`);
50
+ }
51
+ }