@reqvire-org/ads 0.3.36 → 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 (86) hide show
  1. package/README.md +12 -8
  2. package/dist/bootstrap-ds/README.md +8 -9
  3. package/dist/bootstrap-ds/ds.config.json +1 -8
  4. package/dist/bootstrap-ds/package.json +4 -3
  5. package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +2 -32
  6. package/dist/bun-compiler.mjs +13 -0
  7. package/dist/bun-worker.mjs +9 -0
  8. package/dist/check.mjs +7 -4
  9. package/dist/cli.mjs +20 -8
  10. package/dist/config.mjs +24 -4
  11. package/dist/development-runtime.mjs +3 -1
  12. package/dist/init.mjs +16 -18
  13. package/dist/mcp/build-status.mjs +6 -4
  14. package/dist/mcp/context.mjs +9 -4
  15. package/dist/mcp/drafts.mjs +4 -2
  16. package/dist/mcp/mutations.mjs +4 -14
  17. package/dist/mcp/preview-owner-guard.mjs +7 -4
  18. package/dist/mcp/preview-watch.mjs +21 -9
  19. package/dist/mcp/preview-widget.bundle.js +57 -63
  20. package/dist/mcp/preview-work.mjs +1 -15
  21. package/dist/mcp/project-widget.bundle.js +55 -61
  22. package/dist/mcp/prompts.mjs +2 -2
  23. package/dist/mcp/resource-loader.js +32 -10
  24. package/dist/mcp/server.mjs +94 -34
  25. package/dist/mcp/widget.bundle.js +58 -64
  26. package/dist/preview-builder.mjs +17 -5
  27. package/dist/preview-bun.mjs +269 -0
  28. package/dist/preview-imports.mjs +73 -0
  29. package/dist/preview-resources.mjs +26 -14
  30. package/dist/resource-limits.mjs +146 -0
  31. package/dist/runtime-requirements.mjs +21 -0
  32. package/dist/scenario-inspector.mjs +11 -4
  33. package/dist/scenarios-compiler.mjs +51 -9
  34. package/dist/showcase/client.bundle.js +66 -71
  35. package/dist/showcase/index.html +2 -2
  36. package/dist/showcase/sandbox.bundle.js +1 -1
  37. package/dist/showcase/style.css +4 -0
  38. package/dist/skills/ads-break-ui/SKILL.md +42 -42
  39. package/dist/skills/ads-break-ui/references/drafts.md +6 -3
  40. package/dist/skills/ads-break-ui/references/guarded-editing.md +4 -3
  41. package/dist/skills/ads-break-ui/references/runtimes.md +175 -140
  42. package/dist/skills/ads-break-ui/references/validation.md +13 -3
  43. package/dist/skills/ads-break-ui/references/workflows.md +82 -0
  44. package/dist/skills/ads-designer/SKILL.md +41 -41
  45. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +8 -9
  46. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -8
  47. package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +4 -3
  48. package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +2 -32
  49. package/dist/skills/ads-designer/references/cli.md +25 -21
  50. package/dist/skills/ads-designer/references/drafts.md +6 -3
  51. package/dist/skills/ads-designer/references/guarded-editing.md +4 -3
  52. package/dist/skills/ads-designer/references/runtimes.md +175 -140
  53. package/dist/skills/ads-designer/references/validation.md +13 -3
  54. package/dist/skills/ads-designer/references/workflows.md +82 -0
  55. package/dist/skills/ads-import/SKILL.md +43 -44
  56. package/dist/skills/ads-import/references/cli.md +25 -21
  57. package/dist/skills/ads-import/references/drafts.md +6 -3
  58. package/dist/skills/ads-import/references/guarded-editing.md +4 -3
  59. package/dist/skills/ads-import/references/runtimes.md +175 -140
  60. package/dist/skills/ads-import/references/validation.md +13 -3
  61. package/dist/skills/ads-import/references/workflows.md +82 -0
  62. package/dist/skills/ads-motion/SKILL.md +40 -40
  63. package/dist/skills/ads-motion/references/drafts.md +6 -3
  64. package/dist/skills/ads-motion/references/guarded-editing.md +4 -3
  65. package/dist/skills/ads-motion/references/runtimes.md +175 -140
  66. package/dist/skills/ads-motion/references/validation.md +13 -3
  67. package/dist/skills/ads-motion/references/workflows.md +82 -0
  68. package/dist/skills/ads-port/SKILL.md +40 -40
  69. package/dist/skills/ads-port/references/cli.md +25 -21
  70. package/dist/skills/ads-port/references/drafts.md +6 -3
  71. package/dist/skills/ads-port/references/guarded-editing.md +4 -3
  72. package/dist/skills/ads-port/references/runtimes.md +175 -140
  73. package/dist/skills/ads-port/references/validation.md +13 -3
  74. package/dist/skills/ads-port/references/workflows.md +82 -0
  75. package/dist/usage.mjs +84 -0
  76. package/dist/validation.mjs +0 -12
  77. package/dist/verification/browser.mjs +77 -48
  78. package/docs/ADS.md +17 -11
  79. package/docs/ARCHITECTURE.md +43 -29
  80. package/docs/BEHAVIORS.md +3 -3
  81. package/docs/CHANGELOG.md +81 -13
  82. package/docs/GUIDE.md +96 -53
  83. package/docs/MCP.md +117 -123
  84. package/docs/benchmarks/bun-previews.md +91 -0
  85. package/docs/benchmarks/gidi-preview-memory.md +4 -0
  86. package/package.json +16 -14
