@reqvire-org/ads 0.3.38 → 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 (53) hide show
  1. package/README.md +2 -0
  2. package/dist/bootstrap-ds/ds.config.json +2 -0
  3. package/dist/cli.mjs +7 -4
  4. package/dist/config.mjs +11 -6
  5. package/dist/mcp/context.mjs +4 -3
  6. package/dist/mcp/drafts.mjs +126 -10
  7. package/dist/mcp/execution-results.mjs +2 -2
  8. package/dist/mcp/mutations.mjs +3 -2
  9. package/dist/mcp/server.mjs +15 -7
  10. package/dist/skills/ads-break-ui/references/behaviors.md +8 -4
  11. package/dist/skills/ads-break-ui/references/drafts.md +26 -5
  12. package/dist/skills/ads-break-ui/references/guarded-editing.md +4 -2
  13. package/dist/skills/ads-break-ui/references/runtimes.md +4 -3
  14. package/dist/skills/ads-break-ui/references/validation.md +43 -25
  15. package/dist/skills/ads-break-ui/references/workflows.md +4 -3
  16. package/dist/skills/ads-designer/SKILL.md +7 -3
  17. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +2 -0
  18. package/dist/skills/ads-designer/references/behaviors.md +8 -4
  19. package/dist/skills/ads-designer/references/cli.md +1 -1
  20. package/dist/skills/ads-designer/references/drafts.md +26 -5
  21. package/dist/skills/ads-designer/references/guarded-editing.md +4 -2
  22. package/dist/skills/ads-designer/references/runtimes.md +4 -3
  23. package/dist/skills/ads-designer/references/validation.md +43 -25
  24. package/dist/skills/ads-designer/references/workflows.md +4 -3
  25. package/dist/skills/ads-import/references/behaviors.md +8 -4
  26. package/dist/skills/ads-import/references/cli.md +1 -1
  27. package/dist/skills/ads-import/references/drafts.md +26 -5
  28. package/dist/skills/ads-import/references/guarded-editing.md +4 -2
  29. package/dist/skills/ads-import/references/runtimes.md +4 -3
  30. package/dist/skills/ads-import/references/validation.md +43 -25
  31. package/dist/skills/ads-import/references/workflows.md +4 -3
  32. package/dist/skills/ads-motion/references/behaviors.md +8 -4
  33. package/dist/skills/ads-motion/references/drafts.md +26 -5
  34. package/dist/skills/ads-motion/references/guarded-editing.md +4 -2
  35. package/dist/skills/ads-motion/references/runtimes.md +4 -3
  36. package/dist/skills/ads-motion/references/validation.md +43 -25
  37. package/dist/skills/ads-motion/references/workflows.md +4 -3
  38. package/dist/skills/ads-port/references/behaviors.md +8 -4
  39. package/dist/skills/ads-port/references/cli.md +1 -1
  40. package/dist/skills/ads-port/references/drafts.md +26 -5
  41. package/dist/skills/ads-port/references/guarded-editing.md +4 -2
  42. package/dist/skills/ads-port/references/runtimes.md +4 -3
  43. package/dist/skills/ads-port/references/validation.md +43 -25
  44. package/dist/skills/ads-port/references/workflows.md +4 -3
  45. package/dist/units.mjs +1 -1
  46. package/dist/validation-checks.mjs +10 -5
  47. package/dist/validation.mjs +16 -31
  48. package/docs/ARCHITECTURE.md +8 -4
  49. package/docs/BEHAVIORS.md +6 -3
  50. package/docs/CHANGELOG.md +49 -12
  51. package/docs/GUIDE.md +12 -6
  52. package/docs/MCP.md +27 -15
  53. package/package.json +1 -1
@@ -8,8 +8,6 @@ import { inspectBehaviors } from "./behaviors.mjs";
8
8
  import { affectedBehaviorUnits, createVerificationController } from "./verification.mjs";
9
9
  import { validationInputFiles } from "./validation-inputs.mjs";
