@reqvire-org/ads 0.3.39 → 0.3.41
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/dist/bun-compiler.mjs +1 -1
- package/dist/config.mjs +4 -1
- package/dist/investigations.mjs +27 -8
- package/dist/mcp/build-status.mjs +27 -16
- package/dist/mcp/context.mjs +1 -1
- package/dist/mcp/drafts.mjs +1 -1
- package/dist/mcp/execution-context.mjs +38 -0
- package/dist/mcp/execution-coordinator.mjs +220 -0
- package/dist/mcp/execution-results.mjs +107 -48
- package/dist/mcp/mutations.mjs +2 -0
- package/dist/mcp/preview-widget.bundle.js +2 -2
- package/dist/mcp/resource-loader.js +3 -2
- package/dist/mcp/server.mjs +42 -13
- package/dist/preview-failure.mjs +20 -0
- package/dist/preview-resources.mjs +69 -21
- package/dist/scenarios-compiler.mjs +7 -6
- package/dist/showcase/client.bundle.js +43 -41
- package/dist/showcase/index.html +15 -1
- package/dist/showcase/preview-state.js +2 -1
- package/dist/showcase/style.css +4 -1
- package/dist/skills/ads-break-ui/references/behaviors.md +4 -5
- package/dist/skills/ads-break-ui/references/evidence.md +12 -8
- package/dist/skills/ads-break-ui/references/validation.md +33 -0
- package/dist/skills/ads-designer/references/behaviors.md +4 -5
- package/dist/skills/ads-designer/references/evidence.md +12 -8
- package/dist/skills/ads-designer/references/validation.md +33 -0
- package/dist/skills/ads-import/references/behaviors.md +4 -5
- package/dist/skills/ads-import/references/evidence.md +12 -8
- package/dist/skills/ads-import/references/validation.md +33 -0
- package/dist/skills/ads-motion/references/behaviors.md +4 -5
- package/dist/skills/ads-motion/references/evidence.md +12 -8
- package/dist/skills/ads-motion/references/validation.md +33 -0
- package/dist/skills/ads-port/references/behaviors.md +4 -5
- package/dist/skills/ads-port/references/evidence.md +12 -8
- package/dist/skills/ads-port/references/validation.md +33 -0
- package/dist/validation-checks.mjs +6 -2
- package/dist/validation.mjs +8 -2
- package/dist/verification.mjs +7 -3
- package/docs/ARCHITECTURE.md +21 -3
- package/docs/CHANGELOG.md +40 -28
- package/docs/MCP.md +66 -12
- package/docs/plans/execution-coordination.md +57 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { finishExecutionGuard, trackExecutionChild, trackExecutionWorkspace } from "./mcp/execution-context.mjs";
|
|
1
2
|
import { spawn } from "node:child_process";
|
|
2
3
|
import { mkdtempSync, readFileSync, rmSync, statSync } from "node:fs";
|
|
3
4
|
import { tmpdir } from "node:os";
|
|
@@ -10,6 +11,7 @@ const fail = (rule, message, file, failure) => Object.assign(new Error(message),
|
|
|
10
11
|
|
|
11
12
|
export async function checkCandidate(root, signal, trackingRoot = root) {
|
|
12
13
|
const directory = mkdtempSync(path.join(tmpdir(), "ads-architecture-"));
|
|
14
|
+
trackExecutionWorkspace(directory);
|
|
13
15
|
const report = path.join(directory, "report.json");
|
|
14
16
|
try {
|
|
15
17
|
await checkCommand(process.execPath, [fileURLToPath(new URL("./check-runner.mjs", import.meta.url)), root, report, trackingRoot], root, signal, undefined, {category:"architecture",phase:"ads-check"});
|
|
@@ -33,6 +35,7 @@ export function checkCommand(command, args, cwd, signal, input, gate = {category
|
|
|
33
35
|
stop.on("error", () => child.kill("SIGKILL"));
|
|
34
36
|
} else { try { process.kill(-child.pid, "SIGKILL"); } catch (error) { if (error.code !== "ESRCH") failure ??= error; } }
|
|
35
37
|
}
|
|
38
|
+
trackExecutionChild(child);
|
|
36
39
|
if (child.pid) {
|
|
37
40
|
guard = spawn(process.execPath, [fileURLToPath(new URL("./mcp/preview-owner-guard.mjs", import.meta.url)), String(child.pid), "--tree"], {stdio:["pipe","ignore","ignore"],windowsHide:true});
|
|
38
41
|
guard.stdin.on("error",()=>{});
|
|
@@ -45,9 +48,10 @@ export function checkCommand(command, args, cwd, signal, input, gate = {category
|
|
|
45
48
|
for (const stream of [child.stdout, child.stderr]) stream.on("data", chunk => { output = (output + chunk.toString()).slice(-12000); });
|
|
46
49
|
child.once("error", error => { failure = error; });
|
|
47
50
|
child.once("exit", kill); // Also clean up descendants of a finished launcher.
|
|
48
|
-
child.once("close", code => {
|
|
49
|
-
done = true;
|
|
51
|
+
child.once("close", async code => {
|
|
52
|
+
done = true;
|
|
50
53
|
clearTimeout(timer); signal?.removeEventListener("abort", abort);
|
|
54
|
+
try{await finishExecutionGuard(guard);}catch(error){failure??=error;}
|
|
51
55
|
const detail={command:path.basename(command),args,timeoutMs,elapsedMs:Date.now()-startedAt,exitCode:code};
|
|
52
56
|
if (failure || code !== 0) {
|
|
53
57
|
const error=failure??fail("mutation-check", `${path.basename(command)} ${args.join(" ")} failed (${code}).\n${output}`);
|
package/dist/validation.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { executionContext } from "./mcp/execution-context.mjs";
|
|
1
2
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
3
|
import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
3
4
|
import path from "node:path";
|
|
@@ -74,6 +75,7 @@ export function createValidationController(directory, { previewWork } = {}) {
|
|
|
74
75
|
}
|
|
75
76
|
if (fallback) scope = "all";
|
|
76
77
|
}
|
|
78
|
+
onProgress?.({stage:"selection",scope,requestedScope,units,elapsedMs:Date.now()-startedAt});
|
|
77
79
|
stage("architecture");
|
|
78
80
|
const core = await checkCandidate(root, signal);
|
|
79
81
|
diagnostics.push(...core.diagnostics); advisories.push(...(core.advisories ?? []));
|
|
@@ -83,6 +85,7 @@ export function createValidationController(directory, { previewWork } = {}) {
|
|
|
83
85
|
for (const launch of scripts) await command(`project:${launch.args.at(-1)}`,launch,options);
|
|
84
86
|
const behaviors = inspectBehaviors(options);
|
|
85
87
|
units = options.config[policy].behaviorChecks ? (scope === "all" ? behaviors.contracts.map(contract=>contract.unit) : affectedBehaviorUnits(options,changed)) : [];
|
|
88
|
+
onProgress?.({stage:"selection",scope,requestedScope,units,elapsedMs:Date.now()-startedAt});
|
|
86
89
|
const requirePreviews=policy === "validation" || units.length>0;
|
|
87
90
|
if (requirePreviews && options.config.mcp.previewManifest && options.config.mcp.previewWatch) {
|
|
88
91
|
stage("preview-build");
|
|
@@ -128,9 +131,12 @@ export function createValidationController(directory, { previewWork } = {}) {
|
|
|
128
131
|
let ok = current && !signal.aborted && !diagnostics.length && checks.every(check=>check.skipped || check.passed);
|
|
129
132
|
if (ok && scope === "all") {
|
|
130
133
|
const file = outputFile(root,`${policy}-baseline.json`), temporary = `${file}.${randomUUID()}.tmp`;
|
|
131
|
-
|
|
134
|
+
const publish=()=>{
|
|
135
|
+
try { writeFileSync(temporary,JSON.stringify({schemaVersion:1,root,toolRevision,...inputs})); renameSync(temporary,file); }
|
|
136
|
+
finally { rmSync(temporary,{force:true}); }
|
|
137
|
+
};
|
|
138
|
+
try { const execution=executionContext.getStore();if(execution)execution.commits.push({file,value:{schemaVersion:1,root,toolRevision,...inputs}});else publish(); }
|
|
132
139
|
catch (error) { ok=false;diagnostics.push({rule:"validation-baseline",message:error.message}); }
|
|
133
|
-
finally { rmSync(temporary,{force:true}); }
|
|
134
140
|
}
|
|
135
141
|
return {ok,policy,scope,requestedScope,...(fallback?{fallback}:{}),sourceRevision:inputs?.revision,current,elapsedMs:Date.now()-startedAt,selection:{files:changed,units},checks,diagnostics,advisories,results,
|
|
136
142
|
acceptance:acceptance(policy === "acceptance" ? "project-acceptance-policy" : scope === "all" ? "full-project-validation" : "affected-project-validation",ok,checks.filter(check=>check.passed&&!check.skipped).map(check=>check.name),["unconfigured-project-checks","unasserted-behavior","visual-parity","accessibility-audit"])};
|
package/dist/verification.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { finishExecutionGuard, trackExecutionArtifact, trackExecutionChild } from "./mcp/execution-context.mjs";
|
|
1
2
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
3
|
import { spawn } from "node:child_process";
|
|
3
4
|
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -184,8 +185,9 @@ export function executeDevelopmentCommand(profile, args, root, env, signal) {
|
|
|
184
185
|
};
|
|
185
186
|
child = spawn(developmentExecutable(profile.command), args, { cwd: root, detached: process.platform !== "win32", shell: false, stdio: ["ignore", "pipe", "pipe"], windowsHide: true,
|
|
186
187
|
env: { ...process.env, ...env, PATH: [path.join(root, "node_modules/.bin"), path.dirname(process.execPath), process.env.PATH ?? ""].join(path.delimiter) } });
|
|
188
|
+
trackExecutionChild(child);
|
|
187
189
|
if (child.pid) {
|
|
188
|
-
guard = spawn(process.execPath, [fileURLToPath(new URL("./mcp/preview-owner-guard.mjs", import.meta.url)), String(child.pid)], { detached: process.platform !== "win32", stdio: ["pipe", "ignore", "ignore"], windowsHide: true });
|
|
190
|
+
guard = spawn(process.execPath, [fileURLToPath(new URL("./mcp/preview-owner-guard.mjs", import.meta.url)), String(child.pid), "--tree"], { detached: process.platform !== "win32", stdio: ["pipe", "ignore", "ignore"], windowsHide: true });
|
|
189
191
|
guard.stdin.on("error", () => {});
|
|
190
192
|
guard.once("error", error => { failure = error; kill(); });
|
|
191
193
|
guard.once("exit", () => { if (!done) { failure ??= new Error("Verification ownership guard exited unexpectedly."); kill(); } });
|
|
@@ -196,8 +198,9 @@ export function executeDevelopmentCommand(profile, args, root, env, signal) {
|
|
|
196
198
|
for (const stream of [child.stdout, child.stderr]) stream.on("data", chunk => { output = (output + chunk.toString()).slice(-12000); });
|
|
197
199
|
child.once("error", error => { failure = error; });
|
|
198
200
|
child.once("exit", kill);
|
|
199
|
-
child.once("close", code => {
|
|
200
|
-
done = true; kill();
|
|
201
|
+
child.once("close", async code => {
|
|
202
|
+
done = true; kill(); clearTimeout(timeout); signal.removeEventListener("abort", abort);
|
|
203
|
+
try{await finishExecutionGuard(guard);}catch(error){failure??=error;}
|
|
201
204
|
const elapsedMs = Date.now() - startedAt;
|
|
202
205
|
if (failure) reject(Object.assign(failure, { output, elapsedMs }));
|
|
203
206
|
else resolve({ code, output, elapsedMs });
|
|
@@ -253,6 +256,7 @@ export function createVerificationController(root, { reportRoot = root, onProgre
|
|
|
253
256
|
const group = selection.filter(check => check.profile === profileName);
|
|
254
257
|
const directory = path.join(reportRoot, ".ds/verification", randomUUID());
|
|
255
258
|
mkdirSync(directory, { recursive: true });
|
|
259
|
+
trackExecutionArtifact(reportRoot,directory);
|
|
256
260
|
if (realpathSync(directory) !== directory) throw new Error("Verification output cannot resolve through a symlink.");
|
|
257
261
|
const runId = randomUUID(), report = path.join(directory, "report.json"), request = path.join(directory, "request.json");
|
|
258
262
|
const scenarios = {};
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -346,6 +346,13 @@ scenarios unmounts the previous view while keeping unchanged dependencies cached
|
|
|
346
346
|
Persistence is a host lifecycle choice; a new external widget loads the same
|
|
347
347
|
resources independently. Resource sharing is scoped to an App instance.
|
|
348
348
|
|
|
349
|
+
Resource IDs hash original bytes and the transitive graph of URLs they rewrite.
|
|
350
|
+
Cyclic module groups share a deterministic fingerprint. This makes
|
|
351
|
+
IDs independent of compiler filename hashing: rewriting a changed dependency
|
|
352
|
+
cannot put different bytes behind an existing URI. Unrelated graph branches keep
|
|
353
|
+
their IDs and caches. The App still verifies the digest of the final bytes and
|
|
354
|
+
rejects any identity collision without partially registering the new graph.
|
|
355
|
+
|
|
349
356
|
The showcase's resource bridge can recover a transient fetch failure with at most
|
|
350
357
|
three read attempts and bounded backoff. This applies only to `resources/read`;
|
|
351
358
|
tool calls, assertions and whole checks are never replayed. Cancellation,
|
|
@@ -722,6 +729,17 @@ and behavior contracts. Full audits establish a content baseline. Changed audits
|
|
|
722
729
|
select affected behavior owners from that baseline; broad or unclassified changes
|
|
723
730
|
expand to full. Opaque project commands retain their declared scope.
|
|
724
731
|
|
|
732
|
+
MCP executions share a process-wide exclusive lease spanning checks, guarded
|
|
733
|
+
mutations, child cleanup and durable result publication. Conflicting requests get
|
|
734
|
+
a structured `ADS_VALIDATION_LOCKED` response; Explorer and preview serving keep
|
|
735
|
+
their independent lane. Relevant source edits abort working-tree runs early,
|
|
736
|
+
recording changed paths and known/unknown attribution. Source-change interruption
|
|
737
|
+
cannot publish a successful baseline. A small run journal supports crash recovery;
|
|
738
|
+
immutable run results and exact-run investigations survive reconnects and subsequent
|
|
739
|
+
runs under bounded age/count/disk retention. Collection protects active work and
|
|
740
|
+
expires owned evidence with its result. See [execution coordination](MCP.md#shared-process-execution-coordination)
|
|
741
|
+
and the [implementation plan](plans/execution-coordination.md).
|
|
742
|
+
|
|
725
743
|
Only a successful full audit against unchanged source advances the baseline.
|
|
726
744
|
This works without Git history and does not cache individual test results. Skills
|
|
727
745
|
guide agents toward affected checks during editing and full audits after ownership
|
|
@@ -810,9 +828,9 @@ bounded acceptance, at most three failure previews and a result ID in at most
|
|
|
810
828
|
sections without rerunning checks. Pages have at most 20 rows and 8 KiB of JSON;
|
|
811
829
|
truncated records support bounded text ranges. Discovery and investigation
|
|
812
830
|
sections use the same paging budget. Cursors bind the query and result/revision;
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
831
|
+
expired IDs fail explicitly instead of silently returning another run.
|
|
832
|
+
Immutable run snapshots persist under `.ds/tool-results/`, each at most 8 MiB,
|
|
833
|
+
with configurable age/count/disk retention and associated evidence collection. Oversized reports retain a summary with an
|
|
816
834
|
explicit unavailable-details warning. Storage/notification failure cannot change
|
|
817
835
|
an accepted edit's applied state. These are payload byte budgets, not tokenizer
|
|
818
836
|
estimates; MCP compatibility text may duplicate structured JSON on the wire.
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,50 +1,62 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.3.
|
|
3
|
+
## 0.3.41
|
|
4
4
|
|
|
5
5
|
<!-- ads-local-tests:start -->
|
|
6
|
-
Local verification: **
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Runtime code and tests match the completed run. Only release version metadata and policy documentation changed afterward.
|
|
10
|
-
The release owner explicitly approved reusing this completed run; no new full run is claimed.
|
|
11
|
-
Completed 2026-10-23T23:00:40.992Z (799 seconds).
|
|
6
|
+
Local verification: **618/618 passed** with `ADS_TEST_BUN=1 npm test`.
|
|
7
|
+
Tested commit: `05760c51a94bd84b2d298837b9dbba09edb875f2`; Node v24.13.0, Bun 1.4.1.
|
|
8
|
+
Completed 2026-10-26T13:40:29.074Z (793 seconds).
|
|
12
9
|
|
|
13
10
|
<!-- ads-local-test-proof
|
|
14
11
|
{
|
|
15
12
|
"schema": 1,
|
|
16
|
-
"version": "0.3.
|
|
17
|
-
"commit": "
|
|
18
|
-
"sourceSha256": "
|
|
13
|
+
"version": "0.3.41",
|
|
14
|
+
"commit": "05760c51a94bd84b2d298837b9dbba09edb875f2",
|
|
15
|
+
"sourceSha256": "d890df59a6cdcd1b7e3082a7801fc4dcf2e37e417d2194c0142d4ea778851ecc",
|
|
19
16
|
"command": "ADS_TEST_BUN=1 npm test",
|
|
20
17
|
"result": "pass",
|
|
21
|
-
"tests":
|
|
22
|
-
"pass":
|
|
18
|
+
"tests": 618,
|
|
19
|
+
"pass": 618,
|
|
23
20
|
"fail": 0,
|
|
24
21
|
"cancelled": 0,
|
|
25
22
|
"skipped": 0,
|
|
26
23
|
"node": "v24.13.0",
|
|
27
24
|
"bun": "1.4.1",
|
|
28
|
-
"completedAt": "2026-10-
|
|
29
|
-
"durationMs":
|
|
30
|
-
"logSha256": "
|
|
31
|
-
"evidenceOrigin": {
|
|
32
|
-
"kind": "adopted-completed-working-tree-run",
|
|
33
|
-
"testedVersion": "0.3.38",
|
|
34
|
-
"executionSource": "Uncommitted working tree before release commit",
|
|
35
|
-
"releaseSourceCommit": "37bb8f1436d717b451dfe04546e582fc6c61cc99",
|
|
36
|
-
"postRunChanges": [
|
|
37
|
-
"Package and lockfile version: 0.3.38 to 0.3.39",
|
|
38
|
-
"Changelog release heading",
|
|
39
|
-
"README and portable behavior-policy documentation"
|
|
40
|
-
],
|
|
41
|
-
"runtimeAndTests": "Unchanged from the completed 594-test run",
|
|
42
|
-
"authorization": "Release owner explicitly approved reuse of the completed verification instead of rerunning solely for the release proof."
|
|
43
|
-
}
|
|
25
|
+
"completedAt": "2026-10-26T13:40:29.074Z",
|
|
26
|
+
"durationMs": 792714,
|
|
27
|
+
"logSha256": "cdb07ccccde9de440b321252e99252bc69c8cedd64b63d52eb36670d8d19b912"
|
|
44
28
|
}
|
|
45
29
|
-->
|
|
46
30
|
<!-- ads-local-tests:end -->
|
|
47
31
|
|
|
32
|
+
- Coordinate validation, verification, draft acceptance and guarded edits across all
|
|
33
|
+
clients of one ADS process. Return structured lock/holder/progress responses;
|
|
34
|
+
keep Explorer and preview serving available.
|
|
35
|
+
- Abort working-tree checks early on relevant source edits and report changed
|
|
36
|
+
paths and observed attribution without advancing acceptance baselines.
|
|
37
|
+
- Retain immutable run results and exact-run investigation evidence across other
|
|
38
|
+
executions, reconnects and restarts. Journal interrupted runs and finish runner
|
|
39
|
+
ownership cleanup before releasing the execution lease.
|
|
40
|
+
- Add configurable age/count/disk retention with protected active runs and explicit
|
|
41
|
+
expiry errors. Update portable skills and shared-server workflow guidance.
|
|
42
|
+
|
|
43
|
+
## 0.3.40
|
|
44
|
+
|
|
45
|
+
- Fix immutable preview resource collisions when a compiler keeps dependency
|
|
46
|
+
filenames stable. Resource identities include transitive dependencies, with
|
|
47
|
+
cycle-aware hashing; unrelated preview branches retain their cached identities.
|
|
48
|
+
Rejected resource graphs no longer partially update the App loader.
|
|
49
|
+
- Move Explorer failures out of the rendered canvas into a compact workspace
|
|
50
|
+
status strip below the toolbar. Details opens the full diagnostics; Retry and
|
|
51
|
+
the retained preview remain available, including at phone widths.
|
|
52
|
+
- Preserve project/scenario/graph failure scope and validation/discovery/build
|
|
53
|
+
phase in preview reports. Explorer and MCP distinguish project validation
|
|
54
|
+
failures from errors in the selected preview, and retain the actual diagnostic
|
|
55
|
+
file, line, column and rule instead of reporting the compiler launcher location.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 0.3.39
|
|
59
|
+
|
|
48
60
|
- Start stdio prewarming only on the real initialized connection, preventing
|
|
49
61
|
disposable MCP negotiation probes from launching competing compilers. HTTP-only
|
|
50
62
|
hosts can still prewarm immediately.
|
package/docs/MCP.md
CHANGED
|
@@ -192,9 +192,10 @@ HTML in an opaque sandbox. Project UI is never imported into the shell.
|
|
|
192
192
|
|
|
193
193
|
The built-in client refreshes menus after catalogue changes and automatically
|
|
194
194
|
refreshes the active scenario inside the same reusable App after a current
|
|
195
|
-
successful build. Failed builds show
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
successful build. Failed builds show a compact status strip below the toolbar,
|
|
196
|
+
outside the App canvas. Details opens full file/line diagnostics; Retry requests
|
|
197
|
+
the selected preview again. The retained view is identified as stale. Themes and
|
|
198
|
+
available space flow through host context. Other coding-agent hosts retain their own reload
|
|
198
199
|
policy. A disconnected subscription marks retained output stale and tears down
|
|
199
200
|
App watchers; refresh the page after restarting ADS. Compilation remains necessary for project TSX/Linaria, performed by the
|
|
200
201
|
managed project compiler on demand and after relevant source changes.
|
|
@@ -494,16 +495,16 @@ the latest IDs. Status embeds summaries, not complete runner reports. Saved
|
|
|
494
495
|
outcomes are completion-time evidence; compare revisions with `ads_behaviors`
|
|
495
496
|
before claiming current source passed.
|
|
496
497
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
498
|
+
Execution snapshots are immutable by run/result ID. They survive other clients'
|
|
499
|
+
runs, reconnects and ADS restarts within `mcp.resultRetention`: by default 50 runs,
|
|
500
|
+
seven days and 256 MiB of result/evidence data. Each snapshot is limited to 8 MiB;
|
|
501
|
+
oversized reports retain a summary with an explicit warning. Storage failure keeps
|
|
502
|
+
latest details in memory with a warning. `ADS_RESULT_EXPIRED` identifies recently
|
|
503
|
+
collected results; the expiry tombstone index is bounded to 4096 IDs. Older unknown
|
|
504
|
+
IDs are unavailable. These limits do not change actual acceptance/applied state.
|
|
504
505
|
|
|
505
506
|
For diagnosis, take one outcome's exact `unit`, `check` and `runId` and call
|
|
506
|
-
`ads_investigate`. The run ID
|
|
507
|
+
`ads_investigate`. The exact run ID selects retained evidence from that execution. Without a check, it
|
|
507
508
|
lists available investigations with paging. An exact check returns a summary
|
|
508
509
|
within 4096 JSON bytes; `section: "details"`, `"requests"`, `"browserErrors"` or `"artifacts"`
|
|
509
510
|
returns detail pages with the same 10/20-row and 8192-byte limits. Truncated records support
|
|
@@ -514,7 +515,7 @@ artifacts. Exact input/observed preview revisions, source/failing step, startup
|
|
|
514
515
|
viewport and failed requests separate evidence from a suspected cause.
|
|
515
516
|
The summary's `details.failure.category` distinguishes architecture, build,
|
|
516
517
|
transport, runner and assertion boundaries; `acceptance` names established and unverified scope.
|
|
517
|
-
|
|
518
|
+
Latest-check listings are convenience indexes; exact retained run IDs and their registered artifacts remain resource-accessible. Read the portable
|
|
518
519
|
[evidence guide](../skills/ads-designer/references/evidence.md) for collection
|
|
519
520
|
limits and project-controlled trace/screenshot recording.
|
|
520
521
|
|
|
@@ -1384,6 +1385,14 @@ storage directory and `ads://guides/reporting`, without listing report contents.
|
|
|
1384
1385
|
All five skills include the same portable
|
|
1385
1386
|
[reporting reference](../skills/ads-designer/references/reporting.md).
|
|
1386
1387
|
|
|
1388
|
+
Build errors carry optional `failure: {scope, phase}` metadata. `scope` is
|
|
1389
|
+
`project`, `graph` or `scenario`; `phase` is `validation`, `discovery` or `build`.
|
|
1390
|
+
A failed project gate blocks verification across previews; it does not establish
|
|
1391
|
+
that every component failed compilation. Diagnostics retain their owning source
|
|
1392
|
+
file, line, column and rule code. Explorer labels project validation explicitly
|
|
1393
|
+
and shows errors for the selected preview rather than borrowing an unrelated
|
|
1394
|
+
scenario's failure. A retained earlier view is not current-source evidence.
|
|
1395
|
+
|
|
1387
1396
|
## Complete and affected validation
|
|
1388
1397
|
|
|
1389
1398
|
`ads_validate({})` and `ads validate` share the full validation engine.
|
|
@@ -1434,3 +1443,48 @@ so later creation invalidates evidence. Dependencies, metadata and generated out
|
|
|
1434
1443
|
are not source inputs. The setting defaults to an empty list and accepts up to 200
|
|
1435
1444
|
unique canonical paths below the project root. Declare data read dynamically by
|
|
1436
1445
|
selected commands; ADS cannot infer arbitrary filesystem access inside a command.
|
|
1446
|
+
|
|
1447
|
+
## Shared-process execution coordination
|
|
1448
|
+
|
|
1449
|
+
One ADS process has an exclusive execution lease shared by its HTTP and stdio
|
|
1450
|
+
clients. `ads_validate` (both policies/scopes), `ads_verify`, `ads_accept`,
|
|
1451
|
+
`ads_apply_patch` and `ads_apply_transaction` acquire it before work and retain it
|
|
1452
|
+
through child/ownership-guard cleanup and result publication. Changed scope still
|
|
1453
|
+
runs full project scripts. Parallel units and `wait: true` are not supported.
|
|
1454
|
+
|
|
1455
|
+
A conflicting call is a tool error with `code: "ADS_VALIDATION_LOCKED"` and `lock`:
|
|
1456
|
+
run ID, instance ID, operation, owner/client label where known, policy, requested
|
|
1457
|
+
and effective scope, units, start time, progress and nullable estimated remaining
|
|
1458
|
+
milliseconds. Client labels (including optional request `_meta["ads/clientId"]`)
|
|
1459
|
+
are advisory metadata, not authentication. Stateless HTTP requests do not define
|
|
1460
|
+
persistent client sessions. The run ID is the result ID; any connected project
|
|
1461
|
+
client can read retained evidence by ID after reconnecting.
|
|
1462
|
+
|
|
1463
|
+
`ads_status.execution` exposes the lock, server instance and retention state.
|
|
1464
|
+
Status resource subscriptions receive acquisition, progress, stopping and release
|
|
1465
|
+
updates. Read-only discovery, Explorer and preview delivery stay available.
|
|
1466
|
+
Accepted-source writes from every client, including the holder, contend for the
|
|
1467
|
+
same lease. Draft creation/editing affects separate proposals and remains usable.
|
|
1468
|
+
|
|
1469
|
+
Relevant source changes during working-tree validation/verification initiate early
|
|
1470
|
+
shutdown with `ADS_SOURCE_CHANGED_DURING_RUN`. Results name changed paths,
|
|
1471
|
+
added/modified/deleted classification and observed attribution; external editors
|
|
1472
|
+
have unknown authorship. While stopping, contention responses include these details.
|
|
1473
|
+
Generated outputs are excluded. Completed observations remain inspectable, and a
|
|
1474
|
+
stopped run cannot establish acceptance or publish a full-policy baseline. Guarded
|
|
1475
|
+
candidate edits retain their existing source-conflict checks before publication.
|
|
1476
|
+
|
|
1477
|
+
The durable journal under `.ds/execution-runs/` records work before it starts.
|
|
1478
|
+
Cancellation and request disconnect initiate cleanup and save a terminal result
|
|
1479
|
+
even when its response cannot be delivered. On restart, orphaned recorded process
|
|
1480
|
+
identities are checked before cleanup; PID reuse is not authority. Active work in
|
|
1481
|
+
another live process is not recovered. Unfinished abandoned runs become interrupted
|
|
1482
|
+
and never auto-resume. Existing EOF ownership guards also terminate child trees.
|
|
1483
|
+
|
|
1484
|
+
Collection runs at startup and after executions. Results, retained investigations
|
|
1485
|
+
and owned verification folders expire together; baselines are independent. Active
|
|
1486
|
+
runs and the just-returned result are protected (temporary over-budget state is
|
|
1487
|
+
reported). Abandoned known mutation workspaces are removed during recovery;
|
|
1488
|
+
unreferenced old verification folders are removed after the configured age.
|
|
1489
|
+
No cleanup is triggered solely by a client disconnect. Independent ADS processes
|
|
1490
|
+
on the same project are outside this process-local coordination guarantee.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Execution coordination and retained evidence
|
|
2
|
+
|
|
3
|
+
Implement in ADS 0.3.41. One running ADS process coordinates all its MCP
|
|
4
|
+
connections. Independent ADS processes on the same project are outside this
|
|
5
|
+
lease's scope; startup must never recover or delete another live process's work.
|
|
6
|
+
|
|
7
|
+
## Agreed behavior
|
|
8
|
+
|
|
9
|
+
- One exclusive execution lease covers validation (both policies and scopes),
|
|
10
|
+
verification, guarded patches/transactions and draft acceptance. Acquisition is
|
|
11
|
+
immediate, before checks, and release follows process cleanup and durable result
|
|
12
|
+
publication. A caller cannot mutate accepted source while its own lease is held.
|
|
13
|
+
- Reject contention with `ADS_VALIDATION_LOCKED`, holder/run ID, operation, client
|
|
14
|
+
label where available, policy, requested/effective scope, units, start time,
|
|
15
|
+
progress and nullable approximate ETA. Read-only discovery, Explorer and preview
|
|
16
|
+
serving remain usable. Neither waiting nor parallel unit runs are in this version.
|
|
17
|
+
- Scope changed retains full project scripts and may expand to all. Disjoint owner
|
|
18
|
+
names do not establish independent dependencies or outputs.
|
|
19
|
+
- Journal the run before starting work. The run ID is also its execution result ID.
|
|
20
|
+
HTTP requests can be stateless: ownership is a run identity, with advisory client
|
|
21
|
+
metadata, not a socket lifetime or authorization inferred from a client name.
|
|
22
|
+
- Cancellation/disconnection initiates cleanup, holds the lease until cleanup is
|
|
23
|
+
finished and records the terminal outcome independently of response delivery.
|
|
24
|
+
No run is automatically resumed or replayed.
|
|
25
|
+
- Watch relevant inputs during validation/verification. A detected source change
|
|
26
|
+
stops work with `ADS_SOURCE_CHANGED_DURING_RUN`, added/modified/deleted paths and
|
|
27
|
+
observed attribution. Direct editor/shell changes have unknown authorship;
|
|
28
|
+
never infer an author. Generated output changes do not stop runs. Preserve
|
|
29
|
+
observations already reported and never advance baselines on an interrupted run.
|
|
30
|
+
- Persist completed results by immutable run ID and retain exact-run investigations
|
|
31
|
+
and their artifacts. Latest indexes are convenience views, not retention limits.
|
|
32
|
+
Reconnection and another client's completion do not invalidate a retained ID.
|
|
33
|
+
- A new server instance recovers abandoned journal entries as interrupted after
|
|
34
|
+
checking/cleaning recorded owned process identities. Existing ownership guards
|
|
35
|
+
also clean children on parent death. Do not signal a reused PID. Finished results
|
|
36
|
+
and successful baselines survive; current source freshness is checked separately.
|
|
37
|
+
- Garbage collection runs at startup and after executions, never on client
|
|
38
|
+
disconnect. Configurable age/count/disk limits bound completed results and owned
|
|
39
|
+
evidence together. Protect active work and the newly returned result. Baselines
|
|
40
|
+
are independent. Remove abandoned temporaries only when unowned. An expired ID
|
|
41
|
+
reports `ADS_RESULT_EXPIRED`; unknown IDs are unavailable. Limits are soft only
|
|
42
|
+
for protected active/newly completed work and the over-budget state is visible.
|
|
43
|
+
- Status and supported resource subscriptions expose lease acquisition, progress,
|
|
44
|
+
stopping and release. ETA is null without a defensible estimate.
|
|
45
|
+
|
|
46
|
+
## Proof and delivery
|
|
47
|
+
|
|
48
|
+
Test two real MCP clients for refusal without spawning/replacing work; own
|
|
49
|
+
cancellation and disconnect; completion racing disconnect; persisted run lookup
|
|
50
|
+
on reconnect; source-change paths/unknown attribution and unchanged baselines;
|
|
51
|
+
restart recovery and reused/live-process protection; bounded collection and
|
|
52
|
+
historical investigation lookup; preview responsiveness while busy. Test known
|
|
53
|
+
MCP write attribution separately from external changes.
|
|
54
|
+
|
|
55
|
+
Update configuration, architecture, MCP guides and portable skill references.
|
|
56
|
+
Sync skill copies, run targeted regressions then the complete local release suite,
|
|
57
|
+
commit its proof, publish 0.3.41 and update local consumers to the published version.
|