@reqvire-org/ads 0.3.2 → 0.3.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 (55) hide show
  1. package/README.md +12 -4
  2. package/dist/behaviors.mjs +157 -0
  3. package/dist/bootstrap-ds/ADS.md +7 -0
  4. package/dist/bootstrap-ds/design-system/controllers/.gitkeep +0 -0
  5. package/dist/boundaries.mjs +21 -23
  6. package/dist/check.mjs +25 -13
  7. package/dist/cli.mjs +18 -0
  8. package/dist/config.mjs +19 -3
  9. package/dist/css-values.mjs +26 -0
  10. package/dist/index.mjs +2 -0
  11. package/dist/init.mjs +1 -1
  12. package/dist/mcp/build-status.mjs +10 -3
  13. package/dist/mcp/catalog.mjs +11 -8
  14. package/dist/mcp/context.mjs +2 -2
  15. package/dist/mcp/mutations.mjs +11 -1
  16. package/dist/mcp/preview-owner-guard.mjs +29 -0
  17. package/dist/mcp/preview-watch.mjs +28 -4
  18. package/dist/mcp/preview-widget.bundle.js +2 -2
  19. package/dist/mcp/prompts.mjs +3 -3
  20. package/dist/mcp/server.mjs +61 -24
  21. package/dist/mcp/showcase-host.mjs +9 -5
  22. package/dist/oxlint.mjs +1 -1
  23. package/dist/public-api.mjs +39 -0
  24. package/dist/scenarios-compiler.mjs +17 -2
  25. package/dist/scenarios.mjs +27 -39
  26. package/dist/skills/README.md +3 -3
  27. package/dist/skills/ads-break-ui/SKILL.md +48 -4
  28. package/dist/skills/ads-designer/SKILL.md +49 -5
  29. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +7 -0
  30. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/controllers/.gitkeep +0 -0
  31. package/dist/skills/ads-designer/references/cli.md +1 -1
  32. package/dist/skills/ads-designer/references/design-craft.md +1 -1
  33. package/dist/skills/ads-import/SKILL.md +48 -4
  34. package/dist/skills/ads-import/references/cli.md +1 -1
  35. package/dist/skills/{ads-assimilate → ads-migrate}/SKILL.md +54 -10
  36. package/dist/skills/ads-migrate/agents/openai.yaml +4 -0
  37. package/dist/skills/{ads-assimilate → ads-migrate}/references/cli.md +1 -1
  38. package/dist/skills/{ads-assimilate → ads-migrate}/references/native-implementation.md +27 -0
  39. package/dist/skills/ads-motion/SKILL.md +48 -4
  40. package/dist/style-boundaries.mjs +59 -0
  41. package/dist/tokens.mjs +3 -2
  42. package/dist/units.mjs +56 -9
  43. package/dist/verification/browser.mjs +27 -0
  44. package/dist/verification/playwright-reporter.cjs +20 -0
  45. package/dist/verification.mjs +214 -0
  46. package/docs/ADS.md +32 -3
  47. package/docs/ARCHITECTURE.md +45 -4
  48. package/docs/BEHAVIORS.md +230 -0
  49. package/docs/CHANGELOG.md +48 -0
  50. package/docs/GUIDE.md +25 -1
  51. package/docs/MCP.md +76 -7
  52. package/package.json +4 -2
  53. package/dist/skills/ads-assimilate/agents/openai.yaml +0 -4
  54. /package/dist/skills/{ads-assimilate → ads-migrate}/references/lint-and-docs.md +0 -0
  55. /package/dist/skills/{ads-assimilate → ads-migrate}/references/testing.md +0 -0
@@ -149,6 +149,33 @@ preserving compatible consumer APIs. Markup, accessibility, events, layout, and
149
149
  motion still need verification when an implementation changes. Imported or
150
150
  adapted source carries its credits and applicable notices in its local guide.
151
151
 
152
+ ## Controllers own reusable behavior
153
+
154
+ A private controller stays beside its component or pattern. Shared behavior uses
155
+ `controllers/<Name>/` as an independent edit owner. Controllers may be plain
156
+ functions/classes, framework hooks or context providers; sharing code does not
157
+ implicitly share instances. Use the configured framework and declared project
158
+ dependencies, with no runtime supplied by the MCP host. Shared controllers do not
159
+ import styled consumers or introduce another skin layer. Existing measurement and
160
+ style-write boundaries still apply.
161
+
162
+ Optional owner-local `behavior.json` contracts identify public APIs or private
163
+ source/symbols, named guarantees and registered execution checks. Scenario
164
+ `exercises` links public behavior APIs to reachable demonstrations; `covers`
165
+ continues to describe rendered public UI. Controllers need no artificial standalone
166
+ visual scenario. Static registration is separate from current passing evidence.
167
+
168
+ Manifests, checks, scenarios and fixtures are development inputs; production
169
+ imports only actual components/controllers and their styles. Browser checks can
170
+ exercise the real MCP App. React development StrictMode uses a project development
171
+ harness, since production previews do not replay those effects. The
172
+ [behavior contract](BEHAVIORS.md) defines profiles, execution and evidence freshness.
173
+
174
+ The normal compiled import graph delivers controller dependencies through MCP
175
+ resources. There is no eager global controller registry. ESM splitting and selected
176
+ asset loading remain in place; tree shaking depends on actual imports, exports and
177
+ side effects, rather than the controller directory name.
178
+
152
179
  ## The showcase is the shared design workspace
