@reqvire-org/ads 0.3.37 → 0.3.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/bootstrap-ds/README.md +2 -2
- package/dist/bootstrap-ds/ds.config.json +2 -0
- package/dist/bootstrap-ds/package.json +1 -1
- package/dist/cli.mjs +16 -5
- package/dist/config.mjs +13 -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/preview-owner-guard.mjs +7 -4
- package/dist/mcp/preview-widget.bundle.js +46 -47
- package/dist/mcp/project-widget.bundle.js +45 -46
- package/dist/mcp/server.mjs +20 -7
- package/dist/mcp/widget.bundle.js +47 -48
- package/dist/preview-bun.mjs +5 -2
- package/dist/resource-limits.mjs +146 -0
- package/dist/runtime-requirements.mjs +21 -0
- package/dist/scenarios-compiler.mjs +4 -3
- package/dist/showcase/client.bundle.js +56 -57
- package/dist/showcase/sandbox.bundle.js +1 -1
- package/dist/skills/ads-break-ui/SKILL.md +3 -2
- 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 +89 -4
- 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 +10 -5
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +2 -2
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +2 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +1 -1
- package/dist/skills/ads-designer/references/behaviors.md +8 -4
- package/dist/skills/ads-designer/references/cli.md +3 -3
- 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 +89 -4
- 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/SKILL.md +3 -2
- package/dist/skills/ads-import/references/behaviors.md +8 -4
- package/dist/skills/ads-import/references/cli.md +3 -3
- 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 +89 -4
- 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/SKILL.md +3 -2
- 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 +89 -4
- 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/SKILL.md +3 -2
- package/dist/skills/ads-port/references/behaviors.md +8 -4
- package/dist/skills/ads-port/references/cli.md +3 -3
- 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 +89 -4
- 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/dist/verification/browser.mjs +8 -8
- package/docs/ARCHITECTURE.md +8 -4
- package/docs/BEHAVIORS.md +6 -3
- package/docs/CHANGELOG.md +70 -13
- package/docs/GUIDE.md +13 -7
- package/docs/MCP.md +49 -17
- package/package.json +2 -2
|
@@ -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})`;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
# ADS compilation and project runtimes
|
|
2
2
|
|
|
3
|
-
ADS tooling and MCP previews use Bun 1.
|
|
3
|
+
ADS tooling and MCP previews use Bun 1.4.1+ for bundling. Install Bun before
|
|
4
4
|
using the ADS CLI. The consuming application keeps its own package manager,
|
|
5
5
|
bundler, framework and production build. Node-compatible ADS checking APIs remain
|
|
6
6
|
available to projects that run their own checks under Node.
|
|
7
7
|
|
|
8
|
+
The minimum applies to the Bun executable running ADS, not to the application's
|
|
9
|
+
runtime. ADS rejects older Bun before starting commands or native compilation.
|
|
10
|
+
Keep a project's Bun pin/launcher compatible when it also launches ADS; do not
|
|
11
|
+
move Node-based application tools onto Bun to satisfy this requirement. Bun 1.4.1
|
|
12
|
+
fixes invalid split-module output observed with complex preview dependency graphs
|
|
13
|
+
on Bun 1.3.13. Compiler caches include the actual Bun version.
|
|
14
|
+
|
|
8
15
|
Use the installed/pinned ADS version. For npm projects:
|
|
9
16
|
|
|
10
17
|
```sh
|
|
@@ -45,6 +52,83 @@ ADS dispatches Bun project checks with `bun run`, preserving explicitly selected
|
|
|
45
52
|
Node/Bun commands and their flags. Use `bun` in a script when that individual tool
|
|
46
53
|
must run on Bun; ADS does not force the application's tools onto its own runtime.
|
|
47
54
|
|
|
55
|
+
## Project resource budgets
|
|
56
|
+
|
|
57
|
+
When setting up or changing compilation/test commands, put resource limits in
|
|
58
|
+
the project's configuration and scripts so ordinary builds, CI and ADS-started
|
|
59
|
+
checks use them. Account for the MCP server, accepted/draft compilers, test
|
|
60
|
+
workers and browsers together; one process's heap is not the whole workload.
|
|
61
|
+
|
|
62
|
+
- Preserve each tool's supported runtime in `package.json`. A Bun package
|
|
63
|
+
manager or ADS compiler does not imply that Vitest, Vite or every Node CLI
|
|
64
|
+
should be forced onto Bun. Change a tool's runtime only after its real workload
|
|
65
|
+
passes with measured time and memory under a bounded process tree.
|
|
66
|
+
Verify the executable actually used: when real Node is absent, Bun can supply
|
|
67
|
+
a `node` shim that runs Bun. `process.versions.node` alone does not prove Node;
|
|
68
|
+
inspect `process.execPath` and ensure `process.versions.bun` is absent. A project
|
|
69
|
+
launcher must select real Node or fail clearly before launching a Node-only tool;
|
|
70
|
+
V8 heap flags do not constrain Bun's shim runtime.
|
|
71
|
+
- Set worker counts in runner configuration, including project Vitest and
|
|
72
|
+
Playwright configs. Start with a small count appropriate to the machine and
|
|
73
|
+
measure before increasing it. Worker limits apply to the configured runner,
|
|
74
|
+
not every concurrently running project.
|
|
75
|
+
- Set explicit heap ceilings for Node tools in their scripts. For example,
|
|
76
|
+
`node --max-old-space-size=1200 node_modules/vitest/vitest.mjs run` and
|
|
77
|
+
`test: { maxWorkers: 2 }` are possible project settings, not universal defaults.
|
|
78
|
+
Check child processes too: runners can replace inherited Node flags. For
|
|
79
|
+
Vitest's fork pool, configure its `execArgv` heap flag explicitly when needed.
|
|
80
|
+
A heap ceiling excludes native allocations, browser processes and other heaps.
|
|
81
|
+
- Use a process-tree memory ceiling in the project's launcher or CI/container
|
|
82
|
+
when the platform supports it. On Linux with a user systemd manager, a bounded
|
|
83
|
+
launch can use `systemd-run --user --scope --quiet -p MemoryMax=3G
|
|
84
|
+
-p MemorySwapMax=0 bun run test`. Keep MCP stdout reserved for JSON-RPC when
|
|
85
|
+
wrapping its launcher. Account for simultaneous launchers; separate caps do
|
|
86
|
+
not establish an aggregate machine-wide limit.
|
|
87
|
+
- Run the complete affected workload under its saved limits. Record elapsed
|
|
88
|
+
time, peak tree memory and actual passing scope. A growing worker, killed
|
|
89
|
+
process, starved timeout or missing case is a failed/incomplete run. Diagnose
|
|
90
|
+
it; do not silently raise budgets, switch runtimes or remove checks to claim
|
|
91
|
+
success. Scope temporary probes and stop their owned process trees afterward.
|
|
92
|
+
|
|
93
|
+
Standalone project scripts need their own limits even when the same scripts can
|
|
94
|
+
be invoked through ADS. `mcp.mutationCheckTimeoutMs` and behavior-profile timeouts
|
|
95
|
+
limit elapsed time, not RAM. Use only settings supported by the installed ADS
|
|
96
|
+
version; ADS 0.3.37 has no built-in project memory-budget configuration field.
|
|
97
|
+
Do not invent one or describe a JS heap flag as a hard process-tree guarantee.
|
|
98
|
+
Direct editors change project scripts/configuration normally; MCP-only editors
|
|
99
|
+
use the available guarded configuration unit. See [editing workflows](workflows.md).
|
|
100
|
+
|
|
101
|
+
## ADS command memory limits (ADS 0.3.38+)
|
|
102
|
+
|
|
103
|
+
ADS 0.3.38 adds `resources.memoryLimitMb` to `ds.config.json` for CLI
|
|
104
|
+
commands, including MCP, Explorer, compilation and validation. Published ADS
|
|
105
|
+
0.3.37 does not support this field; check the installed version before adding it.
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{"resources":{"memoryLimitMb":4096}}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Missing/null chooses an automatic budget: at most 6 GiB, one quarter of physical
|
|
112
|
+
RAM, and available memory minus 1 GiB of headroom, bounded by an inherited Linux
|
|
113
|
+
cgroup limit. Explicit positive MiB budgets override automatic sizing. Restart
|
|
114
|
+
the ADS command after changing its budget. Nested ADS commands share the outer
|
|
115
|
+
envelope rather than each getting a fresh allowance.
|
|
116
|
+
|
|
117
|
+
On Linux with a user systemd manager, ADS uses a kernel process-tree cap and
|
|
118
|
+
disables additional swap for that scope. It preserves an existing finite parent
|
|
119
|
+
envelope instead of moving work outside the caller's limit. Other launches use
|
|
120
|
+
a separate process-tree watchdog when a kernel scope is unavailable. Watchdog
|
|
121
|
+
sampling can overshoot and shared RSS can overestimate memory; it is not a
|
|
122
|
+
kernel guarantee. `ads_status.resourceLimits` reports the budget, enforcement
|
|
123
|
+
mode and whether the reported limit is hard. An exceeded budget fails the
|
|
124
|
+
invocation with `ADS_MEMORY_LIMIT`; inspect retained results before retrying.
|
|
125
|
+
|
|
126
|
+
Embedded APIs report `host-managed`: their caller owns the enclosing process
|
|
127
|
+
policy. Direct project scripts using these APIs, and tests launched outside an
|
|
128
|
+
ADS command, still need project/OS limits. Separate ADS launches have separate
|
|
129
|
+
budgets, not a machine-wide reservation. Keep shared host headroom when choosing
|
|
130
|
+
project concurrency.
|
|
131
|
+
|
|
48
132
|
## Native preview compilation
|
|
49
133
|
|
|
50
134
|
Configure the framework and generated manifest:
|
|
@@ -103,11 +187,12 @@ Interactive browsing may use `waitFor:"compiled"`; `build.current:false` or
|
|
|
103
187
|
`build.live.validated:false` cannot establish passing evidence. Captures,
|
|
104
188
|
behavior checks and publication still require verified current output.
|
|
105
189
|
|
|
106
|
-
|
|
107
|
-
|
|
190
|
+
When acceptance requires affected behavior checks or captures, it builds the
|
|
191
|
+
candidate in production mode, then releases its compiler while browser checks
|
|
192
|
+
use the hosted immutable graph. Core-only acceptance skips the preview build. Interactive
|
|
108
193
|
accepted/draft previews stay available throughout. Background checks serialize
|
|
109
194
|
without borrowing the interactive compiler. Keep configured project checks;
|
|
110
|
-
remove a duplicate standalone preview build from `
|
|
195
|
+
remove a duplicate standalone preview build from `acceptance.checks` because
|
|
111
196
|
ADS already performs that build once. Keep `ads compile` in ordinary builds if
|
|
112
197
|
that project needs preview artifacts there.
|
|
113
198
|
|
|
@@ -4,33 +4,51 @@ These checks apply to both [direct editing and MCP-only editing](workflows.md).
|
|
|
4
4
|
Direct source edits need current checks and rendered review; ordinary edits do
|
|
5
5
|
not require a draft or acceptance call. Tracked proposals validate on acceptance.
|
|
6
6
|
|
|
7
|
-
|
|
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`
|
|
@@ -29,8 +29,9 @@ MCP serves published previews and evidence without starting a compiler.
|
|
|
29
29
|
For validation scope, full audits, and CLI/MCP parity, read
|
|
30
30
|
[validation.md](references/validation.md).
|
|
31
31
|
|
|
32
|
-
For Node/Bun setup, MCP launch and
|
|
33
|
-
[runtimes.md](references/runtimes.md).
|
|
32
|
+
For Node/Bun setup, MCP launch, compiler workers and project resource budgets,
|
|
33
|
+
read [runtimes.md](references/runtimes.md). Keep runtime choices, worker counts
|
|
34
|
+
and memory limits in project configuration; verify real workloads under them.
|
|
34
35
|
|
|
35
36
|
# ADS Port
|
|
36
37
|
|
|
@@ -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
|
|
|
@@ -4,7 +4,7 @@ Choose [direct source editing or MCP-only editing](workflows.md). CLI commands
|
|
|
4
4
|
are available to direct editors; MCP-only clients use exposed tools instead of
|
|
5
5
|
assuming shell access. The compiler can be managed by MCP or externally.
|
|
6
6
|
|
|
7
|
-
Install Bun 1.
|
|
7
|
+
Install Bun 1.4.1+ for ADS tooling and previews. The application keeps its own
|
|
8
8
|
Node/npm or Bun build pipeline. Use these commands alongside this skill's research,
|
|
9
9
|
implementation, documentation, and verification workflow. ADS must be a project
|
|
10
10
|
development dependency, and its checks must run before the project's build.
|
|
@@ -34,7 +34,7 @@ tooling and rejects conflicting saved/JSX settings instead of converting it.
|
|
|
34
34
|
|
|
35
35
|
Use the confirmed package name/version if different. For a Bun project, use
|
|
36
36
|
`bunx --bun @reqvire-org/ads init --framework react`, `bun install` and
|
|
37
|
-
`bun --bun run build`. Bun 1.
|
|
37
|
+
`bun --bun run build`. Bun 1.4.1+ suffices; Node is unnecessary. Init detects
|
|
38
38
|
`packageManager` or `bun.lock`/`bun.lockb`, then defaults to Bun when launched
|
|
39
39
|
with Bun. See [runtimes.md](runtimes.md)
|
|
40
40
|
for MCP configuration and portable compiler/behavior commands.
|
|
@@ -97,7 +97,7 @@ Integrate that directory through the app's existing asset mount. Fixed token
|
|
|
97
97
|
names and prefixes are required; project values and artwork remain project-owned.
|
|
98
98
|
Builds use the installed local tool, not the initializing npx cache. Ignore `.ds/`.
|
|
99
99
|
Register component-specific guards as explicit project scripts and include them
|
|
100
|
-
in the project build and, when needed, `
|
|
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})`;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
# ADS compilation and project runtimes
|
|
2
2
|
|
|
3
|
-
ADS tooling and MCP previews use Bun 1.
|
|
3
|
+
ADS tooling and MCP previews use Bun 1.4.1+ for bundling. Install Bun before
|
|
4
4
|
using the ADS CLI. The consuming application keeps its own package manager,
|
|
5
5
|
bundler, framework and production build. Node-compatible ADS checking APIs remain
|
|
6
6
|
available to projects that run their own checks under Node.
|
|
7
7
|
|
|
8
|
+
The minimum applies to the Bun executable running ADS, not to the application's
|
|
9
|
+
runtime. ADS rejects older Bun before starting commands or native compilation.
|
|
10
|
+
Keep a project's Bun pin/launcher compatible when it also launches ADS; do not
|
|
11
|
+
move Node-based application tools onto Bun to satisfy this requirement. Bun 1.4.1
|
|
12
|
+
fixes invalid split-module output observed with complex preview dependency graphs
|
|
13
|
+
on Bun 1.3.13. Compiler caches include the actual Bun version.
|
|
14
|
+
|
|
8
15
|
Use the installed/pinned ADS version. For npm projects:
|
|
9
16
|
|
|
10
17
|
```sh
|
|
@@ -45,6 +52,83 @@ ADS dispatches Bun project checks with `bun run`, preserving explicitly selected
|
|
|
45
52
|
Node/Bun commands and their flags. Use `bun` in a script when that individual tool
|
|
46
53
|
must run on Bun; ADS does not force the application's tools onto its own runtime.
|
|
47
54
|
|
|
55
|
+
## Project resource budgets
|
|
56
|
+
|
|
57
|
+
When setting up or changing compilation/test commands, put resource limits in
|
|
58
|
+
the project's configuration and scripts so ordinary builds, CI and ADS-started
|
|
59
|
+
checks use them. Account for the MCP server, accepted/draft compilers, test
|
|
60
|
+
workers and browsers together; one process's heap is not the whole workload.
|
|
61
|
+
|
|
62
|
+
- Preserve each tool's supported runtime in `package.json`. A Bun package
|
|
63
|
+
manager or ADS compiler does not imply that Vitest, Vite or every Node CLI
|
|
64
|
+
should be forced onto Bun. Change a tool's runtime only after its real workload
|
|
65
|
+
passes with measured time and memory under a bounded process tree.
|
|
66
|
+
Verify the executable actually used: when real Node is absent, Bun can supply
|
|
67
|
+
a `node` shim that runs Bun. `process.versions.node` alone does not prove Node;
|
|
68
|
+
inspect `process.execPath` and ensure `process.versions.bun` is absent. A project
|
|
69
|
+
launcher must select real Node or fail clearly before launching a Node-only tool;
|
|
70
|
+
V8 heap flags do not constrain Bun's shim runtime.
|
|
71
|
+
- Set worker counts in runner configuration, including project Vitest and
|
|
72
|
+
Playwright configs. Start with a small count appropriate to the machine and
|
|
73
|
+
measure before increasing it. Worker limits apply to the configured runner,
|
|
74
|
+
not every concurrently running project.
|
|
75
|
+
- Set explicit heap ceilings for Node tools in their scripts. For example,
|
|
76
|
+
`node --max-old-space-size=1200 node_modules/vitest/vitest.mjs run` and
|
|
77
|
+
`test: { maxWorkers: 2 }` are possible project settings, not universal defaults.
|
|
78
|
+
Check child processes too: runners can replace inherited Node flags. For
|
|
79
|
+
Vitest's fork pool, configure its `execArgv` heap flag explicitly when needed.
|
|
80
|
+
A heap ceiling excludes native allocations, browser processes and other heaps.
|
|
81
|
+
- Use a process-tree memory ceiling in the project's launcher or CI/container
|
|
82
|
+
when the platform supports it. On Linux with a user systemd manager, a bounded
|
|
83
|
+
launch can use `systemd-run --user --scope --quiet -p MemoryMax=3G
|
|
84
|
+
-p MemorySwapMax=0 bun run test`. Keep MCP stdout reserved for JSON-RPC when
|
|
85
|
+
wrapping its launcher. Account for simultaneous launchers; separate caps do
|
|
86
|
+
not establish an aggregate machine-wide limit.
|
|
87
|
+
- Run the complete affected workload under its saved limits. Record elapsed
|
|
88
|
+
time, peak tree memory and actual passing scope. A growing worker, killed
|
|
89
|
+
process, starved timeout or missing case is a failed/incomplete run. Diagnose
|
|
90
|
+
it; do not silently raise budgets, switch runtimes or remove checks to claim
|
|
91
|
+
success. Scope temporary probes and stop their owned process trees afterward.
|
|
92
|
+
|
|
93
|
+
Standalone project scripts need their own limits even when the same scripts can
|
|
94
|
+
be invoked through ADS. `mcp.mutationCheckTimeoutMs` and behavior-profile timeouts
|
|
95
|
+
limit elapsed time, not RAM. Use only settings supported by the installed ADS
|
|
96
|
+
version; ADS 0.3.37 has no built-in project memory-budget configuration field.
|
|
97
|
+
Do not invent one or describe a JS heap flag as a hard process-tree guarantee.
|
|
98
|
+
Direct editors change project scripts/configuration normally; MCP-only editors
|
|
99
|
+
use the available guarded configuration unit. See [editing workflows](workflows.md).
|
|
100
|
+
|
|
101
|
+
## ADS command memory limits (ADS 0.3.38+)
|
|
102
|
+
|
|
103
|
+
ADS 0.3.38 adds `resources.memoryLimitMb` to `ds.config.json` for CLI
|
|
104
|
+
commands, including MCP, Explorer, compilation and validation. Published ADS
|
|
105
|
+
0.3.37 does not support this field; check the installed version before adding it.
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{"resources":{"memoryLimitMb":4096}}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Missing/null chooses an automatic budget: at most 6 GiB, one quarter of physical
|
|
112
|
+
RAM, and available memory minus 1 GiB of headroom, bounded by an inherited Linux
|
|
113
|
+
cgroup limit. Explicit positive MiB budgets override automatic sizing. Restart
|
|
114
|
+
the ADS command after changing its budget. Nested ADS commands share the outer
|
|
115
|
+
envelope rather than each getting a fresh allowance.
|
|
116
|
+
|
|
117
|
+
On Linux with a user systemd manager, ADS uses a kernel process-tree cap and
|
|
118
|
+
disables additional swap for that scope. It preserves an existing finite parent
|
|
119
|
+
envelope instead of moving work outside the caller's limit. Other launches use
|
|
120
|
+
a separate process-tree watchdog when a kernel scope is unavailable. Watchdog
|
|
121
|
+
sampling can overshoot and shared RSS can overestimate memory; it is not a
|
|
122
|
+
kernel guarantee. `ads_status.resourceLimits` reports the budget, enforcement
|
|
123
|
+
mode and whether the reported limit is hard. An exceeded budget fails the
|
|
124
|
+
invocation with `ADS_MEMORY_LIMIT`; inspect retained results before retrying.
|
|
125
|
+
|
|
126
|
+
Embedded APIs report `host-managed`: their caller owns the enclosing process
|
|
127
|
+
policy. Direct project scripts using these APIs, and tests launched outside an
|
|
128
|
+
ADS command, still need project/OS limits. Separate ADS launches have separate
|
|
129
|
+
budgets, not a machine-wide reservation. Keep shared host headroom when choosing
|
|
130
|
+
project concurrency.
|
|
131
|
+
|
|
48
132
|
## Native preview compilation
|
|
49
133
|
|
|
50
134
|
Configure the framework and generated manifest:
|
|
@@ -103,11 +187,12 @@ Interactive browsing may use `waitFor:"compiled"`; `build.current:false` or
|
|
|
103
187
|
`build.live.validated:false` cannot establish passing evidence. Captures,
|
|
104
188
|
behavior checks and publication still require verified current output.
|
|
105
189
|
|
|
106
|
-
|
|
107
|
-
|
|
190
|
+
When acceptance requires affected behavior checks or captures, it builds the
|
|
191
|
+
candidate in production mode, then releases its compiler while browser checks
|
|
192
|
+
use the hosted immutable graph. Core-only acceptance skips the preview build. Interactive
|
|
108
193
|
accepted/draft previews stay available throughout. Background checks serialize
|
|
109
194
|
without borrowing the interactive compiler. Keep configured project checks;
|
|
110
|
-
remove a duplicate standalone preview build from `
|
|
195
|
+
remove a duplicate standalone preview build from `acceptance.checks` because
|
|
111
196
|
ADS already performs that build once. Keep `ads compile` in ordinary builds if
|
|
112
197
|
that project needs preview artifacts there.
|
|
113
198
|
|