@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,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:
@@ -131,7 +131,7 @@ function verificationRequest() {
131
131
  }
132
132
  async function openBehaviorScenario(page, checkId, { timeout = 30000 } = {}) {
133
133
  const request = verificationRequest();
134
- const check = request.checks.find((check2) => check2.id === checkId);
134
+ const check = request.checks.find((check) => check.id === checkId);
135
135
  const url = check && request.scenarios[check.scenario];
136
136
  if (!url)
137
137
  throw new Error("This check has no managed browser scenario. StrictMode profiles must supply a project development harness; production preview bundles do not replay React development effects.");
@@ -156,9 +156,9 @@ async function openPreviewScenario(page, url, scenario, { timeout = 30000 } = {}
156
156
  failures.push(`${request.method()} ${request.url().slice(0, 300)}: ${request.failure()?.errorText ?? "request failed"}`);
157
157
  record(request, { error: request.failure()?.errorText ?? "request failed" });
158
158
  };
159
- const response = (response2) => {
160
- if (response2.status() >= 400)
161
- record(response2.request(), { status: response2.status() });
159
+ const response = (response) => {
160
+ if (response.status() >= 400)
161
+ record(response.request(), { status: response.status() });
162
162
  };
163
163
  const pageError = (error) => {
164
164
  if (errors.length < 3)
@@ -174,7 +174,7 @@ async function openPreviewScenario(page, url, scenario, { timeout = 30000 } = {}
174
174
  await page.goto(verified.href, { waitUntil: "load", timeout });
175
175
  const end = Date.now() + timeout;
176
176
  while (Date.now() < end) {
177
- for (const frame of page.frames().filter((frame2) => frame2 !== page.mainFrame())) {
177
+ for (const frame of page.frames().filter((frame) => frame !== page.mainFrame())) {
178
178
  const state = await frame.evaluate(() => {
179
179
  const data = document.documentElement.dataset;
180
180
  return { state: data.adsPreviewState, id: data.adsScenario, revision: data.adsPreviewRevision, category: data.adsPreviewErrorCategory, code: data.adsPreviewErrorCode, resourceUri: data.adsPreviewResourceUri, message: document.getElementById("ads-preview-status")?.textContent };
@@ -216,8 +216,8 @@ ${failures.join(`
216
216
  }
217
217
  }
218
218
  export {
219
- verificationRequest,
220
- openPreviewScenario,
219
+ auditBehaviorPaints,
221
220
  openBehaviorScenario,
222
- auditBehaviorPaints
221
+ openPreviewScenario,
222
+ verificationRequest
223
223
  };
package/docs/CHANGELOG.md CHANGED
@@ -1,34 +1,54 @@
1
1
  # Changelog
2
2
 
3
- ## 0.3.37
3
+ ## 0.3.38
4
4
 
5
5
  <!-- ads-local-tests:start -->
6
- Local verification: **574/574 passed** with `ADS_TEST_BUN=1 npm test`.
7
- Tested commit: `e0e0d53da1b29fdaa1b20735e0726937d5a19dcf`; Node v24.13.0, Bun 1.3.13.
8
- Completed 2026-10-23T18:18:16.960Z (808 seconds).
6
+ Local verification: **584/584 passed** with `ADS_TEST_BUN=1 npm test`.
7
+ Tested commit: `c6f50aa3e3a8c4b746805faf3190c12874108e81`; Node v24.13.0, Bun 1.4.1.
8
+ Completed 2026-10-23T21:33:53.937Z (772 seconds).
9
9
 
10
10
  <!-- ads-local-test-proof
11
11
  {
12
12
  "schema": 1,
13
- "version": "0.3.37",
14
- "commit": "e0e0d53da1b29fdaa1b20735e0726937d5a19dcf",
15
- "sourceSha256": "c71441655e5c8a14242842dbbec17b92608f367396f4645f73dcbaa2eb475cb4",
13
+ "version": "0.3.38",
14
+ "commit": "c6f50aa3e3a8c4b746805faf3190c12874108e81",
15
+ "sourceSha256": "01da9a648eb3206296fadd93ece54996f901ab43b218a137681d5cc5728858e9",
16
16
  "command": "ADS_TEST_BUN=1 npm test",
17
17
  "result": "pass",
18
- "tests": 574,
19
- "pass": 574,
18
+ "tests": 584,
19
+ "pass": 584,
20
20
  "fail": 0,
21
21
  "cancelled": 0,
22
22
  "skipped": 0,
23
23
  "node": "v24.13.0",
24
- "bun": "1.3.13",
25
- "completedAt": "2026-10-23T18:18:16.960Z",
26
- "durationMs": 807676,
27
- "logSha256": "ef20374b0910acea995128abc9ec590f5e73afafe9d529c43dba8d41f51ba907"
24
+ "bun": "1.4.1",
25
+ "completedAt": "2026-10-23T21:33:53.937Z",
26
+ "durationMs": 772285,
27
+ "logSha256": "984ecd9909f3a5808afba6fd1ef1e708a1bab0268f0ebc202c0333f3fe804556"
28
28
  }
29
29
  -->
30
30
  <!-- ads-local-tests:end -->
31
31
 
32
+ - Require Bun 1.4.1+ for ADS's Bun runtime and native compiler. Reject older Bun
33
+ before work starts and invalidate preview caches when its version changes.
34
+ Bun 1.3.13 emitted invalid split modules for Reqvire's graph previews; keep
35
+ production minification/tree shaking and use the corrected compiler. Consuming
36
+ applications retain their own runtimes and build pipelines.
37
+ - Disable Bun's HTTP modulepreload helper in MCP bundles. ADS already loads
38
+ dependencies through its resource bridge; preload self-references must not
39
+ become cyclic blob dependencies or fetch unopened lazy branches.
40
+ - Retain actionable Explorer timeout errors across pending build notifications.
41
+ Retry on request or when new compiled output is available, without silently
42
+ restarting the same failed selection on every status update.
43
+ - Add default process-tree memory budgets to ADS CLI commands, configured through
44
+ `resources.memoryLimitMb`. Use Linux kernel scopes where available, preserve
45
+ inherited envelopes, and report watchdog/host-managed limits honestly in MCP.
46
+ - Teach all five skills to save project worker/heap/OS budgets, validate actual
47
+ runtimes and reject Bun's Node shim for Node-only tooling. Keep package-manager
48
+ choice independent from compiler/test runtime requirements.
49
+
50
+ ## 0.3.37
51
+
32
52
  - Compile ADS tooling/browser bundles and MCP previews with Bun, independently of
33
53
  the application bundler. Native React/Preact JSX, Linaria, static assets and
34
54
  self-contained workers share the existing immutable MCP resource boundary.
package/docs/GUIDE.md CHANGED
@@ -183,7 +183,7 @@ contexts, and exclusion of JavaScript and generated outputs.
183
183
 
184
184
  ## Set up an existing project
185
185
 
186
- Install Bun 1.3.13+ for ADS tooling and previews. The application keeps its own
186
+ Install Bun 1.4.1+ for ADS tooling and previews. The application keeps its own
187
187
  Node/npm or Bun pipeline. Run inside the project containing `package.json`:
188
188
 
189
189
  ```sh
package/docs/MCP.md CHANGED
@@ -52,6 +52,26 @@ starting a compiler. Existing views may remain visible during compilation, but
52
52
  changed-source evidence is stale until verified updated artifacts are published.
53
53
  Both editing routes require current ADS/project checks and rendered review.
54
54
 
55
+ ## Command memory budgets (ADS 0.3.38+)
56
+
57
+ ADS 0.3.38 adds `resources.memoryLimitMb` in `ds.config.json`. Missing/null
58
+ selects an automatic process-tree budget of at most 6 GiB and one quarter of
59
+ physical RAM, with 1 GiB of available-memory headroom and inherited Linux limits
60
+ respected. A positive MiB value sets the project budget explicitly. Changing it
61
+ requires restarting ADS. This field is unavailable in published 0.3.37.
62
+
63
+ CLI MCP/Explorer, compile and check/verification commands share the envelope with
64
+ their descendants. Linux uses a user systemd memory scope where available,
65
+ without additional swap, or keeps a finite parent envelope. A separate watchdog
66
+ is the fallback; its sampling is not a hard kernel bound. `ads_status.resourceLimits`
67
+ reports `memoryLimitMb`, `enforcement`, `scope` and `hardLimit`. Embedded APIs
68
+ report `host-managed`, and standalone project scripts need their own limits.
69
+ See [project budgets and runtime selection](../skills/ads-designer/references/runtimes.md).
70
+
71
+ An exceeded command fails with `ADS_MEMORY_LIMIT` on stderr without contaminating
72
+ MCP stdout. Retained source/results must be inspected before retrying. No passing
73
+ result is implied by a timeout, killed worker or disconnected MCP transport.
74
+
55
75
  ## Built-in showcase client
56
76
 
57
77
  ### Auto-mode tracked drafts
@@ -235,7 +255,7 @@ MCP startup. For this `npx` setup, Node and npm must be available to the client.
235
255
 
236
256
  For **Bun**, use `command = "bunx"` and
237
257
  `args = ["@reqvire-org/ads", "mcp"]` in Codex, or these equivalent
238
- `command`/`args` values in Claude's JSON. Bun 1.3.13+ is sufficient; Node and npm
258
+ `command`/`args` values in Claude's JSON. Bun 1.4.1+ is sufficient; Node and npm
239
259
  are unnecessary for ADS itself. The CLI has a Bun shebang. Generated local
240
260
  launchers use the installed CLI while preserving interpreters selected by
241
261
  application check/build scripts.
@@ -868,7 +888,7 @@ area. Other Apps hosts retain the in-App status fallback.
868
888
 
869
889
  ### ADS-owned Bun compiler
870
890
 
871
- Bun 1.3.13+ compiles ADS browser bundles and MCP previews independently of the
891
+ Bun 1.4.1+ compiles ADS browser bundles and MCP previews independently of the
872
892
  application's bundler. Configure `framework` and `mcp.previewManifest`; ADS
873
893
  supplies its compiler when no explicit project watcher is configured:
874
894
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.3.37",
3
+ "version": "0.3.38",
4
4
  "type": "module",
5
5
  "description": "A design system your agent can see and shape. Your components. Your look. Your code.",
6
6
  "repository": {
@@ -100,7 +100,7 @@
100
100
  },
101
101
  "engines": {
102
102
  "node": ">=22.12.0",
103
- "bun": ">=1.3.13"
103
+ "bun": ">=1.4.1"
104
104
  },
105
105
  "bin": {
106
106
  "ads": "./dist/cli.mjs"