@reqvire-org/ads 0.3.25 → 0.3.26

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 (96) hide show
  1. package/README.md +7 -5
  2. package/dist/bootstrap-ds/ADS.md +28 -30
  3. package/dist/bootstrap-ds/README.md +6 -6
  4. package/dist/bootstrap-ds/design-system/assets/brand/README.md +3 -2
  5. package/dist/boundaries.mjs +0 -3
  6. package/dist/check.mjs +15 -22
  7. package/dist/config.mjs +3 -7
  8. package/dist/contract-migration.mjs +2 -2
  9. package/dist/contracts.d.mts +0 -1
  10. package/dist/design-values.mjs +81 -0
  11. package/dist/evidence.mjs +1 -1
  12. package/dist/mcp/context.mjs +3 -3
  13. package/dist/mcp/prompts.mjs +4 -4
  14. package/dist/mcp/reports.mjs +101 -0
  15. package/dist/mcp/server.mjs +38 -3
  16. package/dist/paint-contracts.mjs +4 -5
  17. package/dist/preview-resources.mjs +1 -2
  18. package/dist/scenarios.mjs +14 -14
  19. package/dist/skills/README.md +7 -3
  20. package/dist/skills/ads-break-ui/SKILL.md +23 -13
  21. package/dist/skills/ads-break-ui/references/atomic-styles.md +9 -2
  22. package/dist/skills/ads-break-ui/references/behaviors.md +393 -0
  23. package/dist/skills/ads-break-ui/references/captures.md +1 -1
  24. package/dist/skills/ads-break-ui/references/contracts.md +18 -37
  25. package/dist/skills/ads-break-ui/references/design-data.md +91 -0
  26. package/dist/skills/ads-break-ui/references/evidence.md +4 -0
  27. package/dist/skills/ads-break-ui/references/guarded-editing.md +7 -11
  28. package/dist/skills/ads-break-ui/references/reporting.md +101 -0
  29. package/dist/skills/ads-break-ui/references/scenarios.md +9 -15
  30. package/dist/skills/ads-designer/SKILL.md +25 -15
  31. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +28 -30
  32. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +6 -6
  33. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +3 -2
  34. package/dist/skills/ads-designer/references/atomic-styles.md +9 -2
  35. package/dist/skills/ads-designer/references/behaviors.md +393 -0
  36. package/dist/skills/ads-designer/references/captures.md +1 -1
  37. package/dist/skills/ads-designer/references/contracts.md +18 -37
  38. package/dist/skills/ads-designer/references/design-craft.md +1 -1
  39. package/dist/skills/ads-designer/references/design-data.md +91 -0
  40. package/dist/skills/ads-designer/references/evidence.md +4 -0
  41. package/dist/skills/ads-designer/references/guarded-editing.md +7 -11
  42. package/dist/skills/ads-designer/references/mobile.md +1 -1
  43. package/dist/skills/ads-designer/references/reporting.md +101 -0
  44. package/dist/skills/ads-designer/references/scenarios.md +9 -15
  45. package/dist/skills/ads-import/SKILL.md +28 -17
  46. package/dist/skills/ads-import/references/atomic-styles.md +9 -2
  47. package/dist/skills/ads-import/references/behaviors.md +393 -0
  48. package/dist/skills/ads-import/references/branding.md +1 -1
  49. package/dist/skills/ads-import/references/captures.md +1 -1
  50. package/dist/skills/ads-import/references/contracts.md +18 -37
  51. package/dist/skills/ads-import/references/design-data.md +91 -0
  52. package/dist/skills/ads-import/references/evidence.md +4 -0
  53. package/dist/skills/ads-import/references/guarded-editing.md +7 -11
  54. package/dist/skills/ads-import/references/implementation.md +3 -2
  55. package/dist/skills/ads-import/references/reporting.md +101 -0
  56. package/dist/skills/ads-import/references/scenarios.md +9 -15
  57. package/dist/skills/ads-import/references/tokens.md +11 -9
  58. package/dist/skills/ads-motion/SKILL.md +22 -12
  59. package/dist/skills/ads-motion/references/atomic-styles.md +9 -2
  60. package/dist/skills/ads-motion/references/behaviors.md +393 -0
  61. package/dist/skills/ads-motion/references/captures.md +1 -1
  62. package/dist/skills/ads-motion/references/contracts.md +18 -37
  63. package/dist/skills/ads-motion/references/design-data.md +91 -0
  64. package/dist/skills/ads-motion/references/evidence.md +4 -0
  65. package/dist/skills/ads-motion/references/guarded-editing.md +7 -11
  66. package/dist/skills/ads-motion/references/reporting.md +101 -0
  67. package/dist/skills/ads-motion/references/scenarios.md +9 -15
  68. package/dist/skills/{ads-migrate → ads-port}/SKILL.md +58 -31
  69. package/dist/skills/ads-port/agents/openai.yaml +4 -0
  70. package/dist/skills/{ads-migrate → ads-port}/references/atomic-styles.md +9 -2
  71. package/dist/skills/ads-port/references/behaviors.md +393 -0
  72. package/dist/skills/{ads-migrate → ads-port}/references/captures.md +1 -1
  73. package/dist/skills/{ads-migrate → ads-port}/references/contracts.md +18 -37
  74. package/dist/skills/ads-port/references/design-data.md +91 -0
  75. package/dist/skills/{ads-migrate → ads-port}/references/evidence.md +4 -0
  76. package/dist/skills/{ads-migrate → ads-port}/references/guarded-editing.md +7 -11
  77. package/dist/skills/{ads-migrate → ads-port}/references/lint-and-docs.md +5 -0
  78. package/dist/skills/{ads-migrate → ads-port}/references/native-implementation.md +49 -15
  79. package/dist/skills/ads-port/references/reporting.md +101 -0
  80. package/dist/skills/{ads-migrate → ads-port}/references/scenarios.md +9 -15
  81. package/dist/skills/{ads-migrate → ads-port}/references/testing.md +11 -1
  82. package/dist/tokens.mjs +5 -8
  83. package/dist/unit-contracts.mjs +1 -8
  84. package/docs/ADS.md +42 -73
  85. package/docs/ARCHITECTURE.md +49 -20
  86. package/docs/BEHAVIORS.md +40 -38
  87. package/docs/CHANGELOG.md +23 -0
  88. package/docs/CONTRACTS.md +18 -37
  89. package/docs/GUIDE.md +21 -13
  90. package/docs/MCP.md +57 -10
  91. package/package.json +1 -1
  92. package/dist/scoped-tokens.mjs +0 -68
  93. package/dist/skills/ads-migrate/agents/openai.yaml +0 -4
  94. /package/dist/skills/{ads-migrate → ads-port}/references/cli.md +0 -0
  95. /package/dist/skills/{ads-migrate → ads-port}/references/layers.md +0 -0
  96. /package/dist/skills/{ads-migrate → ads-port}/references/review.md +0 -0
