@reqvire-org/ads 0.3.33 → 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.
Files changed (67) hide show
  1. package/dist/behavior-libraries.mjs +93 -0
  2. package/dist/behaviors.mjs +0 -6
  3. package/dist/bootstrap-ds/ds.config.json +1 -0
  4. package/dist/capture.mjs +3 -3
  5. package/dist/check-runner.mjs +7 -0
  6. package/dist/check.mjs +2 -0
  7. package/dist/config.mjs +4 -0
  8. package/dist/lint-config.mjs +7 -0
  9. package/dist/mcp/build-status.mjs +1 -1
  10. package/dist/mcp/catalog.mjs +4 -2
  11. package/dist/mcp/draft-discovery.mjs +55 -0
  12. package/dist/mcp/drafts.mjs +135 -16
  13. package/dist/mcp/mutations.mjs +16 -8
  14. package/dist/mcp/preview-owner-guard.mjs +36 -1
  15. package/dist/mcp/preview-watch.mjs +100 -14
  16. package/dist/mcp/preview-widget.bundle.js +14 -14
  17. package/dist/mcp/preview-work.mjs +41 -0
  18. package/dist/mcp/server.mjs +131 -36
  19. package/dist/preview-builder.mjs +1 -0
  20. package/dist/scenario-inspector.mjs +16 -10
  21. package/dist/scenario-program.mjs +36 -0
  22. package/dist/scenario-registry.mjs +106 -0
  23. package/dist/scenarios-compiler.mjs +154 -43
  24. package/dist/scenarios.mjs +2 -1
  25. package/dist/showcase/client.bundle.js +39 -39
  26. package/dist/showcase/comparison.js +29 -5
  27. package/dist/showcase/draft-navigation.js +41 -0
  28. package/dist/showcase/index.html +1 -2
  29. package/dist/showcase/preview-state.js +19 -0
  30. package/dist/showcase/style.css +2 -2
  31. package/dist/skills/ads-break-ui/references/behaviors.md +10 -0
  32. package/dist/skills/ads-break-ui/references/drafts.md +43 -4
  33. package/dist/skills/ads-break-ui/references/runtimes.md +9 -0
  34. package/dist/skills/ads-break-ui/references/validation.md +6 -0
  35. package/dist/skills/ads-designer/SKILL.md +7 -0
  36. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -0
  37. package/dist/skills/ads-designer/references/behaviors.md +10 -0
  38. package/dist/skills/ads-designer/references/drafts.md +43 -4
  39. package/dist/skills/ads-designer/references/runtimes.md +9 -0
  40. package/dist/skills/ads-designer/references/validation.md +6 -0
  41. package/dist/skills/ads-import/SKILL.md +4 -0
  42. package/dist/skills/ads-import/references/behaviors.md +10 -0
  43. package/dist/skills/ads-import/references/drafts.md +43 -4
  44. package/dist/skills/ads-import/references/runtimes.md +9 -0
  45. package/dist/skills/ads-import/references/validation.md +6 -0
  46. package/dist/skills/ads-motion/references/behaviors.md +10 -0
  47. package/dist/skills/ads-motion/references/drafts.md +43 -4
  48. package/dist/skills/ads-motion/references/runtimes.md +9 -0
  49. package/dist/skills/ads-motion/references/validation.md +6 -0
  50. package/dist/skills/ads-port/SKILL.md +8 -1
  51. package/dist/skills/ads-port/references/behaviors.md +10 -0
  52. package/dist/skills/ads-port/references/drafts.md +43 -4
  53. package/dist/skills/ads-port/references/native-implementation.md +14 -1
  54. package/dist/skills/ads-port/references/runtimes.md +9 -0
  55. package/dist/skills/ads-port/references/validation.md +6 -0
  56. package/dist/unit-contracts.mjs +2 -2
  57. package/dist/units.mjs +6 -0
  58. package/dist/validation-checks.mjs +23 -3
  59. package/dist/validation.mjs +19 -10
  60. package/dist/verification/browser.d.mts +27 -0
  61. package/dist/verification.mjs +8 -4
  62. package/docs/ARCHITECTURE.md +110 -0
  63. package/docs/CHANGELOG.md +114 -0
  64. package/docs/GUIDE.md +34 -5
  65. package/docs/MCP.md +54 -9
  66. package/docs/benchmarks/gidi-preview-memory.md +141 -0
  67. package/package.json +6 -4
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,119 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.35
4
+
5
+ <!-- ads-local-tests:start -->
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
+
10
+ <!-- ads-local-test-proof
11
+ {
12
+ "schema": 1,
13
+ "version": "0.3.35",
14
+ "commit": "14232101493c8f611618719dd2bd57a069badff5",
15
+ "sourceSha256": "0e0f6179dfe7ad04c25c867b272a7d2492861417b86d254536e17a5afe310067",
16
+ "command": "ADS_TEST_BUN=1 npm test",
17
+ "result": "pass",
18
+ "tests": 547,
19
+ "pass": 547,
20
+ "fail": 0,
21
+ "cancelled": 0,
22
+ "skipped": 0,
23
+ "node": "v24.13.0",
24
+ "bun": "1.3.13",
25
+ "completedAt": "2026-10-23T06:56:19.558Z",
26
+ "durationMs": 683838,
27
+ "logSha256": "dbc6345c462b7b7345b914b93f5516361842c792cd0759a40b6688332696f3e5"
28
+ }
29
+ -->
30
+ <!-- ads-local-tests:end -->
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
+
54
+ - Ship typed browser verification helpers so strict project typechecks retain
55
+ Playwright's DOM callback inference. Recognize explicitly configured nested
56
+ Vite/Playwright build files as tooling rather than ADS runtime imports.
57
+
58
+ - Batch selected verification scenario roots into one watched graph before parallel
59
+ browser startup. Keep graph handovers pending until a coherent current build
60
+ mounts, preserving selection fencing and avoiding transient startup failures.
61
+ Keep first-visit resources lazy; background peer prefetch follows later edits.
62
+
63
+ - Add `behaviorLibraries`, an explicit project allowlist for installed runtime
64
+ dependencies and subpaths. Enforce it across production ADS source, retaining
65
+ type-only/development and controller skin/framework rules. Require package.json
66
+ dependencies and installation, with actionable lint-config migration messages.
67
+ This is project approval; ADS does not audit third-party source/dependency trees.
68
+ - Report allowed package versions and direct/local-controller usage in MCP status
69
+ and catalog. Preserve existing styling/geometry boundaries and normal sandboxed
70
+ preview bundling. Update design, port and import guidance and the empty starter.
71
+
72
+ - Require a committed local verification stamp in this changelog before release.
73
+ CI verifies its tested commit and source digest instead of repeating the heavy
74
+ browser/package suite. Run the complete suite serially with Bun coverage locally.
75
+
76
+ - Fence cache recording before and after dependency hashing against the compiled
77
+ source revision. An edit during publication cannot make previous output reusable
78
+ for new source. Cover the race with a deterministic regression test.
79
+ - Adopt current checked graph metadata during accepted-edit handover, avoiding a
80
+ second compilation when the watcher still holds previous scenario titles.
81
+ Preserve the full catalogue when reusing partial watched graphs.
82
+ - Allow three minutes for the complete browser workflow with twenty continued
83
+ edits, captures and four dependency acceptances, retaining all assertions and
84
+ reporting each acceptance duration.
85
+
86
+ - Remove synchronous semantic discovery from known draft preview refreshes.
87
+ Refresh metadata in a persistent worker, coalesce revisions and discard stale
88
+ results; discover new identities before selecting them and retain exact-revision
89
+ acceptance checks. Report metadata freshness separately from rendered builds.
90
+ - Show monochrome preview-state glyphs in Explorer entries. Expose draft build
91
+ states in MCP summaries and the parent build resource, with completion/failure
92
+ resource notifications so existing views update without another source edit.
93
+ List active scoped draft build resources and support filtered subscriptions,
94
+ removal invalidation, unsubscribe and reconnect across both MCP protocol eras.
95
+ Serialize overlapping refreshes and detach closed shared observers.
96
+ - Keep stateless HTTP edits on the shared observer instead of treating each new
97
+ request as a source change. Preserve accepted discovery/catalogue caches for
98
+ draft-only edits and reuse revision-fenced metadata for capture updates.
99
+ - Automatically restart only the affected comparison App at its module-revision
100
+ limit, keeping the other version mounted during long draft editing sessions.
101
+ - Refresh draft overlays through file events and immediate MCP edit notifications;
102
+ retain periodic reconciliation for missed events. Queue compiler prewarming
103
+ during creation, coalescing bursts and sharing startup with explicit previews.
104
+ - Reuse TypeScript source trees across preview revisions while refreshing module
105
+ resolution. Compile requested scenario roots in watched graphs; preserve other
106
+ mounted roots and keep full builds/validation complete.
107
+ - Reuse revision-keyed scenario discovery across draft previews, MCP hosts and
108
+ compiler workers. Keep source/tool invalidation and independent validation;
109
+ missing or corrupt generated registry snapshots fall back to fresh discovery.
110
+ Fence explicit catalogue reads against source rather than waiting for polling.
111
+ - Move Explorer draft comparison into ordinary catalogue selection. Enable the
112
+ Split view button for accepted entries with drafts, show new draft owners in
113
+ their normal sections, and remove the separate Drafts tab and scenario picker.
114
+ - Keep owner badges distinct from unchanged overlay review contexts and preserve
115
+ scenario ownership/group metadata when discovering draft-only previews.
116
+
3
117
  ## 0.3.33
