@reqvire-org/ads 0.3.37 → 0.3.39

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 (72) hide show
  1. package/README.md +5 -1
  2. package/dist/bootstrap-ds/README.md +2 -2
  3. package/dist/bootstrap-ds/ds.config.json +2 -0
  4. package/dist/bootstrap-ds/package.json +1 -1
  5. package/dist/cli.mjs +16 -5
  6. package/dist/config.mjs +13 -6
  7. package/dist/mcp/context.mjs +4 -3
  8. package/dist/mcp/drafts.mjs +126 -10
  9. package/dist/mcp/execution-results.mjs +2 -2
  10. package/dist/mcp/mutations.mjs +3 -2
  11. package/dist/mcp/preview-owner-guard.mjs +7 -4
  12. package/dist/mcp/preview-widget.bundle.js +46 -47
  13. package/dist/mcp/project-widget.bundle.js +45 -46
  14. package/dist/mcp/server.mjs +20 -7
  15. package/dist/mcp/widget.bundle.js +47 -48
  16. package/dist/preview-bun.mjs +5 -2
  17. package/dist/resource-limits.mjs +146 -0
  18. package/dist/runtime-requirements.mjs +21 -0
  19. package/dist/scenarios-compiler.mjs +4 -3
  20. package/dist/showcase/client.bundle.js +56 -57
  21. package/dist/showcase/sandbox.bundle.js +1 -1
  22. package/dist/skills/ads-break-ui/SKILL.md +3 -2
  23. package/dist/skills/ads-break-ui/references/behaviors.md +8 -4
  24. package/dist/skills/ads-break-ui/references/drafts.md +26 -5
  25. package/dist/skills/ads-break-ui/references/guarded-editing.md +4 -2
  26. package/dist/skills/ads-break-ui/references/runtimes.md +89 -4
  27. package/dist/skills/ads-break-ui/references/validation.md +43 -25
  28. package/dist/skills/ads-break-ui/references/workflows.md +4 -3
  29. package/dist/skills/ads-designer/SKILL.md +10 -5
  30. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +2 -2
  31. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +2 -0
  32. package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +1 -1
  33. package/dist/skills/ads-designer/references/behaviors.md +8 -4
  34. package/dist/skills/ads-designer/references/cli.md +3 -3
  35. package/dist/skills/ads-designer/references/drafts.md +26 -5
  36. package/dist/skills/ads-designer/references/guarded-editing.md +4 -2
  37. package/dist/skills/ads-designer/references/runtimes.md +89 -4
  38. package/dist/skills/ads-designer/references/validation.md +43 -25
  39. package/dist/skills/ads-designer/references/workflows.md +4 -3
  40. package/dist/skills/ads-import/SKILL.md +3 -2
  41. package/dist/skills/ads-import/references/behaviors.md +8 -4
  42. package/dist/skills/ads-import/references/cli.md +3 -3
  43. package/dist/skills/ads-import/references/drafts.md +26 -5
  44. package/dist/skills/ads-import/references/guarded-editing.md +4 -2
  45. package/dist/skills/ads-import/references/runtimes.md +89 -4
  46. package/dist/skills/ads-import/references/validation.md +43 -25
  47. package/dist/skills/ads-import/references/workflows.md +4 -3
  48. package/dist/skills/ads-motion/SKILL.md +3 -2
  49. package/dist/skills/ads-motion/references/behaviors.md +8 -4
  50. package/dist/skills/ads-motion/references/drafts.md +26 -5
  51. package/dist/skills/ads-motion/references/guarded-editing.md +4 -2
  52. package/dist/skills/ads-motion/references/runtimes.md +89 -4
  53. package/dist/skills/ads-motion/references/validation.md +43 -25
  54. package/dist/skills/ads-motion/references/workflows.md +4 -3
  55. package/dist/skills/ads-port/SKILL.md +3 -2
  56. package/dist/skills/ads-port/references/behaviors.md +8 -4
  57. package/dist/skills/ads-port/references/cli.md +3 -3
  58. package/dist/skills/ads-port/references/drafts.md +26 -5
  59. package/dist/skills/ads-port/references/guarded-editing.md +4 -2
  60. package/dist/skills/ads-port/references/runtimes.md +89 -4
  61. package/dist/skills/ads-port/references/validation.md +43 -25
  62. package/dist/skills/ads-port/references/workflows.md +4 -3
  63. package/dist/units.mjs +1 -1
  64. package/dist/validation-checks.mjs +10 -5
  65. package/dist/validation.mjs +16 -31
  66. package/dist/verification/browser.mjs +8 -8
  67. package/docs/ARCHITECTURE.md +8 -4
  68. package/docs/BEHAVIORS.md +6 -3
  69. package/docs/CHANGELOG.md +70 -13
  70. package/docs/GUIDE.md +13 -7
  71. package/docs/MCP.md +49 -17
  72. 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
