@hydranium/cli 1.0.0-next.75 → 1.0.0-next.77

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 (38) hide show
  1. package/README.md +14 -0
  2. package/lib/commands/analyze-heap.d.ts +3 -0
  3. package/lib/commands/analyze-heap.d.ts.map +1 -1
  4. package/lib/commands/analyze-heap.js +2 -1
  5. package/lib/commands/analyze-heap.js.map +1 -1
  6. package/lib/commands/ast-ground-truth.js +1 -1
  7. package/lib/commands/ast-ground-truth.js.map +1 -1
  8. package/lib/commands/headless-harness.d.ts +18 -3
  9. package/lib/commands/headless-harness.d.ts.map +1 -1
  10. package/lib/commands/headless-harness.js +12 -4
  11. package/lib/commands/headless-harness.js.map +1 -1
  12. package/lib/commands/lint-grammar.js +1 -1
  13. package/lib/commands/lint-grammar.js.map +1 -1
  14. package/lib/commands/measure-memory-driver.js +3 -2
  15. package/lib/commands/measure-memory-driver.js.map +1 -1
  16. package/lib/commands/measure-memory.js +1 -1
  17. package/lib/commands/measure-memory.js.map +1 -1
  18. package/lib/commands/model-docs.js +1 -1
  19. package/lib/commands/model-docs.js.map +1 -1
  20. package/lib/commands/reflect.js +1 -1
  21. package/lib/commands/reflect.js.map +1 -1
  22. package/lib/commands/validate.js +1 -1
  23. package/lib/commands/validate.js.map +1 -1
  24. package/lib/driver-heap.d.ts +52 -0
  25. package/lib/driver-heap.d.ts.map +1 -0
  26. package/lib/driver-heap.js +51 -0
  27. package/lib/driver-heap.js.map +1 -0
  28. package/package.json +9 -9
  29. package/src/commands/analyze-heap.ts +4 -1
  30. package/src/commands/ast-ground-truth.ts +1 -1
  31. package/src/commands/headless-harness.ts +22 -4
  32. package/src/commands/lint-grammar.ts +1 -1
  33. package/src/commands/measure-memory-driver.ts +3 -2
  34. package/src/commands/measure-memory.ts +1 -1
  35. package/src/commands/model-docs.ts +1 -1
  36. package/src/commands/reflect.ts +1 -1
  37. package/src/commands/validate.ts +1 -1
  38. package/src/driver-heap.ts +65 -0
package/README.md CHANGED
@@ -106,6 +106,20 @@ plausibly non-zero and cannot be read as the tell.
106
106
  declared alongside every other subcommand's, so an unrecognised one is rejected rather than
107
107
  ignored.
108
108
 
109
+ **Child-process heap ceiling** (`HYDRANIUM_CLI_MAX_OLD_SPACE_MB`)
110
+
111
+ Subcommands that spawn a child — `analyze-heap`, `measure-memory`, `validate`, `lint-grammar`,
112
+ `reflect`, `model-docs`, `ast-ground-truth` — give it `--max-old-space-size=8192` on a machine with
113
+ no cgroup memory limit, and **no ceiling at all when there is one**. A ceiling above the limit lets
114
+ V8 grow past it without collecting hard, so the kernel kills the container rather than the child
115
+ reporting a heap error.
116
+
117
+ Under a limit, Node derives its own ceiling from that limit, which is a fraction of it — so a
118
+ roomy container gives a child less than the same machine would unconstrained. Set
119
+ `HYDRANIUM_CLI_MAX_OLD_SPACE_MB` to state a ceiling in MiB; it wins in a container too. `0` means
120
+ "let Node decide". A value below 256, or one carrying a unit suffix, is reported and ignored rather
121
+ than passed on.
122
+
109
123
  **Data-server operations** (`--server "<cmd> [args...]"`)
110
124
 
111
125
  These spawn a data-server child and talk to it over its protocol. All four also take `--cwd <dir>`
@@ -6,6 +6,7 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
+ import { type HeapReading } from '../driver-heap.js';
9
10
  /**
10
11
  * Selects the JSON-vs-JSON comparison, which reads two analysis artifacts and
11
12
  * needs neither a snapshot nor memlab. Declared here rather than in the args
@@ -18,6 +19,8 @@ export interface AnalyzeHeapDeps {
18
19
  readonly __spawnForTest?: (execArgs: string[]) => Promise<number>;
19
20
  /** Override the memlab-availability check. */
20
21
  readonly __memlabInstalledForTest?: () => boolean;
22
+ /** Decide the heap ceiling from a stated cgroup reading rather than the machine's. */
23
+ readonly __heapReadingForTest?: HeapReading;
21
24
  }
