@reqvire-org/ads 0.3.25 → 0.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -15
- package/dist/bootstrap-ds/ADS.md +28 -30
- package/dist/bootstrap-ds/README.md +13 -11
- package/dist/bootstrap-ds/design-system/assets/brand/README.md +3 -2
- package/dist/bootstrap-ds/ds.config.json +1 -1
- package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +1 -1
- package/dist/boundaries.mjs +0 -3
- package/dist/capture.mjs +1 -1
- package/dist/check.mjs +15 -22
- package/dist/config.mjs +3 -7
- package/dist/contract-migration.mjs +2 -2
- package/dist/contracts.d.mts +0 -1
- package/dist/design-values.mjs +81 -0
- package/dist/development-runtime.mjs +17 -0
- package/dist/evidence.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/init.mjs +14 -12
- package/dist/mcp/apps.mjs +1 -1
- package/dist/mcp/context.mjs +8 -7
- package/dist/mcp/mutations.mjs +3 -2
- package/dist/mcp/preview-watch.mjs +2 -1
- package/dist/mcp/prompts.mjs +4 -4
- package/dist/mcp/reports.mjs +101 -0
- package/dist/mcp/server.mjs +41 -3
- package/dist/mcp/widget.bundle.js +1 -1
- package/dist/paint-contracts.mjs +4 -5
- package/dist/preview-files.mjs +33 -0
- package/dist/preview-inputs.mjs +6 -5
- package/dist/preview-resources.mjs +1 -2
- package/dist/scenarios-compiler.mjs +7 -7
- package/dist/scenarios.mjs +14 -14
- package/dist/showcase/sandbox.bundle.js +1 -1
- package/dist/skills/README.md +14 -4
- package/dist/skills/ads-break-ui/SKILL.md +29 -15
- package/dist/skills/ads-break-ui/references/atomic-styles.md +9 -2
- package/dist/skills/ads-break-ui/references/behaviors.md +396 -0
- package/dist/skills/ads-break-ui/references/captures.md +1 -1
- package/dist/skills/ads-break-ui/references/contracts.md +18 -37
- package/dist/skills/ads-break-ui/references/design-data.md +91 -0
- package/dist/skills/ads-break-ui/references/evidence.md +4 -0
- package/dist/skills/ads-break-ui/references/guarded-editing.md +7 -11
- package/dist/skills/ads-break-ui/references/layers.md +16 -0
- package/dist/skills/ads-break-ui/references/reporting.md +101 -0
- package/dist/skills/ads-break-ui/references/runtimes.md +110 -0
- package/dist/skills/ads-break-ui/references/scenarios.md +9 -15
- package/dist/skills/ads-designer/README.md +6 -0
- package/dist/skills/ads-designer/SKILL.md +35 -20
- package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +28 -30
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +13 -11
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +3 -2
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -1
- package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +1 -1
- package/dist/skills/ads-designer/references/atomic-styles.md +9 -2
- package/dist/skills/ads-designer/references/behaviors.md +396 -0
- package/dist/skills/ads-designer/references/captures.md +1 -1
- package/dist/skills/ads-designer/references/cli.md +10 -7
- package/dist/skills/ads-designer/references/contracts.md +18 -37
- package/dist/skills/ads-designer/references/design-craft.md +32 -1
- package/dist/skills/ads-designer/references/design-data.md +91 -0
- package/dist/skills/ads-designer/references/evidence.md +4 -0
- package/dist/skills/ads-designer/references/guarded-editing.md +7 -11
- package/dist/skills/ads-designer/references/layers.md +16 -0
- package/dist/skills/ads-designer/references/mobile.md +1 -1
- package/dist/skills/ads-designer/references/reporting.md +101 -0
- package/dist/skills/ads-designer/references/runtimes.md +110 -0
- package/dist/skills/ads-designer/references/scenarios.md +9 -15
- package/dist/skills/ads-import/SKILL.md +51 -20
- package/dist/skills/ads-import/agents/openai.yaml +2 -2
- package/dist/skills/ads-import/references/atomic-styles.md +9 -2
- package/dist/skills/ads-import/references/behaviors.md +396 -0
- package/dist/skills/ads-import/references/branding.md +1 -1
- package/dist/skills/ads-import/references/captures.md +1 -1
- package/dist/skills/ads-import/references/cli.md +10 -7
- package/dist/skills/ads-import/references/compatibility.md +113 -0
- package/dist/skills/ads-import/references/contracts.md +18 -37
- package/dist/skills/ads-import/references/design-data.md +91 -0
- package/dist/skills/ads-import/references/evidence.md +4 -0
- package/dist/skills/ads-import/references/guarded-editing.md +7 -11
- package/dist/skills/ads-import/references/implementation.md +9 -2
- package/dist/skills/ads-import/references/layers.md +16 -0
- package/dist/skills/ads-import/references/reporting.md +101 -0
- package/dist/skills/ads-import/references/runtimes.md +110 -0
- package/dist/skills/ads-import/references/scenarios.md +9 -15
- package/dist/skills/ads-import/references/tokens.md +11 -9
- package/dist/skills/ads-motion/SKILL.md +28 -14
- package/dist/skills/ads-motion/references/atomic-styles.md +9 -2
- package/dist/skills/ads-motion/references/behaviors.md +396 -0
- package/dist/skills/ads-motion/references/captures.md +1 -1
- package/dist/skills/ads-motion/references/contracts.md +18 -37
- package/dist/skills/ads-motion/references/design-data.md +91 -0
- package/dist/skills/ads-motion/references/evidence.md +4 -0
- package/dist/skills/ads-motion/references/guarded-editing.md +7 -11
- package/dist/skills/ads-motion/references/layers.md +16 -0
- package/dist/skills/ads-motion/references/reporting.md +101 -0
- package/dist/skills/ads-motion/references/runtimes.md +110 -0
- package/dist/skills/ads-motion/references/scenarios.md +9 -15
- package/dist/skills/{ads-migrate → ads-port}/SKILL.md +64 -33
- package/dist/skills/ads-port/agents/openai.yaml +4 -0
- package/dist/skills/{ads-migrate → ads-port}/references/atomic-styles.md +9 -2
- package/dist/skills/ads-port/references/behaviors.md +396 -0
- package/dist/skills/{ads-migrate → ads-port}/references/captures.md +1 -1
- package/dist/skills/{ads-migrate → ads-port}/references/cli.md +10 -7
- package/dist/skills/{ads-migrate → ads-port}/references/contracts.md +18 -37
- package/dist/skills/ads-port/references/design-data.md +91 -0
- package/dist/skills/{ads-migrate → ads-port}/references/evidence.md +4 -0
- package/dist/skills/{ads-migrate → ads-port}/references/guarded-editing.md +7 -11
- package/dist/skills/{ads-migrate → ads-port}/references/layers.md +16 -0
- package/dist/skills/{ads-migrate → ads-port}/references/lint-and-docs.md +5 -0
- package/dist/skills/{ads-migrate → ads-port}/references/native-implementation.md +49 -15
- package/dist/skills/ads-port/references/reporting.md +101 -0
- package/dist/skills/ads-port/references/runtimes.md +110 -0
- package/dist/skills/{ads-migrate → ads-port}/references/scenarios.md +9 -15
- package/dist/skills/{ads-migrate → ads-port}/references/testing.md +11 -1
- package/dist/tokens.mjs +5 -8
- package/dist/unit-contracts.mjs +1 -8
- package/dist/verification.mjs +4 -3
- package/docs/ADS.md +59 -73
- package/docs/ARCHITECTURE.md +68 -20
- package/docs/BEHAVIORS.md +46 -41
- package/docs/CHANGELOG.md +44 -1
- package/docs/COMPARISON.md +63 -0
- package/docs/CONTRACTS.md +18 -37
- package/docs/GUIDE.md +41 -23
- package/docs/MCP.md +100 -15
- package/package.json +5 -4
- package/dist/scoped-tokens.mjs +0 -68
- package/dist/skills/ads-migrate/agents/openai.yaml +0 -4
- /package/dist/skills/{ads-migrate → ads-port}/references/review.md +0 -0
|
@@ -0,0 +1,396 @@
|
|
|
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
|
+
Register owner behavior in `<Owner>.ads.contract.ts` with actual API and
|
|
29
|
+
implementation references. The
|
|
30
|
+
[contract reference](contracts.md) covers static authoring, `.ads.behavior.spec.ts`,
|
|
31
|
+
declarative `exercises`, required browser checks and guarded migration.
|
|
32
|
+
A contract declaration alone is not passing evidence. Use
|
|
33
|
+
`auditBehaviorPaints(frame)` after relevant binding updates to repeat the current
|
|
34
|
+
App's generic paint audit, in addition to assertions for the named guarantee.
|
|
35
|
+
|
|
36
|
+
## Development boundary
|
|
37
|
+
|
|
38
|
+
Production includes real components, controllers, tokens and compiled styles.
|
|
39
|
+
Scenarios and fixtures are included only in previews. Behavior manifests and test
|
|
40
|
+
files are development/tooling inputs. Runtime imports and public re-exports of
|
|
41
|
+
those inputs are rejected, including dynamic imports and aliases.
|
|
42
|
+
|
|
43
|
+
## Register guarantees
|
|
44
|
+
|
|
45
|
+
An optional `<Owner>.ads.contract.ts` belongs to one unit. Owners without a
|
|
46
|
+
behavior declaration have no implied behavioral verification. ADS reads the
|
|
47
|
+
contract statically; it does not execute these imports or a project command:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import type { UnitContract } from "@reqvire-org/ads/contracts";
|
|
51
|
+
import { ScrollerController } from "./scroller-controller";
|
|
52
|
+
import { useMessageScroller } from "./MessageScroller";
|
|
53
|
+
|
|
54
|
+
export default {
|
|
55
|
+
schemaVersion: 1,
|
|
56
|
+
behavior: {
|
|
57
|
+
subjects: {
|
|
58
|
+
controller: { implementation: ScrollerController },
|
|
59
|
+
"scroll-api": { api: useMessageScroller },
|
|
60
|
+
},
|
|
61
|
+
guarantees: [{
|
|
62
|
+
id: "prepend-anchor",
|
|
63
|
+
description: "Prepending history preserves the visible anchor after layout settles.",
|
|
64
|
+
subjects: ["controller", "scroll-api"],
|
|
65
|
+
checks: ["prepend-anchor"],
|
|
66
|
+
}],
|
|
67
|
+
checks: {
|
|
68
|
+
"prepend-anchor": {
|
|
69
|
+
file: "./MessageScroller.ads.behavior.spec.ts",
|
|
70
|
+
case: "prepend-anchor",
|
|
71
|
+
scenario: "components/MessageScroller",
|
|
72
|
+
profile: "widget",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
} satisfies UnitContract;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Names above are illustrative project choices. A subject identifies a public API
|
|
80
|
+
or an implementation symbol owned by the unit. Private subjects do not become
|
|
81
|
+
public API. A guarantee references known subjects and checks. Each check names a
|
|
82
|
+
colocated test/spec file, stable case ID, registered profile and optional
|
|
83
|
+
discovered scenario. Several guarantees may reference one check. Repeated
|
|
84
|
+
execution identities use the same check ID.
|
|
85
|
+
|
|
86
|
+
Private subjects default to the headless controller role. For an intentionally
|
|
87
|
+
visual internal renderer or binding producer, declare `role: "implementation"`
|
|
88
|
+
alongside its `implementation` reference in the contract. Its source ownership and normal runtime gates
|
|
89
|
+
still apply; registration does not make it public API. Shared `controllers/`
|
|
90
|
+
source remains headless regardless of subject metadata. See the
|
|
91
|
+
[owner contract](contracts.md#a-contract-uses-actual-implementation-references).
|
|
92
|
+
|
|
93
|
+
Static validation establishes registration and ownership, not that the guarantee
|
|
94
|
+
is true. README prose is not automatically certified. Link specific guarantees
|
|
95
|
+
when describing the evidence available for a behavior.
|
|
96
|
+
|
|
97
|
+
## Link a public API to a demonstration
|
|
98
|
+
|
|
99
|
+
Scenario `covers` retains its existing render-reference contract. Optional
|
|
100
|
+
`exercises` identifies public behavioral APIs:
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
export const scenario = {
|
|
104
|
+
title: "Message scrolling",
|
|
105
|
+
covers: ["MessageScroller", "MessageScrollerViewport"],
|
|
106
|
+
exercises: ["useMessageScroller", "useMessageScrollerScrollable"],
|
|
107
|
+
};
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Call hooks in a rendered local scenario adapter. Calls/construction are matched by
|
|
111
|
+
resolved symbol, not a `use*` naming convention. An unused import, dead adapter or
|
|
112
|
+
metadata string does not count. Dynamically passed behavior references produce a
|
|
113
|
+
review advisory when a direct call cannot be established; verify those through
|
|
114
|
+
registered execution checks rather than changing the API for the analyzer.
|
|
115
|
+
|
|
116
|
+
Callable exports may be functions, callable objects with attached methods, or
|
|
117
|
+
factory results. ADS uses their TypeScript call/construct signatures, including
|
|
118
|
+
the project's library declarations; it does not execute modules or maintain a
|
|
119
|
+
list of recognized factory names. The fast source guard resolves ambiguous public
|
|
120
|
+
values lazily and shares that type discovery within the check. Untyped `any`
|
|
121
|
+
values and objects containing methods do not establish a callable API.
|
|
122
|
+
An invalid `exercises` entry names the offending value and fails validation while
|
|
123
|
+
retaining independent render evidence for `covers`.
|
|
124
|
+
Calls to a callable's attached methods also exercise that public receiver,
|
|
125
|
+
including statically named member calls inside reachable event-handler closures.
|
|
126
|
+
Aliases, namespace access and re-exports retain the receiver identity. Reading a
|
|
127
|
+
method or defining an unused callback does not establish an invocation.
|
|
128
|
+
|
|
129
|
+
Public APIs appear in `ads_catalog` with `apiKind: "ui"` or `"behavior"` and their
|
|
130
|
+
scenario links. `ads_behaviors` joins contracts to demonstrations and evidence.
|
|
131
|
+
A demonstrated API is not automatically a verified guarantee.
|
|
132
|
+
|
|
133
|
+
## Register execution profiles
|
|
134
|
+
|
|
135
|
+
Profiles are explicit trusted development commands in `ds.config.json`. They use
|
|
136
|
+
literal executable/argument arrays, no shell interpolation or model-supplied
|
|
137
|
+
command. For a project with an installed Playwright test runner:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"mcp": {
|
|
142
|
+
"behaviorProfiles": {
|
|
143
|
+
"widget": {
|
|
144
|
+
"runner": "playwright",
|
|
145
|
+
"command": "runtime",
|
|
146
|
+
"args": ["node_modules/@playwright/test/cli.js", "test"],
|
|
147
|
+
"mode": "browser",
|
|
148
|
+
"timeoutMs": 60000
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Here `runtime` uses the Node or Bun interpreter that launched ADS, and the
|
|
156
|
+
project supplies the installed Playwright entry. Explicit executable commands
|
|
157
|
+
retain their meaning. A Bun package-script profile can use `command: "bun"`
|
|
158
|
+
with `args: ["--bun", "run", "test:behavior", "--"]`. The Playwright
|
|
159
|
+
configuration must discover colocated spec files. Configure browser installation
|
|
160
|
+
and any required test setup in that project. The ADS tooling host gains no
|
|
161
|
+
framework or browser dependency from a profile.
|
|
162
|
+
|
|
163
|
+
The Playwright adapter appends selected file paths and case-tag filtering, its
|
|
164
|
+
reporter and a generated artifact directory. Unselected cases in the same spec
|
|
165
|
+
do not run. It preserves the project's worker configuration.
|
|
166
|
+
|
|
167
|
+
`timeoutMs` bounds the complete runner process for one profile, including runner
|
|
168
|
+
startup, hooks, retries and all selected cases. It is not a per-test timeout.
|
|
169
|
+
Playwright's own test/hook timeouts remain separate project settings. Set the
|
|
170
|
+
profile budget from measured suite durations with headroom; increasing it does
|
|
171
|
+
not repair a stalled assertion or cleanup.
|
|
172
|
+
|
|
173
|
+
Independent specs can use multiple Playwright workers against the same managed
|
|
174
|
+
candidate host. Each check needs its own page/context and state; avoid fixed ports,
|
|
175
|
+
shared mutable fixtures and test-order dependencies. Start with a small worker
|
|
176
|
+
count and measure on the target machine. Files normally run in parallel; tests
|
|
177
|
+
within one file normally remain sequential. ADS does not force parallelism or
|
|
178
|
+
change verification policy. See [Playwright parallelism](https://playwright.dev/docs/test-parallel).
|
|
179
|
+
Prefer readiness/assertion polling over arbitrary sleeps. Timer-only guarantees
|
|
180
|
+
may use [Playwright's clock](https://playwright.dev/docs/clock); retain real time
|
|
181
|
+
when browser motion, pointer gestures or layout timing are what the check verifies.
|
|
182
|
+
|
|
183
|
+
An ordinary test-failure exit (code 1) with a complete report and actual failing
|
|
184
|
+
cases preserves independent case outcomes: passing checks stay `passed`, failed
|
|
185
|
+
checks stay `failed`, and overall verification still blocks the mutation. The
|
|
186
|
+
report must account for every selected check, with no active cases or suite errors.
|
|
187
|
+
The same rule supports older custom reports without an explicit `complete` field
|
|
188
|
+
after normal process completion. An unexplained nonzero exit cannot certify a
|
|
189
|
+
pass, even if all reported cases claim success. Results retain `reportedStatus`
|
|
190
|
+
and `runnerExitCode` and explain the overall failure. Suite-level browser errors and
|
|
191
|
+
bounded runner output appear in diagnostics. `openBehaviorScenario` includes the
|
|
192
|
+
scenario ID and failed browser requests in startup failures; App resource errors
|
|
193
|
+
identify the resource URI. The ADS showcase retries only `resources/read` fetch
|
|
194
|
+
transport failures, with at most three attempts and 200/800 ms backoff. Recovered
|
|
195
|
+
startup reads appear in `startupDiagnostics` with retry counts and failed browser
|
|
196
|
+
requests; each retry is also logged in the browser console. This does not retry a
|
|
197
|
+
tool call, assertion, check or complete startup. HTTP/protocol/content errors,
|
|
198
|
+
integrity failures and cancellations do not retry. Persistent loading failures
|
|
199
|
+
still fail the check and block mutations. External hosts control their own
|
|
200
|
+
transport recovery.
|
|
201
|
+
|
|
202
|
+
`net::ERR_NETWORK_CHANGED` reports Chrome's network-change error, not proof that
|
|
203
|
+
the MCP endpoint restarted or that a particular interface changed. To investigate
|
|
204
|
+
an intermittent failure, correlate the saved case timestamps with Chrome's
|
|
205
|
+
network log, server availability and live interface monitoring (for example,
|
|
206
|
+
`ip -ts monitor link address route` on Linux). Interfaces being present, or stable
|
|
207
|
+
after a failure, does not establish the cause. Preserve the draft and original
|
|
208
|
+
diagnostic; do not change a component API, reference example or verification
|
|
209
|
+
policy to compensate for a resource-loading failure.
|
|
210
|
+
|
|
211
|
+
The reporter atomically publishes partial snapshots at test start/end. While a
|
|
212
|
+
run is active, `ads_status.behaviors.progress` exposes the profile, runner budget,
|
|
213
|
+
elapsed time, completed/active/pending counts, worker count when available and
|
|
214
|
+
case identities/timings. Candidate mutation verification exposes the same data at
|
|
215
|
+
`ads_status.mutations.progress`. Clients requesting MCP progress receive updates
|
|
216
|
+
and a heartbeat during the runner phase; client-side request timeouts still apply.
|
|
217
|
+
`durationMs` records completed case execution, including attempts, separately from
|
|
218
|
+
the suite's wall time. Parallel case durations can sum to more than wall time.
|
|
219
|
+
|
|
220
|
+
After a deadline, valid completed outcomes remain visible through `reportedStatus`
|
|
221
|
+
and durations, alongside active and unstarted case identities. A passed case from
|
|
222
|
+
an interrupted run has blocking status `incomplete`; real assertion failures retain
|
|
223
|
+
their own messages. No incomplete run can accept a mutation or certify a guarantee.
|
|
224
|
+
Reports and artifacts stay under the live project's `.ds/verification/` even after
|
|
225
|
+
the candidate copy is removed. This is diagnostic output, not passing live-source
|
|
226
|
+
evidence. Old/custom runners without incremental progress use `not_reported` for
|
|
227
|
+
cases whose execution state cannot be established.
|
|
228
|
+
|
|
229
|
+
Use native test tags for stable case identity:
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
import { test, expect } from "@playwright/test";
|
|
233
|
+
import { openBehaviorScenario } from "@reqvire-org/ads/verification";
|
|
234
|
+
|
|
235
|
+
test("history preserves the visible anchor", { tag: "@ads:prepend-anchor" }, async ({ page }) => {
|
|
236
|
+
const frame = await openBehaviorScenario(page, "prepend-anchor");
|
|
237
|
+
// Perform real interactions and assert the project's guarantee here.
|
|
238
|
+
await expect(frame.getByRole("region", { name: "Messages" })).toBeVisible();
|
|
239
|
+
});
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
The shown assertion is only a harness example; it does not establish anchoring.
|
|
243
|
+
Write meaningful assertions for the registered guarantee. The helper waits for
|
|
244
|
+
the current selected scenario inside the real sandboxed MCP App. It uses `load`
|
|
245
|
+
and explicit readiness, not `networkidle`: MCP keeps event connections open.
|
|
246
|
+
|
|
247
|
+
Compare reference and candidate under equivalent framing. In a reported Chrome
|
|
248
|
+
comparison, `content-visibility` initially used placeholder geometry inside a
|
|
249
|
+
cross-origin App iframe for both ADS and the upstream reference; the same content
|
|
250
|
+
measured differently as a top-level page. This is an observed browser/layout
|
|
251
|
+
condition, not evidence of an ADS defect. App readiness does not imply that every
|
|
252
|
+
off-screen item has rendered. For geometry assertions, bring the relevant content
|
|
253
|
+
into view and wait for its measured layout to settle. Record the framing and
|
|
254
|
+
visibility state; test initial placeholder behavior separately when it matters to
|
|
255
|
+
the guarantee. Wait for focus and positioning readiness before normal keyboard
|
|
256
|
+
comparisons, and test rapid input separately rather than hiding it behind delays.
|
|
257
|
+
|
|
258
|
+
`mode: "browser"` starts an isolated managed showcase on an automatic port. Test
|
|
259
|
+
requests contain its scenario URLs, and cleanup closes its host/compiler tree.
|
|
260
|
+
Mutation candidates use their own source, generated graph and server; a passing
|
|
261
|
+
test against an older fixed-port live showcase cannot validate a candidate.
|
|
262
|
+
|
|
263
|
+
Use `mode: "strict"` only for React with a project development harness that mounts
|
|
264
|
+
the relevant API in StrictMode. The production MCP App does not replay development
|
|
265
|
+
effects. This profile does not receive a production showcase URL from the helper.
|
|
266
|
+
For Preact, register its actual lifecycle tests without claiming React StrictMode.
|
|
267
|
+
The profile names record the chosen environment; ADS does not infer that a test's
|
|
268
|
+
assertions cover every lifecycle condition.
|
|
269
|
+
|
|
270
|
+
Other runners use `runner: "protocol"` (the default). ADS provides
|
|
271
|
+
`ADS_VERIFY_REQUEST` and `ADS_VERIFY_REPORT` absolute paths. Read the request's
|
|
272
|
+
`schemaVersion`, unique `runId`, `projectRoot`, `framework`, `profile`, `mode`,
|
|
273
|
+
selected `checks` and optional `scenarios` URLs. Write a bounded JSON report:
|
|
274
|
+
|
|
275
|
+
```json
|
|
276
|
+
{
|
|
277
|
+
"schemaVersion": 1,
|
|
278
|
+
"runId": "<the request's runId>",
|
|
279
|
+
"cases": [
|
|
280
|
+
{
|
|
281
|
+
"id": "prepend-anchor",
|
|
282
|
+
"file": "design-system/components/MessageScroller/MessageScroller.ads.behavior.spec.ts",
|
|
283
|
+
"status": "passed"
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Case statuses are `passed`, `failed` or `skipped`, with optional `message` and
|
|
290
|
+
`durationMs`. Protocol runners may atomically publish intermediate reports with
|
|
291
|
+
`complete:false` and an `active` list of `{id,file,startedAt,workerIndex?}`, then
|
|
292
|
+
publish `complete:true` at completion. Older final reports without `complete`
|
|
293
|
+
remain supported after normal process completion. An explicitly incomplete report
|
|
294
|
+
cannot pass even with exit code zero. Partial reports retain the same schema/run
|
|
295
|
+
identity and size limits as final reports.
|
|
296
|
+
Cases may optionally include `failure: {category,phase,code,certainty?}`,
|
|
297
|
+
`source: {file,line,column}`, `failingStep`, `viewport`/`viewportSource`, and
|
|
298
|
+
`artifacts: [{name,mimeType,path}]`. Artifact paths are relative to the report
|
|
299
|
+
directory and must remain under that run's `artifacts/` directory. The built-in
|
|
300
|
+
Playwright reporter supplies these from actual step/startup/attachment evidence.
|
|
301
|
+
Older protocol runners can omit them; ADS preserves that lack of classification
|
|
302
|
+
instead of treating an arbitrary thrown message as an assertion.
|
|
303
|
+
`file` is project-relative. Nonzero process exit, missing cases, skipped cases,
|
|
304
|
+
wrong run IDs and unavailable reports do not pass. Test commands are trusted
|
|
305
|
+
project code; an adapter cannot prove the quality or honesty of their assertions.
|
|
306
|
+
|
|
307
|
+
## Execute and inspect evidence
|
|
308
|
+
|
|
309
|
+
Use `ads_behaviors` for bounded discovery; request an exact unit for its contract.
|
|
310
|
+
General listings return counts and short API/guarantee/scenario summaries. Exact
|
|
311
|
+
owner requests return the registered details; source reads remain available for
|
|
312
|
+
bounded inspection of large contracts. No full guide or test body is injected
|
|
313
|
+
into discovery results.
|
|
314
|
+
Call `ads_verify({unit, checks?})` for selected registered checks. Read
|
|
315
|
+
`ads://project/behaviors` for current evidence or `ads://guides/behaviors` for this
|
|
316
|
+
guide. CLI/CI equivalents are:
|
|
317
|
+
|
|
318
|
+
```sh
|
|
319
|
+
ads behaviors . --json
|
|
320
|
+
ads verify . --unit controllers/ScrollFollow
|
|
321
|
+
ads verify . --unit components/MessageScroller --check prepend-anchor --json
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Execution has bounded output, a configured timeout, cancellation and process-tree
|
|
325
|
+
ownership. Evidence records case/profile identity, source/dependency revision,
|
|
326
|
+
completion time, report path and the available preview revision. Later input
|
|
327
|
+
changes mark results stale; changes during execution prevent a current pass.
|
|
328
|
+
Guarantees report passing only when all their checks have current passing evidence.
|
|
329
|
+
Passing applies to those cases and profiles, not every application state.
|
|
330
|
+
|
|
331
|
+
Results expose structured `failure` boundaries and explicit `acceptance` scope.
|
|
332
|
+
MCP execution replies contain counts, bounded acceptance, at most three failure
|
|
333
|
+
previews and a `resultId` (4 KiB UTF-8 JSON maximum). Use `ads_results` to read
|
|
334
|
+
selected `outcomes`, `checks`, `diagnostics` or other sections without execution.
|
|
335
|
+
Pages default to 10 rows, allow at most 20 and stay within 8 KiB; follow
|
|
336
|
+
`nextCursor` with identical selection/status. Truncated records provide
|
|
337
|
+
`recordIndex` for exact `offset`/`chars` ranges. Only the latest verification and
|
|
338
|
+
mutation snapshots are retained, independently, at most 8 MiB each. Replaced IDs
|
|
339
|
+
fail explicitly. Validation still uses complete internal outcomes.
|
|
340
|
+
|
|
341
|
+
Use `ads_investigate({unit,check,runId})` with an outcome's exact IDs for its compact
|
|
342
|
+
summary (4 KiB maximum); details, requests, browser errors and artifact metadata are separate
|
|
343
|
+
paged sections (8 KiB maximum). Truncated records support exact text ranges with
|
|
344
|
+
the recorded run ID. Saved outcomes describe completion time; compare current
|
|
345
|
+
`ads_behaviors` revisions for freshness. It includes isolated dry runs; `ads://project/investigations` lists available entries. Exact
|
|
346
|
+
input and observed preview revisions, failing step/source, startup viewport,
|
|
347
|
+
failed startup requests and available project-recorded artifacts keep diagnosis
|
|
348
|
+
separate from an inferred component defect. No artifact is invented or test
|
|
349
|
+
retried. Each check retains one latest bundle; old artifact resource access is
|
|
350
|
+
superseded. Candidate bundles remain distinct from passing live-source evidence.
|
|
351
|
+
Read the portable [evidence reference](evidence.md)
|
|
352
|
+
for category meanings, collection limits and artifact policy.
|
|
353
|
+
|
|
354
|
+
Revisions include owned files, literal import dependencies, local CSS imports and
|
|
355
|
+
asset URLs, token foundation, project/runner configuration, lockfiles and tooling.
|
|
356
|
+
Computed module selection conservatively includes all ADS owners. Environment,
|
|
357
|
+
network and other unregistered external inputs remain the runner's responsibility;
|
|
358
|
+
an evidence record is not a proof about arbitrary external state.
|
|
359
|
+
|
|
360
|
+
For named imports through simple re-export barrels, ADS follows selected bindings
|
|
361
|
+
and retains dependencies with declared side effects. This narrowing requires a
|
|
362
|
+
package `sideEffects:false` or a supported simple `sideEffects` glob array; preserve
|
|
363
|
+
CSS/global effects in that policy. Unknown policies/patterns, wildcard exports and
|
|
364
|
+
computed imports remain conservative. Barrel source changes still invalidate
|
|
365
|
+
dependents. ADS caches source parsing, resolution and digests within an inspection
|
|
366
|
+
only; later runs read current source again.
|
|
367
|
+
|
|
368
|
+
Guarded mutations execute affected registered behavior contracts after core,
|
|
369
|
+
Oxlint and configured project checks, before writing source. Imported shared
|
|
370
|
+
controller changes also select dependent contracts conservatively. Rejected and
|
|
371
|
+
dry-run patches publish no source changes. Verification output stays under `.ds/`.
|
|
372
|
+
To check a prepared draft, request its diff and pass the returned `patchFile` to
|
|
373
|
+
`ads_apply_patch` with `dryRun:true`. This checks the isolated candidate, including
|
|
374
|
+
affected behavior contracts and its configured browser preview. Candidate evidence
|
|
375
|
+
is not persisted as passing evidence for live source. `ads_verify` selects checks
|
|
376
|
+
for current source and has no draft argument.
|
|
377
|
+
|
|
378
|
+
## Packaging and performance
|
|
379
|
+
|
|
380
|
+
Controllers follow normal component/scenario imports into the project's compiled
|
|
381
|
+
resource graph. Their framework dependencies are bundled by the project compiler
|
|
382
|
+
and served through MCP resources inside the App iframe; external hosts install
|
|
383
|
+
nothing. The selected scenario loads its dependency closure. Shared modules are
|
|
384
|
+
cached within that App instance, and each separately opened App has its own runtime.
|
|
385
|
+
|
|
386
|
+
Keep ESM modules and explicit imports. Avoid an eagerly imported controller
|
|
387
|
+
registry. Tree shaking and shared chunks follow the project bundler: class methods,
|
|
388
|
+
side effects, global CSS and dynamic maps can retain extra code. Inspect emitted
|
|
389
|
+
resources instead of assuming a controller produces a minimal bundle.
|
|
390
|
+
|
|
391
|
+
Development-only `review/<Owner>` units may register the same guarantee/check
|
|
392
|
+
contracts for review presentation and controls. Subjects can name that owner's
|
|
393
|
+
separate review API or local headless helpers; checks still run registered project
|
|
394
|
+
profiles and can refer to an existing real scenario. This grants no production
|
|
395
|
+
API, catalogue entry, `covers` credit or runtime import permission. See the
|
|
396
|
+
[portable review guide](review.md).
|
|
@@ -17,7 +17,7 @@ in original SVG artwork. Licensed fonts needed by an explicit theme import live
|
|
|
17
17
|
in `assets/fonts/`; declarations use `tokens/fonts.css`.
|
|
18
18
|
|
|
19
19
|
UI branding uses existing ADS token names such as `--accent` and `--font-sans`.
|
|
20
|
-
Component variables use `--ds-*`, patterns `--ux-*`, and
|
|
20
|
+
Component variables use `--ds-*`, patterns `--ux-*`, and development-only review layouts
|
|
21
21
|
`--ux-*` (`--showcase-*` is reserved, not permission for fixture CSS). These prefixes are fixed; do not introduce a brand namespace or
|
|
22
22
|
assign component state variables in token files. Source artwork is not a reason
|
|
23
23
|
to change destination token values during an asset-only import.
|
|
@@ -59,7 +59,7 @@ export const scenario = {
|
|
|
59
59
|
};
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Use attributes/selectors already owned by the real UI or its
|
|
62
|
+
Use attributes/selectors already owned by the real UI or its development-only review helper.
|
|
63
63
|
Scenarios keep their existing styling/control rules. A target is not permission
|
|
64
64
|
to add demo-only product props, custom CSS or synthetic native controls. Each
|
|
65
65
|
selector is scoped to the App iframe and must match exactly one visible element.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Run ADS tooling
|
|
1
|
+
# Run ADS tooling with Node or Bun
|
|
2
2
|
|
|
3
|
-
Use
|
|
3
|
+
Use the project's runtime for setup or ad hoc checks alongside this skill's research,
|
|
4
4
|
implementation, documentation, and verification workflow. ADS must be a project
|
|
5
5
|
development dependency, and its checks must run before the project's build.
|
|
6
6
|
Routine builds use the local CLI.
|
|
@@ -27,11 +27,14 @@ Use `--framework preact` for native Preact. A saved `framework` in
|
|
|
27
27
|
required, including for an older config. Init preserves existing framework
|
|
28
28
|
tooling and rejects conflicting saved/JSX settings instead of converting it.
|
|
29
29
|
|
|
30
|
-
Use the confirmed package name/version if different. For
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
Use the confirmed package name/version if different. For a Bun project, use
|
|
31
|
+
`bunx --bun @reqvire-org/ads init --framework react`, `bun install` and
|
|
32
|
+
`bun --bun run build`. Bun 1.3.13+ suffices; Node is unnecessary. Init detects
|
|
33
|
+
`packageManager` or `bun.lock`/`bun.lockb`, then defaults to Bun when launched
|
|
34
|
+
with Bun. See [runtimes.md](runtimes.md)
|
|
35
|
+
for MCP configuration and portable compiler/behavior commands.
|
|
36
|
+
Use `--package-manager bun` only for an explicit override. Preserve the project's
|
|
37
|
+
existing package-manager policy and lockfile.
|
|
35
38
|
|
|
36
39
|
`init` accepts no directory argument and requires an existing `package.json`.
|
|
37
40
|
For starting from zero, copy the bundled `ads-designer` application scaffold
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Check compatibility with the receiving ADS
|
|
2
|
+
|
|
3
|
+
The destination defines the integration contract. Read its configuration, public
|
|
4
|
+
APIs, relevant owner guides, shared token roles, package declarations and normal
|
|
5
|
+
app/preview build commands. Compare those with the selected source and its real
|
|
6
|
+
dependency closure. A shared ADS version, familiar export name or successful
|
|
7
|
+
source build is evidence about the source, not proof that it fits the destination.
|
|
8
|
+
|
|
9
|
+
Keep the comparison scoped to the request. Runtime imports need framework and
|
|
10
|
+
dependency analysis; a token-values or brand-only import needs the applicable
|
|
11
|
+
theme, asset and build checks without unrelated component research.
|
|
12
|
+
|
|
13
|
+
Record source and destination ADS versions when available, alongside the resolved
|
|
14
|
+
source revision. Versions help locate changed contracts; there is no patch-only
|
|
15
|
+
acceptance rule or automatic rejection across minor/major versions. Check what
|
|
16
|
+
the installed destination tooling actually supports, including contract schemas
|
|
17
|
+
and framework behavior. A source's newer tool version does not authorize upgrading
|
|
18
|
+
the destination or copying its configuration.
|
|
19
|
+
|
|
20
|
+
## Compare the contracts that matter
|
|
21
|
+
|
|
22
|
+
| Concern | Destination compatibility evidence |
|
|
23
|
+
|---------|------------------------------------|
|
|
24
|
+
| Framework and build | Configured framework, JSX, hooks, event/ref behavior, package/peer versions and extraction work in both application and preview builds. Any required SSR/hydration behavior is preserved. |
|
|
25
|
+
| Public APIs and dependencies | Existing components/controllers satisfy the needed semantics, providers and lifecycle. New dependencies fit declared versions; names and exports have an explicit destination owner. |
|
|
26
|
+
| Tokens and themes | Map roles by meaning, type, state and theme behavior. Different values for equivalent roles are expected; item imports use destination values. Add only missing shared decisions. |
|
|
27
|
+
| Styling and ownership | Linaria owns the imported styles under the destination's layer rules. Source resets, theme providers, private-selector overrides or independent value sheets do not introduce another visual policy. |
|
|
28
|
+
| Runtime assumptions | Application stores, routing and backend services remain application inputs. The implementation declares needed dependencies and does not assume globals, styles or libraries supplied by an MCP host. |
|
|
29
|
+
| Assets and provenance | Fonts, images and other required assets resolve through the destination build and preview resource policy. Retain applicable licenses and upstream notices. |
|
|
30
|
+
|
|
31
|
+
Inspect existing consumers before replacing a destination export or dependency.
|
|
32
|
+
Matching names or TypeScript signatures do not establish matching behavior.
|
|
33
|
+
Apply the selected value policy: an explicit `tokens` request authorizes compatible
|
|
34
|
+
source values, while an item or artwork import preserves the destination theme.
|
|
35
|
+
Follow [tokens.md](tokens.md) for semantic mappings and theme-scope conflicts.
|
|
36
|
+
|
|
37
|
+
Assess the destination's intended website and MCP App contexts through the same
|
|
38
|
+
public UI API. Use existing showcase evidence for the exercised MCP App conditions
|
|
39
|
+
and relevant application checks for website integration. Keep MCP communication,
|
|
40
|
+
tool-result mapping and serving in application adapters; follow the
|
|
41
|
+
[shared UI boundary](layers.md#share-ui-across-websites-and-mcp-apps). Add targeted
|
|
42
|
+
verification for uncovered assumptions instead of creating a separate component
|
|
43
|
+
implementation or duplicating the showcase pipeline.
|
|
44
|
+
|
|
45
|
+
## Decide before applying
|
|
46
|
+
|
|
47
|
+
Use a compact working comparison: source requirement, destination evidence,
|
|
48
|
+
planned adaptation and how it will be verified. No extra manifest is required.
|
|
49
|
+
|
|
50
|
+
- **Compatible:** the selected source fits the destination's contracts.
|
|
51
|
+
- **Adaptable within the import:** integrate paths/exports, map equivalent roles,
|
|
52
|
+
reuse verified public APIs and adapt supported framework/styling differences
|
|
53
|
+
while preserving required behavior. Keep those changes in the selected scope.
|
|
54
|
+
- **Unresolved:** evidence is missing or requirements conflict. Investigate the
|
|
55
|
+
affected boundary before deciding that the source cannot fit.
|
|
56
|
+
- **Conflicting requirements:** preserving the requested capability would require
|
|
57
|
+
changing destination policy or an existing consumer contract. Keep that import
|
|
58
|
+
unapplied and explain the concrete conflict and available choices. Ask for the
|
|
59
|
+
decision that changes scope; do not ask again for routine integration already
|
|
60
|
+
authorized by the import request.
|
|
61
|
+
|
|
62
|
+
For example, React source entering a native Preact ADS needs an assessment of its
|
|
63
|
+
hooks, JSX, events and dependencies. A renderer alias does not establish that
|
|
64
|
+
compatibility. The required adaptation remains part of this import request.
|
|
65
|
+
Do not silently migrate the destination framework, replace its token scale,
|
|
66
|
+
broaden guard exceptions or drop capabilities to make the import pass.
|
|
67
|
+
|
|
68
|
+
## Resolve differences within the import
|
|
69
|
+
|
|
70
|
+
For each mismatch, identify the source capability that must survive, choose a
|
|
71
|
+
destination-compatible implementation, and name the check that will establish
|
|
72
|
+
it. Start with verified destination APIs and shared roles. Adapt the selected
|
|
73
|
+
source where reuse does not preserve its contract, including rewriting framework
|
|
74
|
+
or styling code when necessary. Follow [implementation.md](implementation.md)
|
|
75
|
+
for dependency, behavior, ownership and provenance requirements.
|
|
76
|
+
|
|
77
|
+
For substantial reimplementation, consult `ads-port` guidance when available;
|
|
78
|
+
the user does not need to restart the request under another skill. Keep the same
|
|
79
|
+
selected capabilities, source revision and destination policy. A standalone
|
|
80
|
+
`ads-import` installation can follow its own implementation reference and source
|
|
81
|
+
research without requiring another installed skill. Record material API changes
|
|
82
|
+
and preserve applicable upstream notices even after rewriting the implementation.
|
|
83
|
+
|
|
84
|
+
Prepare one owner draft at a time. Use a coupled transaction when, for example,
|
|
85
|
+
a genuinely missing shared role and its component must change together. Inspect
|
|
86
|
+
the failing validation boundary, revise the affected owner, and validate again.
|
|
87
|
+
An assertion failure calls for implementation investigation; a resource-loading
|
|
88
|
+
or runner failure calls for infrastructure diagnosis. Neither justifies relaxing
|
|
89
|
+
destination guards. Stop and report when a required capability cannot be expressed
|
|
90
|
+
or verified with the available destination tooling.
|
|
91
|
+
|
|
92
|
+
## Verify in the destination
|
|
93
|
+
|
|
94
|
+
Prepare the integrated candidate and run destination architecture, lint, type,
|
|
95
|
+
build and applicable behavior checks. Through MCP, use the existing guarded
|
|
96
|
+
dry-run workflow; there is no separate compatibility tool or certification flag.
|
|
97
|
+
Inspect the real public API in destination scenarios and actual consumer context,
|
|
98
|
+
including relevant themes, states, asset loads and teardown. Compare behavior
|
|
99
|
+
against the source separately from intentional destination-theme differences.
|
|
100
|
+
|
|
101
|
+
Passing static checks establishes only their tested boundaries. Report material
|
|
102
|
+
adaptations, remaining conflicts, checks run and unverified requirements. Record
|
|
103
|
+
durable integration decisions beside the imported owner's public contract; avoid
|
|
104
|
+
requiring a separate compatibility report for every import.
|
|
105
|
+
|
|
106
|
+
Candidate validation uses the project's installed dependencies. It does not
|
|
107
|
+
install packages, and a dry run is not a dependency-installation sandbox. When
|
|
108
|
+
new dependencies are required, use the project's package-manager workflow to
|
|
109
|
+
prepare compatible declarations, the lockfile and installed packages before
|
|
110
|
+
validating dependent runtime changes. Keep package installation out of validation
|
|
111
|
+
scripts. ADS config/source edits still follow their discovered mutation owners;
|
|
112
|
+
use the client package-manager tools for installation. If those tools are
|
|
113
|
+
unavailable, report the exact prerequisite instead of claiming a validated import.
|