@reqvire-org/ads 0.3.34 → 0.3.35

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/docs/CHANGELOG.md CHANGED
@@ -1,34 +1,56 @@
1
1
  # Changelog
2
2
 
3
- ## 0.3.34
3
+ ## 0.3.35
4
4
 
5
5
  <!-- ads-local-tests:start -->
6
- Local verification: **535/535 passed** with `ADS_TEST_BUN=1 npm test`.
7
- Tested commit: `7e1573d7c1d210b5955cf41778ac3886b515d6af`; Node v24.13.0, Bun 1.3.13.
8
- Completed 2026-10-22T20:53:31.087Z (614 seconds).
6
+ Local verification: **547/547 passed** with `ADS_TEST_BUN=1 npm test`.
7
+ Tested commit: `14232101493c8f611618719dd2bd57a069badff5`; Node v24.13.0, Bun 1.3.13.
8
+ Completed 2026-10-23T06:56:19.558Z (684 seconds).
9
9
 
10
10
  <!-- ads-local-test-proof
11
11
  {
12
12
  "schema": 1,
13
- "version": "0.3.34",
14
- "commit": "7e1573d7c1d210b5955cf41778ac3886b515d6af",
15
- "sourceSha256": "c020f82b1ceab0b30bb61722b26e8bba44c72e115687032fc7a5377487896c96",
13
+ "version": "0.3.35",
14
+ "commit": "14232101493c8f611618719dd2bd57a069badff5",
15
+ "sourceSha256": "0e0f6179dfe7ad04c25c867b272a7d2492861417b86d254536e17a5afe310067",
16
16
  "command": "ADS_TEST_BUN=1 npm test",
17
17
  "result": "pass",
18
- "tests": 535,
19
- "pass": 535,
18
+ "tests": 547,
19
+ "pass": 547,
20
20
  "fail": 0,
21
21
  "cancelled": 0,
22
22
  "skipped": 0,
23
23
  "node": "v24.13.0",
24
24
  "bun": "1.3.13",
25
- "completedAt": "2026-10-22T20:53:31.087Z",
26
- "durationMs": 613940,
27
- "logSha256": "d66e7ddc9334e67567af1c47644e23c82348ab03e0297589301f7f5f00e72005"
25
+ "completedAt": "2026-10-23T06:56:19.558Z",
26
+ "durationMs": 683838,
27
+ "logSha256": "dbc6345c462b7b7345b914b93f5516361842c792cd0759a40b6688332696f3e5"
28
28
  }
29
29
  -->
30
30
  <!-- ads-local-tests:end -->
31
31
 