22
25
  /**
23
26
  * Run the heap-snapshot analyzer. Memlab is an OPTIONAL PEER dependency and a
@@ -1 +1 @@
1
- {"version":3,"file":"analyze-heap.d.ts","sourceRoot":"","sources":["../../src/commands/analyze-heap.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAuBlF;;;;GAIG;AACH,eAAO,MAAM,SAAS,WAAW,CAAC;AAElC,mGAAmG;AACnG,MAAM,WAAW,eAAe;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,8CAA8C;IAC9C,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,OAAO,CAAC;CACpD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB9F"}
1
+ {"version":3,"file":"analyze-heap.d.ts","sourceRoot":"","sources":["../../src/commands/analyze-heap.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAqBrE;;;;GAIG;AACH,eAAO,MAAM,SAAS,WAAW,CAAC;AAElC,mGAAmG;AACnG,MAAM,WAAW,eAAe;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,8CAA8C;IAC9C,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,OAAO,CAAC;IAClD,sFAAsF;IACtF,QAAQ,CAAC,oBAAoB,CAAC,EAAE,WAAW,CAAC;CAC9C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB9F"}
@@ -7,6 +7,7 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  import { fileURLToPath } from 'node:url';
10
+ import { driverHeapArgs } from '../driver-heap.js';
10
11
  import { spawnNodeChild } from './headless-harness.js';
11
12
  /**
12
13
  * Absolute path to the bundled memlab-based analyzer (a standalone ESM script
@@ -55,7 +56,7 @@ export async function runAnalyzeHeap(args, deps = {}) {
55
56
  return;
56
57
  }
57
58
  const spawnChild = deps.__spawnForTest ?? spawnNodeChild;
58
- const code = await spawnChild(['--max-old-space-size=8192', ANALYZER, ...args]);
59
+ const code = await spawnChild([...driverHeapArgs(deps.__heapReadingForTest), ANALYZER, ...args]);
59
60
  if (code) {
60
61
  process.exitCode = code;
61
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"analyze-heap.js","sourceRoot":"","sources":["../../src/commands/analyze-heap.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,sCAAsC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjG,+FAA+F;AAC/F,SAAS,eAAe;IACrB,MAAM,OAAO,GAAI,MAAM,CAAC,IAAoD,CAAC,OAAO,CAAC;IACrF,IAAI,CAAC;QACF,OAAO,EAAE,CAAC,uBAAuB,CAAC,CAAC;QACnC,OAAO,OAAO,KAAK,SAAS,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACN,OAAO,KAAK,CAAC;IAChB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC;AAUlC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAc,EAAE,OAAwB,EAAE;IAC5E,MAAM,iBAAiB,GAAG,IAAI,CAAC,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,QAAQ,CAAC;AAYlC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAc,EAAE,OAAwB,EAAE;IAC5E,MAAM,iBAAiB,GAAG,IAAI,CAAC,wBAAwB,IAAI,eAAe,CAAC;IAC3E,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;QACrD,OAAO,CAAC,KAAK,CACV,qFAAqF;YAClF,sFAAsF;YACtF,kDAAkD,CACvD,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACV,CAAC;IACD,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC;IACzD,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IACjG,IAAI,IAAI,EAAE,CAAC;QACR,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC3B,CAAC;AACJ,CAAC"}
@@ -31,6 +31,6 @@ export function buildGroundTruthDriverArgs(options) {
31
31
  * `--out-file`). No `--expose-gc` needed — this walks the AST, it does not weigh it.
32
32
  */
33
33
  export function runAstGroundTruth(options) {
34
- return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildGroundTruthDriverArgs(options)], options);
34
+ return runDriverChild([DRIVER, ...buildGroundTruthDriverArgs(options)], options);
35
35
  }
36
36
  //# sourceMappingURL=ast-ground-truth.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ast-ground-truth.js","sourceRoot":"","sources":["../../src/commands/ast-ground-truth.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,cAAc,EAA2B,MAAM,uBAAuB,CAAC;AAE/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a,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,IAAI,CAAC;AACf,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAqC;IACpE,OAAO,cAAc,CAAC,CAAC,MAAM,EAAE,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACpF,CAAC"}
@@ -8,6 +8,7 @@
8
8
  ********************************************************************************/
9
9
  import type * as HydraniumCoreNode from '@hydranium/core/node';
10
10
  import type { LogThreshold } from '@hydranium/protocol';
11
+ import { type HeapReading } from '../driver-heap.js';
11
12
  /** The flag every report-producing subcommand names its destination file with. */
12
13
  export declare const OUT_FILE_FLAG = "--out-file";
13
14
  /** The `@hydranium/core/node` module surface the drivers use (type only). */