@@ -377,13 +377,17 @@ computed imports remain conservative. Barrel source changes still invalidate
377
377
  dependents. ADS caches source parsing, resolution and digests within an inspection
378
378
  only; later runs read current source again.
379
379
 
380
- Guarded mutations execute affected registered behavior contracts after core,
381
- Oxlint and configured project checks, before writing source. Imported shared
380
+ When `acceptance.behaviorChecks` is true, guarded mutations execute affected
381
+ registered behavior contracts after mandatory native ADS gates and
382
+ `acceptance.checks`, before writing source. The developer chooses gating through
383
+ project policy; registration alone does not require execution at acceptance.
384
+ `validation.behaviorChecks` separately controls audits, while explicit
385
+ `ads_verify` always runs the requested checks. See [validation policies](validation.md). Imported shared
382
386
  controller changes also select dependent contracts conservatively. Rejected and
383
387
  dry-run patches publish no source changes. Verification output stays under `.ds/`.
384
388
  To check a prepared draft, request its diff and pass the returned `patchFile` to
385
- `ads_apply_patch` with `dryRun:true`. This checks the isolated candidate, including
386
- affected behavior contracts and its configured browser preview. Candidate evidence
389
+ `ads_apply_patch` with `dryRun:true`. This checks the isolated candidate using the acceptance policy, including
390
+ affected behavior contracts and their configured browser preview when enabled. Candidate evidence
387
391
  is not persisted as passing evidence for live source. `ads_verify` selects checks
388
392
  for current source and has no draft argument.
389
393
 
@@ -33,12 +33,14 @@ use one multi-owner draft: its previews share a compiler workspace and acceptanc
33
33
  validates the combined candidate once, then applies all changes together. The
34
34
  existing source and patch byte budgets still apply.
35
35
 
36
- Git is not required to create or recover a draft. Restarting ADS or cloning the
36
+ A Git checkout is not required to create or recover a draft. Refresh uses the
37
+ installed Git executable for three-way text merging. Restarting ADS or cloning the
37
38
  project discovers the same source. Generated compiler workspaces and execution
38
39
  events remain under ignored `.ds/`; an interrupted check is never a pass.
39
40
 
40
41
  The manifest maps each proposed file to its normal project target and records
41
- its baseline fingerprint and owner. Edit returned source files with local file
42
+ its baseline fingerprint, original baseline source and owner. Baseline files under
43
+ `bases/` are recovery data; edit only the proposed `files/` source. Edit returned source files with local file
42
44
  tools. `ads_read_file` reads mapped draft source in bounded ranges.
43
45
  `ads_update_draft` registers additions/deletions or edits source for remote
44
46
  clients; pass the current revision from `ads_drafts`. `content:null` proposes a
@@ -72,6 +74,25 @@ refreshes catalogue metadata. Read `discovery.state` (`current`, `pending`,
72
74
  `error`) and its metadata revision separately from the exact proposal revision.
73
75
  New/missing scenario identities wait for fresh discovery. A previous preview may
74
76
  stay visible until compilation finishes; pending/stale output is not evidence.
