@reqvire-org/ads 0.3.37 → 0.3.38

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 (36) hide show
  1. package/README.md +3 -1
  2. package/dist/bootstrap-ds/README.md +2 -2
  3. package/dist/bootstrap-ds/package.json +1 -1
  4. package/dist/cli.mjs +9 -1
  5. package/dist/config.mjs +4 -2
  6. package/dist/mcp/preview-owner-guard.mjs +7 -4
  7. package/dist/mcp/preview-widget.bundle.js +46 -47
  8. package/dist/mcp/project-widget.bundle.js +45 -46
  9. package/dist/mcp/server.mjs +5 -0
  10. package/dist/mcp/widget.bundle.js +47 -48
  11. package/dist/preview-bun.mjs +5 -2
  12. package/dist/resource-limits.mjs +146 -0
  13. package/dist/runtime-requirements.mjs +21 -0
  14. package/dist/scenarios-compiler.mjs +4 -3
  15. package/dist/showcase/client.bundle.js +56 -57
  16. package/dist/showcase/sandbox.bundle.js +1 -1
  17. package/dist/skills/ads-break-ui/SKILL.md +3 -2
  18. package/dist/skills/ads-break-ui/references/runtimes.md +85 -1
  19. package/dist/skills/ads-designer/SKILL.md +3 -2
  20. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +2 -2
  21. package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +1 -1
  22. package/dist/skills/ads-designer/references/cli.md +2 -2
  23. package/dist/skills/ads-designer/references/runtimes.md +85 -1
  24. package/dist/skills/ads-import/SKILL.md +3 -2
  25. package/dist/skills/ads-import/references/cli.md +2 -2
  26. package/dist/skills/ads-import/references/runtimes.md +85 -1
  27. package/dist/skills/ads-motion/SKILL.md +3 -2
  28. package/dist/skills/ads-motion/references/runtimes.md +85 -1
  29. package/dist/skills/ads-port/SKILL.md +3 -2
  30. package/dist/skills/ads-port/references/cli.md +2 -2
  31. package/dist/skills/ads-port/references/runtimes.md +85 -1
  32. package/dist/verification/browser.mjs +8 -8
  33. package/docs/CHANGELOG.md +33 -13
  34. package/docs/GUIDE.md +1 -1
  35. package/docs/MCP.md +22 -2
  36. package/package.json +2 -2
@@ -1 +1 @@
1
- function S(t,o){let h=new DOMParser().parseFromString(t,"text/html"),f=h.createElement("meta");if(f.httpEquiv="Content-Security-Policy",f.content=o,h.head.prepend(f),!h.querySelector("base[href]")){let E=h.querySelector("base")??h.createElement("base");E.setAttribute("href","about:srcdoc"),f.after(E)}return"<!doctype html>"+h.documentElement.outerHTML}var y=new URL(location.href).searchParams.get("parent"),b;function r(t=[]){return t.filter((o)=>/^(?:https?:\/\/[a-z0-9.*:[\]-]+(?::\d+)?|data:|blob:|about:)$/i.test(o)).join(" ")}function l(t={}){let o=r(t.resourceDomains);return`default-src 'none';script-src 'unsafe-inline' 'wasm-unsafe-eval' ${o};style-src 'unsafe-inline' ${o};img-src data: ${o};font-src ${o||"'none'"};media-src ${o||"'none'"};worker-src ${o||"'none'"};connect-src ${r(t.connectDomains)||"'none'"};frame-src ${r(t.frameDomains)||"'none'"};base-uri about: ${r(t.baseUriDomains)};object-src 'none';form-action 'none'`}window.addEventListener("message",(t)=>{if(t.source===parent&&t.origin===y){let o=t.data;if(o?.method==="ui/notifications/sandbox-resource-ready"){let{html:h,csp:f}=o.params??{};if(typeof h!=="string")return;b?.remove(),b=window.document.createElement("iframe"),b.title="Design-system App",b.setAttribute("sandbox","allow-scripts allow-forms"),window.document.body.append(b),b.srcdoc=S(h,l(f))}else if(o?.jsonrpc==="2.0"&&!o.method?.startsWith("ui/notifications/sandbox-"))b?.contentWindow.postMessage(o,"*")}else if(t.source===b?.contentWindow&&t.data?.jsonrpc==="2.0"&&!t.data.method?.startsWith("ui/notifications/sandbox-"))parent.postMessage(t.data,y)});parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-ready",params:{}},y);
1
+ function c(e,t){let n=new DOMParser().parseFromString(e,"text/html"),s=n.createElement("meta");if(s.httpEquiv="Content-Security-Policy",s.content=t,n.head.prepend(s),!n.querySelector("base[href]")){let i=n.querySelector("base")??n.createElement("base");i.setAttribute("href","about:srcdoc"),s.after(i)}return"<!doctype html>"+n.documentElement.outerHTML}var a=new URL(location.href).searchParams.get("parent"),o;function r(e=[]){return e.filter((t)=>/^(?:https?:\/\/[a-z0-9.*:[\]-]+(?::\d+)?|data:|blob:|about:)$/i.test(t)).join(" ")}function d(e={}){let t=r(e.resourceDomains);return`default-src 'none';script-src 'unsafe-inline' 'wasm-unsafe-eval' ${t};style-src 'unsafe-inline' ${t};img-src data: ${t};font-src ${t||"'none'"};media-src ${t||"'none'"};worker-src ${t||"'none'"};connect-src ${r(e.connectDomains)||"'none'"};frame-src ${r(e.frameDomains)||"'none'"};base-uri about: ${r(e.baseUriDomains)};object-src 'none';form-action 'none'`}window.addEventListener("message",(e)=>{if(e.source===parent&&e.origin===a){let t=e.data;if(t?.method==="ui/notifications/sandbox-resource-ready"){let{html:n,csp:s}=t.params??{};if(typeof n!=="string")return;o?.remove(),o=window.document.createElement("iframe"),o.title="Design-system App",o.setAttribute("sandbox","allow-scripts allow-forms"),window.document.body.append(o),o.srcdoc=c(n,d(s))}else if(t?.jsonrpc==="2.0"&&!t.method?.startsWith("ui/notifications/sandbox-"))o?.contentWindow.postMessage(t,"*")}else if(e.source===o?.contentWindow&&e.data?.jsonrpc==="2.0"&&!e.data.method?.startsWith("ui/notifications/sandbox-"))parent.postMessage(e.data,a)});parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/sandbox-proxy-ready",params:{}},a);
@@ -29,8 +29,9 @@ MCP serves published previews and evidence without starting a compiler.
29
29
  For validation scope, full audits, and CLI/MCP parity, read