@@ -34,9 +35,10 @@ export interface HeadlessContext {
34
35
  * ZERO-ARG `createServices(): { shared }`. `hydranium-cli` is language-agnostic
35
36
  * and cannot statically import a head's `create<Lang>Services`, so the dynamic
36
37
  * import is the seam that keeps the binary head-neutral. Resolving the harness
37
- * from the head's graph (via `createRequire` rooted at the head module) means the
38
- * CLI itself needs no `@hydranium/core` dependency the head always has it — and
39
- * guarantees the harness runs against the SAME core copy as `createServices`.
38
+ * from the head's graph (via `createRequire` rooted at the head module) rather
39
+ * than from the CLI's guarantees it runs against the SAME core copy as
40
+ * `createServices`, which a second copy of the module would break even where
41
+ * both resolve.
40
42
  *
41
43
  * Throws a clear error when the path names no file, and when the export is
42
44
  * missing or not a function.
@@ -76,6 +78,13 @@ export interface DriverSpawnOptions {
76
78
  readonly logLevel?: LogThreshold;
77
79
  /** Test-only: capture the node argv and env instead of spawning the real child. */
78
80
  readonly __spawnForTest?: SpawnDriverChild;
81
+ /**
82
+ * Test-only: decide the heap ceiling from a stated cgroup reading rather
83
+ * than the machine's. Without it an argv assertion means one thing on a
84
+ * workstation and nothing at all under a memory limit, so a suite that
85
+ * asserts the ceiling is present passes vacuously in a container.
86
+ */
87
+ readonly __heapReadingForTest?: HeapReading;
79
88
  }
80
89
  /**
81
90
  * Parent-side: run a subcommand's driver child and propagate its exit code, so a
@@ -91,6 +100,12 @@ export interface DriverSpawnOptions {
91
100
  * A head that binds a logger of its own decides for itself whether the flag means
92
101
  * anything, which is the intended seam: the CLI is language-agnostic and cannot
93
102
  * reach past `createServices`.
103
+ *
104
+ * **The heap ceiling is prepended HERE rather than passed by each subcommand.**
105
+ * Every caller wants the same answer to the same question, and the answer is not
106
+ * a constant — see {@link driverHeapArgs}. A literal at the call site is a place
107
+ * the container case can be missed, and the caller that misses it takes the whole
108
+ * cgroup down with it rather than failing on its own.
94
109
  */
95
110
  export declare function runDriverChild(execArgs: string[], options: DriverSpawnOptions): Promise<void>;
96
111
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"headless-harness.d.ts","sourceRoot":"","sources":["../../src/commands/headless-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,KAAK,iBAAiB,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASxD,kFAAkF;AAClF,eAAO,MAAM,aAAa,eAAe,CAAC;AAE1C,6EAA6E;AAC7E,KAAK,cAAc,GAAG,OAAO,iBAAiB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,CAAC;AAE5F,qFAAqF;AACrF,MAAM,WAAW,eAAe;IAC7B,gEAAgE;IAChE,cAAc,EAAE,eAAe,CAAC;IAChC,yEAAyE;IACzE,QAAQ,EAAE,cAAc,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA4B1F;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,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AC7B,gEAAgE;IAChE,cAAc,EAAE,eAAe,CAAC;IAChC,yEAAyE;IACzE,QAAQ,EAAE,cAAc,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA4B1F;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAS5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAShG;AAED,4FAA4F;AAC5F,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAErG,qGAAqG;AACrG,MAAM,WAAW,kBAAkB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACjC,mFAAmF;IACnF,QAAQ,CAAC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,WAAW,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CASnG"}
@@ -11,6 +11,7 @@ import { statSync, writeFileSync } from 'node:fs';
11
11
  import { createRequire } from 'node:module';
12
12
  import * as path from 'node:path';
13
13
  import { pathToFileURL } from 'node:url';
14
+ import { driverHeapArgs } from '../driver-heap.js';
14
15
  import { logLevelEnv } from '../log-level.js';
15
16
  import { SERVICES_FLAG } from './harness-args.js';
16
17
  /** The flag every report-producing subcommand names its destination file with. */
@@ -24,9 +25,10 @@ export const OUT_FILE_FLAG = '--out-file';
24
25
  * ZERO-ARG `createServices(): { shared }`. `hydranium-cli` is language-agnostic
25
26
  * and cannot statically import a head's `create<Lang>Services`, so the dynamic
26
27
  * import is the seam that keeps the binary head-neutral. Resolving the harness
27
- * from the head's graph (via `createRequire` rooted at the head module) means the
28
- * CLI itself needs no `@hydranium/core` dependency the head always has it — and
29
- * guarantees the harness runs against the SAME core copy as `createServices`.
28
+ * from the head's graph (via `createRequire` rooted at the head module) rather
29
+ * than from the CLI's guarantees it runs against the SAME core copy as
30
+ * `createServices`, which a second copy of the module would break even where
31
+ * both resolve.
30
32
  *
31
33
  * Throws a clear error when the path names no file, and when the export is
32
34
  * missing or not a function.
@@ -110,10 +112,16 @@ export function spawnNodeChild(execArgs, env) {
110
112
  * A head that binds a logger of its own decides for itself whether the flag means
111
113
  * anything, which is the intended seam: the CLI is language-agnostic and cannot
112
114
  * reach past `createServices`.
115
+ *
116
+ * **The heap ceiling is prepended HERE rather than passed by each subcommand.**
117
+ * Every caller wants the same answer to the same question, and the answer is not
118
+ * a constant — see {@link driverHeapArgs}. A literal at the call site is a place
119
+ * the container case can be missed, and the caller that misses it takes the whole
120
+ * cgroup down with it rather than failing on its own.
113
121
  */
114
122
  export async function runDriverChild(execArgs, options) {
115
123
  const spawnChild = options.__spawnForTest ?? spawnNodeChild;
116
- const code = await spawnChild(execArgs, options.logLevel === undefined ? undefined : logLevelEnv(options.logLevel));
124
+ const code = await spawnChild([...driverHeapArgs(options.__heapReadingForTest), ...execArgs], options.logLevel === undefined ? undefined : logLevelEnv(options.logLevel));
117
125
  if (code) {
118
126
  process.exitCode = code;
119
127
  }
@@ -1 +1 @@
1
- {"version":3,"file":"headless-harness.js","sourceRoot":"","sources":["../../src/commands/headless-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAO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AAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAC5E,CAAC;IACF,IAAI,IAAI,EAAE,CAAC;QACR,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC3B,CAAC;AACJ,CAAC"}
@@ -37,6 +37,6 @@ export function buildLintGrammarDriverArgs(options) {
37
37
  * `createServices` module, keeping the binary language-agnostic.
38
38
  */
39
39
  export function runLintGrammar(options) {
40
- return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildLintGrammarDriverArgs(options)], options);
40
+ return runDriverChild([DRIVER, ...buildLintGrammarDriverArgs(options)], options);
41
41
  }
42
42
  //# sourceMappingURL=lint-grammar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lint-grammar.js","sourceRoot":"","sources":["../../src/commands/lint-grammar.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAA2B,MAAM,uBAAuB,CAAC;AAEhF;;;GAGG;AACH,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,0BAA0B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAcnF,oEAAoE;AACpE,MAAM,UAAU,0BAA0B,CAAC,OAAkC;IAC1E,MAAM,IAAI,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACpD,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,cAAc,IAAI,EAAE,EAAE,CAAC;QACnD,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,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AM,EAAE,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACpF,CAAC"}
@@ -8,8 +8,9 @@
8
8
  ********************************************************************************/
9
9
  /*
10
10
  * Spawned child of the `measure-memory` subcommand. Launched by the parent with
11
- * `node --expose-gc --max-old-space-size=8192 <this> --services <module> <workspace> ...`
12
- * so the underlying harness gets post-GC readings. It dynamic-imports the head's
11
+ * `node [heap ceiling] --expose-gc <this> --services <module> <workspace> ...`
12
+ * so the underlying harness gets post-GC readings. The ceiling is whatever
13
+ * `driverHeapArgs` decides, which is nothing at all inside a container. It dynamic-imports the head's
13
14
  * services module and runs the framework's `measureModelMemory`, streaming the
14
15
  * baseline / after-build / churn lines to stdout. Never imported — only spawned.
15
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"measure-memory-driver.js","sourceRoot":"","sources":["../../src/commands/measure-memory-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAgB7D,SAAS,SAAS,CAAC,IAAc;IAC9B,MAAM,MAAM,GAAe,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACjE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,GAAW,EAAE;YACvB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC9B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACvB,OAAO,CAAC,KAAK,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;gBAC3C,OAAO,CAA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I,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;KACxD,CAAC,CAAC;IACH,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,OAAO;IACV,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,iBAAiB,MAAM,CAAC,aAAa,UAAU,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3F,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACtD,CAAC;AACJ,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACvB,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KAC3B,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IACvB,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
@@ -95,6 +95,6 @@ export function buildDriverArgs(options) {
95
95
  * module and reports the baseline / after-build / churn lines on stdout.
96
96
  */
97
97
  export function runMeasureMemory(options) {
98
- return runDriverChild(['--expose-gc', '--max-old-space-size=8192', DRIVER, ...buildDriverArgs(options)], options);
98
+ return runDriverChild(['--expose-gc', DRIVER, ...buildDriverArgs(options)], options);
99
99
  }
100
100
  //# sourceMappingURL=measure-memory.js.map
@@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,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACtD,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,IAAI,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAoC;IAClE,OAAO,cAAc,CAAC,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACxF,CAAC"}
@@ -32,6 +32,6 @@ export function buildModelDocsDriverArgs(options) {
32
32
  * module, keeping the binary language-agnostic.
33
33
  */
34
34
  export function runModelDocs(options) {
35
- return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildModelDocsDriverArgs(options)], options);
35
+ return runDriverChild([DRIVER, ...buildModelDocsDriverArgs(options)], options);
36
36
  }
37
37
  //# sourceMappingURL=model-docs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"model-docs.js","sourceRoot":"","sources":["../../src/commands/model-docs.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,cAA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,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,IAAI,CAAC;AACf,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,OAAgC;IAC1D,OAAO,cAAc,CAAC,CAAC,MAAM,EAAE,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAClF,CAAC"}
@@ -33,6 +33,6 @@ export function buildReflectDriverArgs(options) {
33
33
  * the binary language-agnostic.
34
34
  */
35
35
  export function runReflect(options) {
36
- return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildReflectDriverArgs(options)], options);
36
+ return runDriverChild([DRIVER, ...buildReflectDriverArgs(options)], options);
37
37
  }
38
38
  //# sourceMappingURL=reflect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reflect.js","sourceRoot":"","sources":["../../src/commands/reflect.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,cAAc,EAA2B,MAAM,uBAAuB,CAAC;AAE/F;;;GAGG;AACH,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAY9E,oEAAoE;AACpE,MAAM,UAAU,sBAAsB,CAAC,OAA8B;IAClE,MAAM,IAAI,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACpD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,IAAI,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,OAA8B;IACtD,OAAO,cAAc,CAAC,CAAC,2BAA2B,EAAE,MAAM,EAAE,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAC7G,CAAC"}
1
+ {"version":3,"file":"reflect.js","sourceRoot":"","sources":["../../src/commands/reflect.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,cAAc,EAA2B,MAAM,uBAAuB,CAAC;AAE/F;;;GAGG;AACH,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,qBAAqB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAY9E,oEAAoE;AACpE,MAAM,UAAU,sBAAsB,CAAC,OAA8B;IAClE,MAAM,IAAI,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACpD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,IAAI,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,OAA8B;IACtD,OAAO,cAAc,CAAC,CAAC,MAAM,EAAE,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAChF,CAAC"}
@@ -36,6 +36,6 @@ export function buildValidateDriverArgs(options) {
36
36
  * The child's exit code propagates to this process so shells and CI see the gate.
37
37
  */
38
38
  export function runValidate(options) {
39
- return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildValidateDriverArgs(options)], options);
39
+ return runDriverChild([DRIVER, ...buildValidateDriverArgs(options)], options);
40
40
  }
41
41
  //# sourceMappingURL=validate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,cAAc,EAA2B,MAAM,uBAAuB,CAAC;AAE/F;;;GAGG;AACH,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAgB/E,oEAAoE;AACpE,MAAM,UAAU,uBAAuB,CAAC,OAA+B;IACpE,MAAM,IAAI,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACvE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzB,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,IAAI,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,OAA+B;IACxD,OAAO,cAAc,CAAC,CAAC,2BAA2B,EAAE,MAAM,EAAE,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9G,CAAC"}
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,cAAc,EAA2B,MAAM,uBAAuB,CAAC;AAE/F;;;GAGG;AACH,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAgB/E,oEAAoE;AACpE,MAAM,UAAU,uBAAuB,CAAC,OAA+B;IACpE,MAAM,IAAI,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACvE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzB,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,IAAI,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,OAA+B;IACxD,OAAO,cAAc,CAAC,CAAC,MAAM,EAAE,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACjF,CAAC"}
@@ -0,0 +1,52 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ /**
10
+ * Heap ceiling in MiB for a driver child on a machine with no cgroup limit.
11
+ *
12
+ * The subcommands that spawn one build a whole workspace in that child —
13
+ * `measure-memory` deliberately so, `analyze-heap` loads an entire heap
14
+ * snapshot — so the default Node would pick from physical RAM is too low for
15
+ * the workspaces these are pointed at.
16
+ */
17
+ export declare const DRIVER_HEAP_MB = 8192;
18
+ /** Environment variable an operator raises or lowers {@link driverHeapArgs} with. */
19
+ export declare const DRIVER_HEAP_ENV = "HYDRANIUM_CLI_MAX_OLD_SPACE_MB";
20
+ /**
21
+ * Smallest ceiling {@link DRIVER_HEAP_ENV} may state. A driver child builds a
22
+ * whole workspace, so a value this far below the default is a unit mistake
23
+ * rather than a deliberate squeeze.
24
+ */
25
+ export declare const MIN_DRIVER_HEAP_MB = 256;
26
+ /**
27
+ * A cgroup reading, so a caller — in practice a test — can decide the ceiling
28
+ * instead of inheriting the machine's. Omitted fields fall back to this
29
+ * process's own reading.
30
+ */
31
+ export interface HeapReading {
32
+ readonly constrained?: number;
33
+ readonly total?: number;
34
+ }
35
+ /**
36
+ * The `execArgv` prefix every driver child is spawned under.
37
+ *
38
+ * Inside a container this is EMPTY on purpose. {@link DRIVER_HEAP_MB} is sized
39
+ * for a workstation, and handing it to a process under a smaller cgroup limit
40
+ * is worse than handing it nothing: V8 has no reason to collect hard below a
41
+ * ceiling it will never reach, so the kernel OOM-kills the container first and
42
+ * the failure arrives as a signal against the whole cgroup rather than as a
43
+ * heap error the parent can attribute. Left to itself, Node sizes the heap from
44
+ * the limit instead.
45
+ *
46
+ * That trades away the ability to use a LARGE container's memory, since Node's
47
+ * derived default is a fraction of the limit — which is what {@link DRIVER_HEAP_ENV}
48
+ * is for. An operator who states a number has decided, so it wins in a
49
+ * container too.
50
+ */
51
+ export declare function driverHeapArgs(reading?: HeapReading): string[];
52
+ //# sourceMappingURL=driver-heap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver-heap.d.ts","sourceRoot":"","sources":["../src/driver-heap.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,qFAAqF;AACrF,eAAO,MAAM,eAAe,mCAAmC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,WAAgB,GAAG,MAAM,EAAE,CAOlE"}
@@ -0,0 +1,51 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ import { heapCeilingArgs } from '@hydranium/core/node';
10
+ /**
11
+ * Heap ceiling in MiB for a driver child on a machine with no cgroup limit.
12
+ *
13
+ * The subcommands that spawn one build a whole workspace in that child —
14
+ * `measure-memory` deliberately so, `analyze-heap` loads an entire heap
15
+ * snapshot — so the default Node would pick from physical RAM is too low for
16
+ * the workspaces these are pointed at.
17
+ */
18
+ export const DRIVER_HEAP_MB = 8192;
19
+ /** Environment variable an operator raises or lowers {@link driverHeapArgs} with. */
20
+ export const DRIVER_HEAP_ENV = 'HYDRANIUM_CLI_MAX_OLD_SPACE_MB';
21
+ /**
22
+ * Smallest ceiling {@link DRIVER_HEAP_ENV} may state. A driver child builds a
23
+ * whole workspace, so a value this far below the default is a unit mistake
24
+ * rather than a deliberate squeeze.
25
+ */
26
+ export const MIN_DRIVER_HEAP_MB = 256;
27
+ /**
28
+ * The `execArgv` prefix every driver child is spawned under.
29
+ *
30
+ * Inside a container this is EMPTY on purpose. {@link DRIVER_HEAP_MB} is sized
31
+ * for a workstation, and handing it to a process under a smaller cgroup limit
32
+ * is worse than handing it nothing: V8 has no reason to collect hard below a
33
+ * ceiling it will never reach, so the kernel OOM-kills the container first and
34
+ * the failure arrives as a signal against the whole cgroup rather than as a
35
+ * heap error the parent can attribute. Left to itself, Node sizes the heap from
36
+ * the limit instead.
37
+ *
38
+ * That trades away the ability to use a LARGE container's memory, since Node's
39
+ * derived default is a fraction of the limit — which is what {@link DRIVER_HEAP_ENV}
40
+ * is for. An operator who states a number has decided, so it wins in a
41
+ * container too.
42
+ */
43
+ export function driverHeapArgs(reading = {}) {
44
+ return heapCeilingArgs({
45
+ desktopDefaultMb: DRIVER_HEAP_MB,
46
+ envValue: process.env[DRIVER_HEAP_ENV],
47
+ minMb: MIN_DRIVER_HEAP_MB,
48
+ ...reading
49
+ });
50
+ }
51
+ //# sourceMappingURL=driver-heap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver-heap.js","sourceRoot":"","sources":["../src/driver-heap.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,qFAAqF;AACrF,MAAM,CAAC,MAAM,eAAe,GAAG,gCAAgC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAYtC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,cAAc,CAAC,UAAuB,EAAE;IACrD,OAAO,eAAe,CAAC;QACpB,gBAAgB,EAAE,cAAc;QAChC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;QACtC,KAAK,EAAE,kBAAkB;QACzB,GAAG,OAAO;KACZ,CAAC,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hydranium/cli",
3
- "version": "1.0.0-next.75",
3
+ "version": "1.0.0-next.77",
4
4
  "description": "Build-time codegen tools + data-server subcommands for the hydranium framework.",
5
5
  "keywords": [
6
6
  "hydranium",
@@ -65,20 +65,20 @@
65
65
  "ts-morph": "^25.0.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@hydranium/core": "1.0.0-next.75",
69
- "@hydranium/data-server": "1.0.0-next.75",
70
- "@hydranium/langium": "1.0.0-next.75",
71
- "@hydranium/protocol": "1.0.0-next.75",
68
+ "@hydranium/core": "1.0.0-next.77",
69
+ "@hydranium/data-server": "1.0.0-next.77",
70
+ "@hydranium/langium": "1.0.0-next.77",
71
+ "@hydranium/protocol": "1.0.0-next.77",
72
72
  "rimraf": "^5.0.0",
73
73
  "typescript": "^5.8.0",
74
74
  "vscode-jsonrpc": "9.0.1",
75
75
  "vscode-languageserver": "~10.0.1"
76
76
  },
77
77
  "peerDependencies": {
78
- "@hydranium/core": "1.0.0-next.75",
79
- "@hydranium/data-server": "1.0.0-next.75",
80
- "@hydranium/langium": "1.0.0-next.75",
81
- "@hydranium/protocol": "1.0.0-next.75",
78
+ "@hydranium/core": "1.0.0-next.77",
79
+ "@hydranium/data-server": "1.0.0-next.77",
80
+ "@hydranium/langium": "1.0.0-next.77",
81
+ "@hydranium/protocol": "1.0.0-next.77",
82
82
  "@memlab/core": "^2.0.3",
83
83
  "@memlab/heap-analysis": "^2.0.3",
84
84
  "vscode-jsonrpc": "9.0.1"
@@ -8,6 +8,7 @@
8
8
  ********************************************************************************/
9
9
 
10
10
  import { fileURLToPath } from 'node:url';
11
+ import { driverHeapArgs, type HeapReading } from '../driver-heap.js';
11
12
  import { spawnNodeChild } from './headless-harness.js';
12
13
 
13
14
  /**
@@ -41,6 +42,8 @@ export interface AnalyzeHeapDeps {
41
42
  readonly __spawnForTest?: (execArgs: string[]) => Promise<number>;
42
43
  /** Override the memlab-availability check. */
43
44
  readonly __memlabInstalledForTest?: () => boolean;
45
+ /** Decide the heap ceiling from a stated cgroup reading rather than the machine's. */
46
+ readonly __heapReadingForTest?: HeapReading;
44
47
  }
45
48
 
46
49
  /**
@@ -69,7 +72,7 @@ export async function runAnalyzeHeap(args: string[], deps: AnalyzeHeapDeps = {})
69
72
  return;
70
73
  }
71
74
  const spawnChild = deps.__spawnForTest ?? spawnNodeChild;
72
- const code = await spawnChild(['--max-old-space-size=8192', ANALYZER, ...args]);
75
+ const code = await spawnChild([...driverHeapArgs(deps.__heapReadingForTest), ANALYZER, ...args]);
73
76
  if (code) {
74
77
  process.exitCode = code;
75
78
  }
@@ -45,5 +45,5 @@ export function buildGroundTruthDriverArgs(options: AstGroundTruthCommandOptions
45
45
  * `--out-file`). No `--expose-gc` needed — this walks the AST, it does not weigh it.
46
46
  */
47
47
  export function runAstGroundTruth(options: AstGroundTruthCommandOptions): Promise<void> {
48
- return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildGroundTruthDriverArgs(options)], options);
48
+ return runDriverChild([DRIVER, ...buildGroundTruthDriverArgs(options)], options);
49
49
  }
