@reqvire-org/ads 0.4.3 → 0.4.5

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 (60) hide show
  1. package/README.md +12 -9
  2. package/dist/bun-compiler.mjs +6 -5
  3. package/dist/check.mjs +3 -43
  4. package/dist/cli.mjs +1 -1
  5. package/dist/contrast-composition.mjs +6 -60
  6. package/dist/contrast-styles.mjs +88 -0
  7. package/dist/mcp/apps.mjs +7 -1
  8. package/dist/mcp/build-status.mjs +8 -3
  9. package/dist/mcp/drafts.mjs +13 -1
  10. package/dist/mcp/preview-http.bundle.js +7 -0
  11. package/dist/mcp/preview-http.mjs +148 -0
  12. package/dist/mcp/preview-widget.bundle.js +47 -47
  13. package/dist/mcp/resource-loader.js +1 -201
  14. package/dist/mcp/sandbox-host.mjs +6 -1
  15. package/dist/mcp/server.mjs +35 -4
  16. package/dist/mcp/showcase-host.mjs +55 -5
  17. package/dist/mcp/showcase-http.mjs +66 -0
  18. package/dist/preview-bun.mjs +75 -60
  19. package/dist/preview-incremental.mjs +358 -0
  20. package/dist/preview-manifest-update.mjs +70 -0
  21. package/dist/preview-resources.mjs +33 -1
  22. package/dist/render-composition.mjs +27 -5
  23. package/dist/scenarios-compiler.mjs +19 -1
  24. package/dist/showcase/client.bundle.js +54 -54
  25. package/dist/showcase/comparison.js +15 -12
  26. package/dist/showcase/connection.js +10 -0
  27. package/dist/showcase/http-client.bundle.js +9 -0
  28. package/dist/showcase/http-connection.js +86 -0
  29. package/dist/showcase/http-preview.js +81 -0
  30. package/dist/showcase-http-routes.mjs +31 -0
  31. package/dist/skills/README.md +3 -3
  32. package/dist/skills/ads-designer/SKILL.md +5 -1
  33. package/dist/skills/ads-designer/references/accessibility.md +6 -2
  34. package/dist/skills/ads-designer/references/captures.md +1 -1
  35. package/dist/skills/ads-designer/references/runtimes.md +31 -0
  36. package/dist/skills/ads-designer/references/workflows.md +16 -0
  37. package/dist/skills/ads-import/references/captures.md +1 -1
  38. package/dist/skills/ads-import/references/runtimes.md +31 -0
  39. package/dist/skills/ads-import/references/workflows.md +16 -0
  40. package/dist/skills/ads-migrate/SKILL.md +3 -1
  41. package/dist/skills/ads-migrate/references/0.4.1-to-0.4.2.md +2 -3
  42. package/dist/skills/ads-migrate/references/0.4.3-to-0.4.4.md +89 -0
  43. package/dist/skills/ads-migrate/references/0.4.4-to-0.4.5.md +72 -0
  44. package/dist/skills/ads-port/references/captures.md +1 -1
  45. package/dist/skills/ads-port/references/runtimes.md +31 -0
  46. package/dist/skills/ads-port/references/workflows.md +16 -0
  47. package/dist/style-token-rules.mjs +51 -0
  48. package/dist/verification/browser.mjs +2 -2
  49. package/docs/ADS.md +9 -7
  50. package/docs/ARCHITECTURE.md +109 -48
  51. package/docs/CACHING.md +40 -1
  52. package/docs/CHANGELOG.md +100 -22
  53. package/docs/GUIDE.md +37 -10
  54. package/docs/HTTP-SHOWCASE-POC.md +397 -0
  55. package/docs/MCP.md +104 -25
  56. package/docs/benchmarks/README.md +1 -1
  57. package/docs/benchmarks/http-showcase-optimized.json +1879 -0
  58. package/docs/benchmarks/http-showcase-profile.json +308 -0
  59. package/docs/benchmarks/http-showcase.json +3069 -0
  60. package/package.json +6 -4
@@ -8,7 +8,7 @@ patterns, token values, and branding.
8
8
  ADS manages project-owned UI for websites and MCP Apps. Both use the same public
9
9
  components, patterns, controllers, tokens and styles. The consuming application
10
10
  supplies data, actions, mounting and integration, including serving its MCP Apps.
11
- The ADS showcase renders those real implementations inside MCP Apps; its previews
11
+ The ADS showcase renders those real implementations in isolated HTTP frames; its previews
12
12
  and registered checks provide evidence for the exercised states and conditions.
13
13
  Normal application checks verify website integration.
14
14
 
@@ -104,6 +104,11 @@ render facts. It does not execute project code or open another compiler. The con
104
104
  adapter consumes the CSS trees already parsed by the check, resolves ancestor backdrops
105
105
  and caches identical token-pair calculations within the check. It reports incomplete
106
106
  cascade/branch evidence explicitly; browser axe audits retain dynamic rendering coverage.