153
180
 
154
181
  Humans and coding agents inspect the same project through MCP. The showcase is
@@ -222,6 +249,8 @@ real public implementation. It mounts independently, without opening a showcase
222
249
  page or initializing the application's router, store or services first.
223
250
 
224
251
  Scenarios and their fixtures live beside the tokens, component or pattern they exercise.
252
+ Demo framing belongs to public review/layout patterns; component props describe
253
+ intentional product behavior and visual variants.
225
254
  Token scenarios choose real token names and sample inputs; a project-owned
226
255
  review pattern applies the foundation variables. The tool contains no project
227
256
  token list, sample templates or assumed visual identity. Even an initial token
@@ -287,11 +316,22 @@ Bounded tools establish what exists; explicit resource reads provide detail.
287
316
  Prompts and packaged skills explain how to reason through Data, UX and Skin and
288
317
  how to inspect the real implementation before changing it.
289
318
 
319
+ The MCP runtime owns its browser hosts and preview builder lifetime. Closing the
320
+ client connection releases them together; a separate ownership guard can stop
321
+ detached builders after abrupt owner death. A preview process must not outlive
322
+ its owner and continue publishing stale output.
323
+ Build reports expose queued, validation, compilation and publication progress.
324
+ A timed-out preview request marks the builder stalled; the next explicit request
325
+ restarts it within the same MCP session. A running process alone is not freshness.
326
+
290
327
  Opt-in MCP editing makes validation part of the write operation. The agent sends
291
328
  a Git unified diff for one logical ADS unit: its implementation and owned preview
292
329
  context, or the shared token foundation. ADS resolves file ownership, reconstructs
293
330
  candidate files locally and validates a temporary project copy with architecture
294
- checks, registered lint rules and project validation scripts. This keeps edits
331
+ checks, registered lint rules and project validation scripts. Affected registered
332
+ behavior checks, including consumers of a changed shared controller, also run in
333
+ the isolated candidate project. Passing checks describe
334
+ their registered assertions, not every natural-language claim. This keeps edits
295
335
  focused without requiring entire file bodies in model context. Peer units and
296
336
  unrelated owners remain outside the selected unit's edit boundary. Shared foundation,
297
337
  branding and guides have their own units. Project configuration, registered guards
@@ -303,9 +343,10 @@ remain in place for source changes made through other editors; preview review re
303
343
  necessary after either editing path.
304
344
 
305
345
  Required shared-entry bookkeeping can accompany its owner: component/pattern
306
- re-exports and canonical foundation imports for token files created or deleted in
307
- the same patch. ADS restricts these companion edits and validates the complete
308
- candidate before writing, so coupled changes do not need a guard bypass.
346
+ re-exports, canonical foundation imports for token files created or deleted, and
347
+ only that owner’s style-boundary entries in project configuration in the same
348
+ patch. ADS restricts these companion edits and validates the complete candidate
349
+ before writing, so coupled changes do not need a guard bypass.
309
350
 
310
351
  The architecture makes that inspection practical. A public export has an owning
311
352
  source and addressable preview coverage. Token definitions expose its visual