@@ -14,6 +14,7 @@ import { statSync, writeFileSync } from 'node:fs';
14
14
  import { createRequire } from 'node:module';
15
15
  import * as path from 'node:path';
16
16
  import { pathToFileURL } from 'node:url';
17
+ import { driverHeapArgs, type HeapReading } from '../driver-heap.js';
17
18
  import { logLevelEnv } from '../log-level.js';
18
19
  import { SERVICES_FLAG } from './harness-args.js';
19
20
 
@@ -47,9 +48,10 @@ export interface HeadlessContext {
47
48
  * ZERO-ARG `createServices(): { shared }`. `hydranium-cli` is language-agnostic
48
49
  * and cannot statically import a head's `create<Lang>Services`, so the dynamic
49
50
  * import is the seam that keeps the binary head-neutral. Resolving the harness
50
- * from the head's graph (via `createRequire` rooted at the head module) means the
51
- * CLI itself needs no `@hydranium/core` dependency the head always has it — and
52
- * guarantees the harness runs against the SAME core copy as `createServices`.
51
+ * from the head's graph (via `createRequire` rooted at the head module) rather
52
+ * than from the CLI's guarantees it runs against the SAME core copy as
53
+ * `createServices`, which a second copy of the module would break even where
54
+ * both resolve.
53
55
  *
54
56
  * Throws a clear error when the path names no file, and when the export is
55
57
  * missing or not a function.
@@ -139,6 +141,13 @@ export interface DriverSpawnOptions {
139
141
  readonly logLevel?: LogThreshold;
140
142
  /** Test-only: capture the node argv and env instead of spawning the real child. */
141
143
  readonly __spawnForTest?: SpawnDriverChild;
144
+ /**
145
+ * Test-only: decide the heap ceiling from a stated cgroup reading rather
146
+ * than the machine's. Without it an argv assertion means one thing on a
147
+ * workstation and nothing at all under a memory limit, so a suite that
148
+ * asserts the ceiling is present passes vacuously in a container.
149
+ */
150
+ readonly __heapReadingForTest?: HeapReading;
142
151
  }
143
152
 
144
153
  /**
@@ -155,10 +164,19 @@ export interface DriverSpawnOptions {
155
164
  * A head that binds a logger of its own decides for itself whether the flag means
156
165
  * anything, which is the intended seam: the CLI is language-agnostic and cannot
157
166
  * reach past `createServices`.
167
+ *
168
+ * **The heap ceiling is prepended HERE rather than passed by each subcommand.**
169
+ * Every caller wants the same answer to the same question, and the answer is not
170
+ * a constant — see {@link driverHeapArgs}. A literal at the call site is a place
171
+ * the container case can be missed, and the caller that misses it takes the whole
172
+ * cgroup down with it rather than failing on its own.
158
173
  */
159
174
  export async function runDriverChild(execArgs: string[], options: DriverSpawnOptions): Promise<void> {
160
175
  const spawnChild = options.__spawnForTest ?? spawnNodeChild;
161
- const code = await spawnChild(execArgs, options.logLevel === undefined ? undefined : logLevelEnv(options.logLevel));
176
+ const code = await spawnChild(
177
+ [...driverHeapArgs(options.__heapReadingForTest), ...execArgs],
178
+ options.logLevel === undefined ? undefined : logLevelEnv(options.logLevel)
179
+ );
162
180
  if (code) {
163
181
  process.exitCode = code;
164
182
  }
@@ -53,5 +53,5 @@ export function buildLintGrammarDriverArgs(options: LintGrammarCommandOptions):
53
53
  * `createServices` module, keeping the binary language-agnostic.
54
54
  */
55
55
  export function runLintGrammar(options: LintGrammarCommandOptions): Promise<void> {
56
- return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildLintGrammarDriverArgs(options)], options);
56
+ return runDriverChild([DRIVER, ...buildLintGrammarDriverArgs(options)], options);
57
57
  }