10
10
  import { checkCandidate, checkCommand, projectChecks } from "./validation-checks.mjs";
11
- import { projectContext } from "./mcp/context.mjs";
12
- import { packageScriptCommand } from "./development-runtime.mjs";
13
11
  import { acceptance } from "./evidence.mjs";
14
12
  import { inspectScenarios } from "./scenarios.mjs";
15
13
  import { inspectBuildStatus } from "./mcp/build-status.mjs";
@@ -40,8 +38,9 @@ export function createValidationController(directory, { previewWork } = {}) {
40
38
  return {
41
39
  status() { return { busy: !!active, ...(progress ? {progress} : {}) }; },
42
40
  async close() { const pending = active; pending?.abort(); await pending?.completion; },
43
- async run({scope = "all"} = {}, signal, onProgress) {
41
+ async run({scope = "all", policy = "validation"} = {}, signal, onProgress) {
44
42
  if (!["all","changed"].includes(scope)) throw new Error("Validation scope must be all or changed.");
43
+ if (!["acceptance","validation"].includes(policy)) throw new Error("Policy must be acceptance or validation.");
45
44
  if (active) throw new Error("Validation is already running.");
46
45
  active = new AbortController();
47
46
  const controller = active;
@@ -60,11 +59,11 @@ export function createValidationController(directory, { previewWork } = {}) {
60
59
  if (previewWork) releasePreview = await previewWork.acquire(signal);
61
60
  const options = loadConfig(root);
62
61
  inputs = validationInputs(options);
63
- const baselineFile = outputFile(root,"validation-baseline.json");
62
+ const baselineFile = outputFile(root,`${policy}-baseline.json`);
64
63
  if (scope === "changed") {
65
64
  let baseline;
66
65
  try { if (realpathSync(baselineFile) === baselineFile && lstatSync(baselineFile).size < 8*1024*1024) baseline = JSON.parse(readFileSync(baselineFile,"utf8")); } catch { /* No trusted baseline: perform the complete audit. */ }
67
- if (baseline?.schemaVersion !== 1 || baseline.root !== root || baseline.toolRevision !== toolRevision || !baseline.files || hash(JSON.stringify([toolRevision,baseline.files])) !== baseline.revision) fallback = "No compatible successful full-validation baseline.";
66
+ if (baseline?.schemaVersion !== 1 || baseline.root !== root || baseline.toolRevision !== toolRevision || !baseline.files || hash(JSON.stringify([toolRevision,baseline.files])) !== baseline.revision) fallback = "No compatible successful full-policy baseline.";
68
67
  else {
69
68
  changed = [...new Set([...Object.keys(inputs.files),...Object.keys(baseline.files)])].filter(file => inputs.files[file] !== baseline.files[file]);
70
69
  const inventory = inspectUnits(options);
@@ -80,31 +79,19 @@ export function createValidationController(directory, { previewWork } = {}) {
80
79
  diagnostics.push(...core.diagnostics); advisories.push(...(core.advisories ?? []));
81
80
  checks.push({name:"architecture",passed:core.ok});
82
81
  if (!core.ok) return complete();
83
- const pkg = JSON.parse(readFileSync(path.join(root,"package.json"),"utf8"));
84
- const scripts = projectChecks(options);
85
- if (scope === "all") {
86
- const configured = options.config.validation.checks;
87
- if (configured) scripts.splice(0,scripts.length,...configured.map(script => {
88
- if (typeof pkg.scripts?.[script] !== "string") throw new Error(`Configured validation script does not exist: ${script}`);
89
- return packageScriptCommand(projectContext(options).packageManager,script);
90
- }));
91
- else for (const script of ["test", pkg.scripts?.["build:lib"] ? "build:lib" : pkg.scripts?.["build:app"] ? "build:app" : "build"]) if (typeof pkg.scripts?.[script] === "string" && !scripts.some(item => item.args.at(-1) === script)) scripts.splice(Math.max(0,scripts.length-1),0,packageScriptCommand(projectContext(options).packageManager,script));
92
- }
93
- function recursive(script, seen = new Set()) {
94
- if (seen.has(script)) return false;seen.add(script);
95
- const text=pkg.scripts?.[script] ?? "";
96
- return /\bads\s+validate\b|\bcli\.mjs["']?\s+validate\b/.test(text) || [...text.matchAll(/\b(?:npm|bun)\s+(?:--bun\s+)?run\s+([\w:.-]+)/g)].some(match=>recursive(match[1],seen));
97
- }
98
- if (scripts.some(launch=>recursive(launch.args.at(-1)))) throw new Error("A selected project script calls ads validate recursively. Use leaf check/build scripts in validation.checks.");
82
+ const scripts = projectChecks(options,policy);
99
83
  for (const launch of scripts) await command(`project:${launch.args.at(-1)}`,launch,options);
100
- if (options.config.mcp.previewManifest && options.config.mcp.previewWatch) {
84
+ const behaviors = inspectBehaviors(options);
85
+ units = options.config[policy].behaviorChecks ? (scope === "all" ? behaviors.contracts.map(contract=>contract.unit) : affectedBehaviorUnits(options,changed)) : [];
86
+ const requirePreviews=policy === "validation" || units.length>0;
87
+ if (requirePreviews && options.config.mcp.previewManifest && options.config.mcp.previewWatch) {
101
88
  stage("preview-build");
102
89
  const { startAdsMcp } = await import("./mcp/server.mjs");
103
90
  previewHost = await startAdsMcp(root, { stdio:false });
104
91
  await previewHost.buildAll(signal, {timeoutMs:options.config.mcp.mutationCheckTimeoutMs});
105
92
  checks.push({name:"managed production previews",passed:true});
106
93
  }
107
- if (options.config.mcp.previewManifest || options.config.mcp.apps.length) {
94
+ if (requirePreviews && (options.config.mcp.previewManifest || options.config.mcp.apps.length)) {
108
95
  stage("verified-previews");
109
96
  const apps=[...options.config.mcp.apps,...inspectScenarios(options).scenarios.map(entry=>({id:entry.id,file:entry.artifact}))];
110
97
  const build=previewHost ? previewHost.buildStatus() : inspectBuildStatus(root,{...options.config.mcp,apps});
@@ -118,9 +105,7 @@ export function createValidationController(directory, { previewWork } = {}) {
118
105
  diagnostics.push(...pending.map(entry=>({rule:"validation-previews",message:`${entry.id}: ${entry.state}. A current verified preview is required; successful command exit alone is insufficient.`,details:entry.diagnostics})));
119
106
  return complete();
120
107
  }
121
- } else checks.push({name:"verified-previews",passed:true,skipped:true,reason:"No managed preview output configured."});
122
- const behaviors = inspectBehaviors(options);
123
- units = scope === "all" ? behaviors.contracts.map(contract=>contract.unit) : affectedBehaviorUnits(options,changed);
108
+ } else checks.push({name:"verified-previews",skipped:true,reason:requirePreviews ? "No managed preview output configured." : "Not required by acceptance policy."});
124
109
  if (units.length) {
125
110
  stage("behavior");
126
111
  const verification = createVerificationController(root, {previewHost});
@@ -130,7 +115,7 @@ export function createValidationController(directory, { previewWork } = {}) {
130
115
  results.push(...result.results); diagnostics.push(...result.diagnostics);
131
116
  checks.push({name:"registered-behavior",passed:result.ok});
132
117
  if (!result.ok && !result.diagnostics.length) diagnostics.push({rule:"validation-behavior",message:"Registered behavior checks did not all pass. Inspect the recorded outcomes."});
133
- } else checks.push({name:"registered-behavior",passed:true,skipped:true,reason:scope === "all" ? "No registered behavior contracts." : "No affected behavior contracts."});
118
+ } else checks.push({name:"registered-behavior",skipped:true,reason:!options.config[policy].behaviorChecks ? `Not required by ${policy} policy.` : scope === "all" ? "No registered behavior contracts." : "No affected behavior contracts."});
134
119
  } catch (error) { diagnostics.push(error.diagnostic ?? {rule:signal.aborted ? "validation-cancelled" : "validation-execution",message:error.message}); }
135
120
  finally { try { await previewHost?.close(); } finally { releasePreview?.();active=undefined;progress=undefined;finish(); } }
136
121
  return complete();
@@ -140,15 +125,15 @@ export function createValidationController(directory, { previewWork } = {}) {
140
125
  try { current = !!inputs && validationInputs(loadConfig(root)).revision === inputs.revision; } catch (error) { diagnostics.push({rule:"validation-inputs",message:error.message}); }
141
126
  if (inputs && !current) diagnostics.push({rule:"validation-stale",message:"Project inputs changed during validation. Rerun against current source."});
142
127
  if (signal.aborted && !diagnostics.some(item=>item.rule==="validation-cancelled")) diagnostics.push({rule:"validation-cancelled",message:"Validation was cancelled."});
143
- let ok = current && !signal.aborted && !diagnostics.length && checks.every(check=>check.passed);
128
+ let ok = current && !signal.aborted && !diagnostics.length && checks.every(check=>check.skipped || check.passed);
144
129
  if (ok && scope === "all") {
145
- const file = outputFile(root,"validation-baseline.json"), temporary = `${file}.${randomUUID()}.tmp`;
130
+ const file = outputFile(root,`${policy}-baseline.json`), temporary = `${file}.${randomUUID()}.tmp`;
146
131
  try { writeFileSync(temporary,JSON.stringify({schemaVersion:1,root,toolRevision,...inputs})); renameSync(temporary,file); }
147
132
  catch (error) { ok=false;diagnostics.push({rule:"validation-baseline",message:error.message}); }
148
133
  finally { rmSync(temporary,{force:true}); }
149
134
  }
150
- return {ok,scope,requestedScope,...(fallback?{fallback}:{}),sourceRevision:inputs?.revision,current,elapsedMs:Date.now()-startedAt,selection:{files:changed,units},checks,diagnostics,advisories,results,
151
- acceptance:acceptance(scope === "all" ? "full-project-validation" : "affected-project-validation",ok,checks.filter(check=>check.passed&&!check.skipped).map(check=>check.name),["unconfigured-project-checks","unasserted-behavior","visual-parity","accessibility-audit"])};
135
+ return {ok,policy,scope,requestedScope,...(fallback?{fallback}:{}),sourceRevision:inputs?.revision,current,elapsedMs:Date.now()-startedAt,selection:{files:changed,units},checks,diagnostics,advisories,results,
136
+ acceptance:acceptance(policy === "acceptance" ? "project-acceptance-policy" : scope === "all" ? "full-project-validation" : "affected-project-validation",ok,checks.filter(check=>check.passed&&!check.skipped).map(check=>check.name),["unconfigured-project-checks","unasserted-behavior","visual-parity","accessibility-audit"])};
152
137
  }
153
138
  },
154
139
  };
@@ -595,7 +595,7 @@ Warming an already-current selection does not restart or wait for that compiler.
595
595
  Production reuse requires a successful production build of the exact inputs,
596
596
  not merely a previously compiled development graph. Project-owned additional
597
597
  commands still run as configured. Remove the standalone preview-build command
598
- from `mcp.mutationChecks`; keep it in the ordinary project build.
598
+ from `acceptance.checks`; keep it in the ordinary project build.
599
599
 
600
600
  Candidate architecture inspection runs in a short-lived owned process, releasing
601
601
  its TypeScript heap after completion or cancellation. Semantic preview workers
@@ -779,9 +779,13 @@ candidate files locally and validates a temporary project copy with architecture
779
779
  checks, registered lint rules and project validation scripts.
780
780
  The temporary copy contains the relevant input graph and patched files, with room
781
781
  for 100,000 files / 2 GiB. Unrelated native artifacts are not copied. Declared extra
782
- inputs support project commands that read data outside the UI graph. Affected
783
- registered behavior checks, including consumers of a changed shared controller, also run in
784
- the isolated candidate project. The project owns its test code and runner policy;
782
+ inputs support project commands that read data outside the UI graph. When
783
+ `acceptance.behaviorChecks` is true, affected registered behavior checks, including
784
+ consumers of a changed shared controller, run in the isolated candidate project.
785
+ `acceptance.checks` and `validation.checks` explicitly select project scripts; no
786
+ names are inferred. Validation selects its own `behaviorChecks` flag. Direct
787
+ edits can invoke `ads validate --policy acceptance`; separate baselines prevent
788
+ acceptance evidence from satisfying a complete validation audit. The project owns its test code and runner policy;
785
789
  ADS owns affected-check selection, candidate hosting, progress, evidence freshness
786
790
  and process cleanup. One profile timeout bounds its entire runner process. Parallel
787
791
  workers can share that candidate host with independent App state. Partial outcomes
package/docs/BEHAVIORS.md CHANGED
@@ -374,13 +374,16 @@ scripts still run as configured; ordinary live preview does not automatically ru
374
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 native ADS gates
377
+ When `acceptance.behaviorChecks` is true, guarded mutations execute affected
378
+ registered behavior contracts after mandatory native ADS gates
378
379
  and configured project checks, before writing source. Imported shared
379
380
  controller changes also select dependent contracts conservatively. Rejected and
380
381
  dry-run patches publish no source changes. Verification output stays under `.ds/`.
381
382
  To check a prepared draft, request its diff and pass the returned `patchFile` to
382
- `ads_apply_patch` with `dryRun:true`. This checks the isolated candidate, including
383
- affected behavior contracts and its configured browser preview. Candidate evidence
383
+ `ads_apply_patch` with `dryRun:true`. This checks the isolated candidate using the acceptance policy, including
384
+ affected behavior contracts and their browser preview when enabled.
385
+ `validation.behaviorChecks` separately controls validation, while explicit
386
+ `ads_verify` always runs requested tests. Candidate evidence
384
387
  is not persisted as passing evidence for live source. `ads_verify` selects checks
385
388
  for current source and has no draft argument.
386
389
 
package/docs/CHANGELOG.md CHANGED
@@ -1,34 +1,71 @@
1
1
  # Changelog
2
2
 
3
- ## 0.3.38
3
+ ## 0.3.39
4
4
 
5
5
  <!-- ads-local-tests:start -->
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).
6
+ Local verification: **594/594 passed** with `ADS_TEST_BUN=1 npm test`.
7
+ Evidence adopted from the completed working-tree run of package 0.3.38; Node v24.13.0, Bun 1.4.1.
8
+ Release source commit: `37bb8f1436d717b451dfe04546e582fc6c61cc99`. This commit was not the execution HEAD.
9
+ Runtime code and tests match the completed run. Only release version metadata and policy documentation changed afterward.
10
+ The release owner explicitly approved reusing this completed run; no new full run is claimed.
11
+ Completed 2026-10-23T23:00:40.992Z (799 seconds).
9
12
 
10
13
  <!-- ads-local-test-proof
11
14
  {
12
15
  "schema": 1,
13
- "version": "0.3.38",
14
- "commit": "c6f50aa3e3a8c4b746805faf3190c12874108e81",
15
- "sourceSha256": "01da9a648eb3206296fadd93ece54996f901ab43b218a137681d5cc5728858e9",
16
+ "version": "0.3.39",
17
+ "commit": "37bb8f1436d717b451dfe04546e582fc6c61cc99",
18
+ "sourceSha256": "c44e5946aa23eb9a440e6d6e97dbecb413be4941fb56c51b5bdc4fde0f909e1c",
16
19
  "command": "ADS_TEST_BUN=1 npm test",
17
20
  "result": "pass",
18
- "tests": 584,
19
- "pass": 584,
21
+ "tests": 594,
22
+ "pass": 594,
20
23
  "fail": 0,
21
24
  "cancelled": 0,
22
25
  "skipped": 0,
23
26
  "node": "v24.13.0",
24
27
  "bun": "1.4.1",
25
- "completedAt": "2026-10-23T21:33:53.937Z",
26
- "durationMs": 772285,
27
- "logSha256": "984ecd9909f3a5808afba6fd1ef1e708a1bab0268f0ebc202c0333f3fe804556"
28
+ "completedAt": "2026-10-23T23:00:40.992Z",
29
+ "durationMs": 798977.027594,
30
+ "logSha256": "75ea7b860945aeb06837fdb2d43a22c27553d48c847cd910de52a9036690e2ba",
31
+ "evidenceOrigin": {
32
+ "kind": "adopted-completed-working-tree-run",
33
+ "testedVersion": "0.3.38",
34
+ "executionSource": "Uncommitted working tree before release commit",
35
+ "releaseSourceCommit": "37bb8f1436d717b451dfe04546e582fc6c61cc99",
36
+ "postRunChanges": [
37
+ "Package and lockfile version: 0.3.38 to 0.3.39",
38
+ "Changelog release heading",
39
+ "README and portable behavior-policy documentation"
40
+ ],
41
+ "runtimeAndTests": "Unchanged from the completed 594-test run",
42
+ "authorization": "Release owner explicitly approved reuse of the completed verification instead of rerunning solely for the release proof."
43
+ }
28
44
  }
29
45
  -->
30
46
  <!-- ads-local-tests:end -->
31
47
 
48
+ - Start stdio prewarming only on the real initialized connection, preventing
49
+ disposable MCP negotiation probes from launching competing compilers. HTTP-only
50
+ hosts can still prewarm immediately.
51
+
52
+ - Separate developer-owned acceptance and validation policies. Each explicitly
53
+ lists project scripts and chooses whether registered behavior tests gate it.
54
+ Core ADS architecture, ownership and freshness guards remain mandatory.
55
+ Direct edits can run `ads validate --policy acceptance` or MCP
56
+ `ads_validate({policy:"acceptance"})`. Draft editing/show remains preview-only.
57
+ Remove script-name inference; migrate `mcp.mutationChecks` to `acceptance.checks`.
58
+ Defaults: empty script lists, acceptance behavior checks off, validation on.
59
+ Separate baselines and policy-labelled results keep scopes distinct.
60
+ - Reconcile restarted draft preview workspaces against current project inputs,
61
+ including deletions; recover missing workspaces and remove finished orphan
62
+ workspaces. Return draft-private scenario diagnostics and a scoped resource
63
+ even when preview startup fails. Add explicit `ads_update_draft` refresh using
64
+ durable baselines to merge non-overlapping changes without altering accepted
65
+ source; overlaps leave the proposal intact for resolution.
66
+
67
+ ## 0.3.38
68
+
32
69
  - Require Bun 1.4.1+ for ADS's Bun runtime and native compiler. Reject older Bun
33
70
  before work starts and invalidate preview caches when its version changes.
34
71
  Bun 1.3.13 emitted invalid split modules for Reqvire's graph previews; keep
package/docs/GUIDE.md CHANGED
@@ -433,13 +433,19 @@ Exit codes are 0 for success, 1 for check findings, and 2 for invalid
433
433
  input/configuration or execution errors.
434
434
 
435
435
  Guarded MCP editing is opt-in. Its mandatory checks and optional project
436
- `mcp.mutationChecks` scripts run in a temporary project copy with installed
436
+ `acceptance.checks` scripts run in a temporary project copy with installed
437
437
  dependencies. Project scripts default to 60 seconds each; use the explicit
438
438
  `mcp.mutationCheckTimeoutMs` budget (100–300000 ms) for measured slower builds.
439
439
  Behavior profiles have a separate whole-run budget.
440
- For managed resource previews, ADS builds the complete production graph during
441
- acceptance and shares it with browser verification. Remove `build:mcp-previews`
442
- from `mcp.mutationChecks`; keep that script in the ordinary project build.
440
+ Set `acceptance.behaviorChecks` to require affected registered tests at acceptance.
441
+ Set `validation.checks` and `validation.behaviorChecks` independently for audits.
442
+ Both script lists default to empty; no names are inferred. Direct source edits
443
+ can run `ads validate --policy acceptance`; ordinary `ads validate` selects the
444
+ validation policy. See [policy guidance](../skills/ads-designer/references/validation.md).
445
+ When the acceptance policy requires affected registered behavior checks (or
446
+ a capture was requested), ADS builds and shares production previews with browser
447
+ verification. Core-only acceptance does not build the whole graph. Remove `build:mcp-previews`
448
+ from `acceptance.checks`; keep that script in the ordinary project build.
443
449
  See the [editing contract](MCP.md#guarded-editing) for unit ownership,
444
450
  Git patches, bounded reads and preview review. Keep normal build gates enabled
445
451
  for edits made by other tools.
@@ -469,7 +475,7 @@ Arbitrary computed expressions, combined conditional cascade behavior, computed
469
475
  module specifiers, JSX spreads, other styling engines, and renderer-specific APIs
470
476
  need the project's existing checks and review. Continue to run its type checking,
471
477
  component tests, and browser comparisons. Register component-specific guards as
472
- explicit project scripts; include them in builds and `mcp.mutationChecks` when
478
+ explicit project scripts; include them in builds and `acceptance.checks` when
473
479
  required. `ads check` does not invoke project linter plugins.
474
480
 
475
481
  ## Showcase
@@ -943,7 +949,7 @@ Project scale policies remain explicit. A registered check can call
943
949
  from the tooling package. Check `aliasOnly` for strict alias-only policies across
944
950
  all themes; inspect `literals`/`diagnostics` for raw values, cycles and limits.
945
951
  Choose exact targets/origins and documented geometry exceptions in project code;
946
- register the command in `mcp.mutationChecks` and the normal build. ADS owns no
952
+ register the command in `acceptance.checks` and the normal build. ADS owns no
947
953
  universal spacing scale and infers no design meaning from token names.
948
954
 
949
955
  ## Releasing the ADS tool
package/docs/MCP.md CHANGED
@@ -523,7 +523,7 @@ the selected candidate's sources. StrictMode profiles need a project React
523
523
  development harness. Profiles describe the execution environment, not a proof
524
524
  that every possible interaction or lifecycle has been tested.
525
525
 
526
- Guarded mutations also run affected registered behavior checks, including contracts
526
+ When `acceptance.behaviorChecks` is true, guarded mutations also run affected registered behavior checks, including contracts
527
527
  that depend on changed shared controllers. Failures reject the candidate before
528
528
  writing real source. Projects without contracts retain their existing checks.
529
529
 
@@ -715,20 +715,26 @@ placeholder. For coupled owners use the bounded transaction; a rejection still
715
715
  requires correcting its owner/policy, never a direct-write bypass.
716
716
 
717
717
  Set `dryRun` to `false` to apply. ADS reconstructs complete candidate files locally
718
- and validates a temporary project copy with native ADS guards, including warnings. By default it also runs available `lint:project`
719
- (or `lint`) and `typecheck` scripts. For managed resource previews,
720
- ADS also requests a full production preview build from the managed compiler and
721
- uses that same host and checked graph for registered browser verification. Keep
722
- `build:mcp-previews` for standalone builds; remove it from `mutationChecks` to
723
- avoid a redundant command. Explicit scripts still run exactly as configured.
724
- Projects without managed resource previews retain the standalone script default.
725
- Override the additional script list through project-owned configuration:
718
+ and validates a temporary project copy with mandatory native ADS guards. The
719
+ project's acceptance policy selects additional scripts and registered tests:
726
720
 
727
721
  ```json
728
- { "mcp": { "mutationChecks": ["lint", "typecheck"], "mutationCheckTimeoutMs": 120000 } }
722
+ {
723
+ "acceptance": { "checks": ["typecheck"], "behaviorChecks": true },
724
+ "validation": { "checks": ["typecheck", "test", "build:app"], "behaviorChecks": true },
725
+ "mcp": { "mutationCheckTimeoutMs": 120000 }
726
+ }
729
727
  ```
730
728
 
731
- Every listed script must exist. An empty list still runs mandatory ADS and configured managed preview checks. Scripts use the project's npm/Bun runner; installed dependencies are
729
+ Both script lists default to empty; script names are never inferred. Acceptance
730
+ behavior checks default to false; validation behavior checks default to true.
731
+ Managed previews are built for required behavior checks or requested captures,
732
+ sharing one production graph. Core-only acceptance does not build the whole
733
+ preview graph. Keep standalone preview builds in normal project builds; avoid
734
+ selecting the same build twice. Move the removed `mcp.mutationChecks` field to
735
+ `acceptance.checks` and choose `acceptance.behaviorChecks` explicitly.
736
+
737
+ Every listed script must exist. An empty list still runs mandatory ADS guards; registered tests run only when the policy enables them. Scripts use the project's npm/Bun runner; installed dependencies are
732
738
  shared with the validation copy. These are trusted project commands, not an OS
733
739
  sandbox. An explicit `configuration` patch can change project commands, registered
734
740
  rules and reviewed exceptions; validation runs the proposed configuration and
@@ -907,8 +913,8 @@ Run `ads compile .` for production previews or `ads compile . --watch` for a
907
913
  continuous compiler. Project setup can call `compilePreviews` from
908
914
  `@reqvire-org/ads/scenarios/compile`. Projects can integrate `ads check`,
909
915
  `ads verify` and `ads validate` into their own build/test/CI scripts. ADS acceptance
910
- always runs native gates and selected registered behavior checks; configured
911
- project checks run explicitly. Oxlint is not an ADS gate dependency.
916
+ always runs native gates; `acceptance.checks` and `acceptance.behaviorChecks`
917
+ choose additional scripts and affected registered tests. Oxlint is not an ADS gate dependency.
912
918
 
913
919
  MCP warms the prioritized view first, then compiles the remaining graph in
914
920
  one background build, without delaying service startup. One compiler job runs
@@ -1381,10 +1387,16 @@ All five skills include the same portable
1381
1387
  ## Complete and affected validation
1382
1388
 
1383
1389
  `ads_validate({})` and `ads validate` share the full validation engine.
1384
- `ads_validate({scope:"changed"})` matches `ads validate --changed`. The MCP tool
1390
+ `ads_validate({scope:"changed"})` matches `ads validate --changed`.
1391
+ `ads_validate({policy:"acceptance"})` matches `ads validate --policy acceptance`:
1392
+ it checks the acceptance policy against current source without applying anything.
1393
+ Validation and acceptance keep separate baselines; acceptance cannot establish
1394
+ full validation. Each policy chooses `checks` and `behaviorChecks`; skipped tests
1395
+ are reported as skipped, without a passing label. Draft preview/edit triggers
1396
+ neither policy. Explicit `ads_verify` remains independent of gating choices. The MCP tool
1385
1397
  runs trusted configured project commands with cancellation and bounded output; it
1386
1398
  is available with source mutations disabled and writes only build/evidence output
1387
- when project commands honor their checking contract. Summaries include scope,
1399
+ when project commands honor their checking contract. Summaries include policy, scope,
1388
1400
  requestedScope, fallback reason, sourceRevision, current, elapsedMs and resultId.
1389
1401
  Read diagnostics/checks/outcomes with `ads_results`; progress and the latest
1390
1402
  validation summary are in `ads_status.validation`. Retention is latest per kind:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.3.38",
3
+ "version": "0.3.39",
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": {