32
+ - Bound acceptance memory by parking accepted/draft compilers while retaining
33
+ published views, running candidate architecture checks in a short-lived
34
+ process, and retiring idle semantic workers and temporary program caches.
35
+ - Deduplicate shared preview dependency maps so large full graphs remain below
36
+ the cache reader's size limit. Hash shared dependencies once per operation and
37
+ sort configuration inputs for stable reuse under Bun as well as Node.
38
+ - Build all candidate previews in production mode through the managed compiler;
39
+ reuse that checked graph and host for browser verification. Remove
40
+ `build:mcp-previews` from `mcp.mutationChecks` after upgrading; normal builds
41
+ retain the standalone script. Development graphs cannot satisfy a production
42
+ build check.
43
+ - Preserve current preview reads while compilers are parked, exclude queue time
44
+ from build budgets, and keep configuration replacements parked until validation
45
+ completes. Fail malformed full-build catalogs promptly and recover complete
46
+ catalogs after repair. Keep read-only architecture reports outside the project.
47
+ - In the frozen Gidi acceptance workload, peak process-tree PSS fell from
48
+ 7.99 to 4.56 GiB and two complete draft/accept cycles fell from 355.7 to
49
+ 270.3 seconds, retaining all validation gates. See the
50
+ [benchmark report](https://github.com/reqvire-org/ads/blob/v0.3.35/docs/benchmarks/gidi-preview-memory.md).
51
+
52
+ ## 0.3.34
53
+
32
54
  - Ship typed browser verification helpers so strict project typechecks retain
33
55
  Playwright's DOM callback inference. Recognize explicitly configured nested
34
56
  Vite/Playwright build files as tooling rather than ADS runtime imports.
package/docs/GUIDE.md CHANGED
@@ -433,7 +433,11 @@ Guarded MCP editing is opt-in. Its mandatory checks and optional project
433
433
  `mcp.mutationChecks` scripts run in a temporary project copy with installed
434
434
  dependencies. Project scripts default to 60 seconds each; use the explicit
435
435
  `mcp.mutationCheckTimeoutMs` budget (100–300000 ms) for measured slower builds.
436
- Behavior profiles have a separate whole-run budget. See the [editing contract](MCP.md#guarded-editing) for unit ownership,
436
+ Behavior profiles have a separate whole-run budget.
437
+ For managed resource previews, ADS builds the complete production graph during
438
+ acceptance and shares it with browser verification. Remove `build:mcp-previews`
439
+ from `mcp.mutationChecks`; keep that script in the ordinary project build.
440
+ See the [editing contract](MCP.md#guarded-editing) for unit ownership,
437
441
  Git patches, bounded reads and preview review. Keep normal build gates enabled
438
442
  for edits made by other tools.
439
443
 
package/docs/MCP.md CHANGED
@@ -671,15 +671,20 @@ requires correcting its owner/policy, never a direct-write bypass.
671
671
  Set `dryRun` to `false` to apply. ADS reconstructs complete candidate files locally
672
672
  and validates a temporary project copy with core guards and registered Oxlint
673
673
  rules, including warnings. By default it also runs available `lint:project`
674
- (or `lint`), `typecheck` and `build:mcp-previews` scripts. Override only that
675
- additional list through project-owned configuration:
674
+ (or `lint`) and `typecheck` scripts. For resource projects with `mcp.previewWatch`,
675
+ ADS also requests a full production preview build from the managed compiler and
676
+ uses that same host and checked graph for registered browser verification. Keep
677
+ `build:mcp-previews` for standalone builds; remove it from `mutationChecks` to
678
+ avoid a redundant command. Explicit scripts still run exactly as configured.
679
+ Projects without managed resource previews retain the standalone script default.
680
+ Override the additional script list through project-owned configuration:
676
681
 
677
682
  ```json
678
- { "mcp": { "mutationChecks": ["lint", "typecheck", "build:mcp-previews"], "mutationCheckTimeoutMs": 120000 } }
683
+ { "mcp": { "mutationChecks": ["lint", "typecheck"], "mutationCheckTimeoutMs": 120000 } }
679
684
  ```
680
685
 
681
- Every listed script must exist. An empty list still runs mandatory ADS and Oxlint
682
- checks. Scripts use the project's npm/Bun runner; installed dependencies are
686
+ Every listed script must exist. An empty list still runs mandatory ADS, Oxlint
687
+ and configured managed preview checks. Scripts use the project's npm/Bun runner; installed dependencies are
683
688
  shared with the validation copy. These are trusted project commands, not an OS
684
689
  sandbox. An explicit `configuration` patch can change project commands, registered
685
690
  rules and reviewed exceptions; validation runs the proposed configuration and
@@ -0,0 +1,141 @@
1
+ # Gidi draft acceptance: memory and compiler reuse
2
+
3
+ Measured on 23 October 2026 using a frozen Gidi source snapshot and real MCP
4
+ Apps in headless Chrome. The installed Gidi package and working source were not
5
+ patched. The baseline distribution matched published ADS 0.3.34 byte for byte.
6
+
7
+ | Measurement | ADS 0.3.34 | Changed implementation |
8
+ | --- | ---: | ---: |
9
+ | Peak process-tree PSS | 7.99 GiB | 4.56 GiB |
10
+ | Peak process-tree RSS | 8.82 GiB | 5.50 GiB |
11
+ | Main Bun process peak PSS, including benchmark driver | 3.71 GiB | 2.11 GiB |
12
+ | Idle PSS after acceptance 1 | 3.30 GiB | 1.49 GiB |
13
+ | Idle PSS after acceptance 2 | 4.70 GiB | 1.71 GiB |
14
+ | Acceptance 1, including all configured gates | 101.0 s | 81.3 s |
15
+ | Acceptance 2, including all configured gates | 116.3 s | 81.8 s |
16
+ | Reopen accepted preview after acceptance 1 | 14.3 s | 8.0 s |
17
+ | Reopen accepted preview after acceptance 2 | 14.0 s | 7.4 s |
18
+ | Complete two-cycle workflow | 355.7 s | 270.3 s |
19
+
20
+ Peak proportional memory fell by 43%; the complete workload took 24% less time.
21
+ These are local observations from this workload, not a latency or memory limit
22
+ for every design system. Two cycles demonstrate substantially lower retention;
23
+ they do not establish the absence of every long-session leak.
24
+
25
+ ## Workload and controls
26
+
27
+ Each cycle creates a Popover owner draft, adds a comment to its owned fixture,
28
+ opens the actual draft App, accepts the reviewed revision, reopens the accepted
29
+ App, and observes a two-second idle window. This exercises source revision
30
+ changes without changing the rendered UI. The full catalog contains 151
31
+ scenarios. Both cycles passed all nine acceptance gates and the selected
32
+ registered Popover behavior check, with zero diagnostics or warnings.
33
+
34
+ Both versions run the project's architecture checks, registered Oxlint rules,
35
+ `lint:ds`, typecheck, native app build/audit, frontend tests, application browser
36
+ tests and the affected registered behavior checks. The candidate configuration
37
+ removes `build:mcp-previews` from `mutationChecks`; ADS performs that complete
38
+ production preview build itself and shares its host/graph with verification.
39
+ The adapter's validation callback still runs. No configured check was bypassed.
40
+
41
+ Node v24.13.0 and Bun 1.3.13 were used. Both comparison runs had an 8 GiB systemd
42
+ scope limit, no additional swap, one Playwright worker in each Gidi runner, and
43
+ `NODE_OPTIONS=--max-old-space-size=1536`. Bun's `--smol` flag was not used. PSS and
44
+ RSS were sampled from `/proc` every approximately 200 ms across the MCP process,
45
+ compiler, validators, browser and descendants. Idle values are medians over the
46
+ two-second windows. The main-process measurement includes the same benchmark
47
+ driver in both runs. Filesystem caches were not forcibly cleared.
48
+
49
+ The frozen source contains 865 files. Its SHA-256 inventory identity is
50
+ `b1c4de874e303f6c8a1eb976f5014fcb2589b773cc62fb9b08db8e21d99c0094`.
51
+ The 286-file baseline distribution identity is
52
+ `2f6f81127d585941c70b1bfd2829fdb19b9c89ba4719df08a2d8207d4f11c3e8`.
53
+ Local raw results are `output/memory-benchmark/baseline-5-metrics.json`,
54
+ `candidate-6-metrics.json`, `final-comparison.json` and `identities.json`.
55
+
56
+ ## Findings and changes
57
+
58
+ Accepted and draft compilers previously remained warm during isolated candidate
59
+ validation. The main MCP process also performed candidate architecture analysis
60
+ and retained semantic program state. Acceptance now parks preview compilers
61
+ while keeping their published resources readable. Analysis uses a short-lived
62
+ owned process; idle semantic workers retire after five seconds. Compilers resume
63
+ lazily and preserve the publication session. Current accepted previews remain
64
+ readable; requests requiring a new verified build wait or cancel.
65
+
66
+ Production compilation now happens once in the candidate's managed compiler.
67
+ The same checked graph serves its registered browser verification. Development
68
+ output cannot satisfy a production-build check. Candidate source, outputs and
69
+ reviewed draft revisions retain their existing publication fences.
70
+
71
+ The initial lifecycle change roughly halved memory but made accepted-preview
72
+ reopening slower. A real Gidi probe explained the remaining rebuild: its full
73
+ cache was 10,003,007 bytes, above the reader's 8,388,608-byte limit. It repeated
74
+ the same 520 dependency hashes separately for 151 scenarios. Small fixtures
75
+ had not exposed this size boundary.
76
+
77
+ The cache now stores shared dependency sets once and checks shared hashes once
78
+ per operation. Gidi's complete cache is 252,861 bytes, with 151 entries and one
79
+ dependency set. Metadata transfers with matching accepted source so parked
80
+ compiler restarts can reuse it. Compiler fingerprints use the same declared
81
+ configuration and opaque-input boundary as guarded copies, with canonical
82
+ ordering under Node and Bun. Unrelated local MCP launcher JSON is not a compiler
83
+ input. Hash memos do not survive an operation or hide later edits.
84
+
85
+ Validation subprocesses also have ownership guards. On Linux these retain
86
+ descendant identities so detached browser web servers are cleaned up after a
87
+ launcher exits or its owner is forcibly killed. A timed-out calibration exposed
88
+ one such orphan in the old pipeline; the owned calibration processes were
89
+ removed.
90
+
91
+ ## Reproduction
92
+
93
+ Use Linux, Node, Bun, Chrome and a Gidi checkout with its dependencies installed.
94
+ Build ADS first. Preparing a series freezes source and the installed baseline
95
+ distribution under `output/memory-benchmark`; use a fresh `ADS_BENCH_OUTPUT`
96
+ directory for a new source/dependency baseline. Preparation changes only the
97
+ generated copies. It gives the application tests port 43087 and adjusts the
98
+ candidate's mutation-check list for managed production compilation.
99
+
100
+ ```sh
101
+ node scripts/build-ads-tool.mjs
102
+ node scripts/benchmarks/gidi-preview-memory/prepare.mjs /path/to/gidi baseline 1
103
+ node scripts/benchmarks/gidi-preview-memory/prepare.mjs /path/to/gidi candidate 1
104
+ ```
105
+
106
+ Run the following separately for `baseline-1` and `candidate-1`, with Node and
107
+ Bun on PATH. Do not run the two workloads simultaneously.
108
+
109
+ ```sh
110
+ systemd-run --user --scope -p MemoryMax=8G -p MemorySwapMax=0 \
111
+ timeout --kill-after=5s 900s env NODE_OPTIONS=--max-old-space-size=1536 \
112
+ node scripts/benchmarks/gidi-preview-memory/monitor.mjs \
113
+ output/memory-benchmark/baseline-1
114
+ ```
115
+
116
+ ```sh
117
+ node scripts/benchmarks/gidi-preview-memory/report.mjs \
118
+ output/memory-benchmark/baseline-1-metrics.json \
119
+ output/memory-benchmark/candidate-1-metrics.json
120
+ ```
121
+
122
+ The monitor writes checkpoints during the run so an enforced memory limit does
123
+ not erase the samples. `ADS_BENCH_CYCLES` controls repetitions. Set
124
+ `ADS_BENCH_RUNTIME_SOURCE=1` to edit runtime Popover source instead; in this
125
+ snapshot that selects 74 registered behavior checks and is a much longer
126
+ workload. All selected checks remain mandatory.
127
+
128
+ ## Final verification
129
+
130
+ `ADS_TEST_BUN=1 npm test` passed **547/547 tests**, with zero failures,
131
+ cancellations or skips, on the final source (644 seconds). Tool lint and
132
+ benchmark-helper lint passed. The suite includes oversized-cache restart reuse,
133
+ fresh dependency checks, Bun portability, production-versus-development reuse,
134
+ catalog failure/recovery, current-view reads while parked, cancellation,
135
+ configuration replacement, process ownership and read-only architecture checks.
136
+
137
+ The performance samples identify their measured runtime separately from the
138
+ final distribution in `output/memory-benchmark/identities.json`. Subsequent
139
+ recovery and read-only hardening was included in the final full suite. These
140
+ changes ship in ADS 0.3.35. Upgrade consumers before removing the standalone
141
+ preview-build script from `mcp.mutationChecks`; keep it in the normal build.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.3.34",
3
+ "version": "0.3.35",
4
4
  "type": "module",
5
5
  "description": "A design system your agent can see and shape. Your components. Your look. Your code.",
6
6
  "repository": {