@githolon/dsl 0.119.12 → 0.119.28

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.
Binary file
@@ -6,7 +6,7 @@
6
6
  // If a file isn't this / hosting this / authoring for this / proving this — it's gone.
7
7
 
8
8
  // `nomos-compile` / `holon-compile` — the thin launcher: resolve `tsx` (the
9
- // caller's, else the DSL's own dependency) and run `src/compile_package_main.ts`
9
+ // DSL's own dependency, else the caller's) and run `src/compile_package_main.ts`
10
10
  // through its ESM loader IN THIS PROCESS (the main dynamically imports the caller's
11
11
  // TS domain modules, which needs the tsx loader). tsx is a regular dependency of
12
12
  // @githolon/dsl, so a bare `npx githolon compile` / `npx nomos-compile` works with
@@ -29,82 +29,88 @@ import {
29
29
  const DSL_DIR = path.dirname(fileURLToPath(import.meta.url));
30
30
  const MAIN = path.join(DSL_DIR, "src", "compile_package_main.ts");
31
31
 
32
- const args = process.argv.slice(2);
33
- const configArg = args.find((argument) => !argument.startsWith("--")) ?? "nomos.project.ts";
34
- const configPath = path.resolve(process.cwd(), configArg);
35
- const cacheable =
36
- existsSync(configPath) &&
37
- !args.includes("--preflight") &&
38
- !args.includes("--analyze") &&
39
- process.env.NOMOS_PREFLIGHT !== "1" &&
40
- process.env.NOMOS_ANALYZE !== "1";
41
- const argumentIdentity = [
42
- ...args,
43
- `NOMOS_COMPACT=${process.env.NOMOS_COMPACT ?? ""}`,
44
- `NOMOS_REQUIRE_USDCAT=${process.env.NOMOS_REQUIRE_USDCAT ?? ""}`,
45
- `NOMOS_USDCAT=${process.env.NOMOS_USDCAT ?? ""}`,
46
- ].join("\n");
47
- if (cacheable) {
48
- const proofPath = compileProofPath(process.cwd(), configPath);
49
- const inputs = compileInputs({
50
- cwd: process.cwd(),
51
- dslDir: DSL_DIR,
52
- configPath,
53
- argumentIdentity,
54
- importedSources: recordedImportedSources(proofPath),
55
- });
56
- const proof = readCompileProof({ proofPath, inputs });
57
- if (proof !== undefined) {
58
- console.log(`nomos-compile: ${proof.name} unchanged`);
59
- // The law identity is the unit set (CAP-773): the compile wrote it beside the package it proves.
60
- const unitSet = (() => {
61
- try {
62
- return readFileSync(proof.law.replace(/\.law\.usdz$/u, ".units.sha256"), "utf8").trim();
63
- } catch {
64
- return "(unreadable — recompile)";
65
- }
66
- })();
67
- console.log(` law unit set ${unitSet}`);
68
- console.log(` package ${proof.domainHash} — package — not what targets serve (${path.relative(process.cwd(), proof.law)})`);
69
- console.log(` verify ✓ typed USDA content proof covers compiler, authored inputs and ${proof.outputCount} generated artifacts`);
70
- process.exit(0);
32
+ async function main() {
33
+ const args = process.argv.slice(2);
34
+ const configArg = args.find((argument) => !argument.startsWith("--")) ?? "nomos.project.ts";
35
+ const configPath = path.resolve(process.cwd(), configArg);
36
+ const cacheable =
37
+ existsSync(configPath) &&
38
+ !args.includes("--preflight") &&
39
+ !args.includes("--analyze") &&
40
+ process.env.NOMOS_PREFLIGHT !== "1" &&
41
+ process.env.NOMOS_ANALYZE !== "1";
42
+ const argumentIdentity = [
43
+ ...args,
44
+ `NOMOS_COMPACT=${process.env.NOMOS_COMPACT ?? ""}`,
45
+ `NOMOS_REQUIRE_USDCAT=${process.env.NOMOS_REQUIRE_USDCAT ?? ""}`,
46
+ `NOMOS_USDCAT=${process.env.NOMOS_USDCAT ?? ""}`,
47
+ ].join("\n");
48
+ if (cacheable) {
49
+ const proofPath = compileProofPath(process.cwd(), configPath);
50
+ const inputs = compileInputs({
51
+ cwd: process.cwd(),
52
+ dslDir: DSL_DIR,
53
+ configPath,
54
+ argumentIdentity,
55
+ importedSources: recordedImportedSources(proofPath),
56
+ });
57
+ const proof = readCompileProof({ proofPath, inputs });
58
+ if (proof !== undefined) {
59
+ console.log(`nomos-compile: ${proof.name} unchanged`);
60
+ // The law identity is the unit set (CAP-773): the compile wrote it beside the package it proves.
61
+ const unitSet = (() => {
62
+ try {
63
+ return readFileSync(proof.law.replace(/\.law\.usdz$/u, ".units.sha256"), "utf8").trim();
64
+ } catch {
65
+ return "(unreadable — recompile)";
66
+ }
67
+ })();
68
+ console.log(` law unit set ${unitSet}`);
69
+ console.log(` package ${proof.domainHash} — package — not what targets serve (${path.relative(process.cwd(), proof.law)})`);
70
+ console.log(` verify ✓ typed USDA content proof covers compiler, authored inputs and ${proof.outputCount} generated artifacts`);
71
+ // Let Node drain normally. Forcing shutdown here can deadlock V8
72
+ // background compilation against a collection waiting on this thread.
73
+ return;
74
+ }
75
+ process.env.NOMOS_COMPILE_PROOF_PATH = proofPath;
76
+ process.env.NOMOS_COMPILE_ARGUMENT_IDENTITY = argumentIdentity;
71
77
  }
72
- process.env.NOMOS_COMPILE_PROOF_PATH = proofPath;
73
- process.env.NOMOS_COMPILE_ARGUMENT_IDENTITY = argumentIdentity;
74
- }
75
78
 
76
- /** Resolve a dependency's package dir from `fromDir`, walking Node's resolver. */
77
- function resolvePkgDir(name, fromDir) {
78
- try {
79
- const req = createRequire(pathToFileURL(path.join(fromDir, "noop.js")));
80
- return path.dirname(req.resolve(`${name}/package.json`));
81
- } catch {
82
- return undefined;
79
+ /** Resolve a dependency's package dir from `fromDir`, walking Node's resolver. */
80
+ function resolvePkgDir(name, fromDir) {
81
+ try {
82
+ const req = createRequire(pathToFileURL(path.join(fromDir, "noop.js")));
83
+ return path.dirname(req.resolve(`${name}/package.json`));
84
+ } catch {
85
+ return undefined;
86
+ }
83
87
  }
84
- }
85
88
 
86
- const tsxDir = resolvePkgDir("tsx", process.cwd()) ?? resolvePkgDir("tsx", DSL_DIR);
87
- if (!tsxDir) {
88
- console.error("nomos-compile: tsx not found — reinstall @githolon/dsl (tsx is one of its dependencies)");
89
- process.exit(1);
89
+ const tsxDir = resolvePkgDir("tsx", DSL_DIR) ?? resolvePkgDir("tsx", process.cwd());
90
+ if (!tsxDir) {
91
+ console.error("nomos-compile: tsx not found — reinstall @githolon/dsl (tsx is one of its dependencies)");
92
+ process.exit(1);
93
+ }
94
+ const tsxApi = JSON.parse(readFileSync(path.join(tsxDir, "package.json"), "utf8")).exports?.["./esm/api"];
95
+ const tsxApiEntry = path.join(
96
+ tsxDir,
97
+ (typeof tsxApi === "string" ? tsxApi : tsxApi?.import?.default ?? tsxApi?.import ?? tsxApi?.default) ?? "dist/esm/api/index.mjs"
98
+ );
99
+
100
+ // Global hooks (not a namespaced `tsImport`): the compiler's `import.meta.url` and every
101
+ // `createRequire` must stay plain file URLs, exactly as under the tsx CLI.
102
+ // The compile's authored import closure (including modules outside the project directory) is
103
+ // collected here and recorded in the compile proof, so editing any of them invalidates it.
104
+ const importedSources = new Set();
105
+ globalThis[Symbol.for("nomos.compile.importedSources")] = importedSources;
106
+ const { register } = await import(pathToFileURL(tsxApiEntry).href);
107
+ register({
108
+ onImport(url) {
109
+ const file = authoredImport(url, DSL_DIR);
110
+ if (file !== undefined) importedSources.add(file);
111
+ },
112
+ });
113
+ await import(pathToFileURL(MAIN).href);
90
114
  }
91
- const tsxApi = JSON.parse(readFileSync(path.join(tsxDir, "package.json"), "utf8")).exports?.["./esm/api"];
92
- const tsxApiEntry = path.join(
93
- tsxDir,
94
- (typeof tsxApi === "string" ? tsxApi : tsxApi?.import?.default ?? tsxApi?.import ?? tsxApi?.default) ?? "dist/esm/api/index.mjs"
95
- );
96
115
 
97
- // Global hooks (not a namespaced `tsImport`): the compiler's `import.meta.url` and every
98
- // `createRequire` must stay plain file URLs, exactly as under the tsx CLI.
99
- // The compile's authored import closure (including modules outside the project directory) is
100
- // collected here and recorded in the compile proof, so editing any of them invalidates it.
101
- const importedSources = new Set();
102
- globalThis[Symbol.for("nomos.compile.importedSources")] = importedSources;
103
- const { register } = await import(pathToFileURL(tsxApiEntry).href);
104
- register({
105
- onImport(url) {
106
- const file = authoredImport(url, DSL_DIR);
107
- if (file !== undefined) importedSources.add(file);
108
- },
109
- });
110
- await import(pathToFileURL(MAIN).href);
116
+ await main();
@@ -1,3 +1,4 @@
1
+ export function compilerPackageManifest(name: string, from: NodeJS.Require): string;
1
2
  export interface CompileProofInputs {
2
3
  readonly authoring: readonly { readonly path: string; readonly sha256: string }[];
3
4
  readonly compiler: readonly { readonly path: string; readonly sha256: string }[];
package/compile_proof.mjs CHANGED
@@ -68,6 +68,22 @@ function inventoryIdentity(kind, entries) {
68
68
  return hash.digest("hex");
69
69
  }
70
70
 
71
+ export function compilerPackageManifest(name, from) {
72
+ try { return from.resolve(`${name}/package.json`); }
73
+ catch {
74
+ // Protobuf deliberately does not export package.json. Follow its actual entry,
75
+ // rather than assuming a hoisted node_modules layout.
76
+ let directory = path.dirname(from.resolve(name));
77
+ while (true) {
78
+ const file = path.join(directory, "package.json");
79
+ if (existsSync(file) && JSON.parse(readFileSync(file, "utf8")).name === name) return file;
80
+ const parent = path.dirname(directory);
81
+ if (parent === directory) throw new Error(`Missing manifest for ${name}`);
82
+ directory = parent;
83
+ }
84
+ }
85
+ }
86
+
71
87
  function dependencyPackageFiles(dslDir, cwd) {
72
88
  const files = [];
73
89
  // These packages contribute executable bytes or generated bindings to compiler output.
@@ -77,20 +93,30 @@ function dependencyPackageFiles(dslDir, cwd) {
77
93
  "@bufbuild/protobuf",
78
94
  "@bufbuild/protoc-gen-es",
79
95
  "esbuild",
96
+ "fflate",
80
97
  "tsx",
81
98
  "typescript",
82
99
  "zod",
83
100
  ]) {
84
- for (const base of [cwd, dslDir]) {
101
+ for (const base of [dslDir, cwd]) {
85
102
  try {
86
103
  const request = createRequire(pathToFileURL(path.join(base, "noop.js")));
87
- files.push(request.resolve(`${name}/package.json`));
88
- break;
104
+ files.push(compilerPackageManifest(name, request));
105
+ // Keep tenant copies too: authored schemas may import their own dependencies.
89
106
  } catch {
90
107
  // The real compiler names a missing dependency after a proof miss.
91
108
  }
92
109
  }
93
110
  }
111
+ // protoc-gen-es resolves its own exact plugin/runtime, which may be nested when the
112
+ // application deliberately uses a different Protobuf toolchain.
113
+ try {
114
+ const compiler = createRequire(path.join(dslDir, "package.json"));
115
+ const generator = compiler.resolve("@bufbuild/protoc-gen-es/package.json");
116
+ const plugin = createRequire(generator).resolve("@bufbuild/protoplugin/package.json");
117
+ files.push(plugin, compilerPackageManifest("@bufbuild/protobuf", createRequire(generator)),
118
+ compilerPackageManifest("@bufbuild/protobuf", createRequire(plugin)));
119
+ } catch { /* The canonical toolchain check reports missing dependencies after a proof miss. */ }
94
120
  return files;
95
121
  }
96
122
 
package/dart/CHANGELOG.md CHANGED
@@ -1,3 +1,92 @@
1
+ ## 0.70.27
2
+
3
+ - The bundled Node runner names the @githolon/runtime release it was built from; it now carries the runtime that accompanies native hosts 0.69.3.
4
+
5
+ ## 0.70.26
6
+
7
+ - Keep a first write's enrolment convergence prioritised after placement discovery completes.
8
+
9
+ - Bound speculative connection handshakes while retaining reserved capacity for pending reads and writes.
10
+
11
+ - Wait for the parent birth receipt before enrolling a newborn workspace.
12
+
13
+ - Preserve interactive correspondence capacity when speculative follows announce new frontiers.
14
+
15
+ - Publish the first write immediately after device enrolment completes.
16
+
17
+ ## 0.70.25
18
+
19
+ - Bound background replication and preserve capacity for interactive writes; enrol newborn workspaces after provider custody is observed.
20
+
21
+ ## 0.70.24
22
+
23
+ - Preserve the first call while an accepted device enrolment converges locally, including when console preparation consumed the initial wait window.
24
+ - Receive the proven remote suffix for a newborn workspace before attempting full-history recovery.
25
+
26
+ ## 0.70.23
27
+
28
+ - Carry the runtime scheduling fix for a first write waiting on birth custody and device enrolment.
29
+
30
+ ## 0.70.22
31
+
32
+ - Carry the newborn custody seal fix for discovery racing its persistence acknowledgement.
33
+
34
+ ## 0.70.21
35
+
36
+ - Carry the runtime fix that registers locally born children for replica follow and wakes placement discovery after device enrolment.
37
+
38
+ ## 0.70.20
39
+
40
+ - Bundle the runtime fix for cold checkpoint custody and pending stream cleanup on peer shutdown.
41
+
42
+ ## 0.70.19
43
+
44
+ - Restage the bundled runtime with the coordinated compiler release that fixes cached compile process completion.
45
+
46
+ ## 0.70.18
47
+
48
+ - Restage the bundled runtime with the coordinated compiler release that compacts generated Dart analysis roots.
49
+
50
+ ## 0.70.17
51
+
52
+ - Bundle the isolated law-preparation worker with the Node test runner so published consumers can prepare current law without source-tree files.
53
+
54
+ ## 0.70.16
55
+
56
+ - Await read-only current-law preparation during test fixture installation and carry the shared runtime's bounded cold-attachment readiness hold.
57
+
58
+ ## 0.70.15
59
+
60
+ - Preserve recoverable law-product readiness through repeated cold replay attempts (CAP-992).
61
+
62
+ ## 0.70.14
63
+
64
+ - Carry the runtime correction for retryable admitted births and observable child custody failures (CAP-960).
65
+
66
+ Carry the runtime release for the kernel's duplicate-composition fix in frontier transition judgement (CAP-972).
67
+
68
+ - Carry the framework cut with typed custody-open failures in the next kernel (CAP-975).
69
+
70
+ - Carry the framework cut with typed missing law-product custody failures in the next kernel (CAP-976).
71
+
72
+ - Carry the framework runtime cut with canonical Protobuf dependency pins (CAP-979).
73
+
74
+ - Restage the embedded runtime identity with the framework package cut containing CAP-982 and CAP-983; generated contracts retain published nested value wire allocations.
75
+
76
+ - Carry the framework cut with atomic per-domain law transitions and retirement protection (CAP-985).
77
+
78
+ - Carry the framework cut with isolated law preparation and generation-specific product readiness (CAP-986).
79
+
80
+ - Carry the framework protocol for per-domain plan qualification and detached admission recovery (CAP-987).
81
+
82
+ - Restage the embedded framework identity with the compiler cut containing CAP-988. The nominal record read fix applies to generated TypeScript clients; Dart already handles this wrapper.
83
+
84
+ - Carry the kernel correction for query readiness during private child-genesis recovery (CAP-990).
85
+
86
+ ## 0.70.13
87
+
88
+ - The bundled Node runner names the @githolon/runtime release it was built from; it now carries the runtime that accompanies native hosts 0.69.2.
89
+
1
90
  ## 0.70.12
2
91
 
3
92
  - Reconcile a completed round's outstanding work and copy repairs before folding application sync status, so a successful reconnect clears the aggregate pending state immediately. Add opt-in session and aggregate sync trace provenance.