@@ -4,21 +4,25 @@ import { readFileSync } from "node:fs";
4
4
  // preview-client/paint-audit.mjs
5
5
  function auditPaintBindings({ container = document.getElementById("root"), bindings = [], auditResources = false } = {}) {
6
6
  const diagnostics = [], verified = [], limits = [];
7
- if (!container || !Array.isArray(bindings) || bindings.length > 100) return { ok: false, diagnostics: ["Invalid bounded paint-audit descriptor."], verified };
7
+ if (!container || !Array.isArray(bindings) || bindings.length > 100)
8
+ return { ok: false, diagnostics: ["Invalid bounded paint-audit descriptor."], verified };
8
9
  const document2 = container.ownerDocument, view = document2.defaultView;
9
10
  const properties = ["color", "fill", "stroke", "stop-color", "background-color", "border-top-color", "border-right-color", "border-bottom-color", "border-left-color"];
10
- function reference(value, node, descriptor, seen = /* @__PURE__ */ new Set()) {
11
+ function reference(value, node, descriptor, seen = new Set) {
11
12
  value = value.trim();
12
- if (["none", "currentColor"].includes(value)) return true;
13
+ if (["none", "currentColor"].includes(value))
14
+ return true;
13
15
  const variable = /^var\(\s*(--[\w-]+)\s*\)$/.exec(value);
14
16
  if (variable) {
15
17
  const name = variable[1];
16
- if (!descriptor.tokens.includes(name) || seen.has(name)) return false;
18
+ if (!descriptor.tokens.includes(name) || seen.has(name))
19
+ return false;
17
20
  const resolved = view.getComputedStyle(node).getPropertyValue(name).trim();
18
21
  return !!resolved && view.CSS.supports("color", resolved);
19
22
  }
20
23
  const themed = /^light-dark\(\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*,\s*(var\(\s*--[\w-]+\s*\)|currentColor)\s*\)$/.exec(value);
21
- if (themed) return view.CSS.supports("color", value) && reference(themed[1], node, descriptor, seen) && reference(themed[2], node, descriptor, seen);
24
+ if (themed)
25
+ return view.CSS.supports("color", value) && reference(themed[1], node, descriptor, seen) && reference(themed[2], node, descriptor, seen);
22
26
  const resource = /^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(value);
23
27
  if (resource && view.CSS.supports("fill", value)) {
24
28
  const candidates = [...document2.querySelectorAll("[id]")].filter((item) => item.id === resource[2]);
@@ -38,17 +42,19 @@ function auditPaintBindings({ container = document.getElementById("root"), bindi
38
42
  diagnostics.push(`${descriptor.owner}: invalid binding scope.`);
39
43
  continue;
40
44
  }
41
- if (roots.length > 20) limits.push(`${descriptor.owner}: only the first 20 instances were audited; use a focused scenario for complete evidence.`);
45
+ if (roots.length > 20)
46
+ limits.push(`${descriptor.owner}: only the first 20 instances were audited; use a focused scenario for complete evidence.`);
42
47
  for (const root of roots.slice(0, 20)) {
43
48
  const nodes = [root, ...root.querySelectorAll("*")];
44
- if (nodes.length > 1e3) {
49
+ if (nodes.length > 1000) {
45
50
  limits.push(`${descriptor.owner}: instance exceeds 1000 elements; paint effects are not established.`);
46
51
  continue;
47
52
  }
48
53
  const names = [...root.style].filter((name) => name.startsWith(descriptor.prefix) && name.endsWith(descriptor.suffix));
49
- if (names.length > 100) limits.push(`${descriptor.owner}: only the first 100 binding keys were audited.`);
54
+ if (names.length > 100)
55
+ limits.push(`${descriptor.owner}: only the first 100 binding keys were audited.`);
50
56
  for (const name of names.slice(0, 100)) {
51
- const value = root.style.getPropertyValue(name).trim(), key = name.slice(descriptor.prefix.length, descriptor.suffix ? -descriptor.suffix.length : void 0);
57
+ const value = root.style.getPropertyValue(name).trim(), key = name.slice(descriptor.prefix.length, descriptor.suffix ? -descriptor.suffix.length : undefined);
52
58
  if (!/^[A-Za-z0-9_-]+$/.test(key) || !reference(value, root, descriptor)) {
53
59
  diagnostics.push(`${descriptor.owner}: invalid or inaccessible paint ${name}: ${value}. Use an accessible token, instance-local SVG paint server, none or currentColor.`);
54
60
  continue;
@@ -56,7 +62,8 @@ function auditPaintBindings({ container = document.getElementById("root"), bindi
56
62
  const previous = root.getAttribute("style");
57
63
  const nodeStyles = nodes.map((node) => node.getAttribute("style"));
58
64
  try {
59
- for (const node of nodes) node.style.setProperty("transition", "none", "important");
65
+ for (const node of nodes)
66
+ node.style.setProperty("transition", "none", "important");
60
67
  const before = nodes.map((node) => properties.map((property) => view.getComputedStyle(node).getPropertyValue(property)));
61
68
  root.style.setProperty(name, "rgb(17, 103, 211)", "important");
62
69
  let changed = nodes.some((node, index) => properties.some((property, i) => view.getComputedStyle(node).getPropertyValue(property) !== before[index][i]));
@@ -64,36 +71,50 @@ function auditPaintBindings({ container = document.getElementById("root"), bindi
64
71
  root.style.setProperty(name, "rgb(211, 67, 23)", "important");
65
72
  changed = nodes.some((node, index) => properties.some((property, i) => view.getComputedStyle(node).getPropertyValue(property) !== before[index][i]));
66
73
  }
67
- if (!changed) limits.push(`${descriptor.owner}: ${name} has no observed paint effect in its current instance. A written variable alone is not rendering evidence; check the relevant selected/visible consumer.`);
68
- else verified.push({ owner: descriptor.owner, binding: descriptor.name, variable: name });
74
+ if (!changed)
75
+ limits.push(`${descriptor.owner}: ${name} has no observed paint effect in its current instance. A written variable alone is not rendering evidence; check the relevant selected/visible consumer.`);
76
+ else
77
+ verified.push({ owner: descriptor.owner, binding: descriptor.name, variable: name });
69
78
  } finally {
70
79
  nodes.forEach((node, index) => {
71
- if (nodeStyles[index] === null) node.removeAttribute("style");
72
- else node.setAttribute("style", nodeStyles[index]);
80
+ if (nodeStyles[index] === null)
81
+ node.removeAttribute("style");
82
+ else
83
+ node.setAttribute("style", nodeStyles[index]);
73
84
  });
74
- if (previous === null) root.removeAttribute("style");
75
- else root.setAttribute("style", previous);
85
+ if (previous === null)
86
+ root.removeAttribute("style");
87
+ else
88
+ root.setAttribute("style", previous);
76
89
  }
77
90
  }
78
- for (const node of nodes) for (const property of ["fill", "stroke", "stop-color"]) {
79
- const value = node.getAttribute(property);
80
- if (!value) continue;
81
- const variable = /^var\(\s*(--[\w-]+)\s*\)$/.exec(value);
82
- if (variable && variable[1].startsWith(descriptor.prefix) && variable[1].endsWith(descriptor.suffix) && !names.includes(variable[1])) diagnostics.push(`${descriptor.owner}: ${variable[1]} is consumed without a value in this instance.`);
83
- if (value.startsWith("url(") && !reference(value, root, descriptor)) diagnostics.push(`${descriptor.owner}: missing, duplicated or out-of-instance local paint resource ${value}.`);
84
- }
91
+ for (const node of nodes)
92
+ for (const property of ["fill", "stroke", "stop-color"]) {
93
+ const value = node.getAttribute(property);
94
+ if (!value)
95
+ continue;
96
+ const variable = /^var\(\s*(--[\w-]+)\s*\)$/.exec(value);
97
+ if (variable && variable[1].startsWith(descriptor.prefix) && variable[1].endsWith(descriptor.suffix) && !names.includes(variable[1]))
98
+ diagnostics.push(`${descriptor.owner}: ${variable[1]} is consumed without a value in this instance.`);
99
+ if (value.startsWith("url(") && !reference(value, root, descriptor))
100
+ diagnostics.push(`${descriptor.owner}: missing, duplicated or out-of-instance local paint resource ${value}.`);
101
+ }
85
102
  }
86
103
  }
87
104
  const resourceNodes = auditResources ? [...container.querySelectorAll("[fill], [stroke], [style]")] : [];
88
- if (resourceNodes.length > 1e3) limits.push("Only the first 1000 potential SVG paint consumers were audited.");
89
- for (const node of resourceNodes.slice(0, 1e3)) for (const property of ["fill", "stroke"]) {
90
- const value = node.getAttribute(property) ?? node.style.getPropertyValue(property);
91
- if (!value?.startsWith("url(")) continue;
92
- const id = /^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(value)?.[2];
93
- const resources = id ? [...document2.querySelectorAll("[id]")].filter((item) => item.id === id) : [];
94
- const svg = node.ownerSVGElement ?? (node.localName === "svg" ? node : null);
95
- if (resources.length !== 1 || !svg?.contains(resources[0]) || !["linearGradient", "radialGradient", "pattern"].includes(resources[0]?.localName)) diagnostics.push(`Invalid, missing, duplicated or nonlocal SVG paint resource ${value}. Keep IDs isolated per rendered instance.`);
96
- }
105
+ if (resourceNodes.length > 1000)
106
+ limits.push("Only the first 1000 potential SVG paint consumers were audited.");
107
+ for (const node of resourceNodes.slice(0, 1000))
108
+ for (const property of ["fill", "stroke"]) {
109
+ const value = node.getAttribute(property) ?? node.style.getPropertyValue(property);
110
+ if (!value?.startsWith("url("))
111
+ continue;
112
+ const id = /^url\(\s*(["']?)#([^\s"'()#\\\p{Cc}]+)\1\s*\)$/u.exec(value)?.[2];
113
+ const resources = id ? [...document2.querySelectorAll("[id]")].filter((item) => item.id === id) : [];
114
+ const svg = node.ownerSVGElement ?? (node.localName === "svg" ? node : null);
115
+ if (resources.length !== 1 || !svg?.contains(resources[0]) || !["linearGradient", "radialGradient", "pattern"].includes(resources[0]?.localName))
116
+ diagnostics.push(`Invalid, missing, duplicated or nonlocal SVG paint resource ${value}. Keep IDs isolated per rendered instance.`);
117
+ }
97
118
  return { ok: !diagnostics.length, complete: !limits.length, verified, diagnostics: diagnostics.slice(0, 40), limits: limits.slice(0, 20), scope: "observed App instances and current input; repeat after updates" };
98
119
  }
99
120
 
@@ -104,38 +125,44 @@ async function auditBehaviorPaints(frame) {
104
125
  return frame.evaluate(auditPaintBindings, { bindings: JSON.parse(bindings ?? "[]"), auditResources: auditResources === "true" });
105
126
  }
106
127
  function verificationRequest() {
107
- if (!process.env.ADS_VERIFY_REQUEST) throw new Error("Run this check through ads_verify so the request and selected profile are explicit.");
128
+ if (!process.env.ADS_VERIFY_REQUEST)
129
+ throw new Error("Run this check through ads_verify so the request and selected profile are explicit.");
108
130
  return JSON.parse(readFileSync(process.env.ADS_VERIFY_REQUEST, "utf8"));
109
131
  }
110
- async function openBehaviorScenario(page, checkId, { timeout = 3e4 } = {}) {
132
+ async function openBehaviorScenario(page, checkId, { timeout = 30000 } = {}) {
111
133
  const request = verificationRequest();
112
- const check = request.checks.find((check2) => check2.id === checkId);
134
+ const check = request.checks.find((check) => check.id === checkId);
113
135
  const url = check && request.scenarios[check.scenario];
114
- if (!url) 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.");
136
+ if (!url)
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.");
115
138
  return openPreviewScenario(page, url, check.scenario, { timeout });
116
139
  }
117
- async function openPreviewScenario(page, url, scenario, { timeout = 3e4 } = {}) {
140
+ async function openPreviewScenario(page, url, scenario, { timeout = 30000 } = {}) {
118
141
  const failures = [], requests = [], errors = [];
119
142
  let boundary;
120
143
  const record = (request, detail) => {
121
- if (requests.length >= 8) return;
144
+ if (requests.length >= 8)
145
+ return;
122
146
  let resourceUri;
123
147
  try {
124
148
  const payload = request.postDataJSON();
125
- if (payload?.method === "resources/read" && typeof payload.params?.uri === "string" && payload.params.uri.startsWith("ads://")) resourceUri = payload.params.uri.slice(0, 500);
126
- } catch {
127
- }
149
+ if (payload?.method === "resources/read" && typeof payload.params?.uri === "string" && payload.params.uri.startsWith("ads://"))
150
+ resourceUri = payload.params.uri.slice(0, 500);
151
+ } catch {}
128
152
  requests.push({ method: request.method(), url: request.url().slice(0, 300), ...detail, ...resourceUri ? { resourceUri } : {} });
129
153
  };
130
154
  const failed = (request) => {
131
- if (failures.length < 5) failures.push(`${request.method()} ${request.url().slice(0, 300)}: ${request.failure()?.errorText ?? "request failed"}`);
155
+ if (failures.length < 5)
156
+ failures.push(`${request.method()} ${request.url().slice(0, 300)}: ${request.failure()?.errorText ?? "request failed"}`);
132
157
  record(request, { error: request.failure()?.errorText ?? "request failed" });
133
158
  };
134
- const response = (response2) => {
135
- if (response2.status() >= 400) record(response2.request(), { status: response2.status() });
159
+ const response = (response) => {
160
+ if (response.status() >= 400)
161
+ record(response.request(), { status: response.status() });
136
162
  };
137
163
  const pageError = (error) => {
138
- if (errors.length < 3) errors.push(error.message.slice(0, 500));
164
+ if (errors.length < 3)
165
+ errors.push(error.message.slice(0, 500));
139
166
  };
140
167
  const diagnostic = (outcome, detail = {}) => console.warn(JSON.stringify({ adsPreviewDiagnostic: { kind: "preview-startup", scenario, outcome, viewport: page.viewportSize(), requests, errors, ...detail } }));
141
168
  page.on("requestfailed", failed);
@@ -147,14 +174,15 @@ async function openPreviewScenario(page, url, scenario, { timeout = 3e4 } = {})
147
174
  await page.goto(verified.href, { waitUntil: "load", timeout });
148
175
  const end = Date.now() + timeout;
149
176
  while (Date.now() < end) {
150
- for (const frame of page.frames().filter((frame2) => frame2 !== page.mainFrame())) {
177
+ for (const frame of page.frames().filter((frame) => frame !== page.mainFrame())) {
151
178
  const state = await frame.evaluate(() => {
152
179
  const data = document.documentElement.dataset;
153
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 };
154
181
  }).catch(() => ({}));
155
182
  if (state.id === scenario && state.state === "ready") {
156
183
  const retries = await page.evaluate(() => Number(document.documentElement.dataset.adsResourceRetries ?? 0)).catch(() => 0);
157
- if (retries > 0) console.warn(JSON.stringify({ adsPreviewDiagnostic: { kind: "resource-read-recovery", scenario, retries, failedRequests: failures } }));
184
+ if (retries > 0)
185
+ console.warn(JSON.stringify({ adsPreviewDiagnostic: { kind: "resource-read-recovery", scenario, retries, failedRequests: failures } }));
158
186
  diagnostic("ready", { previewRevision: state.revision ?? null });
159
187
  return frame;
160
188
  }
@@ -179,7 +207,8 @@ async function openPreviewScenario(page, url, scenario, { timeout = 3e4 } = {})
179
207
  diagnostic("failed", { failure: boundary });
180
208
  throw Object.assign(new Error(`Scenario ${scenario}: ${error.message}${failures.length ? `
181
209
  Failed browser requests:
182
- ${failures.join("\n")}` : ""}`, { cause: error }), { failure: boundary });
210
+ ${failures.join(`
211
+ `)}` : ""}`, { cause: error }), { failure: boundary });
183
212
  } finally {
184
213
  page.off("requestfailed", failed);
185
214
  page.off("response", response);
package/docs/ADS.md CHANGED
@@ -6,7 +6,11 @@ UX, and Skin pillars. [GUIDE.md](GUIDE.md) gives setup and configuration steps.
6
6
 
7
7
  ## Ownership boundary
8
8
 
9
- Iterative design uses the [tracked draft contract](../skills/ads-designer/references/drafts.md).
9
+ Choose [direct editing or MCP-only editing](../skills/ads-designer/references/workflows.md)
10
+ from the actual source access and user instructions. Direct editors modify owned
11
+ files normally and use MCP for previews/checks; ordinary edits do not require
12
+ tracked drafts or acceptance. MCP-only iterative editing, and direct editors
13
+ choosing isolated proposals, use the [tracked draft contract](../skills/ads-designer/references/drafts.md).
10
14
  Drafts are Git-committable proposals under `ads-drafts/` using `.ads`
11
15
  source and a target/baseline manifest. They are excluded from normal discovery
12
16
  and may not be imported, re-exported or resolved into application builds. Use
@@ -22,7 +26,7 @@ complete, unless the user explicitly requested a retained proposal.
22
26
  MCP source editing is opt-in through `ads mcp --mutations`. Its write operation
23
27
  accepts a Git unified diff for one ADS unit (or bounded owner patches for coupled
24
28
  transactions) and validates its source, scenario and
25
- fixture changes against core checks, registered Oxlint rules and project checks
29
+ fixture changes against native ADS gates and configured project checks
26
30
  before application. This includes
27
31
  foundation, documentation, original assets and an explicit configuration unit for
28
32
  project settings, registered guard code and compiler integration. Configuration
@@ -392,12 +396,12 @@ describes source locations, public entry points, asset sources, and explicit
392
396
  boundaries. Initialized builds use the local CLI in this order:
393
397
 
394
398
  ```text
395
- ads lint-config → ads check → Oxlint → ads assets → existing prebuild → existing build
399
+ ads check → ads assets → existing prebuild → existing build
396
400
  ```
397
401
 
398
- `lint-config` regenerates ignored `.ds/oxlintrc.json` for the installed tool and
399
- registered project rules. `ads check` validates the architecture before asset
400
- generation; Oxlint runs the core and registered usage rules. `ads assets`
402
+ `ads check` validates architecture and declared native usage policies directly
403
+ before asset generation. Additional project linters run only through explicit scripts.
404
+ `lint-config` is an optional adapter for projects that choose Oxlint. `ads assets`
401
405
  generates configured browser icons from the source SVG into ignored `.ds/assets/`.
402
406
  A failed check or generation stops the build. Keep the project's CSS lint,
403
407
  type checks, behavior tests, and framework compilation in its build/test flow.
@@ -461,11 +465,13 @@ Opaque/computed dependencies and ambiguous/generated style hooks require review.
461
465
  See the skill-local [layer guide](../skills/ads-designer/references/layers.md), also
462
466
  available through MCP at `ads://guides/layers`.
463
467
 
464
- Component-specific usage rules belong to that component in the receiving
465
- project. Import applicable rules with the item and register them through
466
- project configuration or maintained tooling integration. Core tooling must
467
- not hardcode imports from an external catalogue or assume Toast, Button, or a
468
- particular shell is installed.
468
+ Use ADS-managed policies when they cover a concrete component misuse. The
469
+ optional `usage.notifications` registration names a project's public notification
470
+ API, host and exact allowed root files; `usage.restrictedImports` blocks runtime
471
+ package imports that bypass the owned API. Both run in the native gate without
472
+ another linter. The tooling does not assume Toast, Button, or any shell is installed.
473
+ Document the registration with its component. Only custom policies not covered
474
+ by ADS need component-owned tooling and an explicit project command.
469
475
 
470
476
  Register project plugins and rules in `ds.config.json` under `oxlint`. Use scoped
471
477
  `oxlint.overrides` for file-specific rule settings. These settings configure
@@ -30,11 +30,11 @@ their own reviewed lifecycle.
30
30
 
31
31
  ADS is opinionated about tooling and ownership. Linaria is required for the
32
32
  component and pattern styling pipeline. Visual choices belong to the project.
33
- Development tooling runs on Node or Bun, selected by its launcher. Managed
34
- workers inherit that interpreter; `command: "runtime"` gives project compilers
35
- and behavior profiles the same portable choice. Explicit interpreter commands
36
- retain their meaning. Runtime choice is separate from the UI framework and adds
37
- no Node/Bun dependency to deployed components.
33
+ ADS bundles its tooling and compiles MCP previews with Bun 1.3.13+, independently
34
+ of the application's build tools. Checking APIs also run on Node. Project scripts
35
+ and behavior profiles retain their explicit interpreter commands; `command:
36
+ "runtime"` inherits the launcher's interpreter. This tooling choice is separate
37
+ from the UI framework and adds no Node/Bun dependency to deployed components.
38
38
  The project declares React or native Preact in `ds.config.json` and uses the
39
39
  matching compiler and mount adapter. Both integrate with the required styling
40
40
  and validation pipeline; additional frameworks need explicit tooling support.
@@ -174,6 +174,16 @@ Linaria's [colocation and extraction model](https://github.com/callstack/linaria
174
174
  and [atomic composition model](https://github.com/callstack/linaria/blob/master/docs/ATOMIC_CSS.md)
175
175
  support this combination of local ownership and compiled styling.
176
176
 
177
+ CSS file count is an output detail, not an ownership boundary. The native preview
178
+ compiler attaches extracted styles after JavaScript tree shaking, retaining only
179
+ owners whose generated classes survive in that chunk. Foundation CSS loads first
180
+ to preserve cascade-layer declarations. Owner styles and fonts have separate,
181
+ immutable resource identities, so unchanged CSS survives JavaScript edits and can
182
+ be reused by multiple views. A shared JavaScript chunk can carry styles for its
183
+ shared owners; this is not selector-level pruning of every unused variant. The
184
+ compiler does not inject one whole-system stylesheet into every preview. Product
185
+ builds keep their own bundler's splitting and caching policy.
186
+
177
187
  Atomic merging matches property/selector/condition keys; it does not resolve
178
188
  every shorthand/logical-property overlap. ADS reports detectable composition
179
189
  risks as nonblocking warnings with guidance, while registered rendered checks
@@ -461,16 +471,17 @@ no API visibility, render coverage, styling permission or runtime behavior.
461
471
  ### Incremental compilation and refresh
462
472
 
463
473
  `runScenarioCompiler` owns scheduling, validation, freshness and publication.
464
- The project's `createVitePreviewBuilder({ build, configure })` adapter owns its
465
- framework and Linaria configuration. During a watched session it retains one
466
- Vite/Rollup graph, reusing unchanged module transforms and rebuilding dependencies
467
- that changed. An entry-list or project-configuration change creates a fresh graph.
468
- Existing custom adapters retain their behavior until they adopt this helper;
469
- one-shot production/library builds keep their own compiler and optimization.
474
+ ADS owns preview compilation with Bun, using the project's declared React or
475
+ Preact framework and shared Linaria extraction. The application keeps its own
476
+ production bundler. A single scheduler warms views sequentially with foreground
477
+ priority, retains compiled output, and reuses per-file transforms and worker
478
+ bundles. Native ADS gates run directly; project lint/build/test commands remain
479
+ explicit integration checks. Explorer navigation and metadata are served
480
+ independently of compilation and validation.
470
481
 
471
482
  ```mermaid
472
483
  flowchart LR
473
- Edit[Source edit] --> Compile[Update persistent Vite graph]
484
+ Edit[Source edit] --> Compile[Compile changes with Bun]
474
485
  Compile --> Validate[Validate project and inspect registry in background]
475
486
  Compile --> Live[Unverified live resources]
476
487
  Live --> App[Compare selected dependency closure]
@@ -545,14 +556,14 @@ Live resources are fenced to the current source digest and managed session.
545
556
  They never update accepted artifacts, the successful graph cache or `current`.
546
557
  Only validation and compilation passing against unchanged source can publish the
547
558
  verified graph. Failure restores the last verified view; compilation errors are
548
- reported without waiting for a slow validation command. Files outside Rollup's
559
+ reported without waiting for a slow validation command. Files outside the compiled
549
560
  module graph still cause validation and build reconciliation. Normal compiler
550
- shutdown closes its Vite watcher and removes its scratch directory.
561
+ shutdown clears its current transform/worker caches and removes its scratch directory.
551
562
 
552
- The shared builder also reuses unchanged worker bundles through the project's
553
- Vite pipeline. Worker code, transitive dependencies and configuration determine
554
- reuse; changed inputs rebuild the affected bundle. This is generic build caching,
555
- independent of any design system and separate from source-validation evidence.
563
+ The shared Bun builder reuses unchanged worker bundles using source, transitive
564
+ dependency and configuration hashes. Workers compile sequentially in temporary
565
+ Bun processes, which release their heaps before the next worker runs. This build
566
+ cache is separate from source-validation evidence.
556
567
 
557
568
  Accepted MCP edits prepare previews even when no viewer has opened them. A
558
569
  matching checked candidate graph and scenario registry carry into the project's existing cache;
@@ -571,17 +582,16 @@ reuse operation. No file hash is retained across operations. Configuration input
571
582
  ordering is canonical across Node and Bun; complete caches stay within the
572
583
  existing 8 MiB budget rather than silently writing an unreadable large file.
573
584
 
574
- Guarded acceptance and MCP validation park the project's accepted and draft
575
- compiler processes while the isolated candidate runs. Parking retains the same
576
- publication session and immutable assets, so mounted Apps keep their view and
577
- resource reads continue. Requests requiring a verified build queue until validation releases the
578
- compiler budget; cancellation removes the waiter. Resumption starts a compiler
579
- only when requested, reusing checked artifacts for unchanged inputs.
585
+ Background acceptance, validation and architecture checks serialize independently
586
+ of the accepted/draft preview lane. They never suspend Explorer's compiler or
587
+ make a cold selection wait for a browser verification suite. Existing publications
588
+ remain readable while interactive source changes compile.
580
589
 
581
590
  For managed resource previews, ADS requests all scenarios in production mode
582
591
  through that candidate's compiler. It closes an incremental Rollup graph before
583
- starting production compilation. The same candidate host then serves registered
584
- browser verification; warm selections reuse the checked production graph.
592
+ starting production compilation. The candidate compiler is parked after production publication, while its host
593
+ continues serving that immutable graph to registered browser verification.
594
+ Warming an already-current selection does not restart or wait for that compiler.
585
595
  Production reuse requires a successful production build of the exact inputs,
586
596
  not merely a previously compiled development graph. Project-owned additional
587
597
  commands still run as configured. Remove the standalone preview-build command
@@ -852,9 +862,13 @@ inspector remains available for token source/alias diagnostics, even if project
852
862
  previews cannot compile; it does not substitute for token scenario coverage.
853
863
  The server serves those artifacts; it does not interpret arbitrary component
854
864
  code or introduce production UI dependencies. File-change notifications let
855
- hosts refresh their views. An optional project-configured compiler watcher is
856
- managed by MCP, giving clients one launch command while leaving preview builds
857
- owned by the project. Structured build reports distinguish running compilers
865
+ hosts refresh their views. ADS normally manages its native Bun preview compiler with one launch command.
866
+ Editing access is independent: direct editors can use MCP only for preview/checks,
867
+ while MCP-only editors use enabled mutation tools. Direct editors can instead
868
+ manage compilation externally with `mcp.previewWatch: false`; the external builder
869
+ must publish the ADS resource graph and build evidence. MCP still serves previews,
870
+ but source changes stale their evidence until verified updated output is published.
871
+ See the [editing workflows](../skills/ads-designer/references/workflows.md). Structured build reports distinguish running compilers
858
872
  from successful, current previews; diagnostics remain readable even when a host
859
873
  does not forward notifications. Older clients retain tools/resources/prompts;
860
874
  native skill discovery and Apps presentation depend on the host's capabilities.
package/docs/BEHAVIORS.md CHANGED
@@ -371,11 +371,11 @@ Test selection is at owner-contract granularity: when a registered check's input
371
371
  dependencies intersect changed files, that owner is selected and its registered
372
372
  checks run. A shared token/foundation edit can affect every owner. Project check
373
373
  scripts still run as configured; ordinary live preview does not automatically run
374
- browser checks and release validation runs the full suite. Persistent Vite
374
+ browser checks and release validation runs the full suite. Persistent Bun
375
375
  compilation and retained preview state do not imply per-test-case execution caches.
376
376
 
377
- Guarded mutations execute affected registered behavior contracts after core,
378
- Oxlint and configured project checks, before writing source. Imported shared
377
+ Guarded mutations execute affected registered behavior contracts after native ADS gates
378
+ and configured project checks, before writing source. Imported shared
379
379
  controller changes also select dependent contracts conservatively. Rejected and
380
380
  dry-run patches publish no source changes. Verification output stays under `.ds/`.
381
381
  To check a prepared draft, request its diff and pass the returned `patchFile` to
package/docs/CHANGELOG.md CHANGED
@@ -1,34 +1,102 @@
1
1
  # Changelog
2
2
 
3
- ## 0.3.36
3
+ ## 0.3.38
4
4
 
5
5
  <!-- ads-local-tests:start -->
6
- Local verification: **550/550 passed** with `ADS_TEST_BUN=1 npm test`.
7
- Tested commit: `bd323b5bca2899bfe0693cbe18d847e7117363ff`; Node v24.13.0, Bun 1.3.13.
8
- Completed 2026-10-23T08:15:20.531Z (755 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.36",
14
- "commit": "bd323b5bca2899bfe0693cbe18d847e7117363ff",
15
- "sourceSha256": "071702f9a64c119b33cd06b348cb995ccfe6c97de7f8d624a05d75b57f15eec7",
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": 550,
19
- "pass": 550,
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-23T08:15:20.531Z",
26
- "durationMs": 754603,
27
- "logSha256": "9c04003e1d68049541f855f2d3909f8f1569737f2b978fb828889a2f5ff13da8"
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
+
52
+ - Compile ADS tooling/browser bundles and MCP previews with Bun, independently of
53
+ the application bundler. Native React/Preact JSX, Linaria, static assets and
54
+ self-contained workers share the existing immutable MCP resource boundary.
55
+ - Separate direct source editing from MCP-only draft editing in all five skills,
56
+ shared references, MCP instructions/prompts and project guidance. Ordinary direct
57
+ edits use MCP for previews/checks without compulsory drafts or acceptance.
58
+ - Let direct editors with an external builder disable MCP-started compilation
59
+ with `mcp.previewWatch: false`. The builder publishes resource graphs/evidence;
60
+ retained views stay stale after source changes until a verified update arrives.
61
+ - Attach Linaria CSS after JavaScript tree shaking. Cache foundation, owner
62
+ styles and fonts separately, preserve cascade-layer order, and reuse unchanged
63
+ CSS across views and JavaScript-only changes.
64
+ - Split provably pure public-barrel imports at their owners before bundling,
65
+ respecting the design system package's sideEffects policy. Unrelated public
66
+ exports no longer share unnecessary CSS in a fully warmed graph.
67
+ - Warm the prioritized view then remaining views in one background graph build
68
+ after MCP startup, with one compiler job at a time. Give foreground selections
69
+ priority, retain exact compiled view closures, and reuse unchanged transforms
70
+ and worker bundles. Expose warming progress through Explorer and MCP resources.
71
+ - Run ADS gates directly; remove mandatory Oxlint passes and dependency setup.
72
+ Configuration import guards now run in the native checker. Project checks and
73
+ tests remain explicitly configurable, with CLI/API entry points for setup/CI.
74
+ - Preserve explicit interpreters and memory flags in Bun project scripts instead
75
+ of forcing every child tool onto Bun. ADS's own compiler remains Bun-native.
76
+ - Enforce declared notification lifecycle/root policies and restricted package
77
+ imports in the native ADS gate. No component-specific project linter is needed.
78
+ - Keep unopened lazy modules and their styles off the MCP App resource path.
79
+ Refresh styles of already opened lazy branches while retaining mounted state;
80
+ include an on-demand page composition in ADS's own development example.
81
+ - Reuse compiled graphs after unchanged process restarts, excluding temporary
82
+ generated entry files from source fingerprints. Only loaded module changes
83
+ count toward the App's bounded module-revision reset.
84
+ - Keep informational source-review limitations in JSON/MCP evidence; ordinary CLI
85
+ checks print actionable warnings and errors without advisory-only noise.
86
+ - Move catalogue/status semantic analysis into an idle-retiring worker so the
87
+ running MCP process does not retain repeated TypeScript analysis heaps.
88
+
89
+ - Keep cold and existing Explorer previews independent of background acceptance,
90
+ validation and verification. Park only the candidate compiler after its production
91
+ build; serve its immutable output throughout browser checks.
92
+ - Bootstrap Explorer navigation in one compact resource, removing repeated semantic
93
+ catalog/token discovery and paginated startup calls. Publish index updates through
94
+ MCP resource subscriptions.
95
+ - Cancel superseded preview requests, align their timeout with the compiler budget,
96
+ and expose build failures with an in-place Retry action.
97
+
98
+ ## 0.3.36
99
+
32
100
  - Allow up to 64 owners in one tracked draft or guarded transaction, with up to
33
101
  256 changed files. Related changes share the draft compiler and one final
34
102
  acceptance validation; source/patch byte budgets and publication checks remain