@@ -0,0 +1,230 @@
1
+ # Controllers and behavioral verification
2
+
3
+ Controllers own reusable UI behavior: state, subscriptions, DOM measurements and
4
+ lifecycle coordination. A controller may be a class, function, hook, state
5
+ machine or context provider. Linaria and tokens own its consumers' visual design.
6
+
7
+ Private controllers stay inside their component/pattern mutation unit. Shared
8
+ controllers use `design-system/controllers/<Name>/` with an `index` entry or a
9
+ runtime file matching the directory name. The unit ID is `controllers/<Name>`.
10
+ Its implementation, tests and guides can change together, including only its own
11
+ required public re-exports. A shared controller needs no artificial visual preview.
12
+ Consumers normally create separate instances; sharing implementation does not
13
+ implicitly share state.
14
+
15
+ Use the project's `framework` from `ds.config.json` for framework-specific APIs.
16
+ Plain TypeScript, browser APIs and local behavior helpers remain supported.
17
+ Declare external dependencies in the project package. ADS does not install them
18
+ or assume a renderer/library supplied by an MCP host. The framework field selects
19
+ compilation/mounting; controller checks also validate runtime imports. Type-only
20
+ UI references are allowed, but shared controllers cannot import component/pattern
21
+ runtime implementations. Keep business data in application adapters. Measured
22
+ style writes retain exact `boundaries.styleWrites` properties; they do not allow
23
+ shared-token overrides or an extra styling layer.
24
+ These gates inspect supported direct imports, markup and style boundaries.
25
+ External package internals and delegated DOM behavior still require source,
26
+ build and browser review; declaring a dependency does not prove it is headless.
27
+
28
+ ## Development boundary
29
+
30
+ Production includes real components, controllers, tokens and compiled styles.
31
+ Scenarios and fixtures are included only in previews. Behavior manifests and test
32
+ files are development/tooling inputs. Runtime imports and public re-exports of
33
+ those inputs are rejected, including dynamic imports and aliases.
34
+
35
+ ## Register guarantees
36
+
37
+ An optional `behavior.json` belongs to one directory unit. Flat units use
38
+ `<Owner>.behavior.json`. Existing projects without manifests remain valid and have
39
+ no implied behavioral verification. A manifest is declarative and contains no
40
+ executable command:
41
+
42
+ ```json
43
+ {
44
+ "schemaVersion": 1,
45
+ "subjects": {
46
+ "controller": { "source": "./scroller-controller.ts", "symbol": "ScrollerController" },
47
+ "scroll-api": { "api": "useMessageScroller" }
48
+ },
49
+ "guarantees": [
50
+ {
51
+ "id": "prepend-anchor",
52
+ "description": "Prepending history preserves the visible anchor after layout settles.",
53
+ "subjects": ["controller", "scroll-api"],
54
+ "checks": ["prepend-anchor"]
55
+ }
56
+ ],
57
+ "checks": {
58
+ "prepend-anchor": {
59
+ "file": "./behavior.spec.ts",
60
+ "case": "prepend-anchor",
61
+ "scenario": "components/MessageScroller",
62
+ "profile": "widget"
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ Names above are illustrative project choices. A subject identifies a public export
69
+ through `api`, or an owner-local implementation `source` with an optional top-level
70
+ `symbol`. Private subjects do not become public API. A guarantee references known
71
+ subjects and checks. Each check names an owner-local test/spec file, stable case
72
+ ID, registered profile and optional discovered scenario. Several guarantees may
73
+ reference one check. Repeated execution identities use the same check ID.
74
+
75
+ Static validation establishes registration and ownership, not that the guarantee
76
+ is true. README prose is not automatically certified. Link specific guarantees
77
+ when describing the evidence available for a behavior.
78
+
79
+ ## Link a public API to a demonstration
80
+
81
+ Scenario `covers` retains its existing render-reference contract. Optional
82
+ `exercises` identifies public behavioral APIs:
83
+
84
+ ```tsx
85
+ export const scenario = {
86
+ title: "Message scrolling",
87
+ covers: ["MessageScroller", "MessageScrollerViewport"],
88
+ exercises: ["useMessageScroller", "useMessageScrollerScrollable"],
89
+ };
90
+ ```
91
+
92
+ Call hooks in a rendered local scenario adapter. Calls/construction are matched by
93
+ resolved symbol, not a `use*` naming convention. An unused import, dead adapter or
94
+ metadata string does not count. Dynamically passed behavior references produce a
95
+ review advisory when a direct call cannot be established; verify those through
96
+ registered execution checks rather than changing the API for the analyzer.
97
+
98
+ Public APIs appear in `ads_catalog` with `apiKind: "ui"` or `"behavior"` and their
99
+ scenario links. `ads_behaviors` joins contracts to demonstrations and evidence.
100
+ A demonstrated API is not automatically a verified guarantee.
101
+
102
+ ## Register execution profiles
103
+
104
+ Profiles are explicit trusted development commands in `ds.config.json`. They use
105
+ literal executable/argument arrays, no shell interpolation or model-supplied
106
+ command. For a project with an installed Playwright test runner:
107
+
108
+ ```json
109
+ {
110
+ "mcp": {
111
+ "behaviorProfiles": {
112
+ "widget": {
113
+ "runner": "playwright",
114
+ "command": "npm",
115
+ "args": ["run", "test:behavior", "--"],
116
+ "mode": "browser",
117
+ "timeoutMs": 60000
118
+ }
119
+ }
120
+ }
121
+ }
122
+ ```
123
+
124
+ Here `test:behavior` invokes the project's local `playwright test`. Its Playwright
125
+ configuration must discover colocated spec files. Configure browser installation
126
+ and any required test setup in that project. The ADS tooling host gains no
127
+ framework or browser dependency from a profile.
128
+
129
+ The Playwright adapter appends selected file paths, its reporter and a generated
130
+ artifact directory. Use native test tags for stable case identity:
131
+
132
+ ```ts
133
+ import { test, expect } from "@playwright/test";
134
+ import { openBehaviorScenario } from "@reqvire-org/ads/verification";
135
+
136
+ test("history preserves the visible anchor", { tag: "@ads:prepend-anchor" }, async ({ page }) => {
137
+ const frame = await openBehaviorScenario(page, "prepend-anchor");
138
+ // Perform real interactions and assert the project's guarantee here.
139
+ await expect(frame.getByRole("region", { name: "Messages" })).toBeVisible();
140
+ });
141
+ ```
142
+
143
+ The shown assertion is only a harness example; it does not establish anchoring.
144
+ Write meaningful assertions for the registered guarantee. The helper waits for
145
+ the current selected scenario inside the real sandboxed MCP App. It uses `load`
146
+ and explicit readiness, not `networkidle`: MCP keeps event connections open.
147
+
148
+ `mode: "browser"` starts an isolated managed showcase on an automatic port. Test
149
+ requests contain its scenario URLs, and cleanup closes its host/compiler tree.
150
+ Mutation candidates use their own source, generated graph and server; a passing
151
+ test against an older fixed-port live showcase cannot validate a candidate.
152
+
153
+ Use `mode: "strict"` only for React with a project development harness that mounts
154
+ the relevant API in StrictMode. The production MCP App does not replay development
155
+ effects. This profile does not receive a production showcase URL from the helper.
156
+ For Preact, register its actual lifecycle tests without claiming React StrictMode.
157
+ The profile names record the chosen environment; ADS does not infer that a test's
158
+ assertions cover every lifecycle condition.
159
+
160
+ Other runners use `runner: "protocol"` (the default). ADS provides
161
+ `ADS_VERIFY_REQUEST` and `ADS_VERIFY_REPORT` absolute paths. Read the request's
162
+ `schemaVersion`, unique `runId`, `projectRoot`, `framework`, `profile`, `mode`,
163
+ selected `checks` and optional `scenarios` URLs. Write a bounded JSON report:
164
+
165
+ ```json
166
+ {
167
+ "schemaVersion": 1,
168
+ "runId": "<the request's runId>",
169
+ "cases": [
170
+ {
171
+ "id": "prepend-anchor",
172
+ "file": "design-system/components/MessageScroller/behavior.spec.ts",
173
+ "status": "passed"
174
+ }
175
+ ]
176
+ }
177
+ ```
178
+
179
+ Case statuses are `passed`, `failed` or `skipped`, with optional `message`.
180
+ `file` is project-relative. Nonzero process exit, missing cases, skipped cases,
181
+ wrong run IDs and unavailable reports do not pass. Test commands are trusted
182
+ project code; an adapter cannot prove the quality or honesty of their assertions.
183
+
184
+ ## Execute and inspect evidence
185
+
186
+ Use `ads_behaviors` for bounded discovery; request an exact unit for its contract.
187
+ General listings return counts and short API/guarantee/scenario summaries. Exact
188
+ owner requests return the registered details; source reads remain available for
189
+ bounded inspection of large contracts. No full guide or test body is injected
190
+ into discovery results.
191
+ Call `ads_verify({unit, checks?})` for selected registered checks. Read
192
+ `ads://project/behaviors` for current evidence or `ads://guides/behaviors` for this
193
+ guide. CLI/CI equivalents are:
194
+
195
+ ```sh
196
+ ads behaviors . --json
197
+ ads verify . --unit controllers/ScrollFollow
198
+ ads verify . --unit components/MessageScroller --check prepend-anchor --json
199
+ ```
200
+
201
+ Execution has bounded output, a configured timeout, cancellation and process-tree
202
+ ownership. Evidence records case/profile identity, source/dependency revision,
203
+ completion time, report path and the available preview revision. Later input
204
+ changes mark results stale; changes during execution prevent a current pass.
205
+ Guarantees report passing only when all their checks have current passing evidence.
206
+ Passing applies to those cases and profiles, not every application state.
207
+
208
+ Revisions include owned files, literal import dependencies, local CSS imports and
209
+ asset URLs, token foundation, project/runner configuration, lockfiles and tooling.
210
+ Computed module selection conservatively includes all ADS owners. Environment,
211
+ network and other unregistered external inputs remain the runner's responsibility;
212
+ an evidence record is not a proof about arbitrary external state.
213
+
214
+ Guarded mutations execute affected registered behavior contracts after core,
215
+ Oxlint and configured project checks, before writing source. Imported shared
216
+ controller changes also select dependent contracts conservatively. Rejected and
217
+ dry-run patches publish no source changes. Verification output stays under `.ds/`.
218
+
219
+ ## Packaging and performance
220
+
221
+ Controllers follow normal component/scenario imports into the project's compiled
222
+ resource graph. Their framework dependencies are bundled by the project compiler
223
+ and served through MCP resources inside the App iframe; external hosts install
224
+ nothing. The selected scenario loads its dependency closure. Shared modules are
225
+ cached within that App instance, and each separately opened App has its own runtime.
226
+
227
+ Keep ESM modules and explicit imports. Avoid an eagerly imported controller
228
+ registry. Tree shaking and shared chunks follow the project bundler: class methods,
229
+ side effects, global CSS and dynamic maps can retain extra code. Inspect emitted
230
+ resources instead of assuming a controller produces a minimal bundle.
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 0.3.5
6
+
7
+ - Bound preview-watch test teardown, publish selection requests atomically and
8
+ wait for the changed preview output before checking revision/queue order.
9
+ Cap the release test stage so failed cleanup cannot hold publication indefinitely.
10
+
11
+ - Stabilize the development StrictMode browser harness across dependency-optimizer
12
+ reloads. Verify the broken controller fails its cleanup assertion and the
13
+ repaired controller passes. Version 0.3.4 was not published after CI caught the
14
+ harness navigation race.
15
+
16
+ - Add shared controller units, framework/dependency and headless ownership checks,
17
+ while retaining private controllers in their consumers' units.
18
+ - Add optional owner-local behavior contracts, scenario `exercises`, public hook
19
+ discovery, `ads_behaviors`/`ads_verify`, revision-bound results and subscribed
20
+ evidence resources. Guarded edits run affected registered checks in candidates.
21
+ - Add registered protocol/Playwright execution profiles with cancellation,
22
+ process-tree cleanup, real sandboxed-App checks and development StrictMode
23
+ harness guidance. Keep behavior metadata/tests outside production imports.
24
+ - Rename the external-library adaptation workflow and MCP prompt to `ads-migrate`;
25
+ retain `ads-import` for ADS-compatible source and token transfers.
26
+ - Expose compiler progress phases and restart a timed-out builder on the next
27
+ explicit preview request without requiring an MCP reconnect.
28
+
29
+ - Close the raw `ch` sizing gap across absolute/font-relative CSS length units,
30
+ nested calculations and numeric notation. Share unit categories with dimension
31
+ token validation; keep structural angles and responsive geometry available.
32
+ Preserve the demo's text measures in owned tokens with preview coverage.
33
+
34
+ - Close the whole MCP runtime on stdio wire closure, including broken output,
35
+ and stop browser sockets, subscriptions and preview processes together.
36
+ - Add an independent preview ownership guard so abrupt MCP process or process-group
37
+ death also terminates detached builders and their descendants.
38
+
39
+ ## 0.3.3
40
+
41
+ - Reject unused inline-style permissions and imperative property permissions.
42
+ Allow only the edited owner's boundary entries to accompany its source patch
43
+ atomically; preserve other settings and peer permissions.
44
+ - Keep directory unit ownership stable when removing an optional standalone
45
+ scenario; require actual coverage from remaining entries.
46
+ - Expose nonblocking pointer-capture cleanup advisories in CLI, MCP checks and
47
+ accepted mutations. Keep delegated cleanup and runtime correctness under review.
48
+ - Clarify demo framing, intentional product APIs and local asset fixtures in
49
+ diagnostics and skills; preserve component capabilities without demo-only props.
50
+
3
51
  ## 0.3.2