4
118
 
5
119
  - Add auto-mode tracked drafts with persistent manifests and terminal `.ads`
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
 
@@ -866,10 +870,10 @@ Published npm versions cannot be replaced, even by moving or recreating a Git
866
870
  tag; see [npm publishing rules](https://docs.npmjs.com/cli/v11/commands/npm-publish/).
867
871
 
868
872
  Update `package.json` and its lockfile with
869
- `npm version <new-version> --no-git-tag-version --ignore-scripts`, commit and push
870
- those files, then push the matching `v<new-version>` tag. `release.yml` checks
871
- version availability, tests packed npm/Bun installs, publishes the package and
872
- creates the GitHub release. Stable tags publish as `latest`; prerelease tags
873
+ `npm version <new-version> --no-git-tag-version --ignore-scripts`. Follow the
874
+ [local verification and changelog stamp workflow](#releasing-the-ads-tool), then
875
+ push the matching `v<new-version>` tag. `release.yml` checks version availability
876
+ and the committed local proof, packs, publishes and creates the GitHub release. Stable tags publish as `latest`; prerelease tags
873
877
  publish as `next`. Check the workflow result and npm version before updating
874
878
  consumer dependencies. The manual workflow moves a label to an existing
875
879
  published version; it does not publish new source.
@@ -898,3 +902,28 @@ all themes; inspect `literals`/`diagnostics` for raw values, cycles and limits.
898
902
  Choose exact targets/origins and documented geometry exceptions in project code;
899
903
  register the command in `mcp.mutationChecks` and the normal build. ADS owns no
900
904
  universal spacing scale and infers no design meaning from token names.
905
+
906
+ ## Releasing the ADS tool
907
+
908
+ Run the complete tool, browser and packed npm/Bun suite locally before tagging.
909
+ Commit the implementation, documentation and package version first, then run
910
+ `npm run release:verify` with Node, Bun and Chrome available. Tests run serially;
911
+ use an OS memory limit when exercising the full browser/compiler suite. The
912
+ runner forces `ADS_TEST_BUN=1`, rejects failed, cancelled or skipped tests, and
913
+ refuses uncommitted inputs or source changes during the run.
914
+
915
+ A successful run writes a generated verification stamp under the matching
916
+ version in `docs/CHANGELOG.md`. It records the tested implementation commit,
917
+ command, counts, runtimes, completion time, duration, source SHA-256 and log
918
+ SHA-256. The full log remains in `output/local-tests.log`. Commit that stamp
919
+ and tag the resulting commit. Do not hand-author a passing stamp.
920
+
921
+ `npm run release:proof` verifies that the tested commit is an ancestor and its
922
+ source digest matches both the release tree and working inputs. Only generated
923
+ proof blocks and the machine-specific, unpackaged `.mcp.json` launcher are
924
+ excluded from the digest; other tracked changes require another local run.
925
+ Untracked release source must be committed before testing. This is a record of
926
+ trusted local verification, not a signed attestation or a substitute for review.
927
+
928
+ Release CI checks the committed proof, builds and packs the tool, and publishes
929
+ the tagged version with its changelog entry as the release notes. It does not repeat the local browser/package suite.
package/docs/MCP.md CHANGED
@@ -13,6 +13,13 @@ preview watcher and serves the built-in browser showcase, so the client needs
13
13
  only one launch command. Source editing is disabled by default; `--mutations`
14
14
  enables guarded ADS edits. MCP does not install skills or add a production runtime.
15
15
 
16
+ `ads_status.behaviorLibraries` reports each explicitly allowed project package,
17
+ its installed version and the ADS units that use it. Catalog entries expose their
18
+ `behaviorLibraries`, following local helpers and controllers. This allowlist
19
+ permits imports; it does not load packages or audit third-party dependencies.
20
+ Used code is bundled by the project's normal preview compiler into the resources
21
+ read by the sandboxed MCP App. Existing style and geometry boundaries still apply.
22
+
16
23
  Websites and product MCP Apps reuse the project's public design-system UI. The
17
24
  consuming application owns data, actions, mounting, MCP communication and serving.
18
25
  The ADS MCP server supports development, inspection and review of that UI. Its
@@ -57,15 +64,48 @@ being imported into application source. Normal imports of marked draft source,
57
64
  including aliases/symlinks, fail guards; use the isolated preview overlay instead.
58
65
  Install the exported `draftImportGuard()` in application Vite/Rollup builds too.
59
66
 
60
- Explorer's Drafts section and per-owner badges open proposals. Its upper-header
61
- Split view toggle compares Accepted and Draft in the right pane using separate
62
- opaque MCP Apps, the same scenario/theme and matched available/phone viewport
63
- widths. It is disabled when the scenario has no accepted counterpart. Project
67
+ Explorer keeps pending proposals in the ordinary catalogue, with Draft badges
68
+ on their owners, including new owners without an accepted version. Selecting an
69
+ entry with a draft enables the upper-header Split view toggle to compare Accepted
70
+ and Draft in the right pane using separate opaque MCP Apps, the same scenario/theme
71
+ and matched available/phone viewport widths. New-only entries show their draft
72
+ and disable comparison. Unchanged scenarios available as explicit overlay review
73
+ contexts do not acquire owner badges. There is no separate Drafts tab or scenario
74
+ picker; `ads_drafts` provides draft-only MCP listing. Project
64
75
  code remains inside the existing sandbox; no additional iframe origin is allowed.
65
76
  Draft resource reads are explicitly scoped through `ads://drafts/<id>/resource`.
66
77
  `ads://project/drafts` supports resource subscriptions; tool outcomes and persisted
67
78
  events/status are the fallback when a host does not deliver notifications.
68
79
 
80
+ For an existing preview, `ads_show_draft` reuses known scenario metadata while a
81
+ worker refreshes discovery. Its `discovery.state` is `current`, `pending` or
82
+ `error`; `discovery.revision` identifies the metadata snapshot, separately from
83
+ the returned exact proposal `revision`. New/missing identities await discovery.
84
+ The previous view may remain visible until the new compilation is available.
85
+ Acceptance always runs its fresh checks against the exact reviewed revision.
86
+ After 20 retained module revisions, Explorer automatically restarts the affected
87
+ App to release its module cache. Draft comparison preserves the other version's
88
+ mounted state and the selected scenario/theme/viewport.
89
+
90
+ Build state is separate from the Draft badge. Explorer entry glyphs show not
91
+ built, building, compiled/checking, ready, stale and failed using monochrome
92
+ shapes with accessible descriptions. Relevant MCP results expose `build` or
93
+ `preview` with `state`, `building`, `current`, `stale`, scenario/revision data and
94
+ a build-resource address. `ads://project/build` includes active `drafts`; each
95
+ draft's `preview.resourceUri` addresses its complete isolated build report.
96
+ Subscribe to `ads://project/build`, `ads://project/drafts`, or an active draft's
97
+ `preview.resourceUri` (also listed by `resources/list`): standard
98
+ `notifications/resources/updated` signals progress, completion, failure and
99
+ metadata refresh without another edit. Re-read the resource after a notification;
100
+ hosts without notifications can poll it. A scoped subscription receives only that
101
+ draft's build changes, including a final invalidation when its session is removed.
102
+ Unsubscribe when leaving the view; subscribe again and read current status after
103
+ reconnecting. Modern clients use `subscriptions/listen` resource filters; older
104
+ clients use `resources/subscribe` and `resources/unsubscribe`. Notifications
105
+ invalidate data; they do not carry the build report. Ready means compilation and
106
+ its checks completed; the mounted App separately reports when rendering is ready.
107
+ A ready draft remains unaccepted.
108
+
69
109
  Agents must finish coherent design changes by accepting required drafts. A
70
110
  preview-only proposal is unfinished unless the user asked to retain it. Failed
71
111
  checks require repair or an explicit unfinished-blocker report, never bypassing
@@ -631,15 +671,20 @@ requires correcting its owner/policy, never a direct-write bypass.
631
671
  Set `dryRun` to `false` to apply. ADS reconstructs complete candidate files locally
632
672
  and validates a temporary project copy with core guards and registered Oxlint
633
673
  rules, including warnings. By default it also runs available `lint:project`
634
- (or `lint`), `typecheck` and `build:mcp-previews` scripts. Override only that
635
- 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:
636
681
 
637
682
  ```json
638
- { "mcp": { "mutationChecks": ["lint", "typecheck", "build:mcp-previews"], "mutationCheckTimeoutMs": 120000 } }
683
+ { "mcp": { "mutationChecks": ["lint", "typecheck"], "mutationCheckTimeoutMs": 120000 } }
639
684
  ```
640
685
 
641
- Every listed script must exist. An empty list still runs mandatory ADS and Oxlint
642
- 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
643
688
  shared with the validation copy. These are trusted project commands, not an OS
644
689
  sandbox. An explicit `configuration` patch can change project commands, registered
645
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.33",
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": {
@@ -37,18 +37,20 @@
37
37
  "sync:skill-references": "node scripts/sync-skill-references.mjs",
38
38
  "check:skill-references": "node scripts/sync-skill-references.mjs --check",
39
39
  "lint": "npm run lint:tool",
40
- "lint:tool": "npm run check:skill-starter && npm run check:skill-references && oxlint --deny-warnings src preview-client showcase-client mcp-explorer tests/*.test.mjs tests/helpers scripts/build-ads-tool.mjs scripts/pack-ads-tool.mjs scripts/sync-skill-references.mjs",
40
+ "lint:tool": "npm run check:skill-starter && npm run check:skill-references && oxlint --deny-warnings src preview-client showcase-client mcp-explorer tests/*.test.mjs tests/helpers scripts/build-ads-tool.mjs scripts/pack-ads-tool.mjs scripts/sync-skill-references.mjs scripts/local-test-proof.mjs",
41
41
  "lint:project": "npm run lint:ds && npm run lint:style && npm run check:skill-starter",
42
42
  "lint:ds": "node dist/cli.mjs lint-config && node dist/cli.mjs check && oxlint --deny-warnings --config .ds/oxlintrc.json src design-system",
43
43
  "lint:style": "biome lint --config-path=biome.css.json .",
44
44
  "preview": "node dist/cli.mjs showcase",
45
45
  "preview:showcase": "node dist/cli.mjs showcase",
46
46
  "typecheck": "tsc --noEmit",
47
- "test": "npm run build && node --test --test-concurrency=2 tests/*.test.mjs",
47
+ "test": "npm run build && node --test --test-reporter=tap --test-concurrency=1 tests/*.test.mjs",
48
48
  "test:tool": "npm test",
49
49
  "pack:tool": "node scripts/pack-ads-tool.mjs",
50
50
  "ads": "node dist/cli.mjs",
51
- "prepack": "npm run build"
51
+ "prepack": "npm run build",
52
+ "release:verify": "node scripts/local-test-proof.mjs",
53
+ "release:proof": "node scripts/local-test-proof.mjs --check"
52
54
  },
53
55
  "dependencies": {
54
56
  "@modelcontextprotocol/server": "2.3.1",