@@ -9,8 +9,9 @@
9
9
 
10
10
  /*
11
11
  * Spawned child of the `measure-memory` subcommand. Launched by the parent with
12
- * `node --expose-gc --max-old-space-size=8192 <this> --services <module> <workspace> ...`
13
- * so the underlying harness gets post-GC readings. It dynamic-imports the head's
12
+ * `node [heap ceiling] --expose-gc <this> --services <module> <workspace> ...`
13
+ * so the underlying harness gets post-GC readings. The ceiling is whatever
14
+ * `driverHeapArgs` decides, which is nothing at all inside a container. It dynamic-imports the head's
14
15
  * services module and runs the framework's `measureModelMemory`, streaming the
15
16
  * baseline / after-build / churn lines to stdout. Never imported — only spawned.
16
17
  */
@@ -139,5 +139,5 @@ export function buildDriverArgs(options: MeasureMemoryCommandOptions): string[]
139
139
  * module and reports the baseline / after-build / churn lines on stdout.
140
140
  */
141
141
  export function runMeasureMemory(options: MeasureMemoryCommandOptions): Promise<void> {
142
- return runDriverChild(['--expose-gc', '--max-old-space-size=8192', DRIVER, ...buildDriverArgs(options)], options);
142
+ return runDriverChild(['--expose-gc', DRIVER, ...buildDriverArgs(options)], options);
143
143
  }