107
+ Class choices stay factored in the immutable render graph. The contrast adapter compares
108
+ all alternatives' paint facts without enumerating their Cartesian product; layout-only
109
+ choices can retain a known ancestor backdrop. Captured selector targets distinguish inert
110
+ class hooks from possible paint overrides. Native type queries identify string/number
111
+ text slots without treating arbitrary React/Preact children as plain text.
107
112
  Optional inputs and immediate directory membership use `optionalSourceText` and
108
113
  `sourceDirectoryFiles`; both observe the captured revision, including absence.
109
114
  `sourceCss` shares read-only PostCSS trees across requests on the same captured revision; transforms clone
@@ -455,11 +460,11 @@ visual scenario. Static registration is separate from current passing evidence.
455
460
 
456
461
  Manifests, checks, scenarios and fixtures are development inputs; production
457
462
  imports only actual components/controllers and their styles. Browser checks can
458
- exercise the real MCP App. React development StrictMode uses a project development
463
+ exercise the real isolated preview. React development StrictMode uses a project development
459
464
  harness, since production previews do not replay those effects. The
460
465
  [behavior contract](BEHAVIORS.md) defines profiles, execution and evidence freshness.
461
466
 
462
- The normal compiled import graph delivers controller dependencies through MCP
467
+ The normal compiled import graph delivers controller dependencies through HTTP or MCP
463
468
  resources. There is no eager global controller registry. ESM splitting and selected
464
469
  asset loading remain in place; tree shaking depends on actual imports, exports and
465
470
  side effects, rather than the controller directory name.
@@ -504,27 +509,33 @@ resolve to normal accepted source after promotion.
504
509
  The [draft guide](../skills/ads-designer/references/drafts.md) defines lifecycle,
505
510
  completion requirements, build integration and recovery.
506
511
 
507
- Humans and coding agents inspect the same project through MCP. The showcase is
508
- **a minimal shell plus an MCP client and Apps host**, shipped as development
509
- tooling. Its header, section tabs (Brand, shown first when the project previews its
510
- artwork, then Tokens, Icons when the project has a glyph set, Components, Patterns and
511
- Composition), collapsible left menu,
512
- grid overlay and theme switches and preview area stay neutral. Through the App's host
513
- context, the grid inspector highlights actual computed grid tracks inside the rendered
514
- widgets, following each container's padding, gaps, size and scroll position. The client discovers entries, invokes tools, forwards App
515
- resource requests and subscribes to changes. It contains no project UI catalogue
516
- or implementation imports.
517
-
518
- The server supplies catalogues, the token and brand views it builds, source guides, preview Apps,
519
- build status and diagnostics. Agents connect over stdio; the browser uses a
520
- loopback HTTP MCP endpoint in the same runtime. Both share ADS's managed Bun
521
- preview compiler. Starting MCP starts the website; a browser-only command starts the same
522
- runtime without stdio. Shutdown closes the website, connections and compiler.
523
- Local and external compatible hosts load the same reusable preview App. The
524
- browser host uses a separate-origin sandbox proxy around its opaque App iframe.
525
- Project JavaScript, styles, fonts and UI run only inside that App; the outer
526
- shell forwards resource bytes without applying project styles or executing its
527
- runtime. This keeps the host neutral while compositions retain their full skin.
512
+ Humans and coding agents inspect the same project through one ADS runtime.
513
+ The local showcase is a minimal HTTP shell. It discovers navigation and scoped
514
+ preview actions through a narrow JSON adapter over the same services used by
515
+ MCP. Agents and external MCP Apps retain MCP tools/resources; the HTTP browser
516
+ bundle contains no MCP SDK or JSON-RPC implementation. The shell has no project
517
+ implementation imports and does not execute project code.
518
+
519
+ The local preview is one persistent opaque iframe on a separate loopback origin,
520
+ without the extra MCP Apps proxy frame. Checked manifests use bounded revision
521
+ reuse/deltas; immutable asset URLs refer to pinned, authorized graph bytes, never
522
+ filesystem paths. Ordinary modules, CSS, fonts and images load over HTTP. Worker
523
+ scripts and modules referring to them use verified Blob URLs because the opaque
524
+ sandbox cannot directly create workers from another origin. External MCP Apps
525
+ continue to use the existing resource adapter and sandbox proxy.
526
+
527
+ HTTP build reports arrive over SSE. Connect/reconnect and visibility resume
528
+ reconcile discovery and scoped build state; there is no periodic HTTP status
529
+ poll. Interrupted connections mark retained previews potentially stale. Frame
530
+ capabilities have a separate lifetime connection, a bounded reconnect grace,
531
+ and immediate retirement on explicit close, scope removal or shutdown. The
532
+ [HTTP design and measurements](HTTP-SHOWCASE-POC.md) record limits and historical
533
+ comparisons. Captures and verification use the default local HTTP host while
534
+ preserving exact viewport, revision, readiness and publication gates.
535
+
536
+ Starting MCP starts the website; browser-only showcase starts the same runtime
537
+ without stdio. All modes share the managed Bun compiler. Shutdown closes the
538
+ website, streams, frame capabilities, connections and compiler.
528
539
 
529
540
  The ADS host gives inline App documents an `about:srcdoc` base when the App
530
541
  provides no explicit base URL. Fragment links then stay inside their own document
@@ -541,8 +552,8 @@ handlers. Hosts outside ADS choose their own sandbox and CSP permissions.
541
552
 