30
30
  [validation.md](references/validation.md).
31
31
 
32
- For Node/Bun setup, MCP launch and compiler workers, read
33
- [runtimes.md](references/runtimes.md).
32
+ For Node/Bun setup, MCP launch, compiler workers and project resource budgets,
33
+ read [runtimes.md](references/runtimes.md). Keep runtime choices, worker counts
34
+ and memory limits in project configuration; verify real workloads under them.
34
35
 
35
36
  Exercise the real component through its public API. Accept an item name, screen,
36
37
  file, or local project path; discover the relevant exports and usage when the
@@ -1,10 +1,17 @@
1
1
  # ADS compilation and project runtimes
2
2
 
3
- ADS tooling and MCP previews use Bun 1.3.13+ for bundling. Install Bun before
3
+ ADS tooling and MCP previews use Bun 1.4.1+ for bundling. Install Bun before
4
4
  using the ADS CLI. The consuming application keeps its own package manager,
5
5
  bundler, framework and production build. Node-compatible ADS checking APIs remain
6
6
  available to projects that run their own checks under Node.
7
7
 
8
+ The minimum applies to the Bun executable running ADS, not to the application's
9
+ runtime. ADS rejects older Bun before starting commands or native compilation.
10
+ Keep a project's Bun pin/launcher compatible when it also launches ADS; do not
11
+ move Node-based application tools onto Bun to satisfy this requirement. Bun 1.4.1
12
+ fixes invalid split-module output observed with complex preview dependency graphs
13
+ on Bun 1.3.13. Compiler caches include the actual Bun version.
14
+
8
15
  Use the installed/pinned ADS version. For npm projects:
9
16
 