4
52
 
5
53
  - Enforce foundation CSS roles, parsed selector boundaries, root-only shared token
package/docs/GUIDE.md CHANGED
@@ -29,6 +29,20 @@ template strings and Shadow DOM style constructs lack equivalent coverage.
29
29
  Retain framework-specific checks; a clean ADS check does not validate those
30
30
  unchecked surfaces.
31
31
 
32
+ ### Controllers and behavior checks
33
+
34
+ Keep private controllers with their consumer; share reusable behavior through
35
+ `design-system/controllers/<Name>/`. Use the configured framework and declared
36
+ project dependencies. Controllers own lifecycle/measurements while components and
37
+ patterns own presentation. A shared context provider is a behavioral API too.
38
+
39
+ Optional owner-local `behavior.json` registers guarantees and maintained checks.
40
+ Scenario `exercises` records demonstrations separately from rendered `covers`.
41
+ Use `ads behaviors --json` for discovery and `ads verify --unit <discovered-id>`
42
+ to run registered cases; MCP exposes `ads_behaviors` and `ads_verify`. Tests and
43
+ contracts stay outside production exports. See the [complete schema and runner
44
+ integration](BEHAVIORS.md), including browser and React development StrictMode profiles.
45
+
32
46
  ### Linaria integration
33
47
 