77
+ Preview workspaces follow current project inputs, including deletions, and overlay
78
+ only actual draft changes. A restarted session rebuilds its disposable workspace;
79
+ a missing workspace is recreated. Accept/drop removes it even after a restart,
80
+ and startup prunes workspaces whose proposals no longer exist.
81
+ When discovery fails, `ads_show_draft` returns the draft's own diagnostics and
82
+ `diagnosticsUri`; the accepted `ads://project/scenarios` is a different registry.
83
+ Read the scoped URI even when the compiler could not start.
84
+
85
+ If accepted source advanced, use
86
+ `ads_update_draft({id,revision,refresh:true})` after accepted source changes.
87
+ Stored originals allow non-overlapping text edits and independent owner exports
88
+ to merge. Untouched copies advance to current source. Overlaps return
89
+ `refreshed:false` plus file diagnostics and leave the proposal unchanged; resolve
90
+ them deliberately by passing `refresh:true` with `changes` containing the
91
+ resolved contents of those existing files and their owners. Refresh separately
92
+ from dependency changes. Non-overlapping JSON object fields merge structurally;
93
+ conflicting arrays/values remain explicit. Older drafts without originals can refresh untouched files,
94
+ but overlapping changed files require explicit resolution. Review the new
95
+ revision and preview after every successful refresh.
75
96
  Reopen after edits to obtain the current revision.
76
97
  Compilation is feedback, not passing behavior/visual evidence.
77
98
 
@@ -88,7 +109,7 @@ updating the dependent draft. Keep normal `@ds` imports in all implementations
88
109
  and scenarios. The preview overlays the proposed files at canonical paths; no
89
110
  project code imports `.ads` draft source. Cycles, missing dependencies and
90
111
  overlapping non-barrel edits are errors. Use one coupled draft for overlapping
91
- changes. A coupled draft may declare up to eight existing/new owners.
112
+ changes. A coupled draft may declare up to 64 existing/new owners.
92
113
 
93
114
  Accept dependencies first. ADS removes resolved dependency IDs from dependent
94
115
  manifests and their previews use the final accepted implementation automatically.
@@ -129,8 +150,8 @@ current rendered revision and complete acceptance before finishing the change.
129
150
  ## Accept or drop
130
151
 
131
152
  After rendered review, call `ads_accept({id,revision})` once. It checks that exact
132
- revision, runs mandatory ADS/configured project checks and affected
133
- behavior checks against an isolated candidate, and applies passing changes at
153
+ revision, runs mandatory ADS guards plus `acceptance.checks` and, when
154
+ `acceptance.behaviorChecks` is enabled, affected registered behavior checks against an isolated candidate, and applies passing changes at
134
155
  their normal paths. Changes during checking or baseline conflicts prevent
135
156
  application. Successful acceptance removes the proposal and records an event.
136
157
  There is no separate Apply or Iterate action. A failed attempt retains the draft;