@@ -44,5 +44,5 @@ export function buildModelDocsDriverArgs(options: ModelDocsCommandOptions): stri
44
44
  * module, keeping the binary language-agnostic.
45
45
  */
46
46
  export function runModelDocs(options: ModelDocsCommandOptions): Promise<void> {
47
- return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildModelDocsDriverArgs(options)], options);
47
+ return runDriverChild([DRIVER, ...buildModelDocsDriverArgs(options)], options);
48
48
  }
@@ -47,5 +47,5 @@ export function buildReflectDriverArgs(options: ReflectCommandOptions): string[]
47
47
  * the binary language-agnostic.
48
48
  */
49
49
  export function runReflect(options: ReflectCommandOptions): Promise<void> {
50
- return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildReflectDriverArgs(options)], options);
50
+ return runDriverChild([DRIVER, ...buildReflectDriverArgs(options)], options);
51
51
  }
@@ -54,5 +54,5 @@ export function buildValidateDriverArgs(options: ValidateCommandOptions): string
54
54
  * The child's exit code propagates to this process so shells and CI see the gate.
55
55
  */
56
56
  export function runValidate(options: ValidateCommandOptions): Promise<void> {
57
- return runDriverChild(['--max-old-space-size=8192', DRIVER, ...buildValidateDriverArgs(options)], options);
57
+ return runDriverChild([DRIVER, ...buildValidateDriverArgs(options)], options);
58
58
  }