34
48
  Before authoring components or patterns, integrate Linaria extraction with the
@@ -558,6 +572,7 @@ Application manifest metadata and other platform exports remain project-owned.
558
572
  | Asset ownership | ADS/public mount collisions, configured generated assets in source, and tracked generated output |
559
573
  | Product patterns | CSS/JSX namespace ownership; ADS implementations and showcase cannot import app source |
560
574
  | Primitive state | State-variable overrides outside components; undocumented non-state component variables |
575
+ | Literal visual values | Absolute/font-relative lengths (including `ch` and root font units), durations and color/effect formulas require tokens; geometry angles and responsive viewport/container relationships remain available |
561
576
  | Fixed token ownership | Foreign token names, shared token overrides, misplaced component/pattern/showcase variables, and noncanonical foundation imports |
562
577
  | Showcase ownership | Fixture CSS/Linaria definitions, custom JSX classes, native controls/widget roles, state styling, private CSS/aliased imports, legacy catalogue dependencies and source ownership, and runtime imports of fixtures/test helpers |
563
578
  | Scenario coverage | All public renderable UI has path-discovered entries, colocated fixtures, literal metadata and reachable public render references; runtime imports of scenarios/fixtures are rejected |
@@ -689,6 +704,15 @@ Registered project configuration and build helpers may import one another;
689
704
  this boundary is derived when lint configuration is generated. It does not