@@ -20,8 +20,10 @@ ads_prepare_patch({"unit":"components/Example","action":"diff","draft":"<returne
20
20
  ads_apply_patch({"unit":"components/Example","patchFile":"<returned patchFile>","dryRun":true})
21
21
  ```
22
22
 
23
- The dry run validates the full candidate, including affected registered behavior
24
- checks in an isolated project copy. Configured browser checks use that candidate's
23
+ The dry run validates the candidate in an isolated project copy using mandatory
24
+ ADS guards, `acceptance.checks` and, when `acceptance.behaviorChecks` is enabled,
25
+ affected registered behavior checks. Registration alone does not require a test
26
+ at acceptance. See [validation policies](validation.md). Configured browser checks use that candidate's
25
27
  managed preview, not the live showcase. Read the summary, then page failing
26
28
  `outcomes`, `diagnostics` or pipeline `checks` through `ads_results` with its
27
29
  `resultId`. Inspect one exact outcome with `ads_investigate({unit,check,runId})`;
@@ -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:
@@ -103,11 +187,12 @@ Interactive browsing may use `waitFor:"compiled"`; `build.current:false` or
103
187
  `build.live.validated:false` cannot establish passing evidence. Captures,
104
188
  behavior checks and publication still require verified current output.
105
189
 
106
- Acceptance builds the complete candidate in production mode, then releases its
107
- compiler while browser checks use the hosted immutable graph. Interactive
190
+ When acceptance requires affected behavior checks or captures, it builds the
191
+ candidate in production mode, then releases its compiler while browser checks
192
+ use the hosted immutable graph. Core-only acceptance skips the preview build. Interactive
108
193
  accepted/draft previews stay available throughout. Background checks serialize
109
194
  without borrowing the interactive compiler. Keep configured project checks;
110
- remove a duplicate standalone preview build from `mcp.mutationChecks` because
195
+ remove a duplicate standalone preview build from `acceptance.checks` because
111
196
  ADS already performs that build once. Keep `ads compile` in ordinary builds if
112
197
  that project needs preview artifacts there.
113
198
 
@@ -4,33 +4,51 @@ These checks apply to both [direct editing and MCP-only editing](workflows.md).
4
4
  Direct source edits need current checks and rendered review; ordinary edits do
5
5
  not require a draft or acceptance call. Tracked proposals validate on acceptance.
6
6
 
7
- Use `ads_validate({})` for the complete project audit, equivalent to `ads validate`.
8
- Use `ads_validate({scope:"changed"})`, equivalent to `ads validate --changed`, during
9
- editing when a successful full baseline exists. Both interfaces call the same
10
- engine. Full is the default.
7
+ The project chooses required tests in `ds.config.json`; ADS enforces that choice.
8
+ Architecture, ownership, candidate conflicts and source freshness remain mandatory.
9
+ Registering a behavior contract makes checks discoverable and runnable, without
10
+ implicitly requiring them at acceptance.
11
11
 
12
- - During local editing, use existing guarded edits and affected behavior checks.
13
- Reuse completed guards for unchanged source rather than repeatedly auditing all
14
- owners. Direct edits need `ads_check` and appropriate project/behavior checks.
15
- - After test migrations, ownership changes or validation/runner configuration
16
- changes, run full validation. Also run it before a release or an explicit request
17
- to validate everything. It validates the current source, not a prepared draft.
18
- - Inspect failures through `ads_results` using the returned resultId and sections
19
- diagnostics, checks or outcomes. For browser failures, use the outcome's exact
20
- unit/check/runId with `ads_investigate`. Fix the owner and rerun the appropriate scope.
21
- - Report the actual scope and revision. Scoped, stale, cancelled or incomplete
22
- runs cannot establish successful full validation. Passing covers registered
23
- checks and configured scripts, not arbitrary assertions, visual parity or every
24
- application state.
12
+ ```json
13
+ {
14
+ "acceptance": {"checks": ["typecheck"], "behaviorChecks": false},
15
+ "validation": {"checks": ["typecheck", "test", "build:app"], "behaviorChecks": true}
16
+ }
17
+ ```
25
18
 
26
- Full validation runs core architecture/test-boundary guards, configured project scripts and every registered behavior contract. Defaults use the existing
27
- mutation-check scripts plus a project's `test` and build scripts when present.
28
- Build selection prefers `build:lib`, then `build:app`, then `build`.
29
- Projects can declare `validation.checks` as a list of package
30
- script names for the complete audit; core ADS and registered behaviors remain
31
- mandatory. Commands are trusted project configuration, never MCP arguments.
32
- Use scripts that check/build without changing source. Avoid calling `ads validate`
33
- from a script selected by validation.
19
+ - `ads_accept`, guarded patch/transaction application and their dry runs use
20
+ **acceptance** against the isolated candidate. When `behaviorChecks` is true,
21
+ ADS selects affected registered owners, including controller consumers.
22
+ - Direct source editing uses `ads_validate({policy:"acceptance"})` or
23
+ `ads validate --policy acceptance`. It checks working-tree source and applies
24
+ nothing. `--changed`/`scope:"changed"` can narrow registered owners from this
25
+ policy's own successful full baseline. Without that baseline it expands to all.
26
+ - `ads_validate({})` / `ads validate` select **validation**, default scope all:
27
+ core gates, `validation.checks`, current production previews and, when enabled,
28
+ all registered behavior checks. Use before a release, after ownership/test/config
29
+ migrations and for an explicit complete audit. Changed scope narrows registered
30
+ owners while project scripts and core gates retain full scope.
31
+ - Draft create, edit and show are preview-only; they trigger neither policy.
32
+ `ads_verify` explicitly runs selected checks independently of either policy.
33
+ - Builds, hooks and CI trigger a policy only when their scripts invoke it. Use
34
+ leaf commands in policy lists; a selected script must not call `ads validate`
35
+ directly or recursively. Choose project scripts with the developer; do not
36
+ disable tests or weaken configuration to make a failing change pass.
37
+
38
+ Defaults: both script lists are empty, acceptance `behaviorChecks:false`,
39
+ validation `behaviorChecks:true`. No lint/test/build script names are inferred.
40
+ Every listed script must exist; commands are trusted project configuration, not
41
+ MCP arguments. Move the removed `mcp.mutationChecks` field to `acceptance.checks`
42
+ and explicitly choose behavior gating. Existing `mcp.mutationCheckTimeoutMs`
43
+ still bounds each project script; behavior profiles have separate budgets.
44
+
45
+ Report the chosen policy, scope and revision. Skipped tests are not passed tests;
46
+ acceptance evidence is not complete-validation evidence. The two policies keep
47
+ separate ignored baselines (`.ds/acceptance-baseline.json` and
48
+ `.ds/validation-baseline.json`). Inspect failures with `ads_results` and exact
49
+ unit/check/runId via `ads_investigate`. A passing policy does not establish visual
50
+ parity, accessibility or assertions that were not executed. Behavior claims still
51
+ need appropriate current test evidence and rendered review.
34
52
 
35
53
  Prefer native ADS usage policies over project lint plugins. Notification APIs
36
54
  and hosts can be registered as `usage.notifications: [{api, host, rootFiles}]`;
@@ -19,9 +19,10 @@ write source. A read-only MCP connection is sufficient for this workflow.
19
19
  3. With the default ADS-managed compiler, let the existing watcher rebuild. Open
20
20
  the scenario through `ads_show_scenario` or Explorer and inspect the rendered
21
21
  result. Do not launch a second compiler beside the managed one.
22
- 4. Inspect `ads_status.build` or `ads://project/build`. Run native ADS gates and
23
- appropriate project/registered behavior checks, using MCP or the equivalent
24
- CLI/project commands. Review the final current view before finishing. See
22
+ 4. Inspect `ads_status.build` or `ads://project/build`. Run
23
+ `ads_validate({policy:"acceptance"})` or `ads validate --policy acceptance`
24
+ to enforce the developer's project policy against direct source edits. Run
25
+ additional explicit behavior checks when needed for the requested claims. Review the final current view before finishing. See
25
26
  [validation scope](validation.md).
26
27
 
27
28
  ### External builder: `mcp.previewWatch: false`
@@ -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
@@ -97,8 +98,8 @@ also list a `ds.config.json` companion: change only that owner's `inlineStyleFil
97
98
  and `boundaries.styleWrites` entries together with its source. Unused permissions
98
99
  fail the core checks; do not pre-register a boundary without its implementation.
99
100
  Use `dryRun: true` to
100
- inspect validation, including affected registered behavior checks on the isolated
101
- candidate. For a prepared draft, request its diff and dry-run the returned
101
+ inspect the isolated candidate against mandatory ADS gates and the project's
102
+ acceptance policy; registered tests run when `acceptance.behaviorChecks` is true. For a prepared draft, request its diff and dry-run the returned
102
103
  `patchFile`; `ads_verify` checks current source and accepts no draft argument.
103
104
  Applying re-runs the gates. Fix rejected patches in their
104
105
  owner. Use `ads_apply_transaction` for genuinely coupled owner patches;
@@ -487,7 +488,11 @@ the ADS server package itself. Persistent SSE/notification streams make
487
488
 
488
489
  Run ADS's own gates directly with `ads check`; acceptance and validation do not
489
490
  require Oxlint. Register project-specific checks as explicit package scripts in
490
- `mcp.mutationChecks` / `validation.checks`, and behavior tests through ADS contracts.
491
+ `acceptance.checks` / `validation.checks`, and behavior tests through ADS contracts.
492
+ The developer chooses each policy's `behaviorChecks` flag; registration alone
493
+ does not gate acceptance. Direct edits can run `ads validate --policy acceptance`
494
+ or `ads_validate({policy:"acceptance"})`. Follow [validation](references/validation.md)
495
+ for triggers and evidence scopes; never weaken a policy to pass a failing change.
491
496
  A project can use its own linter in those scripts when desired. Measured renderer properties and documented
492
497
  non-state hooks use explicit `boundaries`; shared token writes and primitive
493
498
  state overrides cannot be allowlisted. When migrating JSX inline geometry to
@@ -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.
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "framework": "react",
3
3
  "behaviorLibraries": [],
4
+ "acceptance": { "checks": [], "behaviorChecks": false },
5
+ "validation": { "checks": [], "behaviorChecks": true, "inputs": [] },
4
6
  "mcp": {
5
7
  "previewManifest": ".ds/preview/manifest.json"
6
8
  },
@@ -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"
@@ -377,13 +377,17 @@ computed imports remain conservative. Barrel source changes still invalidate
377
377
  dependents. ADS caches source parsing, resolution and digests within an inspection
378
378
  only; later runs read current source again.
379
379
 
380
- Guarded mutations execute affected registered behavior contracts after core,
381
- Oxlint and configured project checks, before writing source. Imported shared
380
+ When `acceptance.behaviorChecks` is true, guarded mutations execute affected
381
+ registered behavior contracts after mandatory native ADS gates and
382
+ `acceptance.checks`, before writing source. The developer chooses gating through
383
+ project policy; registration alone does not require execution at acceptance.
384
+ `validation.behaviorChecks` separately controls audits, while explicit
385
+ `ads_verify` always runs the requested checks. See [validation policies](validation.md). Imported shared
382
386
  controller changes also select dependent contracts conservatively. Rejected and
383
387
  dry-run patches publish no source changes. Verification output stays under `.ds/`.
384
388
  To check a prepared draft, request its diff and pass the returned `patchFile` to
385
- `ads_apply_patch` with `dryRun:true`. This checks the isolated candidate, including
386
- affected behavior contracts and its configured browser preview. Candidate evidence
389
+ `ads_apply_patch` with `dryRun:true`. This checks the isolated candidate using the acceptance policy, including
390
+ affected behavior contracts and their configured browser preview when enabled. Candidate evidence
387
391
  is not persisted as passing evidence for live source. `ads_verify` selects checks
388
392
  for current source and has no draft argument.
389
393
 
@@ -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.
@@ -97,7 +97,7 @@ Integrate that directory through the app's existing asset mount. Fixed token
97
97
  names and prefixes are required; project values and artwork remain project-owned.
98
98
  Builds use the installed local tool, not the initializing npx cache. Ignore `.ds/`.
99
99
  Register component-specific guards as explicit project scripts and include them
100
- in the project build and, when needed, `mcp.mutationChecks`. `lint-config` is an
100
+ in the project build and, when needed, `acceptance.checks`. `lint-config` is an
101
101
  optional adapter for projects that explicitly choose Oxlint; ADS gates do not
102
102
  require or invoke it.
103
103
 
@@ -33,12 +33,14 @@ use one multi-owner draft: its previews share a compiler workspace and acceptanc
33
33
  validates the combined candidate once, then applies all changes together. The
34
34
  existing source and patch byte budgets still apply.
35
35
 
36
- Git is not required to create or recover a draft. Restarting ADS or cloning the
36
+ A Git checkout is not required to create or recover a draft. Refresh uses the
37
+ installed Git executable for three-way text merging. Restarting ADS or cloning the
37
38
  project discovers the same source. Generated compiler workspaces and execution
38
39
  events remain under ignored `.ds/`; an interrupted check is never a pass.
39
40
 
40
41
  The manifest maps each proposed file to its normal project target and records
41
- its baseline fingerprint and owner. Edit returned source files with local file
42
+ its baseline fingerprint, original baseline source and owner. Baseline files under
43
+ `bases/` are recovery data; edit only the proposed `files/` source. Edit returned source files with local file
42
44
  tools. `ads_read_file` reads mapped draft source in bounded ranges.
43
45
  `ads_update_draft` registers additions/deletions or edits source for remote
44
46
  clients; pass the current revision from `ads_drafts`. `content:null` proposes a
@@ -72,6 +74,25 @@ refreshes catalogue metadata. Read `discovery.state` (`current`, `pending`,
72
74
  `error`) and its metadata revision separately from the exact proposal revision.
73
75
  New/missing scenario identities wait for fresh discovery. A previous preview may
74
76
  stay visible until compilation finishes; pending/stale output is not evidence.
77
+ Preview workspaces follow current project inputs, including deletions, and overlay
78
+ only actual draft changes. A restarted session rebuilds its disposable workspace;
79
+ a missing workspace is recreated. Accept/drop removes it even after a restart,
80
+ and startup prunes workspaces whose proposals no longer exist.
81
+ When discovery fails, `ads_show_draft` returns the draft's own diagnostics and
82
+ `diagnosticsUri`; the accepted `ads://project/scenarios` is a different registry.
83
+ Read the scoped URI even when the compiler could not start.
84
+
85
+ If accepted source advanced, use
86
+ `ads_update_draft({id,revision,refresh:true})` after accepted source changes.
87
+ Stored originals allow non-overlapping text edits and independent owner exports
88
+ to merge. Untouched copies advance to current source. Overlaps return
89
+ `refreshed:false` plus file diagnostics and leave the proposal unchanged; resolve
90
+ them deliberately by passing `refresh:true` with `changes` containing the
91
+ resolved contents of those existing files and their owners. Refresh separately
92
+ from dependency changes. Non-overlapping JSON object fields merge structurally;
93
+ conflicting arrays/values remain explicit. Older drafts without originals can refresh untouched files,
94
+ but overlapping changed files require explicit resolution. Review the new
95
+ revision and preview after every successful refresh.
75
96
  Reopen after edits to obtain the current revision.
76
97
  Compilation is feedback, not passing behavior/visual evidence.
77
98
 
@@ -88,7 +109,7 @@ updating the dependent draft. Keep normal `@ds` imports in all implementations
88
109
  and scenarios. The preview overlays the proposed files at canonical paths; no
89
110
  project code imports `.ads` draft source. Cycles, missing dependencies and
90
111
  overlapping non-barrel edits are errors. Use one coupled draft for overlapping
91
- changes. A coupled draft may declare up to eight existing/new owners.
112
+ changes. A coupled draft may declare up to 64 existing/new owners.
92
113
 
93
114
  Accept dependencies first. ADS removes resolved dependency IDs from dependent
94
115
  manifests and their previews use the final accepted implementation automatically.
@@ -129,8 +150,8 @@ current rendered revision and complete acceptance before finishing the change.
129
150
  ## Accept or drop
130
151
 
131
152
  After rendered review, call `ads_accept({id,revision})` once. It checks that exact
132
- revision, runs mandatory ADS/configured project checks and affected
133
- behavior checks against an isolated candidate, and applies passing changes at
153
+ revision, runs mandatory ADS guards plus `acceptance.checks` and, when
154
+ `acceptance.behaviorChecks` is enabled, affected registered behavior checks against an isolated candidate, and applies passing changes at
134
155
  their normal paths. Changes during checking or baseline conflicts prevent
135
156
  application. Successful acceptance removes the proposal and records an event.
136
157
  There is no separate Apply or Iterate action. A failed attempt retains the draft;
@@ -20,8 +20,10 @@ ads_prepare_patch({"unit":"components/Example","action":"diff","draft":"<returne
20
20
  ads_apply_patch({"unit":"components/Example","patchFile":"<returned patchFile>","dryRun":true})
21
21
  ```
22
22
 
23
- The dry run validates the full candidate, including affected registered behavior
24
- checks in an isolated project copy. Configured browser checks use that candidate's
23
+ The dry run validates the candidate in an isolated project copy using mandatory
24
+ ADS guards, `acceptance.checks` and, when `acceptance.behaviorChecks` is enabled,
25
+ affected registered behavior checks. Registration alone does not require a test
26
+ at acceptance. See [validation policies](validation.md). Configured browser checks use that candidate's
25
27
  managed preview, not the live showcase. Read the summary, then page failing
26
28
  `outcomes`, `diagnostics` or pipeline `checks` through `ads_results` with its
27
29
  `resultId`. Inspect one exact outcome with `ads_investigate({unit,check,runId})`;