10
17
  ```sh
@@ -45,6 +52,83 @@ ADS dispatches Bun project checks with `bun run`, preserving explicitly selected
45
52
  Node/Bun commands and their flags. Use `bun` in a script when that individual tool
46
53
  must run on Bun; ADS does not force the application's tools onto its own runtime.
47
54
 
55
+ ## Project resource budgets
56
+
57
+ When setting up or changing compilation/test commands, put resource limits in
58
+ the project's configuration and scripts so ordinary builds, CI and ADS-started
59
+ checks use them. Account for the MCP server, accepted/draft compilers, test
60
+ workers and browsers together; one process's heap is not the whole workload.
61
+
62
+ - Preserve each tool's supported runtime in `package.json`. A Bun package
63
+ manager or ADS compiler does not imply that Vitest, Vite or every Node CLI
64
+ should be forced onto Bun. Change a tool's runtime only after its real workload
65
+ passes with measured time and memory under a bounded process tree.
66
+ Verify the executable actually used: when real Node is absent, Bun can supply
67
+ a `node` shim that runs Bun. `process.versions.node` alone does not prove Node;
68
+ inspect `process.execPath` and ensure `process.versions.bun` is absent. A project
69
+ launcher must select real Node or fail clearly before launching a Node-only tool;
70
+ V8 heap flags do not constrain Bun's shim runtime.
71
+ - Set worker counts in runner configuration, including project Vitest and
72
+ Playwright configs. Start with a small count appropriate to the machine and
73
+ measure before increasing it. Worker limits apply to the configured runner,
74
+ not every concurrently running project.
75
+ - Set explicit heap ceilings for Node tools in their scripts. For example,
76
+ `node --max-old-space-size=1200 node_modules/vitest/vitest.mjs run` and
77
+ `test: { maxWorkers: 2 }` are possible project settings, not universal defaults.
78
+ Check child processes too: runners can replace inherited Node flags. For
79
+ Vitest's fork pool, configure its `execArgv` heap flag explicitly when needed.
80
+ A heap ceiling excludes native allocations, browser processes and other heaps.
81
+ - Use a process-tree memory ceiling in the project's launcher or CI/container
82
+ when the platform supports it. On Linux with a user systemd manager, a bounded
83
+ launch can use `systemd-run --user --scope --quiet -p MemoryMax=3G
84
+ -p MemorySwapMax=0 bun run test`. Keep MCP stdout reserved for JSON-RPC when
85
+ wrapping its launcher. Account for simultaneous launchers; separate caps do
86
+ not establish an aggregate machine-wide limit.
87
+ - Run the complete affected workload under its saved limits. Record elapsed
88
+ time, peak tree memory and actual passing scope. A growing worker, killed
89
+ process, starved timeout or missing case is a failed/incomplete run. Diagnose
90
+ it; do not silently raise budgets, switch runtimes or remove checks to claim
91
+ success. Scope temporary probes and stop their owned process trees afterward.
92
+
93
+ Standalone project scripts need their own limits even when the same scripts can
94
+ be invoked through ADS. `mcp.mutationCheckTimeoutMs` and behavior-profile timeouts
95
+ limit elapsed time, not RAM. Use only settings supported by the installed ADS
96
+ version; ADS 0.3.37 has no built-in project memory-budget configuration field.
97
+ Do not invent one or describe a JS heap flag as a hard process-tree guarantee.
98
+ Direct editors change project scripts/configuration normally; MCP-only editors
99
+ use the available guarded configuration unit. See [editing workflows](workflows.md).
100
+
101
+ ## ADS command memory limits (ADS 0.3.38+)
102
+
103
+ ADS 0.3.38 adds `resources.memoryLimitMb` to `ds.config.json` for CLI
104
+ commands, including MCP, Explorer, compilation and validation. Published ADS
105
+ 0.3.37 does not support this field; check the installed version before adding it.
106
+
107
+ ```json
108
+ {"resources":{"memoryLimitMb":4096}}
109
+ ```
110
+
111
+ Missing/null chooses an automatic budget: at most 6 GiB, one quarter of physical
112
+ RAM, and available memory minus 1 GiB of headroom, bounded by an inherited Linux
113
+ cgroup limit. Explicit positive MiB budgets override automatic sizing. Restart
114
+ the ADS command after changing its budget. Nested ADS commands share the outer
115
+ envelope rather than each getting a fresh allowance.
116
+
117
+ On Linux with a user systemd manager, ADS uses a kernel process-tree cap and
118
+ disables additional swap for that scope. It preserves an existing finite parent
119
+ envelope instead of moving work outside the caller's limit. Other launches use
120
+ a separate process-tree watchdog when a kernel scope is unavailable. Watchdog
121
+ sampling can overshoot and shared RSS can overestimate memory; it is not a
122
+ kernel guarantee. `ads_status.resourceLimits` reports the budget, enforcement
123
+ mode and whether the reported limit is hard. An exceeded budget fails the
124
+ invocation with `ADS_MEMORY_LIMIT`; inspect retained results before retrying.
125
+
126
+ Embedded APIs report `host-managed`: their caller owns the enclosing process
127
+ policy. Direct project scripts using these APIs, and tests launched outside an
128
+ ADS command, still need project/OS limits. Separate ADS launches have separate
129
+ budgets, not a machine-wide reservation. Keep shared host headroom when choosing
130
+ project concurrency.
131
+
48
132
  ## Native preview compilation
49
133
 
50
134
  Configure the framework and generated manifest:
@@ -29,8 +29,9 @@ MCP serves published previews and evidence without starting a compiler.
29
29
  For validation scope, full audits, and CLI/MCP parity, read
30
30
  [validation.md](references/validation.md).
31
31
 
32
- For Node/Bun setup, MCP launch and compiler workers, read
33
- [runtimes.md](references/runtimes.md).
32
+ For Node/Bun setup, MCP launch, compiler workers and project resource budgets,
33
+ read [runtimes.md](references/runtimes.md). Keep runtime choices, worker counts
34
+ and memory limits in project configuration; verify real workloads under them.
34
35
 
35
36
  Inspect the target before editing. Read its `README.md`, `docs/ARCHITECTURE.md`
36
37
  and `docs/ADS.md` when present (or existing project guides), public exports, and relevant
@@ -12,7 +12,7 @@ Read the local [contract](ADS.md) and the
12
12
 
13
13
  Copy the contents of `bootstrap-ds/`, including dotfiles, into a new project.
14
14
  The installed `ads-designer` skill contains the same files in
15
- `assets/bootstrap-ds/`. Set the project name in `package.json`. Install Bun 1.3.13+ for ADS tooling and previews. The application can keep its
15
+ `assets/bootstrap-ds/`. Set the project name in `package.json`. Install Bun 1.4.1+ for ADS tooling and previews. The application can keep its
16
16
  Node/npm build pipeline. Use a current ADS release.
17
17
 
18
18
  ```sh
@@ -36,7 +36,7 @@ lockfile and translate nested npm scripts to `bun --bun run`. Initialize with
36
36
  `bunx @reqvire-org/ads init`. Init detects existing
37
37
  Bun projects and preserves their scripts/lockfiles. Use `bun install` and
38
38
  `bun --bun run build`/`bun --bun run dev:showcase`. Node is unnecessary with Bun
39
- 1.3.13+. ADS supplies its Bun preview compiler independently of the project build.
39
+ 1.4.1+. ADS supplies its Bun preview compiler independently of the project build.
40
40
 