@@ -0,0 +1,393 @@
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": "npm",
146
+ "args": ["run", "test:behavior", "--"],
147
+ "mode": "browser",
148
+ "timeoutMs": 60000
149
+ }
150
+ }
151
+ }
152
+ }
153
+ ```
154
+
155
+ Here `test:behavior` invokes the project's local `playwright test`. Its Playwright
156
+ configuration must discover colocated spec files. Configure browser installation
157
+ and any required test setup in that project. The ADS tooling host gains no
158
+ framework or browser dependency from a profile.
159
+
160
+ The Playwright adapter appends selected file paths and case-tag filtering, its
161
+ reporter and a generated artifact directory. Unselected cases in the same spec
162
+ do not run. It preserves the project's worker configuration.
163
+
164
+ `timeoutMs` bounds the complete runner process for one profile, including runner
165
+ startup, hooks, retries and all selected cases. It is not a per-test timeout.
166
+ Playwright's own test/hook timeouts remain separate project settings. Set the
167
+ profile budget from measured suite durations with headroom; increasing it does
168
+ not repair a stalled assertion or cleanup.
169
+
170
+ Independent specs can use multiple Playwright workers against the same managed
171
+ candidate host. Each check needs its own page/context and state; avoid fixed ports,
172
+ shared mutable fixtures and test-order dependencies. Start with a small worker
173
+ count and measure on the target machine. Files normally run in parallel; tests
174
+ within one file normally remain sequential. ADS does not force parallelism or
175
+ change verification policy. See [Playwright parallelism](https://playwright.dev/docs/test-parallel).
176
+ Prefer readiness/assertion polling over arbitrary sleeps. Timer-only guarantees
177
+ may use [Playwright's clock](https://playwright.dev/docs/clock); retain real time
178
+ when browser motion, pointer gestures or layout timing are what the check verifies.
179
+
180
+ An ordinary test-failure exit (code 1) with a complete report and actual failing
181
+ cases preserves independent case outcomes: passing checks stay `passed`, failed
182
+ checks stay `failed`, and overall verification still blocks the mutation. The
183
+ report must account for every selected check, with no active cases or suite errors.
184
+ The same rule supports older custom reports without an explicit `complete` field
185
+ after normal process completion. An unexplained nonzero exit cannot certify a
186
+ pass, even if all reported cases claim success. Results retain `reportedStatus`
187
+ and `runnerExitCode` and explain the overall failure. Suite-level browser errors and
188
+ bounded runner output appear in diagnostics. `openBehaviorScenario` includes the
189
+ scenario ID and failed browser requests in startup failures; App resource errors
190
+ identify the resource URI. The ADS showcase retries only `resources/read` fetch
191
+ transport failures, with at most three attempts and 200/800 ms backoff. Recovered
192
+ startup reads appear in `startupDiagnostics` with retry counts and failed browser
193
+ requests; each retry is also logged in the browser console. This does not retry a
194
+ tool call, assertion, check or complete startup. HTTP/protocol/content errors,
195
+ integrity failures and cancellations do not retry. Persistent loading failures
196
+ still fail the check and block mutations. External hosts control their own
197
+ transport recovery.
198
+
199
+ `net::ERR_NETWORK_CHANGED` reports Chrome's network-change error, not proof that
200
+ the MCP endpoint restarted or that a particular interface changed. To investigate
201
+ an intermittent failure, correlate the saved case timestamps with Chrome's
202
+ network log, server availability and live interface monitoring (for example,
203
+ `ip -ts monitor link address route` on Linux). Interfaces being present, or stable
204
+ after a failure, does not establish the cause. Preserve the draft and original
205
+ diagnostic; do not change a component API, reference example or verification
206
+ policy to compensate for a resource-loading failure.
207
+
208
+ The reporter atomically publishes partial snapshots at test start/end. While a
209
+ run is active, `ads_status.behaviors.progress` exposes the profile, runner budget,
210
+ elapsed time, completed/active/pending counts, worker count when available and
211
+ case identities/timings. Candidate mutation verification exposes the same data at
212
+ `ads_status.mutations.progress`. Clients requesting MCP progress receive updates
213
+ and a heartbeat during the runner phase; client-side request timeouts still apply.
214
+ `durationMs` records completed case execution, including attempts, separately from
215
+ the suite's wall time. Parallel case durations can sum to more than wall time.
216
+
217
+ After a deadline, valid completed outcomes remain visible through `reportedStatus`
218
+ and durations, alongside active and unstarted case identities. A passed case from
219
+ an interrupted run has blocking status `incomplete`; real assertion failures retain
220
+ their own messages. No incomplete run can accept a mutation or certify a guarantee.
221
+ Reports and artifacts stay under the live project's `.ds/verification/` even after
222
+ the candidate copy is removed. This is diagnostic output, not passing live-source
223
+ evidence. Old/custom runners without incremental progress use `not_reported` for
224
+ cases whose execution state cannot be established.
225
+
226
+ Use native test tags for stable case identity:
227
+
228
+ ```ts
229
+ import { test, expect } from "@playwright/test";
230
+ import { openBehaviorScenario } from "@reqvire-org/ads/verification";
231
+
232
+ test("history preserves the visible anchor", { tag: "@ads:prepend-anchor" }, async ({ page }) => {
233
+ const frame = await openBehaviorScenario(page, "prepend-anchor");
234
+ // Perform real interactions and assert the project's guarantee here.
235
+ await expect(frame.getByRole("region", { name: "Messages" })).toBeVisible();
236
+ });
237
+ ```
238
+
239
+ The shown assertion is only a harness example; it does not establish anchoring.
240
+ Write meaningful assertions for the registered guarantee. The helper waits for
241
+ the current selected scenario inside the real sandboxed MCP App. It uses `load`
242
+ and explicit readiness, not `networkidle`: MCP keeps event connections open.
243
+
244
+ Compare reference and candidate under equivalent framing. In a reported Chrome
245
+ comparison, `content-visibility` initially used placeholder geometry inside a
246
+ cross-origin App iframe for both ADS and the upstream reference; the same content
247
+ measured differently as a top-level page. This is an observed browser/layout
248
+ condition, not evidence of an ADS defect. App readiness does not imply that every
249
+ off-screen item has rendered. For geometry assertions, bring the relevant content
250
+ into view and wait for its measured layout to settle. Record the framing and
251
+ visibility state; test initial placeholder behavior separately when it matters to
252
+ the guarantee. Wait for focus and positioning readiness before normal keyboard
253
+ comparisons, and test rapid input separately rather than hiding it behind delays.
254
+
255
+ `mode: "browser"` starts an isolated managed showcase on an automatic port. Test
256
+ requests contain its scenario URLs, and cleanup closes its host/compiler tree.
257
+ Mutation candidates use their own source, generated graph and server; a passing
258
+ test against an older fixed-port live showcase cannot validate a candidate.
259
+
260
+ Use `mode: "strict"` only for React with a project development harness that mounts
261
+ the relevant API in StrictMode. The production MCP App does not replay development
262
+ effects. This profile does not receive a production showcase URL from the helper.
263
+ For Preact, register its actual lifecycle tests without claiming React StrictMode.
264
+ The profile names record the chosen environment; ADS does not infer that a test's
265
+ assertions cover every lifecycle condition.
266
+
267
+ Other runners use `runner: "protocol"` (the default). ADS provides
268
+ `ADS_VERIFY_REQUEST` and `ADS_VERIFY_REPORT` absolute paths. Read the request's
269
+ `schemaVersion`, unique `runId`, `projectRoot`, `framework`, `profile`, `mode`,
270
+ selected `checks` and optional `scenarios` URLs. Write a bounded JSON report:
271
+
272
+ ```json
273
+ {
274
+ "schemaVersion": 1,
275
+ "runId": "<the request's runId>",
276
+ "cases": [
277
+ {
278
+ "id": "prepend-anchor",
279
+ "file": "design-system/components/MessageScroller/MessageScroller.ads.behavior.spec.ts",
280
+ "status": "passed"
281
+ }
282
+ ]
283
+ }
284
+ ```
285
+
286
+ Case statuses are `passed`, `failed` or `skipped`, with optional `message` and
287
+ `durationMs`. Protocol runners may atomically publish intermediate reports with
288
+ `complete:false` and an `active` list of `{id,file,startedAt,workerIndex?}`, then
289
+ publish `complete:true` at completion. Older final reports without `complete`
290
+ remain supported after normal process completion. An explicitly incomplete report
291
+ cannot pass even with exit code zero. Partial reports retain the same schema/run
292
+ identity and size limits as final reports.
293
+ Cases may optionally include `failure: {category,phase,code,certainty?}`,
294
+ `source: {file,line,column}`, `failingStep`, `viewport`/`viewportSource`, and
295
+ `artifacts: [{name,mimeType,path}]`. Artifact paths are relative to the report
296
+ directory and must remain under that run's `artifacts/` directory. The built-in
297
+ Playwright reporter supplies these from actual step/startup/attachment evidence.
298
+ Older protocol runners can omit them; ADS preserves that lack of classification
299
+ instead of treating an arbitrary thrown message as an assertion.
300
+ `file` is project-relative. Nonzero process exit, missing cases, skipped cases,
301
+ wrong run IDs and unavailable reports do not pass. Test commands are trusted
302
+ project code; an adapter cannot prove the quality or honesty of their assertions.
303
+
304
+ ## Execute and inspect evidence
305
+
306
+ Use `ads_behaviors` for bounded discovery; request an exact unit for its contract.
307
+ General listings return counts and short API/guarantee/scenario summaries. Exact
308
+ owner requests return the registered details; source reads remain available for
309
+ bounded inspection of large contracts. No full guide or test body is injected
310
+ into discovery results.
311
+ Call `ads_verify({unit, checks?})` for selected registered checks. Read
312
+ `ads://project/behaviors` for current evidence or `ads://guides/behaviors` for this
313
+ guide. CLI/CI equivalents are:
314
+
315
+ ```sh
316
+ ads behaviors . --json
317
+ ads verify . --unit controllers/ScrollFollow
318
+ ads verify . --unit components/MessageScroller --check prepend-anchor --json
319
+ ```
320
+
321
+ Execution has bounded output, a configured timeout, cancellation and process-tree
322
+ ownership. Evidence records case/profile identity, source/dependency revision,
323
+ completion time, report path and the available preview revision. Later input
324
+ changes mark results stale; changes during execution prevent a current pass.
325
+ Guarantees report passing only when all their checks have current passing evidence.
326
+ Passing applies to those cases and profiles, not every application state.
327
+
328
+ Results expose structured `failure` boundaries and explicit `acceptance` scope.
329
+ MCP execution replies contain counts, bounded acceptance, at most three failure
330
+ previews and a `resultId` (4 KiB UTF-8 JSON maximum). Use `ads_results` to read
331
+ selected `outcomes`, `checks`, `diagnostics` or other sections without execution.
332
+ Pages default to 10 rows, allow at most 20 and stay within 8 KiB; follow
333
+ `nextCursor` with identical selection/status. Truncated records provide
334
+ `recordIndex` for exact `offset`/`chars` ranges. Only the latest verification and
335
+ mutation snapshots are retained, independently, at most 8 MiB each. Replaced IDs
336
+ fail explicitly. Validation still uses complete internal outcomes.
337
+
338
+ Use `ads_investigate({unit,check,runId})` with an outcome's exact IDs for its compact
339
+ summary (4 KiB maximum); details, requests, browser errors and artifact metadata are separate
340
+ paged sections (8 KiB maximum). Truncated records support exact text ranges with
341
+ the recorded run ID. Saved outcomes describe completion time; compare current
342
+ `ads_behaviors` revisions for freshness. It includes isolated dry runs; `ads://project/investigations` lists available entries. Exact
343
+ input and observed preview revisions, failing step/source, startup viewport,
344
+ failed startup requests and available project-recorded artifacts keep diagnosis
345
+ separate from an inferred component defect. No artifact is invented or test
346
+ retried. Each check retains one latest bundle; old artifact resource access is
347
+ superseded. Candidate bundles remain distinct from passing live-source evidence.
348
+ Read the portable [evidence reference](evidence.md)
349
+ for category meanings, collection limits and artifact policy.
350
+
351
+ Revisions include owned files, literal import dependencies, local CSS imports and
352
+ asset URLs, token foundation, project/runner configuration, lockfiles and tooling.
353
+ Computed module selection conservatively includes all ADS owners. Environment,
354
+ network and other unregistered external inputs remain the runner's responsibility;
355
+ an evidence record is not a proof about arbitrary external state.
356
+
357
+ For named imports through simple re-export barrels, ADS follows selected bindings
358
+ and retains dependencies with declared side effects. This narrowing requires a
359
+ package `sideEffects:false` or a supported simple `sideEffects` glob array; preserve
360
+ CSS/global effects in that policy. Unknown policies/patterns, wildcard exports and
361
+ computed imports remain conservative. Barrel source changes still invalidate
362
+ dependents. ADS caches source parsing, resolution and digests within an inspection
363
+ only; later runs read current source again.
364
+
365
+ Guarded mutations execute affected registered behavior contracts after core,
366
+ Oxlint and configured project checks, before writing source. Imported shared
367
+ controller changes also select dependent contracts conservatively. Rejected and
368
+ dry-run patches publish no source changes. Verification output stays under `.ds/`.
369
+ To check a prepared draft, request its diff and pass the returned `patchFile` to
370
+ `ads_apply_patch` with `dryRun:true`. This checks the isolated candidate, including
371
+ affected behavior contracts and its configured browser preview. Candidate evidence
372
+ is not persisted as passing evidence for live source. `ads_verify` selects checks
373
+ for current source and has no draft argument.
374
+
375
+ ## Packaging and performance
376
+
377
+ Controllers follow normal component/scenario imports into the project's compiled
378
+ resource graph. Their framework dependencies are bundled by the project compiler
379
+ and served through MCP resources inside the App iframe; external hosts install
380
+ nothing. The selected scenario loads its dependency closure. Shared modules are
381
+ cached within that App instance, and each separately opened App has its own runtime.
382
+
383
+ Keep ESM modules and explicit imports. Avoid an eagerly imported controller
384
+ registry. Tree shaking and shared chunks follow the project bundler: class methods,
385
+ side effects, global CSS and dynamic maps can retain extra code. Inspect emitted
386
+ resources instead of assuming a controller produces a minimal bundle.
387
+
388
+ Development-only `review/<Owner>` units may register the same guarantee/check
389
+ contracts for review presentation and controls. Subjects can name that owner's
390
+ separate review API or local headless helpers; checks still run registered project
391
+ profiles and can refer to an existing real scenario. This grants no production
392
+ API, catalogue entry, `covers` credit or runtime import permission. See the
393
+ [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 owned scenario review layouts
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 public review pattern.
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
1
  # Static owner contracts and development files
2
2
 
3
- Use one optional `<Owner>.ads.contract.ts` for owner-local tokens, constrained
3
+ Use one optional `<Owner>.ads.contract.ts` for constrained
4
4
  paint inputs, scoped runtime bindings, declarative parts and behavioral checks.
5
5
  The import `import type { UnitContract } from "@reqvire-org/ads/contracts"` supplies
6
6
  development typing. ADS reads its AST and resolves real symbols without importing
@@ -15,12 +15,9 @@ components/Plot/
15
15
  renderer.tsx production consumer
16
16
  paints.ts production binding producer
17
17
  types.ts production prop types
18
- tokens.css optional production token definitions
19
18
  Plot.ads.contract.ts static tool declaration
20
19
  Plot.ads.scenario.tsx demonstration
21
20
  Plot.ads.fixture.ts demonstration data
22
- Tokens.ads.scenario.tsx real owner-token samples
23
- Tokens.ads.fixture.ts sample bindings/probes
24
21
  Plot.ads.behavior.spec.ts registered browser checks
25
22
  Plot.ads.test.tsx optional unit tests
26
23
  Plot.ads.helpers.ts development-only adapters
@@ -56,7 +53,6 @@ import { paints } from "./paints";
56
53
 
57
54
  export default {
58
55
  schemaVersion: 1,
59
- tokens: { namespace: "--plot-", stylesheet: "./tokens.css" },
60
56
  paintInputs: [
61
57
  { api: Plot, property: "config.*.paint", kind: "paint-reference" },
62
58
  { api: Series, property: "fill", kind: "paint-reference", bindings: ["items"] },
@@ -164,17 +160,17 @@ Raw constants, undeclared fields, extra writes and unknown transforms are reject
164
160
  The browser audit checks actual accessible color references in both branches;
165
161
  a local SVG URL or `none` is not a CSS color inside `light-dark()`.
166
162
 
167
- Families cannot overlap shared tokens, owner-token namespaces, private runtime
163
+ Families cannot overlap shared tokens, private runtime
168
164
  prefixes or other bindings. A broad family such as `--color-${key}` grants no
169
165
  shared-token exception. Use a distinct private family where collision freedom
170
166
  cannot be established. Registered paint consumers list their allowed binding IDs;
171
- borrowing a peer's family or private token remains invalid. Bindings are scoped
167
+ borrowing a peer's binding family or private runtime variable remains invalid. Bindings are scoped
172
168
  to their actual root; portals outside it need deliberate project integration.
173
169
 
174
170
  A registered binding producer may combine two accessible color references as
175
171
  `light-dark(var(--light-token), var(--dark-token))`. The App paint audit checks
176
172
  both branches and their observed effect in the active color scheme. Raw colors,
177
- unknown/private tokens and SVG URLs inside this color function remain invalid.
173
+ undefined tokens and SVG URLs inside this color function remain invalid.
178
174
  This derived binding form does not widen public paint-input types; use constrained
179
175
  references for each theme input and verify both color schemes in browser checks.
180
176
 
@@ -239,38 +235,23 @@ retained. Unreadable prerequisites report coverage as not established. Inspect
239
235
  the exact source diagnostic and bounded results; do not assume every subsequent
240
236
  missing preview means its runtime API is invalid.
241
237
 
242
- ## Local tokens and project consistency
243
-
244
- `tokens.css` remains optional production design data for component/pattern owners,
245
- imported by the runtime owner. Controllers stay headless; review uses the shared
246
- vocabulary and its own development presentation state. Only root/theme definitions belong there. Tokens require real sample
247
- coverage, including independently built owner token scenarios. One namespace
248
- cannot be shared by peer components. Private references remain private through
249
- TS constants, re-exports, helper returns, SVG/paint props and property reads/writes.
250
- Normal composition of a public component using its own tokens remains valid.
251
- Source analysis covers supported value flows; arbitrary dynamic code is not
252
- proof of ownership. CSS variables remain browser-visible; namespacing is an
253
- architecture boundary, not browser encapsulation.
254
-
255
- Ownership does not establish a project's visual scale:
256
-
257
- - A component redefining shared `--space-4` fails.
258
- - Its private `--plot-gap: 7px` can be valid component geometry.
259
- - `--plot-gap: var(--space-4)` preserves a shared scale with local meaning.
260
-
261
- Choose project policy explicitly. A registered project check can use tooling-only
262
- `inspectTokens(root)` and `inspectTokenOrigins(inventory, name, { stopAt: names })`
263
- from `@reqvire-org/ads`. `aliasOnly` verifies every theme definition follows only
264
- aliases to the explicitly selected origins; `literals` and `diagnostics` explain
265
- violations/limits. Select the exact targets and permitted shared origins. Keep
266
- intentional geometry exceptions exact with documented reasons. ADS neither
267
- infers spacing meaning from names nor prescribes a global spacing palette.
238
+ ## Shared Data and project consistency
239
+
240
+ Data has one shared design vocabulary in the configured token foundation. There
241
+ is no owner-contract token namespace or private value stylesheet. Components map
242
+ shared values into `--ds-*`; patterns use `--ux-*`. Static literals cannot bypass
243
+ this boundary through aliases, fallbacks, themes or helper/import interpolation.
244
+ Shared token samples belong under the token directory. See
245
+ [shared Data and component mappings](design-data.md).
246
+
247
+ `inspectTokenOrigins(inventory, name, {stopAt: names})` remains available for
248
+ project-specific audits of shared alias relationships. It supplements mandatory
249
+ core source checks and does not enable independent local values.
268
250
 
269
251
  ## Migration and MCP editing
270
252
 
271
- Legacy `tokens.json`/`<Owner>.tokens.json` and `behavior.json` remain readable.
272
- Use either authoring form per section; competing declarations fail. New contracts
273
- normalize into the same discovery, ownership, source revisions, affected-check
253
+ Use the static owner contract for new registrations. Competing declarations fail.
254
+ Contracts participate in discovery, ownership, source revisions, affected-check
274
255
  selection and candidate gates. `ads_units` exposes `contractFile`; `ads_catalog`
275
256
  reports constrained paint paths and declarative parent/consumer/check references.
276
257
  Use bounded file reads and paged detailed results, not repeated whole-project dumps.
@@ -0,0 +1,91 @@
1
+ # Shared Data, component mappings and design consistency
2
+
3
+ ADS has three cooperating responsibilities: Data supplies one shared design
4
+ vocabulary; UX owns structure, behavior and accessibility; Skin maps Data to
5
+ states and variants. Components own their implementation, not separate design
6
+ systems. Project values and themes remain project-owned.
7
+
8
+ ## One design catalogue
9
+
10
+ Define static design values, semantic roles, formulas and themes in the configured
11
+ shared token foundation: colors, typography, spacing and elevation. Reuse existing
12
+ roles before introducing another token. A new value is a visible project design
13
+ decision. Do not copy every imported library constant into another name merely to
14
+ satisfy a guard. Existing project font, text, spacing and other semantic roles
15
+ take precedence over divergent upstream constants. Preserve the capability and
16
+ interaction contract, then document deliberate visual differences from the
17
+ migration reference. Do not add a private or duplicate role to recover an
18
+ upstream font or size that project policy intentionally replaces.
19
+
20
+ Porting should converge on the destination's visual language. Different upstream
21
+ dependencies do not justify separate scales or duplicate roles. Consolidate
22
+ equivalent roles introduced by the selected port, update their consumers and
23
+ samples, and remove obsolete source sheets when unused. Compare semantics,
24
+ themes, states and actual use before merging; equal numbers alone are not enough.
25
+ For an empty destination, establish a coherent initial vocabulary across the
26
+ selected scope. Exact upstream pixels are not a default acceptance requirement.
27
+ Document intentional adaptations and verify consistency with existing UI while
28
+ preserving required behavior. Unrelated cleanup or removal of an existing public
29
+ token needs its own scope/compatibility decision.
30
+
31
+ There are no owner-local token namespaces, token manifests, component token value
32
+ sheets or `tokens` sections in owner contracts. Token previews and their fixtures
33
+ belong under the shared token directory. The public contract remains about shared
34
+ names, meanings, types and alias relationships; ADS supplies no hardcoded palette,
35
+ spacing grid or component catalogue.
36
+
37
+ ## Component variables are mappings and runtime mechanics
38
+
39
+ `--ds-*` belongs to component implementations, `--ux-*` to patterns and review
40
+ presentation, and `--showcase-*` to development scaffolding. They are not additional
41
+ token vocabularies. State styling remains owned by the control. Documented non-state
42
+ customization hooks keep their narrow registration and ownership rules.
43
+
44
+ ```css
45
+ /* In component Linaria: map project Data into a state. */
46
+ --ds-control-bg: var(--accent);
47
+ --ds-control-hover-bg: var(--accent-hover);
48
+ --ds-control-gap: var(--space-4);
49
+ --ds-control-font: var(--font-sans);
50
+
51
+ /* Rejected: private design values, even behind aliases or fallbacks. */
52
+ --ds-control-gap: 7px;
53
+ --ds-control-bg: red;
54
+ --ds-control-gap: var(--space-4, 7px);
55
+ --ds-control-font: Arial;
56
+ ```
57
+
58
+ Styles and static interpolations from imports/helpers obey the same source rule.
59
+ Unknown interpolation is not proof of a valid design source. Typography/layering
60
+ roles follow variable references to their actual consuming properties; a different
61
+ variable name cannot conceal an independent font, weight or stacking level.
62
+
63
+ Zero, structural unitless geometry, percentages, grid fractions, responsive
64
+ viewport/container relationships and structural angles retain their existing use.
65
+ Measured instance geometry still uses exact, documented style-write boundaries;
66
+ those boundaries do not authorize another static design palette. Typed per-instance
67
+ paint bindings retain their provenance and browser checks. Inputs select shared
68
+ paints or local SVG resources, rather than supplying arbitrary visual strings.
69
+
70
+ A calculation containing a raw design length/color is still rejected. Structural
71
+ calculations using shared values can remain valid; static analysis cannot prove
72
+ whether a dimensionless factor represents real geometry or an invented scale.
73
+ Review that intent and do not disguise a new design decision as arithmetic.
74
+
75
+ ## Review overlap without deleting legitimate roles
76
+
77
+ `token-overlap-review` is a nonblocking warning for shared tokens with identical
78
+ normalized definitions across their declared theme/condition scopes. It identifies
79
+ the tokens and source. Inspect their consumers and roles. If one decision is being
80
+ copied, reuse one shared token or make its relationship explicit with an alias.
81
+ Equal values alone do not prove equal purpose: body text and strong text, spacing
82
+ and control sizes, or two motion roles may intentionally differ later. A light-only
83
+ match does not justify merging tokens whose dark/reduced-motion values differ.
84
+
85
+ For our existing workspaces, convert independent component constants explicitly:
86
+ select an existing shared role when it means the same thing; centralize genuinely
87
+ missing decisions; remove private sheets/imports and contract fields; update token
88
+ sample coverage in the shared directory. Preserve themes, units, public APIs and
89
+ behavior unless changing the visual policy was explicitly intended. Review a Git
90
+ diff and run core, project and browser checks. There is no compatibility mode that
91
+ keeps independent component token definitions valid.
@@ -118,3 +118,7 @@ the smallest source/browser reproduction when ownership remains unprovable.
118
118
  guard acceptance; registered tests establish only their actual cases/profiles.
119
119
  Neither establishes untested states, visual parity, an accessibility audit or
120
120
  another MCP host's compatibility. Captures show an appearance, not a transition.
121
+
122
+ When targeted investigation suggests a tooling defect or missing capability, read
123
+ [reporting.md](reporting.md), then use the matching intake tool. Reports preserve
124
+ compact evidence without certifying an ADS cause or changing validation policy.