690
705
  allow application code to import private ADS modules or build helpers to import
691
706
  private UI implementation.
707
+
708
+ Unused `inlineStyleFiles` entries and `styleWrites` properties fail the core
709
+ `stale-style-boundary` check. Inline permissions recognize JSX, imported UI
710
+ factories and UI `CSSProperties` use; property permissions require an exact write
711
+ or removal, not a read. For MCP migrations, include the owner's source and only
712
+ its own exception entries through its `ds.config.json` companion. Preserve peer
713
+ permissions and other settings. A future filename can be valid configuration,
714
+ but the complete checked candidate must contain the matching use.
715
+
692
716
  `inlineStyleFiles` should name only documented geometry/renderer boundaries,
693
717
  not broad styling exceptions. Ignore `.ds/`; generated paths refer to the project
694
718
  and its locally installed tool.
@@ -708,7 +732,7 @@ Retain unrelated lint, type checking, and framework build commands.
708
732
  ## External content
709
733
 
710
734
  Use the repository's `ads-import` skill for selected external ADS source or theme
711
- values, and `ads-assimilate` for a native implementation inspired by an upstream
735
+ values, and `ads-migrate` for a native implementation inspired by an upstream
712
736
  library. These agent workflows handle dependency closure, token mapping, motion
713
737
  comparisons, source credits, applicable notices, and local documentation.
714
738
  They are agent workflows, rather than CLI import/design subcommands. Install
package/docs/MCP.md CHANGED
@@ -17,7 +17,11 @@ preview watcher and artifacts. Stdout remains exclusively JSON-RPC.
17
17
 
18
18
  For browser-only work, run `ads showcase` inside the project. It starts the same
19
19
  runtime without stdio. `--port 4185` selects a port; otherwise the OS chooses an
20
- available one. `ads mcp --no-showcase` disables the website for headless clients.
20
+ available one. For a stable address, add `"--port", "4191"` to the server's `args`
21
+ in `.mcp.json` (or the corresponding client configuration). An occupied explicit
22
+ port fails startup; ADS does not silently switch ports or terminate another live
23
+ client. Reuse the connected server's showcase instead of launching another one.
24
+ `ads mcp --no-showcase` disables the website for headless clients.
21
25
  The website binds to 127.0.0.1 and accepts its own origin only. It serves packaged
22
26
  client assets and MCP, with no arbitrary file reader or command launcher.
23
27
  Shutdown closes both transports, subscriptions and the managed compiler.
@@ -155,7 +159,7 @@ The server supplies agent guidance through its instructions, tool descriptions,
155
159
  | Tool | Purpose |
156
160
  |------|---------|
157
161
  | `ads_status` | Project paths, watcher/build states, preview revisions and diagnostics, skills |
158
- | `ads_catalog` | Bounded search for real public components/patterns and source/guide URIs |
162
+ | `ads_catalog` | Bounded search for public UI, controllers and hooks, with source/guide URIs |
159
163
  | `ads_tokens` | Bounded token-definition and theme inspection |
160
164
  | `ads_check` | Current core architectural diagnostics; registered Oxlint/build tests remain separate |
161
165
  | `ads_skills` | Workflow names/descriptions without loading instructions |
@@ -163,22 +167,50 @@ The server supplies agent guidance through its instructions, tool descriptions,
163
167
  | `ads_show_tokens` | Render a discovered token scenario; legacy compilers retain the definition inspector |
164
168
  | `ads_scenarios` | Bounded token/component/pattern/composition scenario discovery |
165
169
  | `ads_show_scenario` | Render an exact discovered scenario with its own fixtures |