@@ -0,0 +1,65 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+
10
+ import { heapCeilingArgs } from '@hydranium/core/node';
11
+
12
+ /**
13
+ * Heap ceiling in MiB for a driver child on a machine with no cgroup limit.
14
+ *
15
+ * The subcommands that spawn one build a whole workspace in that child —
16
+ * `measure-memory` deliberately so, `analyze-heap` loads an entire heap
17
+ * snapshot — so the default Node would pick from physical RAM is too low for
18
+ * the workspaces these are pointed at.
19
+ */
20
+ export const DRIVER_HEAP_MB = 8192;
21
+
22
+ /** Environment variable an operator raises or lowers {@link driverHeapArgs} with. */
23
+ export const DRIVER_HEAP_ENV = 'HYDRANIUM_CLI_MAX_OLD_SPACE_MB';
24
+
25
+ /**
26
+ * Smallest ceiling {@link DRIVER_HEAP_ENV} may state. A driver child builds a
27
+ * whole workspace, so a value this far below the default is a unit mistake
28
+ * rather than a deliberate squeeze.
29
+ */
30
+ export const MIN_DRIVER_HEAP_MB = 256;
31
+
32
+ /**
33
+ * A cgroup reading, so a caller — in practice a test — can decide the ceiling
34
+ * instead of inheriting the machine's. Omitted fields fall back to this
35
+ * process's own reading.
36
+ */
37
+ export interface HeapReading {
38
+ readonly constrained?: number;
39
+ readonly total?: number;
40
+ }
41
+
42
+ /**
43
+ * The `execArgv` prefix every driver child is spawned under.
44
+ *
45
+ * Inside a container this is EMPTY on purpose. {@link DRIVER_HEAP_MB} is sized
46
+ * for a workstation, and handing it to a process under a smaller cgroup limit
47
+ * is worse than handing it nothing: V8 has no reason to collect hard below a
48
+ * ceiling it will never reach, so the kernel OOM-kills the container first and
49
+ * the failure arrives as a signal against the whole cgroup rather than as a
50
+ * heap error the parent can attribute. Left to itself, Node sizes the heap from
51
+ * the limit instead.
52
+ *
53
+ * That trades away the ability to use a LARGE container's memory, since Node's
54
+ * derived default is a fraction of the limit — which is what {@link DRIVER_HEAP_ENV}
55
+ * is for. An operator who states a number has decided, so it wins in a
56
+ * container too.
57
+ */
58
+ export function driverHeapArgs(reading: HeapReading = {}): string[] {
59
+ return heapCeilingArgs({
60
+ desktopDefaultMb: DRIVER_HEAP_MB,
61
+ envValue: process.env[DRIVER_HEAP_ENV],
62
+ minMb: MIN_DRIVER_HEAP_MB,
63
+ ...reading
64
+ });
65
+ }