542
553
  ADS's Bun preview compiler publishes a versioned dependency graph: shared runtime and
543
554
  foundation assets, plus independently addressable scenario modules. Inside the
544
- App, a resource loader obtains the selected dependency closure through MCP,
545
- verifies its content and mounts it using the project's framework adapter. Native
555
+ preview, the selected dependency closure loads from checked HTTP assets or
556
+ verified MCP resources and mounts it using the project's framework adapter. Native
546
557
  ES modules preserve shared runtime identity, cycles and live bindings. Switching
547
558
  scenarios unmounts the previous view while keeping unchanged dependencies cached.
548
559
  Persistence is a host lifecycle choice; a new external widget loads the same
@@ -556,7 +567,7 @@ their IDs and caches. The App still verifies the digest of the final bytes and
556
567
  rejects any identity collision without partially registering the new graph.
557
568
 
558
569
  The showcase's resource bridge can recover a transient fetch failure with at most
559
- three read attempts and bounded backoff. This applies only to `resources/read`;
570
+ three read attempts and bounded backoff. This applies only to resource reads;
560
571
  tool calls, assertions and whole checks are never replayed. Cancellation,
561
572
  HTTP/protocol/content errors and integrity failures remain failures. Browser
562
573
  diagnostics record retries, and verification retains recovered startup reads in
@@ -573,10 +584,11 @@ Ordinary shutdown removes owned session output while retaining that cache.
573
584
 
574
585
  ```mermaid
575
586
  flowchart LR
576
- Host[Minimal host: navigation and MCP client] --> Proxy[Separate-origin sandbox proxy]
577
- Proxy --> App[Opaque App: loader and project preview]
578
- App -->|resource reads via bridge| MCP[ADS MCP server]
579
- MCP --> Graph[Compiled graph: runtime, CSS, fonts, scenarios]
587
+ Host[Local HTTP showcase] --> Frame[Persistent opaque preview]
588
+ Frame -->|checked asset URLs| HTTP[Scoped HTTP delivery]
589
+ External[External MCP App] -->|resource reads| MCP[MCP adapter]
590
+ HTTP --> Graph[Shared checked graph]
591
+ MCP --> Graph
580
592
  ```
581
593
 
582
594
  The shell belongs to tooling. Components, patterns, design values, scenario inputs
@@ -677,14 +689,55 @@ no API visibility, render coverage, styling permission or runtime behavior.
677
689
 
678
690
  ### Incremental compilation and refresh
679
691
 