170
+ | `ads_behaviors` | Bounded guarantee/evidence discovery; pass an exact unit for contract details |
171
+ | `ads_verify` | Execute an owner's registered checks and record revision-bound evidence |
166
172
  | `ads_show_<id>` | Optional explicitly configured grouped App |
167
173
  | `ads_units` | Discover edit owners and the files belonging to one unit |
168
174
  | `ads_read_file` | Read bounded source ranges, with owning unit and full-file digest |
169
175
  | `ads_apply_patch` | Opt-in Git unified diff for one ADS unit, with dry-run validation |
170
176
 
171
177
  Listings have bounded pages and opaque cursors. The source catalogue exposes
172
- public exports from `components/` and `patterns/`; it does not execute TSX to
178
+ public exports from `components/`, `patterns/` and `controllers/`; it does not execute TSX to
173
179
  guess component props. Read the exported API and owning guide. An export name
174
180
  alone does not prove that a preview renders that particular element.
175
181
 
176
- `ads://project/status`, `/build`, `/tokens`, `/catalog`, `/scenarios`, and `/checks` carry complete JSON
182
+ `ads://project/status`, `/build`, `/tokens`, `/catalog`, `/scenarios`, `/behaviors`, and `/checks` carry complete JSON
177
183
  detail. Allowed project documentation/source and skill files are separate
178
184
  resources. No arbitrary filesystem reader is exposed. Prefer bounded tools for
179
185
  large catalogues; explicit resource reads can enter model context and a client
180
186
  may truncate large payloads.
181
187
 
188
+ ### Behavioral verification
189
+
190
+ Read `ads://guides/behaviors` or the [behavior guide](BEHAVIORS.md) for the contract
191
+ and runner schema. `ads_behaviors({ "unit": "components/MessageScroller" })`
192
+ returns subjects, guarantees, demonstration links and check IDs for a discovered
193
+ owner. `ads_verify({ "unit": "components/MessageScroller", "checks": ["prepend-anchor"] })`
194
+ runs those registered cases. The names here are examples, never built-in cases.
195
+
196
+ `covers` describes rendered UI; optional `exercises` describes public behavioral
197
+ APIs used through reachable scenario code. Neither metadata nor README prose is
198
+ passing evidence. Verification runs trusted project commands from configured
199
+ profiles, without installing dependencies. It is available in read-only source
200
+ mode too and is annotated as executing commands/writing generated evidence.
201
+ Missing/skipped cases, unavailable runners and changed inputs cannot pass.
202
+ Results and subscribed resource notifications are available through
203
+ `ads://project/behaviors`; explicitly re-read evidence when notifications are absent.
204
+
205
+ Browser profiles start an isolated showcase and verify its sandboxed App using
206
+ the selected candidate's sources. StrictMode profiles need a project React
207
+ development harness. Profiles describe the execution environment, not a proof
208
+ that every possible interaction or lifecycle has been tested.
209
+
210
+ Guarded mutations also run affected registered behavior checks, including contracts
211
+ that depend on changed shared controllers. Failures reject the candidate before
212
+ writing real source. Projects without contracts retain their existing checks.
213
+
182
214
  ## Guarded editing
183
215
 
184
216
  Enable editing in the MCP launch arguments and reconnect:
@@ -209,6 +241,22 @@ imports for canonical files created/deleted in that patch. Preserve other import
209
241
  and comments, retain the foundation entry, and follow the required import order.
210
242
  Both files pass the same candidate checks before either is written.
211
243
 
244
+ Runtime owner manifests also list `ds.config.json` in `companionFiles`. An owner's
245
+ patch may update only its own `inlineStyleFiles` and `boundaries.styleWrites`
246
+ entries together with its source. All other settings and peer permissions must
247
+ remain unchanged. This supports atomic JSX-to-imperative geometry migrations,
248
+ new boundaries and removal of obsolete permissions without bypassing the gate.
249
+ Unused inline exceptions and properties never written fail `stale-style-boundary`;
250
+ configuration-first registration of an unused boundary therefore fails validation.
251
+ General policy, component customization hooks and compiler changes still use the
252
+ `configuration` unit.
253
+
254
+ A directory owner's runtime entry (`index` or a source file matching its directory
255
+ name) or colocated fixture keeps ownership stable without `Scenario.tsx`.
256
+ A redundant standalone scenario can be removed when other registered scenarios
257
+ still declare and actually render its public exports. Coverage requirements remain
258
+ in force; there is no metadata waiver for uncovered UI.
259
+
212
260
  The same discovery covers the rest of the project ADS:
213
261
 
214
262
  | Unit | Scope |
@@ -262,6 +310,13 @@ not an edit to live ADS source. Binary `ads_read_file` results return the digest
262
310
  byte count without encoded content. Git verifies the original binary blob and
263
311
  reconstructs the result inside the validation copy.
