@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
@@ -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})`;
@@ -187,11 +187,12 @@ Interactive browsing may use `waitFor:"compiled"`; `build.current:false` or
187
187
  `build.live.validated:false` cannot establish passing evidence. Captures,
188
188
  behavior checks and publication still require verified current output.
189
189
 
190
- Acceptance builds the complete candidate in production mode, then releases its
191
- 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
192
193
  accepted/draft previews stay available throughout. Background checks serialize
193
194
  without borrowing the interactive compiler. Keep configured project checks;
194
- remove a duplicate standalone preview build from `mcp.mutationChecks` because
195
+ remove a duplicate standalone preview build from `acceptance.checks` because
195
196
  ADS already performs that build once. Keep `ads compile` in ordinary builds if
196
197
  that project needs preview artifacts there.
197
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`
@@ -98,8 +98,8 @@ also list a `ds.config.json` companion: change only that owner's `inlineStyleFil
98
98
  and `boundaries.styleWrites` entries together with its source. Unused permissions
99
99
  fail the core checks; do not pre-register a boundary without its implementation.
100
100
  Use `dryRun: true` to
101
- inspect validation, including affected registered behavior checks on the isolated
102
- 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
103
103
  `patchFile`; `ads_verify` checks current source and accepts no draft argument.
104
104
  Applying re-runs the gates. Fix rejected patches in their
105
105
  owner. Use `ads_apply_transaction` for genuinely coupled owner patches;
@@ -488,7 +488,11 @@ the ADS server package itself. Persistent SSE/notification streams make
488
488
 
489
489
  Run ADS's own gates directly with `ads check`; acceptance and validation do not
490
490
  require Oxlint. Register project-specific checks as explicit package scripts in
491
- `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.
492
496
  A project can use its own linter in those scripts when desired. Measured renderer properties and documented
493
497
  non-state hooks use explicit `boundaries`; shared token writes and primitive
494
498
  state overrides cannot be allowlisted. When migrating JSX inline geometry to
@@ -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
  },
@@ -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
 
@@ -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})`;
@@ -187,11 +187,12 @@ Interactive browsing may use `waitFor:"compiled"`; `build.current:false` or
187
187
  `build.live.validated:false` cannot establish passing evidence. Captures,
188
188
  behavior checks and publication still require verified current output.
189
189
 
190
- Acceptance builds the complete candidate in production mode, then releases its
191
- 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
192
193
  accepted/draft previews stay available throughout. Background checks serialize
193
194
  without borrowing the interactive compiler. Keep configured project checks;
194
- remove a duplicate standalone preview build from `mcp.mutationChecks` because
195
+ remove a duplicate standalone preview build from `acceptance.checks` because
195
196
  ADS already performs that build once. Keep `ads compile` in ordinary builds if
196
197
  that project needs preview artifacts there.
197
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`
@@ -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
 
@@ -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})`;
@@ -187,11 +187,12 @@ Interactive browsing may use `waitFor:"compiled"`; `build.current:false` or
187
187
  `build.live.validated:false` cannot establish passing evidence. Captures,
188
188
  behavior checks and publication still require verified current output.
189
189
 
190
- Acceptance builds the complete candidate in production mode, then releases its
191
- 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
192
193
  accepted/draft previews stay available throughout. Background checks serialize
193
194
  without borrowing the interactive compiler. Keep configured project checks;
194
- remove a duplicate standalone preview build from `mcp.mutationChecks` because
195
+ remove a duplicate standalone preview build from `acceptance.checks` because
195
196
  ADS already performs that build once. Keep `ads compile` in ordinary builds if
196
197
  that project needs preview artifacts there.
197
198