680
- `runScenarioCompiler` owns scheduling, validation, freshness and publication.
681
- ADS owns preview compilation with Bun, using the project's declared React or
682
- Preact framework and shared Linaria extraction. The application keeps its own
683
- production bundler. A single scheduler warms views sequentially with foreground
684
- priority, retains compiled output, and reuses per-file transforms and worker
685
- bundles. Native ADS gates run directly; project lint/build/test commands remain
686
- explicit integration checks. Explorer navigation and metadata are served
687
- independently of compilation and validation.
692
+ `runScenarioCompiler` remains the single scheduler for live feedback, source
693
+ validation, discovery, freshness and verified publication. Watched previews use
694
+ `createIncrementalPreviewBuilder`: a private Vite module graph with the same ADS
695
+ Linaria extraction, import optimization, spatial metadata and source identities
696
+ as complete builds. React Refresh and native Prefresh supply component signatures
697
+ and replacement. This is preview compilation, not a second analysis engine.
698
+ Unwatched builds and acceptance preparation retain the complete Bun builder.
699
+ The application retains its own production bundler.
700
+
701
+ Vite runs in middleware mode without a listening server, filesystem routes or
702
+ browser websocket. The builder snapshots transformed modules, CSS, local assets,
703
+ literal lazy imports and self-contained Bun worker output into the existing
704
+ immutable `ads://assets/…` graph. Module reads never compile live filesystem
705
+ contents. The existing scheduler fences the source revision before publishing;
706
+ project and draft roots own separate compiler sessions. The shared analysis
707
+ service continues to supply discovery and checking.
708
+
709
+ Watched manifests add optional `refresh: {version: 1, epoch}` and module metadata
710
+ `hot: {id, source}`. The ID is stable within that compiler session; `source` hashes
711
+ the lowered module before immutable dependency URI rewriting. This lets the
712
+ loader distinguish changed code from a changed dependency address. A bounded
713
+ rewrite cache avoids reparsing unchanged compiler output while still observing
714
+ output membership and worker content changes.
715
+
716
+ The existing sandboxed iframe remains alive for compatible updates. Its resource
717
+ loader evaluates changed framework boundaries, updates styles, and preserves
718
+ component state, input values, focus and selection where the framework permits.
719
+ It tracks already executed lazy modules and visited views too; unopened lazy
720
+ branches remain unloaded. Navigation still mounts the selected scenario normally.
721
+ Changed hook signatures follow the framework's reset semantics. Removed or
722
+ incompatible exports, compiler/configuration epoch changes, interrupted refresh,
723
+ and restoration of an already evaluated old revision require a clean frame.
724
+ A failed source check restores the last verified output and remains a failure;
725
+ state retention is never a substitute for validation or acceptance.
726
+
727
+ The internal graph is renewed when configuration/dependency manifests or the
728
+ captured original inputs of optimized dependencies change, on source-directory
729
+ membership changes that can alter resolution, or when
730
+ its retained input/module count exceeds 4096 or retained lowered source/code
731
+ exceeds 64 MiB. Browser retained module metadata is bounded at 4096 records and
732
+ materialized resource bodies at 64 MiB, with a clean-frame reopen at the next
733
+ mount. These are retention limits, not process RSS guarantees. Owned Vite,
734
+ extraction, worker and temporary-directory lifetimes end with their builder.
735
+ See [caching](CACHING.md#preview-restoration) for the content checks.
736
+
737
+ The [preview benchmark](../scripts/benchmarks/preview/README.md) records the
738
+ integrated measurement method and results. Frame removal, the V3/source-emission
739
+ proposal and HTTP delivery remain outside this release. This integration does
740
+ not claim to fix Chromium's raw corner pixels.
688
741
 
689
742
  New preview requests share one input-stamp capture per batch. After that
690
743
  asynchronous capture, scheduling reads the current candidate, publication and
@@ -693,7 +746,7 @@ lose a requested view or reuse coverage from a retired candidate.
693
746
 
694
747
  ```mermaid
695
748
  flowchart LR
696
- Edit[Source edit] --> Compile[Compile changes with Bun]
749
+ Edit[Source edit] --> Compile[Update private module graph]
697
750
  Compile --> Validate[Validate project and inspect registry in background]
698
751
  Compile --> Live[Unverified live resources]
699
752
  Live --> App[Compare selected dependency closure]
@@ -701,8 +754,8 @@ flowchart LR
701
754
  Compile --> Publish
702
755
  Publish --> App
703
756
  Validate -->|Failure| Revert[Restore last verified view]
704
- App --> Keep[Unchanged: keep mounted view]
705
- App --> Mount[Changed: remount selected view]
757
+ App --> Keep[Compatible: refresh within persistent frame]
758
+ App --> Mount[Incompatible or rollback: clean frame]
706
759
  ```
707
760
 
708
761
  Watched compilation provides immediate visual feedback while validation and
@@ -833,9 +886,10 @@ independent of background preparation, and resource integrity checks still apply
833
886
  A successful global revision does not require remounting an unchanged selected
834
887
  view. The App compares its static module/style/asset closure, retains DOM/form/
835
888
  scroll state when that closure matches, and reruns token/paint audits against the
836
- accepted manifest. A changed selected closure remounts through the project's
837
- adapter. Native ESM resources still obey digest checks and the existing bounded
838
- revision lifecycle; this is state-preserving refresh, not component-level HMR.
889
+ accepted manifest. Watched graphs refresh compatible framework boundaries when
890
+ the selected closure changes; complete bundled graphs remount through the
891
+ project's adapter. Native ESM resources still obey digest checks and the bounded
892
+ revision lifecycle described above.
839
893
  The visible preview retains its framing while replacement resources load. Kind
840
894
  and subject framing change only after a successful mount; structural padding is
841
895
  resolved before paint, including delayed framework commits. Font readiness and
@@ -908,14 +962,14 @@ semantics; choosing a framework does not install one into the tooling host.
908
962
 
909
963
  The capture unit is a registered, independently mountable scenario or one of its
910
964
  project-declared `captureTargets`. Components, patterns, compositions and token
911
- previews use the same real MCP App, fixtures and adapter as interactive review.
965
+ previews use the same real isolated frame, fixtures and adapter as interactive review.
912
966
  Shared controllers/hooks need a visible demonstration. Capture introduces no
913
967
  tool-owned component templates, styling or fixture inference.
914
968
 
915
969
  ADS owns isolated preview hosting, App readiness and an owned Playwright process;
916
970
  the receiving project supplies Playwright and its installed browser. The capture
917
- host is the existing minimal MCP client/bridge with navigation hidden, giving the
918
- sandboxed App the requested viewport. Project runtime, fonts and styles remain
971
+ host is the HTTP showcase with navigation hidden, giving the
972
+ isolated preview the requested viewport. Project runtime, fonts and styles remain
919
973
  inside the App resource graph. The image excludes showcase chrome.
920
974
 
921
975
  Captures exist only when requested. `ads_capture` replaces current and removes any
@@ -1356,3 +1410,10 @@ transformations, illustration meaning and optical quality remain outside this
1356
1410
  image guard. Assets remain shared inputs for change selection, so their edits
1357
1411
  widen verification to consuming UI. Browser measurements are not included in
1358
1412
  analysis/acceptance performance benchmarks.
1413
+
1414
+ ## HTTP showcase delivery
1415
+
1416
+ The 0.4.5 local showcase uses HTTP for discovery, status, events, preview actions
1417
+ and checked assets. Agents retain MCP against the same engine. See the
1418
+ [scope, endpoint boundary and proof history](HTTP-SHOWCASE-POC.md). The persistent
1419
+ preview iframe preserves isolation and viewport behavior.
package/docs/CACHING.md CHANGED
@@ -119,7 +119,7 @@ Only immutable archives share storage; live outputs and evidence stay isolated.
119
119
 
120
120
  ## Preview restoration
121
121
 
122
- The interactive Bun compiler keeps its incremental module/graph cache. Turbo is
122
+ The watched preview compiler keeps a private incremental module graph. Turbo is
123
123
  not launched on every edit. ADS reopens a matching complete graph without semantic
124
124
  scenario discovery or compiler startup: check cached registry/dependencies, verify
125
125
  immutable assets, match the successful guard evidence already attached to the
@@ -127,6 +127,45 @@ graph against current source/tool/runtime/Git/dependency state, fence inputs, an
127
127
  publish new session metadata. This native handoff does not invoke Turbo again. Missing, changed or corrupt artifacts fall back to compiling.
128
128
  Guard failures remain failures. Old live build evidence is never restored.
129
129
 
130
+ Each project/draft builder owns its Vite graph, lowered ADS modules, Linaria
131
+ extractions, worker bundles and resource-rewrite cache. No dev server is exposed.
132
+ Before reuse it compares recorded input **contents**, including evaluated style
133
+ imports, CSS imports inlined by PostCSS, public-barrel inputs and spatial token-sheet membership. Same size and
134
+ mtime are insufficient. Package/dependency manifests, configuration and tsconfig
135
+ changes replace the graph and its refresh epoch. Original optimized-dependency
136
+ inputs, including transitive CommonJS requires, are also content checked and
137
+ renew the graph when changed. Failed requests are not published;
138
+ restored or newly added inputs are evaluated on the next request.
139
+ Design-system directory membership and source dependency directories are observed
140
+ too. Additions/deletions renew the graph and frame: a new file can outrank an old
141
+ import resolution even when every previously imported file is unchanged.
142
+ Every preview entry loads the configured project stylesheet, including generated
143
+ Token and Brand views that do not use the project's scenario mount adapter.
144
+
145
+ The resource-rewrite cache retains one entry per current output file, keyed by
146
+ its bytes, dependency/style metadata and output membership. JavaScript worker
147
+ asset bytes participate so changing a worker into an unsupported module cannot
148
+ reuse an earlier successful rewrite. Immutable output graph hashes and the
149
+ scheduler's pre/post source fences still determine publication.
150
+
151
+ Retained graph/input count over 4096 or lowered source/code over 64 MiB renews the
152
+ compiler session on its next build. The iframe separately reopens at the next
153
+ mount if retained module metadata exceeds 4096 records or materialized bodies
154
+ exceed 64 MiB. These limits bound retained objects, not total process memory.
155
+ Closing a builder releases compiler/extraction workers and its temporary
156
+ `.ds/incremental/` directory. Complete Bun verification builds remain separate.
157
+
158
+ The App keeps up to six manifest revisions and 8 MiB of serialized graph metadata
159
+ per accepted/draft scope, sharing pending reads and discarding rejected requests.
160
+ Current build/tool status authorizes reuse; the cache itself never establishes
161
+ freshness. Live-to-verified handoff can reuse identical graph records. A changed
162
+ revision requests only differences from a known base, using the server's existing
163
+ retained graph history; unavailable history falls back to a full manifest.
164
+ Scope changes and teardown clear the cache, and late responses from an old scope
165
+ cannot populate the new one. Restarted compiler sessions require new metadata even
166
+ when graph bytes are unchanged. The original full-manifest resource remains
167
+ available to older clients, and older servers work through full-resource fallback.
168
+
130
169
  ## CI wiring
131
170
 
132
171
  Use the existing CLI and persist the artifact directory. No additional ADS cache
package/docs/CHANGELOG.md CHANGED
@@ -1,61 +1,139 @@
1
1
  # Changelog
2
2
 
3
- ## 0.4.3
3
+ ## Unreleased
4
+
5
+ ## 0.4.5
4
6
 
5
7
  <!-- ads-local-tests:start -->
6
- Local verification: **833/833 passed** with `bun run test`.
7
- Tested commit: `b461dfe801b0fb0871ae814a0d75cc1e5db47b3e`; Bun 1.4.4.
8
- Completed 2026-11-07T10:14:03.979Z (798 seconds).
8
+ Local verification: **876/876 passed** with `bun run test`.
9
+ Tested commit: `caae427a294180dc849ab0e31f4bceca65e8c60e`; Bun 1.4.4.
10
+ Completed 2026-11-11T07:40:07.975Z (1184 seconds).
9
11
 
10
12
  <!-- ads-local-test-proof
11
13
  {
12
14
  "schema": 3,
13
- "version": "0.4.3",
14
- "commit": "b461dfe801b0fb0871ae814a0d75cc1e5db47b3e",
15
- "sourceSha256": "049f372686fea898cb3829668c6e3071c766bd18722c9270b26d596bf5e69937",
15
+ "version": "0.4.5",
16
+ "commit": "caae427a294180dc849ab0e31f4bceca65e8c60e",
17
+ "sourceSha256": "147c084857478c978856b4965aa1d01e2573b19634ed6c96c0add32c0e399a9c",
16
18
  "command": "bun run test",
17
19
  "result": "pass",
18
- "tests": 833,
19
- "pass": 833,
20
+ "tests": 876,
21
+ "pass": 876,
20
22
  "fail": 0,
21
23
  "skipped": 0,
22
24
  "groups": [
23
25
  {
24
26
  "name": "unit",
25
- "tests": 83,
26
- "pass": 83,
27
+ "tests": 94,
28
+ "pass": 94,
27
29
  "fail": 0,
28
30
  "skipped": 0,
29
- "reportSha256": "eaa05144b54ab4d694bbd66ab29c741d46eecbdef5eb6d9d5de5805b302f05c4"
31
+ "reportSha256": "b98fd5a89f05c4a45c8ca454e379a6cddbae1320575d124566185ebd3f5e264c"
30
32
  },
31
33
  {
32
34
  "name": "integration",
33
- "tests": 603,
34
- "pass": 603,
35
+ "tests": 621,
36
+ "pass": 621,
35
37
  "fail": 0,
36
38
  "skipped": 0,
37
- "reportSha256": "e7bf889b404194e73f0662ddc2a789dfc45e57190bf6afa9b3f0095f4b5aa1ec"
39
+ "reportSha256": "0a73f0aa3668cb41a280286afb2bcbe44db64415c8b66d8313b0ba754f168f33"
38
40
  },
39
41
  {
40
42
  "name": "browser",
41
- "tests": 147,
42
- "pass": 147,
43
+ "tests": 161,
44
+ "pass": 161,
43
45
  "fail": 0,
44
46
  "skipped": 0,
45
- "reportSha256": "4f08212c482bf42a7914e1e51b89964a884e730827c7eafb60a2609d3c6f5285"
47
+ "reportSha256": "1f378c366aaf2c4434d7b9bf5fd92cfc2bcfcb564ed3bcc2a83fdad3f9d08669"
46
48
  }
47
49
  ],
48
50
  "testOverrides": {
49
- "ADS_BROWSER_WORKERS": "2"
51
+ "ADS_INTEGRATION_WORKERS": "1",
52
+ "ADS_BROWSER_WORKERS": "1"
50
53
  },
51
54
  "bun": "1.4.4",
52
- "completedAt": "2026-11-07T10:14:03.979Z",
53
- "durationMs": 798441,
54
- "logSha256": "8de81a9e0439a8ee1c3a4304e300f30f20a3e8844644b56610ca916c287f9d92"
55
+ "completedAt": "2026-11-11T07:40:07.975Z",
56
+ "durationMs": 1184086,
57
+ "logSha256": "c96ef7b803262f1aa23a5d8753b1cf989f6217038becbdb578c97e6ca07c6da3"
55
58
  }
56
59
  -->
57
60
  <!-- ads-local-tests:end -->
58
61
 
62
+ - Make the local showcase use HTTP by default for discovery, scoped preview actions and checked assets. Keep MCP tools, resources and embedded Apps supported by the same engine; remove the experimental activation requirement.
63
+ - Deliver build reports through SSE, reconnect and reconcile missed updates, and refresh current state when a tab becomes visible. Retained previews show a stale-connection warning; no periodic HTTP browser status polling is required.
64
+ - Combine checked manifest preparation with bounded asset publication, reuse known revisions and pin asset reads to the authorized graph. Keep persistent opaque preview frames and verified Blob loading for worker dependencies.
65
+ - Use the HTTP showcase for captures and browser verification, retaining viewport, target, guide-layer, exact-revision and publication guarantees. Update browser automation for the single preview frame.
66
+ - Release a draft compiler that is still starting when its workspace is retired, without recreating deleted output or reporting a spurious background failure.
67
+ - Prove React and Preact product widgets through an independent MCP server and client, including interaction, themes, fonts and artwork; reject unrelated component code, CSS and assets in the served bundle.
68
+ - Document the delivery architecture and add the 0.4.4-to-0.4.5 migration guide. Project components, tokens, scenarios and configuration require no migration.
69
+
70
+ ## 0.4.4
71
+
72
+ <!-- ads-local-tests:start -->
73
+ Local verification: **860/860 passed** with `bun run test`.
74
+ Tested commit: `d8d9b2d093ce26d140c037f90e5c9087b8fed46d`; Bun 1.4.4.
75
+ Completed 2026-11-10T14:37:34.287Z (1344 seconds).
76
+
77
+ <!-- ads-local-test-proof
78
+ {
79
+ "schema": 3,
80
+ "version": "0.4.4",
81
+ "commit": "d8d9b2d093ce26d140c037f90e5c9087b8fed46d",
82
+ "sourceSha256": "2ff7cc61caabd96b928581e79ddbc1c6df459145c0039023c2f3400947d46131",
83
+ "command": "bun run test",
84
+ "result": "pass",
85
+ "tests": 860,
86
+ "pass": 860,
87
+ "fail": 0,
88
+ "skipped": 0,
89
+ "groups": [
90
+ {
91
+ "name": "unit",
92
+ "tests": 91,
93
+ "pass": 91,
94
+ "fail": 0,
95
+ "skipped": 0,
96
+ "reportSha256": "896a8879bc0071d3bc822a9a5ee6b32ba78f47c69ac81045534c39bb2e9533c5"
97
+ },
98
+ {
99
+ "name": "integration",
100
+ "tests": 617,
101
+ "pass": 617,
102
+ "fail": 0,
103
+ "skipped": 0,
104
+ "reportSha256": "6ad851727bd92ee38143505e045d8cc7ee3624c0861510efde7beb8f7480d528"
105
+ },
106
+ {
107
+ "name": "browser",
108
+ "tests": 152,
109
+ "pass": 152,
110
+ "fail": 0,
111
+ "skipped": 0,
112
+ "reportSha256": "af3bcf2d9aeb6d80d073763ff346ec142c476c327c9e12b4827e3964c28b841d"
113
+ }
114
+ ],
115
+ "testOverrides": {
116
+ "ADS_INTEGRATION_WORKERS": "1",
117
+ "ADS_BROWSER_WORKERS": "1"
118
+ },
119
+ "bun": "1.4.4",
120
+ "completedAt": "2026-11-10T14:37:34.287Z",
121
+ "durationMs": 1343621,
122
+ "logSha256": "dba1d323e6a2d4da20f000f86d75d8955c490d61c55f18765656f5d5bee8ae82"
123
+ }
124
+ -->
125
+ <!-- ads-local-tests:end -->
126
+
127
+ - Load the configured project stylesheet in generated Token and Brand previews. Track inlined CSS import dependencies by contents so same-size/same-time token edits refresh correctly; include Preact refresh helpers in the private compiler graph.
128
+ - Stop draft watcher reconciliation when its controller closes, and skip previews retired while another draft refreshes.
129
+ - Update watched previews through a private incremental module graph inside the existing isolated iframe. Preserve state and focus for compatible React/Preact edits, refresh styles and lazy branches, and reopen safely for incompatible updates or rejected revisions. Keep full Bun builds and native acceptance gates.
130
+ - Reuse known preview manifests across polling and live-to-verified handoff. Internal MCP resource updates transfer changed records, with bounded per-scope caching and a full-manifest fallback for expired history; agent-facing tool results remain graph references.
131
+ - Add the 0.4.3-to-0.4.4 migration guide and update agent runtime guidance for incremental previews, conditional state retention and verified evidence. Experimental HTTP delivery and source-emission/V3 work are excluded.
132
+
133
+ - Keep ancestor-background contrast checks active for card text supplied through string/number props, inert class hooks and optional layout-only classes. Preserve unresolved diagnostics for paint overrides and unknown children.
134
+
135
+ ## 0.4.3
136
+
59
137
  - Audit contrast on the project's canvas without decorative showcase staging, preserving subject framing. Measure image shape against its content or CSS sizing box so borders, padding and rotated bounding rectangles do not cause false failures.
60
138
 
61
139
  - Detect text contrast across source-resolvable component composition, including inherited ancestor backgrounds and forwarded children; report uncertain cascades for rendered auditing without requiring custom token-pair declarations.
package/docs/GUIDE.md CHANGED
@@ -14,6 +14,11 @@ foundation scaffolding. Default initialization creates an empty design system;
14
14
  `--include-starter` adds the shared example design and application source. ADS
15
15
  adds no runtime dependency to the application's shipped UI.
16
16
 
17
+ For an existing installation, use the [ads-migrate skill](../skills/ads-migrate/SKILL.md).
18
+ The [0.4.3 → 0.4.4 guide](../skills/ads-migrate/references/0.4.3-to-0.4.4.md)
19
+ covers dependency updates, restarting the managed runtime and checking incremental
20
+ previews without rewriting project components or deleting active drafts.
21
+
17
22
  ## Use ADS through MCP
18
23
 
19
24
  Connect your coding agent using the [MCP client setup](MCP.md#connect-codex-or-claude).
@@ -89,6 +94,13 @@ notifications. The portable [capture guide](../skills/ads-designer/references/ca
89
94
  explains screenshot setup, named targets, limits and comparison usage; MCP serves
90
95
  the same guide at `ads://guides/captures`.
91
96
 
97
+ Watched previews keep the isolated frame alive during compatible edits. Component
98
+ state, entered text and focus can survive code and style updates; changed hook
99
+ signatures follow React or Preact's reset rules. Incompatible module changes and
100
+ restoring rejected revisions may reset the preview. “Checking changes…” is live
101
+ feedback, not acceptance: source gates and selected browser checks still decide
102
+ whether the revision passes. Application production builds are unchanged.
103
+
92
104
  ## Implementation support
93
105
 
94
106
  Linaria is required for component and pattern styling. Projects choose their
@@ -141,6 +153,12 @@ project's existing build:
141
153
  result. Static source checks do not establish complete extraction or
142
154
  unused-style removal.
143
155
 
156
+ For product MCP Apps, make the widget's entry the production bundle root and
157
+ import the needed public design-system UI by name. The app's own MCP server
158
+ serves that built widget; it does not need ADS's server or showcase. Check both
159
+ runtime code and emitted CSS/assets for unrelated owners. See the
160
+ [product widget integration proof](MCP.md#product-widgets-and-payload-scope).
161
+
144
162
  The [starter's dependencies](https://github.com/reqvire-org/ads/blob/main/starters/shared/package.json),
145
163
  [entry build](https://github.com/reqvire-org/ads/blob/main/starters/shared/vite.config.ts),
146
164
  and [native mounts](https://github.com/reqvire-org/ads/tree/main/starters)
@@ -252,7 +270,7 @@ Initialization:
252
270
  - Adds the same checks and generation to `prebuild:showcase` when a standalone
253
271
  `build:showcase` script exists, preserving its existing hook and build command.
254
272
  - Adds `dev:showcase` as `ads showcase` when absent. An existing run command is
255
- preserved; deliberately switch it when migrating to the built-in MCP client.
273
+ preserved; deliberately switch it when migrating to the built-in showcase.
256
274
  - Adds `ads-mcp` with guarded editing enabled and `ads-read-mcp` with editing
257
275
  disabled, preserving existing scripts with those names. Both start the showcase.
258
276
  - Appends `.ds/` to the project's ignore file and supplies a framework mount
@@ -599,9 +617,13 @@ there is no custom pair declaration to remember. Transparent wrappers preserve t
599
617
  backdrop; translucent token layers need a known opaque ancestor. Composed text can use a
600
618
  known inherited font size/weight. Hidden and disabled text is excluded; matching text and
601
619
  background tokens are still an error when the source proves that text is rendered.
620
+ Text supplied through a `string` or `number` prop is checked too. Literal class hooks
621
+ do not hide the backdrop when no captured paint selector targets them. Optional classes
622
+ that only change layout preserve contrast evidence; every alternative must establish
623
+ the same paint and visibility facts.
602
624
 
603
625
  This composition pass does not guess the browser cascade. Competing classes, differing
604
- class/interpolation alternatives, unknown prop spreads or components, conditional or
626
+ paint/interpolation alternatives, unknown prop spreads or components, conditional or
605
627
  descendant paint selectors, gradients, opacity, filters, out-of-flow positioning and
606
628
  missing backdrops produce `component-contrast-unresolved` info where contrast evidence
607
629
  is incomplete. SVG text, native control value/placeholder text and dynamically generated
@@ -808,7 +830,7 @@ owners' own ones unless `acceptance.behavior` is `false`.
808
830
 
809
831
  ## Showcase
810
832
 
811
- ADS ships a minimal browser shell, MCP client and Apps host. `ads mcp` serves the
833
+ ADS ships a minimal HTTP browser shell with isolated previews. `ads mcp` serves the
812
834
  website alongside its stdio connection; `ads showcase` starts the same runtime
813
835
  for browser-only use. Run commands from the project root. Open the printed URL,
814
836
  or use `ads_status.showcaseUrl` from an already connected runtime: it is the URL
@@ -816,16 +838,19 @@ and port of the showcase that server is running. An available loopback port is
816
838
  selected by default; `--port 4185` selects a fixed port.
817
839
  `ads mcp --no-showcase` keeps a headless stdio server.
818
840
 
819
- The client negotiates the current modern MCP protocol, discovers menus with
820
- `ads_tokens`/`ads_scenarios`, invokes `ads_show_scenario` and renders
821
- Apps through the official bridge. It refreshes menus on catalogue notifications
822
- and refreshes the active scenario in the same App after a successful build. Errors identify
841
+ The browser reads catalogues and opens previews through scoped HTTP services
842
+ backed by the same engine as MCP. SSE events refresh menus and build state;
843
+ the selected scenario updates inside its persistent iframe.
844
+ Compatible React/Preact edits retain component state, typed values and focus.
845
+ Edits that change hook signatures or module boundaries can reset state; failed
846
+ checks restore verified output. Errors identify
823
847
  stale retained output. Its neutral header and left pane align and collapse
824
- together. Themes flow through the Apps host context. No project catalogue pages
848
+ together. Themes flow through the preview host context. No project catalogue pages
825
849
  or direct component imports are used by this client.
826
850
 
827
851
  The project owns implementations, colocated scenarios/fixtures, foundation
828
- CSS and a framework mount adapter. ADS supplies its native Bun preview compiler.
852
+ CSS and a framework mount adapter. ADS runs its preview compiler on Bun, using
853
+ incremental modules for watched previews and complete bundles for verification.
829
854
  The starter and init provide the mount under `design-system/showcase/mcp/`.
830
855
  Configure the framework; ADS compiles every scenario into one shared preview graph:
831
856
 
@@ -942,7 +967,9 @@ Preact starter under ignored `.ds/playground/`. `bun run dev:react` selects Reac
942
967
  The design source is `starters/shared/`; restart after editing it to generate a new
943
968
  playground snapshot. `bun run build:showcase` compiles that starter’s scenarios.
944
969
  The playground and receiving projects use the same initializer and packaged source.
945
- The built-in client reads discovery through MCP. Existing custom showcases
970
+ The built-in browser reads discovery and checked assets over HTTP and receives
971
+ build reports through SSE. MCP agents and embedded Apps retain their existing
972
+ interfaces. No delivery flag or project migration is required. Existing custom showcases
946
973
  are preserved by init; replace their run command deliberately when migrating.
947
974
 
948
975
  Run core and registered project checks before preview compilation, alongside