@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.
- package/README.md +2 -0
- package/dist/bootstrap-ds/ds.config.json +2 -0
- package/dist/cli.mjs +7 -4
- package/dist/config.mjs +11 -6
- package/dist/mcp/context.mjs +4 -3
- package/dist/mcp/drafts.mjs +126 -10
- package/dist/mcp/execution-results.mjs +2 -2
- package/dist/mcp/mutations.mjs +3 -2
- package/dist/mcp/server.mjs +15 -7
- package/dist/skills/ads-break-ui/references/behaviors.md +8 -4
- package/dist/skills/ads-break-ui/references/drafts.md +26 -5
- package/dist/skills/ads-break-ui/references/guarded-editing.md +4 -2
- package/dist/skills/ads-break-ui/references/runtimes.md +4 -3
- package/dist/skills/ads-break-ui/references/validation.md +43 -25
- package/dist/skills/ads-break-ui/references/workflows.md +4 -3
- package/dist/skills/ads-designer/SKILL.md +7 -3
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +2 -0
- package/dist/skills/ads-designer/references/behaviors.md +8 -4
- package/dist/skills/ads-designer/references/cli.md +1 -1
- package/dist/skills/ads-designer/references/drafts.md +26 -5
- package/dist/skills/ads-designer/references/guarded-editing.md +4 -2
- package/dist/skills/ads-designer/references/runtimes.md +4 -3
- package/dist/skills/ads-designer/references/validation.md +43 -25
- package/dist/skills/ads-designer/references/workflows.md +4 -3
- package/dist/skills/ads-import/references/behaviors.md +8 -4
- package/dist/skills/ads-import/references/cli.md +1 -1
- package/dist/skills/ads-import/references/drafts.md +26 -5
- package/dist/skills/ads-import/references/guarded-editing.md +4 -2
- package/dist/skills/ads-import/references/runtimes.md +4 -3
- package/dist/skills/ads-import/references/validation.md +43 -25
- package/dist/skills/ads-import/references/workflows.md +4 -3
- package/dist/skills/ads-motion/references/behaviors.md +8 -4
- package/dist/skills/ads-motion/references/drafts.md +26 -5
- package/dist/skills/ads-motion/references/guarded-editing.md +4 -2
- package/dist/skills/ads-motion/references/runtimes.md +4 -3
- package/dist/skills/ads-motion/references/validation.md +43 -25
- package/dist/skills/ads-motion/references/workflows.md +4 -3
- package/dist/skills/ads-port/references/behaviors.md +8 -4
- package/dist/skills/ads-port/references/cli.md +1 -1
- package/dist/skills/ads-port/references/drafts.md +26 -5
- package/dist/skills/ads-port/references/guarded-editing.md +4 -2
- package/dist/skills/ads-port/references/runtimes.md +4 -3
- package/dist/skills/ads-port/references/validation.md +43 -25
- package/dist/skills/ads-port/references/workflows.md +4 -3
- package/dist/units.mjs +1 -1
- package/dist/validation-checks.mjs +10 -5
- package/dist/validation.mjs +16 -31
- package/docs/ARCHITECTURE.md +8 -4
- package/docs/BEHAVIORS.md +6 -3
- package/docs/CHANGELOG.md +49 -12
- package/docs/GUIDE.md +12 -6
- package/docs/MCP.md +27 -15
- package/package.json +1 -1
|
@@ -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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
381
|
-
|
|
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
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
24
|
-
|
|
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
|
-
|
|
191
|
-
|
|
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 `
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
381
|
-
|
|
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
|
|
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, `
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
24
|
-
|
|
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
|
-
|
|
191
|
-
|
|
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 `
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
23
|
-
|
|
24
|
-
|
|
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`
|
package/dist/units.mjs
CHANGED
|
@@ -78,7 +78,7 @@ export function configurationFiles(options) {
|
|
|
78
78
|
for (const match of command.matchAll(/\b(?:npm|bun)\s+run\s+([\w:.-]+)/g)) script(match[1]);
|
|
79
79
|
for (const match of command.matchAll(/\b(?:node|bun|tsx|ts-node)\s+([^\s;&|]+\.[cm]?[jt]sx?)(?=\s|$)/g)) visit(path.resolve(root, match[1]), true);
|
|
80
80
|
}
|
|
81
|
-
for (const name of ["lint:ds", "lint:style", "lint:project", "typecheck", "test", "build", "build:mcp-previews", "generate:icons", "build:lib", "build:app", ...(config.validation?.checks ?? []), ...(config.
|
|
81
|
+
for (const name of ["lint:ds", "lint:style", "lint:project", "typecheck", "test", "build", "build:mcp-previews", "generate:icons", "build:lib", "build:app", ...(config.validation?.checks ?? []), ...(config.acceptance?.checks ?? [])]) script(name);
|
|
82
82
|
const watch = config.mcp.previewWatch;
|
|
83
83
|
if (watch) {
|
|
84
84
|
if (["npm", "bun"].includes(watch.command) && watch.args[0] === "run") script(watch.args[1]);
|
|
@@ -59,12 +59,17 @@ export function checkCommand(command, args, cwd, signal, input, gate = {category
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
export function projectChecks(options) {
|
|
62
|
+
export function projectChecks(options, policy = "acceptance") {
|
|
63
63
|
const context = projectContext(options);
|
|
64
64
|
const pkg = JSON.parse(readFileSync(path.join(options.root, "package.json"), "utf8"));
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
if (scripts.
|
|
68
|
-
|
|
65
|
+
const scripts = options.config[policy].checks;
|
|
66
|
+
if (scripts.some(name => typeof pkg.scripts?.[name] !== "string")) throw fail("project-check", `Every configured ${policy}.checks script must exist in package.json.`);
|
|
67
|
+
if (scripts.length && !["npm", "bun"].includes(context.packageManager)) throw fail("project-check", "Declare packageManager as npm or bun to run project checks.");
|
|
68
|
+
function recursive(script, seen = new Set()) {
|
|
69
|
+
if (seen.has(script)) return false; seen.add(script);
|
|
70
|
+
const text=pkg.scripts?.[script] ?? "";
|
|
71
|
+
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));
|
|
72
|
+
}
|
|
73
|
+
if(scripts.some(script=>recursive(script)))throw fail("project-check", `A selected script calls ads validate recursively. Use leaf scripts in ${policy}.checks.`);
|
|
69
74
|
return scripts.map(script => packageScriptCommand(context.packageManager, script));
|
|
70
75
|
}
|