41
41
  For an existing application, merge only the ADS source and required extraction,
42
42
  aliases and preview adapter. Preserve its framework, entry points and build.
@@ -6,7 +6,7 @@
6
6
  "description": "Private starter workspace for a project's local React design system.",
7
7
  "engines": {
8
8
  "node": ">=22.12.0",
9
- "bun": ">=1.3.13"
9
+ "bun": ">=1.4.1"
10
10
  },
11
11
  "sideEffects": [
12
12
  "**/*.css"
@@ -4,7 +4,7 @@ Choose [direct source editing or MCP-only editing](workflows.md). CLI commands
4
4
  are available to direct editors; MCP-only clients use exposed tools instead of
5
5
  assuming shell access. The compiler can be managed by MCP or externally.
6
6
 
7
- Install Bun 1.3.13+ for ADS tooling and previews. The application keeps its own
7
+ Install Bun 1.4.1+ for ADS tooling and previews. The application keeps its own
8
8
  Node/npm or Bun build pipeline. Use these commands alongside this skill's research,
9
9
  implementation, documentation, and verification workflow. ADS must be a project
10
10
  development dependency, and its checks must run before the project's build.
@@ -34,7 +34,7 @@ tooling and rejects conflicting saved/JSX settings instead of converting it.
34
34
 
35
35
  Use the confirmed package name/version if different. For a Bun project, use
36
36
  `bunx --bun @reqvire-org/ads init --framework react`, `bun install` and
37
- `bun --bun run build`. Bun 1.3.13+ suffices; Node is unnecessary. Init detects
37
+ `bun --bun run build`. Bun 1.4.1+ suffices; Node is unnecessary. Init detects
38
38
  `packageManager` or `bun.lock`/`bun.lockb`, then defaults to Bun when launched
39
39
  with Bun. See [runtimes.md](runtimes.md)
40
40
  for MCP configuration and portable compiler/behavior commands.
@@ -1,10 +1,17 @@
1
1
  # ADS compilation and project runtimes
2
2
 
3
- ADS tooling and MCP previews use Bun 1.3.13+ for bundling. Install Bun before
3
+ ADS tooling and MCP previews use Bun 1.4.1+ for bundling. Install Bun before
4
4
  using the ADS CLI. The consuming application keeps its own package manager,
5
5
  bundler, framework and production build. Node-compatible ADS checking APIs remain
6
6
  available to projects that run their own checks under Node.
7
7
 
8
+ The minimum applies to the Bun executable running ADS, not to the application's
9
+ runtime. ADS rejects older Bun before starting commands or native compilation.
10
+ Keep a project's Bun pin/launcher compatible when it also launches ADS; do not
11
+ move Node-based application tools onto Bun to satisfy this requirement. Bun 1.4.1
12
+ fixes invalid split-module output observed with complex preview dependency graphs
13
+ on Bun 1.3.13. Compiler caches include the actual Bun version.
14
+
8
15
  Use the installed/pinned ADS version. For npm projects:
9
16
 
10
17
  ```sh
@@ -45,6 +52,83 @@ ADS dispatches Bun project checks with `bun run`, preserving explicitly selected
45
52
  Node/Bun commands and their flags. Use `bun` in a script when that individual tool
46
53
  must run on Bun; ADS does not force the application's tools onto its own runtime.
47
54
 
55
+ ## Project resource budgets
56
+
57
+ When setting up or changing compilation/test commands, put resource limits in
58
+ the project's configuration and scripts so ordinary builds, CI and ADS-started
59
+ checks use them. Account for the MCP server, accepted/draft compilers, test
60
+ workers and browsers together; one process's heap is not the whole workload.
61
+
62
+ - Preserve each tool's supported runtime in `package.json`. A Bun package
63
+ manager or ADS compiler does not imply that Vitest, Vite or every Node CLI
64
+ should be forced onto Bun. Change a tool's runtime only after its real workload
65
+ passes with measured time and memory under a bounded process tree.
66
+ Verify the executable actually used: when real Node is absent, Bun can supply
67
+ a `node` shim that runs Bun. `process.versions.node` alone does not prove Node;
68
+ inspect `process.execPath` and ensure `process.versions.bun` is absent. A project
69
+ launcher must select real Node or fail clearly before launching a Node-only tool;
70
+ V8 heap flags do not constrain Bun's shim runtime.
71
+ - Set worker counts in runner configuration, including project Vitest and
72
+ Playwright configs. Start with a small count appropriate to the machine and
73
+ measure before increasing it. Worker limits apply to the configured runner,
74
+ not every concurrently running project.
75
+ - Set explicit heap ceilings for Node tools in their scripts. For example,
76
+ `node --max-old-space-size=1200 node_modules/vitest/vitest.mjs run` and
77
+ `test: { maxWorkers: 2 }` are possible project settings, not universal defaults.
78
+ Check child processes too: runners can replace inherited Node flags. For
79
+ Vitest's fork pool, configure its `execArgv` heap flag explicitly when needed.
80
+ A heap ceiling excludes native allocations, browser processes and other heaps.
81
+ - Use a process-tree memory ceiling in the project's launcher or CI/container
82
+ when the platform supports it. On Linux with a user systemd manager, a bounded
83
+ launch can use `systemd-run --user --scope --quiet -p MemoryMax=3G
84
+ -p MemorySwapMax=0 bun run test`. Keep MCP stdout reserved for JSON-RPC when
85
+ wrapping its launcher. Account for simultaneous launchers; separate caps do
86
+ not establish an aggregate machine-wide limit.
87
+ - Run the complete affected workload under its saved limits. Record elapsed
88
+ time, peak tree memory and actual passing scope. A growing worker, killed
89
+ process, starved timeout or missing case is a failed/incomplete run. Diagnose
90
+ it; do not silently raise budgets, switch runtimes or remove checks to claim
91
+ success. Scope temporary probes and stop their owned process trees afterward.
92
+
93
+ Standalone project scripts need their own limits even when the same scripts can
94
+ be invoked through ADS. `mcp.mutationCheckTimeoutMs` and behavior-profile timeouts
95
+ limit elapsed time, not RAM. Use only settings supported by the installed ADS
96
+ version; ADS 0.3.37 has no built-in project memory-budget configuration field.
97
+ Do not invent one or describe a JS heap flag as a hard process-tree guarantee.
98
+ Direct editors change project scripts/configuration normally; MCP-only editors
99
+ use the available guarded configuration unit. See [editing workflows](workflows.md).
100
+
101
+ ## ADS command memory limits (ADS 0.3.38+)
102
+
103
+ ADS 0.3.38 adds `resources.memoryLimitMb` to `ds.config.json` for CLI
104
+ commands, including MCP, Explorer, compilation and validation. Published ADS
105
+ 0.3.37 does not support this field; check the installed version before adding it.
106
+
107
+ ```json
108
+ {"resources":{"memoryLimitMb":4096}}
109
+ ```
110
+
111
+ Missing/null chooses an automatic budget: at most 6 GiB, one quarter of physical
112
+ RAM, and available memory minus 1 GiB of headroom, bounded by an inherited Linux
113
+ cgroup limit. Explicit positive MiB budgets override automatic sizing. Restart
114
+ the ADS command after changing its budget. Nested ADS commands share the outer
115
+ envelope rather than each getting a fresh allowance.
116
+
117
+ On Linux with a user systemd manager, ADS uses a kernel process-tree cap and
118
+ disables additional swap for that scope. It preserves an existing finite parent
119
+ envelope instead of moving work outside the caller's limit. Other launches use
120
+ a separate process-tree watchdog when a kernel scope is unavailable. Watchdog
121
+ sampling can overshoot and shared RSS can overestimate memory; it is not a
122
+ kernel guarantee. `ads_status.resourceLimits` reports the budget, enforcement
123
+ mode and whether the reported limit is hard. An exceeded budget fails the
124
+ invocation with `ADS_MEMORY_LIMIT`; inspect retained results before retrying.
125
+
126
+ Embedded APIs report `host-managed`: their caller owns the enclosing process
127
+ policy. Direct project scripts using these APIs, and tests launched outside an
128
+ ADS command, still need project/OS limits. Separate ADS launches have separate
129
+ budgets, not a machine-wide reservation. Keep shared host headroom when choosing
130
+ project concurrency.
131
+
48
132
  ## Native preview compilation
49
133
 
50
134
  Configure the framework and generated manifest:
@@ -29,8 +29,9 @@ MCP serves published previews and evidence without starting a compiler.
29
29
  For validation scope, full audits, and CLI/MCP parity, read
30
30
  [validation.md](references/validation.md).
31
31
 
32
- For Node/Bun setup, MCP launch and compiler workers, read
33
- [runtimes.md](references/runtimes.md).
32
+ For Node/Bun setup, MCP launch, compiler workers and project resource budgets,
33
+ read [runtimes.md](references/runtimes.md). Keep runtime choices, worker counts
34
+ and memory limits in project configuration; verify real workloads under them.
34
35
 
35
36
  # ADS Import
36
37
 
@@ -4,7 +4,7 @@ Choose [direct source editing or MCP-only editing](workflows.md). CLI commands
4
4
  are available to direct editors; MCP-only clients use exposed tools instead of
5
5
  assuming shell access. The compiler can be managed by MCP or externally.
6
6
 
7
- Install Bun 1.3.13+ for ADS tooling and previews. The application keeps its own
7
+ Install Bun 1.4.1+ for ADS tooling and previews. The application keeps its own
8
8
  Node/npm or Bun build pipeline. Use these commands alongside this skill's research,
9
9
  implementation, documentation, and verification workflow. ADS must be a project
10
10
  development dependency, and its checks must run before the project's build.
@@ -34,7 +34,7 @@ tooling and rejects conflicting saved/JSX settings instead of converting it.
34
34
 
35
35
  Use the confirmed package name/version if different. For a Bun project, use
36
36
  `bunx --bun @reqvire-org/ads init --framework react`, `bun install` and
37
- `bun --bun run build`. Bun 1.3.13+ suffices; Node is unnecessary. Init detects
37
+ `bun --bun run build`. Bun 1.4.1+ suffices; Node is unnecessary. Init detects
38
38
  `packageManager` or `bun.lock`/`bun.lockb`, then defaults to Bun when launched
39
39
  with Bun. See [runtimes.md](runtimes.md)
40
40
  for MCP configuration and portable compiler/behavior commands.
@@ -1,10 +1,17 @@
1
1
  # ADS compilation and project runtimes
2
2
 
3
- ADS tooling and MCP previews use Bun 1.3.13+ for bundling. Install Bun before
3
+ ADS tooling and MCP previews use Bun 1.4.1+ for bundling. Install Bun before
4
4
  using the ADS CLI. The consuming application keeps its own package manager,
5
5
  bundler, framework and production build. Node-compatible ADS checking APIs remain
6
6
  available to projects that run their own checks under Node.
7
7
 
8
+ The minimum applies to the Bun executable running ADS, not to the application's
9
+ runtime. ADS rejects older Bun before starting commands or native compilation.
10
+ Keep a project's Bun pin/launcher compatible when it also launches ADS; do not
11
+ move Node-based application tools onto Bun to satisfy this requirement. Bun 1.4.1
12
+ fixes invalid split-module output observed with complex preview dependency graphs
13
+ on Bun 1.3.13. Compiler caches include the actual Bun version.
14
+
8
15
  Use the installed/pinned ADS version. For npm projects:
9
16
 
10
17
  ```sh
@@ -45,6 +52,83 @@ ADS dispatches Bun project checks with `bun run`, preserving explicitly selected
45
52
  Node/Bun commands and their flags. Use `bun` in a script when that individual tool
46
53
  must run on Bun; ADS does not force the application's tools onto its own runtime.
47
54
 
55
+ ## Project resource budgets
56
+
57
+ When setting up or changing compilation/test commands, put resource limits in
58
+ the project's configuration and scripts so ordinary builds, CI and ADS-started
59
+ checks use them. Account for the MCP server, accepted/draft compilers, test
60
+ workers and browsers together; one process's heap is not the whole workload.
61
+
62
+ - Preserve each tool's supported runtime in `package.json`. A Bun package
63
+ manager or ADS compiler does not imply that Vitest, Vite or every Node CLI
64
+ should be forced onto Bun. Change a tool's runtime only after its real workload
65
+ passes with measured time and memory under a bounded process tree.
66
+ Verify the executable actually used: when real Node is absent, Bun can supply
67
+ a `node` shim that runs Bun. `process.versions.node` alone does not prove Node;
68
+ inspect `process.execPath` and ensure `process.versions.bun` is absent. A project
69
+ launcher must select real Node or fail clearly before launching a Node-only tool;
70
+ V8 heap flags do not constrain Bun's shim runtime.
71
+ - Set worker counts in runner configuration, including project Vitest and
72
+ Playwright configs. Start with a small count appropriate to the machine and
73
+ measure before increasing it. Worker limits apply to the configured runner,
74
+ not every concurrently running project.
75
+ - Set explicit heap ceilings for Node tools in their scripts. For example,
76
+ `node --max-old-space-size=1200 node_modules/vitest/vitest.mjs run` and
77
+ `test: { maxWorkers: 2 }` are possible project settings, not universal defaults.
78
+ Check child processes too: runners can replace inherited Node flags. For
79
+ Vitest's fork pool, configure its `execArgv` heap flag explicitly when needed.
80
+ A heap ceiling excludes native allocations, browser processes and other heaps.
81
+ - Use a process-tree memory ceiling in the project's launcher or CI/container
82
+ when the platform supports it. On Linux with a user systemd manager, a bounded
83
+ launch can use `systemd-run --user --scope --quiet -p MemoryMax=3G
84
+ -p MemorySwapMax=0 bun run test`. Keep MCP stdout reserved for JSON-RPC when
85
+ wrapping its launcher. Account for simultaneous launchers; separate caps do
86
+ not establish an aggregate machine-wide limit.
87
+ - Run the complete affected workload under its saved limits. Record elapsed
88
+ time, peak tree memory and actual passing scope. A growing worker, killed
89
+ process, starved timeout or missing case is a failed/incomplete run. Diagnose
90
+ it; do not silently raise budgets, switch runtimes or remove checks to claim
91
+ success. Scope temporary probes and stop their owned process trees afterward.
92
+
93
+ Standalone project scripts need their own limits even when the same scripts can
94
+ be invoked through ADS. `mcp.mutationCheckTimeoutMs` and behavior-profile timeouts
95
+ limit elapsed time, not RAM. Use only settings supported by the installed ADS
96
+ version; ADS 0.3.37 has no built-in project memory-budget configuration field.
97
+ Do not invent one or describe a JS heap flag as a hard process-tree guarantee.
98
+ Direct editors change project scripts/configuration normally; MCP-only editors
99
+ use the available guarded configuration unit. See [editing workflows](workflows.md).
100
+
101
+ ## ADS command memory limits (ADS 0.3.38+)
102
+
103
+ ADS 0.3.38 adds `resources.memoryLimitMb` to `ds.config.json` for CLI
104
+ commands, including MCP, Explorer, compilation and validation. Published ADS
105
+ 0.3.37 does not support this field; check the installed version before adding it.
106
+
107
+ ```json
108
+ {"resources":{"memoryLimitMb":4096}}
109
+ ```
110
+
111
+ Missing/null chooses an automatic budget: at most 6 GiB, one quarter of physical
112
+ RAM, and available memory minus 1 GiB of headroom, bounded by an inherited Linux
113
+ cgroup limit. Explicit positive MiB budgets override automatic sizing. Restart
114
+ the ADS command after changing its budget. Nested ADS commands share the outer
115
+ envelope rather than each getting a fresh allowance.
116
+
117
+ On Linux with a user systemd manager, ADS uses a kernel process-tree cap and
118
+ disables additional swap for that scope. It preserves an existing finite parent
119
+ envelope instead of moving work outside the caller's limit. Other launches use
120
+ a separate process-tree watchdog when a kernel scope is unavailable. Watchdog
121
+ sampling can overshoot and shared RSS can overestimate memory; it is not a
122
+ kernel guarantee. `ads_status.resourceLimits` reports the budget, enforcement
123
+ mode and whether the reported limit is hard. An exceeded budget fails the
124
+ invocation with `ADS_MEMORY_LIMIT`; inspect retained results before retrying.
125
+
126
+ Embedded APIs report `host-managed`: their caller owns the enclosing process
127
+ policy. Direct project scripts using these APIs, and tests launched outside an
128
+ ADS command, still need project/OS limits. Separate ADS launches have separate
129
+ budgets, not a machine-wide reservation. Keep shared host headroom when choosing
130
+ project concurrency.
131
+
48
132
  ## Native preview compilation
49
133
 
50
134
  Configure the framework and generated manifest:
@@ -29,8 +29,9 @@ MCP serves published previews and evidence without starting a compiler.
29
29
  For validation scope, full audits, and CLI/MCP parity, read
30
30
  [validation.md](references/validation.md).
31
31
 
32
- For Node/Bun setup, MCP launch and compiler workers, read
33
- [runtimes.md](references/runtimes.md).
32
+ For Node/Bun setup, MCP launch, compiler workers and project resource budgets,
33
+ read [runtimes.md](references/runtimes.md). Keep runtime choices, worker counts
34
+ and memory limits in project configuration; verify real workloads under them.
34
35
 
35
36
  Accept a component/pattern name, file, screen, or project path and infer the mode
36
37
  from the request. Inspect before proposing motion: read `docs/ARCHITECTURE.md` when
@@ -1,10 +1,17 @@
1
1
  # ADS compilation and project runtimes
2
2
 
3
- ADS tooling and MCP previews use Bun 1.3.13+ for bundling. Install Bun before
3
+ ADS tooling and MCP previews use Bun 1.4.1+ for bundling. Install Bun before
4
4
  using the ADS CLI. The consuming application keeps its own package manager,
5
5
  bundler, framework and production build. Node-compatible ADS checking APIs remain
6
6
  available to projects that run their own checks under Node.
7
7
 
8
+ The minimum applies to the Bun executable running ADS, not to the application's
9
+ runtime. ADS rejects older Bun before starting commands or native compilation.
10
+ Keep a project's Bun pin/launcher compatible when it also launches ADS; do not
11
+ move Node-based application tools onto Bun to satisfy this requirement. Bun 1.4.1
12
+ fixes invalid split-module output observed with complex preview dependency graphs
13
+ on Bun 1.3.13. Compiler caches include the actual Bun version.
14
+
8
15
  Use the installed/pinned ADS version. For npm projects:
9
16
 
10
17
  ```sh
@@ -45,6 +52,83 @@ ADS dispatches Bun project checks with `bun run`, preserving explicitly selected
45
52
  Node/Bun commands and their flags. Use `bun` in a script when that individual tool
46
53
  must run on Bun; ADS does not force the application's tools onto its own runtime.
47
54
 
55
+ ## Project resource budgets
56
+
57
+ When setting up or changing compilation/test commands, put resource limits in
58
+ the project's configuration and scripts so ordinary builds, CI and ADS-started
59
+ checks use them. Account for the MCP server, accepted/draft compilers, test
60
+ workers and browsers together; one process's heap is not the whole workload.
61
+
62
+ - Preserve each tool's supported runtime in `package.json`. A Bun package
63
+ manager or ADS compiler does not imply that Vitest, Vite or every Node CLI
64
+ should be forced onto Bun. Change a tool's runtime only after its real workload
65
+ passes with measured time and memory under a bounded process tree.
66
+ Verify the executable actually used: when real Node is absent, Bun can supply
67
+ a `node` shim that runs Bun. `process.versions.node` alone does not prove Node;
68
+ inspect `process.execPath` and ensure `process.versions.bun` is absent. A project
69
+ launcher must select real Node or fail clearly before launching a Node-only tool;
70
+ V8 heap flags do not constrain Bun's shim runtime.
71
+ - Set worker counts in runner configuration, including project Vitest and
72
+ Playwright configs. Start with a small count appropriate to the machine and
73
+ measure before increasing it. Worker limits apply to the configured runner,
74
+ not every concurrently running project.
75
+ - Set explicit heap ceilings for Node tools in their scripts. For example,
76
+ `node --max-old-space-size=1200 node_modules/vitest/vitest.mjs run` and
77
+ `test: { maxWorkers: 2 }` are possible project settings, not universal defaults.
78
+ Check child processes too: runners can replace inherited Node flags. For
79
+ Vitest's fork pool, configure its `execArgv` heap flag explicitly when needed.
80
+ A heap ceiling excludes native allocations, browser processes and other heaps.
81
+ - Use a process-tree memory ceiling in the project's launcher or CI/container
82
+ when the platform supports it. On Linux with a user systemd manager, a bounded
83
+ launch can use `systemd-run --user --scope --quiet -p MemoryMax=3G
84
+ -p MemorySwapMax=0 bun run test`. Keep MCP stdout reserved for JSON-RPC when
85
+ wrapping its launcher. Account for simultaneous launchers; separate caps do
86
+ not establish an aggregate machine-wide limit.
87
+ - Run the complete affected workload under its saved limits. Record elapsed
88
+ time, peak tree memory and actual passing scope. A growing worker, killed
89
+ process, starved timeout or missing case is a failed/incomplete run. Diagnose
90
+ it; do not silently raise budgets, switch runtimes or remove checks to claim
91
+ success. Scope temporary probes and stop their owned process trees afterward.
92
+
93
+ Standalone project scripts need their own limits even when the same scripts can
94
+ be invoked through ADS. `mcp.mutationCheckTimeoutMs` and behavior-profile timeouts
95
+ limit elapsed time, not RAM. Use only settings supported by the installed ADS
96
+ version; ADS 0.3.37 has no built-in project memory-budget configuration field.
97
+ Do not invent one or describe a JS heap flag as a hard process-tree guarantee.
98
+ Direct editors change project scripts/configuration normally; MCP-only editors
99
+ use the available guarded configuration unit. See [editing workflows](workflows.md).
100
+
101
+ ## ADS command memory limits (ADS 0.3.38+)
102
+
103
+ ADS 0.3.38 adds `resources.memoryLimitMb` to `ds.config.json` for CLI
104
+ commands, including MCP, Explorer, compilation and validation. Published ADS
105
+ 0.3.37 does not support this field; check the installed version before adding it.
106
+
107
+ ```json
108
+ {"resources":{"memoryLimitMb":4096}}
109
+ ```
110
+
111
+ Missing/null chooses an automatic budget: at most 6 GiB, one quarter of physical
112
+ RAM, and available memory minus 1 GiB of headroom, bounded by an inherited Linux
113
+ cgroup limit. Explicit positive MiB budgets override automatic sizing. Restart
114
+ the ADS command after changing its budget. Nested ADS commands share the outer
115
+ envelope rather than each getting a fresh allowance.
116
+
117
+ On Linux with a user systemd manager, ADS uses a kernel process-tree cap and
118
+ disables additional swap for that scope. It preserves an existing finite parent
119
+ envelope instead of moving work outside the caller's limit. Other launches use
120
+ a separate process-tree watchdog when a kernel scope is unavailable. Watchdog
121
+ sampling can overshoot and shared RSS can overestimate memory; it is not a
122
+ kernel guarantee. `ads_status.resourceLimits` reports the budget, enforcement
123
+ mode and whether the reported limit is hard. An exceeded budget fails the
124
+ invocation with `ADS_MEMORY_LIMIT`; inspect retained results before retrying.
125
+
126
+ Embedded APIs report `host-managed`: their caller owns the enclosing process
127
+ policy. Direct project scripts using these APIs, and tests launched outside an
128
+ ADS command, still need project/OS limits. Separate ADS launches have separate
129
+ budgets, not a machine-wide reservation. Keep shared host headroom when choosing
130
+ project concurrency.
131
+
48
132
  ## Native preview compilation
49
133
 
50
134
  Configure the framework and generated manifest:
@@ -29,8 +29,9 @@ MCP serves published previews and evidence without starting a compiler.
29
29
  For validation scope, full audits, and CLI/MCP parity, read
30
30
  [validation.md](references/validation.md).
31
31
 
32
- For Node/Bun setup, MCP launch and compiler workers, read
33
- [runtimes.md](references/runtimes.md).
32
+ For Node/Bun setup, MCP launch, compiler workers and project resource budgets,
33
+ read [runtimes.md](references/runtimes.md). Keep runtime choices, worker counts
34
+ and memory limits in project configuration; verify real workloads under them.
34
35
 
35
36
  # ADS Port
36
37
 
@@ -4,7 +4,7 @@ Choose [direct source editing or MCP-only editing](workflows.md). CLI commands
4
4
  are available to direct editors; MCP-only clients use exposed tools instead of
5
5
  assuming shell access. The compiler can be managed by MCP or externally.
6
6
 
7
- Install Bun 1.3.13+ for ADS tooling and previews. The application keeps its own
7
+ Install Bun 1.4.1+ for ADS tooling and previews. The application keeps its own
8
8
  Node/npm or Bun build pipeline. Use these commands alongside this skill's research,
9
9
  implementation, documentation, and verification workflow. ADS must be a project
10
10
  development dependency, and its checks must run before the project's build.
@@ -34,7 +34,7 @@ tooling and rejects conflicting saved/JSX settings instead of converting it.
34
34
 
35
35
  Use the confirmed package name/version if different. For a Bun project, use
36
36
  `bunx --bun @reqvire-org/ads init --framework react`, `bun install` and
37
- `bun --bun run build`. Bun 1.3.13+ suffices; Node is unnecessary. Init detects
37
+ `bun --bun run build`. Bun 1.4.1+ suffices; Node is unnecessary. Init detects
38
38
  `packageManager` or `bun.lock`/`bun.lockb`, then defaults to Bun when launched
39
39
  with Bun. See [runtimes.md](runtimes.md)
40
40
  for MCP configuration and portable compiler/behavior commands.