264
312
 
313
+ Resolve ownership diagnostics by preserving the required capability in its proper
314
+ layer. Demo-only sizing, borders and framing belong in a public review/layout
315
+ pattern; a component API addition needs a runtime use case. Measured imperative
316
+ geometry uses exact `styleWrites` properties. After migrating JSX inline geometry,
317
+ replace its own boundary entries in the same owner patch and check the final state.
318
+ After the gates pass, verify the behavior in a browser.
319
+
265
320
  A small change needs only its hunk. A complete new component may include its
266
321
  implementation, public re-export, scenario and fixture in the same unit patch,
267
322
  so coverage is checked against a complete candidate. New units use a new
@@ -378,6 +433,13 @@ and unchanged styles/fonts are reused. External hosts may create a fresh App for
378
433
  each tool call. Each fresh App loads independently through the same contract.
379
434
  There is no special local direct-artifact rendering path.
380
435
 
436
+ `ads_check` returns blocking `diagnostics` separately from bounded nonblocking
437
+ `advisories`, with `advisoryCount`. The checks resource contains the full result.
438
+ For example, `pointer-capture-review` reports capture without a locally visible
439
+ capture-loss handler. Cleanup can be delegated; inspect it and test cancellation,
440
+ capture loss and teardown. A local handler suppresses that advisory but does not
441
+ prove correct behavior. Accepted mutations also return bounded advisories.
442
+
381
443
  ### Host boundary and compatibility
382
444
 
383
445
  The showcase's packaged shell retains its own minimal CSS and navigation. It
@@ -510,8 +572,15 @@ Managed configuration changes replace the compiler through the same supervisor.
510
572
  Updating ADS server code itself still requires reconnecting the MCP client to load
511
573
  the new package. Normal component, fixture and style edits remain automatic.
512
574
 
513
- ADS stops the managed watcher and its compiler subprocesses when stdin closes or
514
- it receives SIGINT/SIGTERM. The project must keep its watcher in the foreground,
575
+ ADS closes both network hosts and stops the managed watcher and its compiler
576
+ subprocesses when the stdio wire closes, including EOF or broken output, or it
577
+ receives SIGINT/SIGTERM. Active browser subscriptions do not retain the runtime.
578
+ A small independent ownership guard watches a pipe from MCP; owner death closes
579
+ that pipe even after SIGKILL. The guard terminates the owned compiler process
580
+ group, escalates for stubborn descendants, then exits. It is disarmed on ordinary
581
+ shutdown; `previewWatch.guardPid` identifies it while running. This requires no
582
+ second user command and applies to custom builders too.
583
+ The project must keep its watcher in the foreground,
515
584
  rather than launching detached background processes. The configuration is
516
585
  trusted project setup; MCP tools accept no executable or command arguments.
517
586
  To manage builds yourself, omit `previewWatch` or set it to `null`, then run the
@@ -650,7 +719,7 @@ See the [MCP Apps specification](https://github.com/modelcontextprotocol/ext-app
650
719
  | Each of the five ADS skill names | `request` | Select that workflow and its skill resource |
651
720
 
652
721
  Example: get `ads-inspect` with `element="Button states in both themes"`, or
653
- `ads-assimilate` with `request` containing the upstream component-library URL.
722
+ `ads-migrate` with `request` containing the upstream component-library URL.
654
723
  Prompts explain Data/UX/Skin ownership, public API reuse, fixture boundaries,
655
724
  which tools select widgets, progressive skill reads and validation. They guide
656
725
  reasoning rather than inventing another component implementation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.3.2",
3
+ "version": "0.3.5",
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": {
@@ -69,6 +69,7 @@
69
69
  "@modelcontextprotocol/client": "2.3.1",
70
70
  "@modelcontextprotocol/ext-apps": "2.0.3",
71
71
  "@modelcontextprotocol/sdk": "1.32.1",
72
+ "@playwright/test": "1.64.1",
72
73
  "@preact/signals": "2.11.3",
73
74
  "@types/node": "^25.9.2",
74
75
  "@types/react": "^19.2.17",
@@ -98,7 +99,8 @@
98
99
  "./mcp/build": "./dist/mcp/build-status.mjs",
99
100
  "./scenarios": "./dist/scenarios.mjs",
100
101
  "./scenarios/vite": "./dist/scenarios-vite.mjs",
101
- "./scenarios/compiler": "./dist/scenarios-compiler.mjs"
102
+ "./scenarios/compiler": "./dist/scenarios-compiler.mjs",
103
+ "./verification": "./dist/verification/browser.mjs"
102
104
  },
103
105
  "files": [
104
106
  "dist",
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "ADS Assimilate"
3
- short_description: "Adapt reference components into a native design system"
4
- default_prompt: "Use $ads-assimilate with a component-library URL to implement and verify a native design-system component."