@reqvire-org/ads 0.3.17 → 0.3.20

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 (101) hide show
  1. package/dist/atomic-composition.mjs +1 -1
  2. package/dist/behaviors.mjs +5 -5
  3. package/dist/bootstrap-ds/ADS.md +2 -2
  4. package/dist/bootstrap-ds/README.md +1 -1
  5. package/dist/bootstrap-ds/design-system/index.ts +0 -1
  6. package/dist/bootstrap-ds/design-system/review/index.ts +1 -0
  7. package/dist/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +1 -1
  8. package/dist/bootstrap-ds/ds.config.json +1 -1
  9. package/dist/bootstrap-ds/tsconfig.json +18 -3
  10. package/dist/bootstrap-ds/vite.config.ts +1 -1
  11. package/dist/boundaries.mjs +4 -2
  12. package/dist/check.mjs +49 -15
  13. package/dist/config.mjs +13 -2
  14. package/dist/init.mjs +17 -14
  15. package/dist/investigations.mjs +34 -3
  16. package/dist/layers.mjs +288 -0
  17. package/dist/linaria/preserve-values.cjs +21 -2
  18. package/dist/lint-config.mjs +1 -1
  19. package/dist/mcp/behavior-pages.mjs +36 -0
  20. package/dist/mcp/context.mjs +5 -2
  21. package/dist/mcp/edit-preparation.mjs +3 -3
  22. package/dist/mcp/execution-results.mjs +146 -0
  23. package/dist/mcp/mutations.mjs +4 -4
  24. package/dist/mcp/prompts.mjs +1 -1
  25. package/dist/mcp/result-pages.mjs +87 -0
  26. package/dist/mcp/server.mjs +49 -30
  27. package/dist/mcp/widget.bundle.js +1 -1
  28. package/dist/oxlint.mjs +3 -1
  29. package/dist/preview-resources.mjs +11 -1
  30. package/dist/property-registrations.mjs +39 -0
  31. package/dist/public-api.mjs +13 -6
  32. package/dist/scenario-trace.mjs +7 -7
  33. package/dist/scenarios-vite.mjs +2 -1
  34. package/dist/scenarios.mjs +10 -7
  35. package/dist/scoped-tokens.mjs +6 -0
  36. package/dist/showcase/client.bundle.js +1 -1
  37. package/dist/showcase/sandbox.bundle.js +1 -1
  38. package/dist/skills/ads-break-ui/SKILL.md +27 -10
  39. package/dist/skills/ads-break-ui/references/atomic-styles.md +48 -0
  40. package/dist/skills/ads-break-ui/references/captures.md +6 -1
  41. package/dist/skills/ads-break-ui/references/evidence.md +52 -5
  42. package/dist/skills/ads-break-ui/references/guarded-editing.md +9 -6
  43. package/dist/skills/ads-break-ui/references/layers.md +123 -0
  44. package/dist/skills/ads-break-ui/references/review.md +96 -0
  45. package/dist/skills/ads-break-ui/references/scenarios.md +24 -3
  46. package/dist/skills/ads-designer/SKILL.md +28 -11
  47. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +2 -2
  48. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +1 -1
  49. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +0 -1
  50. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/index.ts +1 -0
  51. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +1 -1
  52. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -1
  53. package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.json +18 -3
  54. package/dist/skills/ads-designer/assets/bootstrap-ds/vite.config.ts +1 -1
  55. package/dist/skills/ads-designer/references/atomic-styles.md +48 -0
  56. package/dist/skills/ads-designer/references/captures.md +6 -1
  57. package/dist/skills/ads-designer/references/evidence.md +52 -5
  58. package/dist/skills/ads-designer/references/guarded-editing.md +9 -6
  59. package/dist/skills/ads-designer/references/layers.md +123 -0
  60. package/dist/skills/ads-designer/references/review.md +96 -0
  61. package/dist/skills/ads-designer/references/scenarios.md +24 -3
  62. package/dist/skills/ads-import/SKILL.md +27 -10
  63. package/dist/skills/ads-import/references/atomic-styles.md +48 -0
  64. package/dist/skills/ads-import/references/captures.md +6 -1
  65. package/dist/skills/ads-import/references/evidence.md +52 -5
  66. package/dist/skills/ads-import/references/guarded-editing.md +9 -6
  67. package/dist/skills/ads-import/references/layers.md +123 -0
  68. package/dist/skills/ads-import/references/review.md +96 -0
  69. package/dist/skills/ads-import/references/scenarios.md +24 -3
  70. package/dist/skills/ads-migrate/SKILL.md +27 -10
  71. package/dist/skills/ads-migrate/references/atomic-styles.md +48 -0
  72. package/dist/skills/ads-migrate/references/captures.md +6 -1
  73. package/dist/skills/ads-migrate/references/evidence.md +52 -5
  74. package/dist/skills/ads-migrate/references/guarded-editing.md +9 -6
  75. package/dist/skills/ads-migrate/references/layers.md +123 -0
  76. package/dist/skills/ads-migrate/references/review.md +96 -0
  77. package/dist/skills/ads-migrate/references/scenarios.md +24 -3
  78. package/dist/skills/ads-motion/SKILL.md +28 -11
  79. package/dist/skills/ads-motion/references/atomic-styles.md +48 -0
  80. package/dist/skills/ads-motion/references/audit.md +1 -1
  81. package/dist/skills/ads-motion/references/captures.md +6 -1
  82. package/dist/skills/ads-motion/references/evidence.md +52 -5
  83. package/dist/skills/ads-motion/references/guarded-editing.md +9 -6
  84. package/dist/skills/ads-motion/references/layers.md +123 -0
  85. package/dist/skills/ads-motion/references/motion-review.md +35 -0
  86. package/dist/skills/ads-motion/references/review.md +96 -35
  87. package/dist/skills/ads-motion/references/scenarios.md +24 -3
  88. package/dist/units.mjs +17 -14
  89. package/docs/ADS.md +42 -5
  90. package/docs/ARCHITECTURE.md +64 -4
  91. package/docs/BEHAVIORS.md +21 -2
  92. package/docs/CHANGELOG.md +40 -0
  93. package/docs/GUIDE.md +3 -2
  94. package/docs/MCP.md +87 -20
  95. package/package.json +2 -1
  96. package/dist/bootstrap-ds/design-system/patterns/token-preview/Scenario.tsx +0 -4
  97. package/dist/bootstrap-ds/design-system/patterns/token-preview/fixture.ts +0 -8
  98. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/token-preview/Scenario.tsx +0 -4
  99. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/token-preview/fixture.ts +0 -8
  100. /package/dist/bootstrap-ds/design-system/{patterns → review}/token-preview/TokenPreview.tsx +0 -0
  101. /package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/{patterns → review}/token-preview/TokenPreview.tsx +0 -0
@@ -0,0 +1,123 @@
1
+ # Components, patterns and application adapters
2
+
3
+ Read this when choosing an owner, moving UI between layers, or resolving
4
+ `component-dependency`, `component-contract`, `component-style`, `no-app-import`
5
+ or `showcase-import`. MCP also serves this guide as `ads://guides/layers`.
6
+
7
+ ## Choose by responsibility
8
+
9
+ A **component** provides one cohesive UI capability: semantics, input handling,
10
+ focus, accessibility, states and appearance. It may compose other components and
11
+ controllers. A notification using an icon, action button and spinner can still
12
+ be one component.
13
+
14
+ A **pattern** arranges capabilities and content slots into a reusable structure
15
+ or workflow, such as navigation with search/account controls or a report screen.
16
+ Layout parts may arrange `children` without importing several components.
17
+ Patterns may compose other patterns. A native wrapper or a large implementation
18
+ does not decide the layer.
19
+
20
+ An **application adapter** supplies domain data, store access, route state and
21
+ navigation/service callbacks. Domain-shaped inputs are valid in project-owned
22
+ patterns; importing a particular application store/router is not.
23
+
24
+ A **scenario** supplies demonstration inputs, local state and simulated services.
25
+ A component scenario may compose several public components and development review helpers
26
+ to demonstrate its subject. That does not turn its fixture or variant selectors
27
+ into production API. Keep `covers` aligned with the scenario's subject layer.
28
+
29
+ Do not classify by import count, JSX element count, names or file length. Review
30
+ the capability and its consumer contract. Preserve valid APIs when tracing is
31
+ inconclusive; do not make an export private or add a product prop just to pass.
32
+
33
+ ## Demonstrate the production implementation
34
+
35
+ Product patterns are reusable application UI, not showcase replicas. A scenario
36
+ imports the same production owner and supplies fixtures through its public API;
37
+ the application supplies live data and callbacks to that API. Keep mock records,
38
+ demo selections and simulated services in development files. Legitimate defaults,
39
+ control labels and the pattern's own interaction logic remain with their owner.
40
+
41
+ Demo framing must not replace a product pattern's styling or behavior. Browser
42
+ checks should exercise both the demonstrated contract and relevant application
43
+ integration; a successful showcase does not establish production parity. A new
44
+ pattern need not already have an application consumer, and import counts cannot
45
+ detect a duplicated implementation. Existing import guards prevent fixture/test
46
+ dependencies; review and browser checks must assess hardcoded mock data and
47
+ unrepresentative rendering that source ownership alone cannot prove.
48
+
49
+ Review framing belongs in development-only `review/`, not production patterns.
50
+ Use the separate review entry and [review.md](review.md) for the migration and
51
+ build contract.
52
+
53
+ ## Dependency contracts (blocking)
54
+
55
+ - Component runtime may depend on components, shared controllers and lower-level
56
+ helpers. It cannot depend on patterns or composition, including indirectly
57
+ through aliases, forwarding exports, helpers or literal dynamic imports.
58
+ Type-only pattern references do not introduce runtime dependencies.
59
+ - Patterns consume component symbols published by the configured public entry,
60
+ including intentional public types. A relative import of a public symbol is
61
+ allowed inside the ADS; requiring a self-import through the barrel can create
62
+ cycles. Private state, class blocks and implementation helpers stay internal.
63
+ A public component may use its own private implementation dependencies.
64
+ - Runtime code cannot import review implementations/types/styles, scenarios, fixtures or checks, including through
65
+ forwarding exports. Scenarios also cannot import application source.
66
+ - ADS implementations receive application data/effects through inputs and
67
+ callbacks. Re-exporting application stores, routers or services from a helper
68
+ does not make them part of the ADS.
69
+
70
+ For example, `components/Control → shared/helper → patterns/Navigation` fails
71
+ `component-dependency`. Extract a lower-level capability/controller, or move the
72
+ arrangement to a pattern. `patterns/Navigation → components/Control` is valid
73
+ when `Control` is public. Replacing that import with its private state helper
74
+ fails `component-contract` even through a forwarding module.
75
+
76
+ ## Styling contracts (blocking when ownership is established)
77
+
78
+ Components own their control states and appearance. Patterns own arrangement,
79
+ spacing and their own presentation. Use typed component props/variants, an
80
+ intentional public class helper/hook, or registered non-state customization
81
+ variables. Registration does not authorize overriding interaction policy.
82
+
83
+ ```tsx
84
+ // Component-owned implementation; the marker is not a consumer styling API.
85
+ function Control() {
86
+ return <button><span className="control-private-label">Label</span></button>;
87
+ }
88
+
89
+ // Pattern: rejected because it styles the component's private rendered part.
90
+ const wrong = css`
91
+ & .control-private-label { color: var(--text-muted); }
92
+ `;
93
+
94
+ // Pattern: its own arrangement remains valid.
95
+ const layout = css`
96
+ display: flex;
97
+ gap: var(--space-4);
98
+ `;
99
+ ```
100
+
101
+ The source guard matches component-emitted class names and unambiguous literal
102
+ data markers to the selector's styled subject, including `:is()`/`:where()`.
103
+ It also rejects reads of known private component variables. It does not treat
104
+ an ancestor predicate or `:has()` query as styling that ancestor/descendant:
105
+ `[data-layout="expanded"] > & { gap: var(--space-4); }` changes the pattern's
106
+ own arrangement. Public hooks and registered non-state variables remain valid.
107
+ Token definitions, namespaces and writes retain their existing guards.
108
+
109
+ Opaque/computed imports, generated selectors, ambiguous shared markers, forwarded
110
+ consumer classes and arbitrary service abstractions are not a complete static
111
+ proof. Passing source checks does not prove that every visual override is safe.
112
+ Review the real rendered states, computed styles, keyboard interactions and
113
+ responsive layouts; use registered browser checks for promised behavior.
114
+
115
+ ## Refactoring an owner
116
+
117
+ Move runtime source, its scenarios/fixtures and guides together; update public
118
+ exports, dependent imports and documented scenario IDs. Keep callers on the
119
+ same intentional public API. Navigation stays in an application callback or a
120
+ normal link supplied by the consumer, rather than a hidden router mutation in
121
+ the pattern. Validate the complete migration with project checks, product and
122
+ preview builds, and behavior tests. An existing guard rejection is not permission
123
+ to write around the guarded editing workflow.
@@ -0,0 +1,35 @@
1
+ # Review motion
2
+
3
+ Read the item's local README before treating a choice as accidental. Compare
4
+ the source state machine with actual rendered behavior when a browser is
5
+ available. Mark source-only conclusions and untested performance hypotheses.
6
+
7
+ Assess the following where applicable:
8
+
9
+ | Area | Look for |
10
+ |------|----------|
11
+ | Purpose/frequency | A clear relationship to the action; repeated work is not slowed |
12
+ | Easing | Entry decelerates naturally; continuous movement and elapsed-time motion use suitable curves |
13
+ | Timing | Feedback starts promptly; total choreography fits its distance and task |
14
+ | Origin/distance | Placement and scale point to the real trigger without excessive travel |
15
+ | Continuity | Reversal and repeated updates retarget without snapping or restarting |
16
+ | Lifecycle | Exit, cancellation, unmount, and zero-duration states clean up correctly |
17
+ | Accessibility | Motion preference, focus, hidden content, and keyboard behavior remain correct |
18
+ | Ownership | Motion uses tokens and owner styles; consumers do not override internals |
19
+ | Cost | Measured rendering work matches the problem; no per-frame work is assumed harmless |
20
+
21
+ The upstream guidance favors short transitions, restrained scale, and transform/
22
+ opacity. Apply those as defaults with context. A documented 400 ms stack,
23
+ measured height transition, or necessary loading loop is not inherently broken.
24
+ Likewise, a transition below 300 ms is not automatically good. Verify whether an
25
+ exception preserves the intended experience and has acceptable observed cost.
26
+
27
+ Present only actionable findings. Include file/line, trigger, observed behavior,
28
+ expected behavior, why the difference matters, and a concrete owner-level fix.
29
+ For timing/easing proposals, name the current and proposed token policy and its
30
+ scope. If a token is shared, identify affected neighbors before changing values.
31
+
32
+ Use a before/after/why comparison for implemented fixes. Separate behavior
33
+ defects, visual refinements, and profiling questions so a suspicion is not
34
+ reported as a proved performance failure. If no defect is found, say what was
35
+ checked and what remains unverified. Do not invent findings to fill a checklist.
@@ -1,35 +1,96 @@
1
- # Review motion
2
-
3
- Read the item's local README before treating a choice as accidental. Compare
4
- the source state machine with actual rendered behavior when a browser is
5
- available. Mark source-only conclusions and untested performance hypotheses.
6
-
7
- Assess the following where applicable:
8
-
9
- | Area | Look for |
10
- |------|----------|
11
- | Purpose/frequency | A clear relationship to the action; repeated work is not slowed |
12
- | Easing | Entry decelerates naturally; continuous movement and elapsed-time motion use suitable curves |
13
- | Timing | Feedback starts promptly; total choreography fits its distance and task |
14
- | Origin/distance | Placement and scale point to the real trigger without excessive travel |
15
- | Continuity | Reversal and repeated updates retarget without snapping or restarting |
16
- | Lifecycle | Exit, cancellation, unmount, and zero-duration states clean up correctly |
17
- | Accessibility | Motion preference, focus, hidden content, and keyboard behavior remain correct |
18
- | Ownership | Motion uses tokens and owner styles; consumers do not override internals |
19
- | Cost | Measured rendering work matches the problem; no per-frame work is assumed harmless |
20
-
21
- The upstream guidance favors short transitions, restrained scale, and transform/
22
- opacity. Apply those as defaults with context. A documented 400 ms stack,
23
- measured height transition, or necessary loading loop is not inherently broken.
24
- Likewise, a transition below 300 ms is not automatically good. Verify whether an
25
- exception preserves the intended experience and has acceptable observed cost.
26
-
27
- Present only actionable findings. Include file/line, trigger, observed behavior,
28
- expected behavior, why the difference matters, and a concrete owner-level fix.
29
- For timing/easing proposals, name the current and proposed token policy and its
30
- scope. If a token is shared, identify affected neighbors before changing values.
31
-
32
- Use a before/after/why comparison for implemented fixes. Separate behavior
33
- defects, visual refinements, and profiling questions so a suspicion is not
34
- reported as a proved performance failure. If no defect is found, say what was
35
- checked and what remains unverified. Do not invent findings to fill a checklist.
1
+ # Development-only review UI
2
+
3
+ Read this when creating or migrating demo frames, preview sizing helpers, token
4
+ renderers or demonstration controls. MCP serves it as `ads://guides/review`.
5
+
6
+ ## Responsibilities and boundaries
7
+
8
+ Components provide cohesive production capabilities. Patterns provide reusable
9
+ application structures/workflows. Both receive variable application data and
10
+ callbacks through their APIs. Their scenarios import the same implementation
11
+ used by the application and supply fixtures; do not create a second implementation
12
+ that only looks correct in the showcase.
13
+
14
+ `design-system/review/` owns development-only presentation: example frames,
15
+ arrangement, demonstration controls, token sample renderers and their styles.
16
+ It remains project-owned. The MCP host shell stays generic; review code executes
17
+ inside the preview App with the project's framework, foundation, fonts and styles.
18
+ Nothing depends on particular helper names or an imported component library.
19
+
20
+ The development entry defaults to `review/index.ts` relative to `dsDir`; configure
21
+ `reviewEntry` for another script inside `review/`. Its import alias is the
22
+ configured `publicAlias` plus `/review`, normally `@ds/review`. Discover the actual
23
+ entry/alias through `ads_status.project.review`. Export helpers there, never from
24
+ the production public barrel. Review implementations, types and styles must not
25
+ enter application, component, pattern or controller dependencies. Tests, fixtures,
26
+ scenarios and preview mounts can consume review code.
27
+
28
+ Review helpers can own Linaria presentation, local state and demo controls. Normal
29
+ style-token, variable ownership, measured-style-write and application separation
30
+ gates still apply. They consume deliberate public component/pattern/controller
31
+ contracts and may reuse local foundation helpers. They cannot target private
32
+ component styles or replace real product behavior. Keep one-off fixture data in
33
+ the scenario; a helper need not become a product API to frame an example.
34
+
35
+ ## Scenario and token contracts
36
+
37
+ ```tsx
38
+ import { Panel } from "@ds";
39
+ import { ReviewFrame } from "@ds/review";
40
+ import { fixture } from "./Panel.fixture";
41
+
42
+ export const scenario = { title: "Panel", covers: ["Panel"] };
43
+ export default function Scenario() {
44
+ return <ReviewFrame><Panel {...fixture} /></ReviewFrame>;
45
+ }
46
+ ```
47
+
48
+ The names above are illustrative. `covers` names the production subjects actually
49
+ demonstrated, not every review wrapper. A review export has no product catalogue
50
+ entry and needs no standalone catalogue scenario. Keep review unit tests/specs
51
+ beside their owner; optional behavior contracts can verify review guarantees
52
+ through an existing real scenario. They establish no production coverage.
53
+
54
+ A token scenario may name its real review renderer in `covers`, import it from
55
+ the development entry, declare `samples: fixture.samples`, and pass those samples
56
+ into the renderer. Existing real product patterns may also serve as token UI.
57
+ Empty covers, unused samples, fabricated tokens and plain value lists remain
58
+ invalid. The rendered App must still pass token-binding checks. See
59
+ [scenarios.md](scenarios.md) for the full token/render contract.
60
+
61
+ Review class helpers can supply source-proven Linaria classes to a scenario.
62
+ Arbitrary scenario classes/styles remain forbidden. A review wrapper's own native
63
+ controls do not authorize arbitrary native controls in its consuming scenario;
64
+ slot/selector exceptions still need actual production-owner evidence. Keep
65
+ production and review export names distinct where `covers` would be ambiguous.
66
+
67
+ ## Build and guarded edits
68
+
69
+ The normal preview plugin registers the exact review alias before broader product
70
+ aliases. Configure the same alias in project TypeScript and any independent
71
+ preview/dev harness. In an ordered bundler alias map, put `@ds/review` before
72
+ `@ds`; the broad `@ds` mapping must not resolve it as `index.ts/review`.
73
+ Production entrypoints never import the development entry. Inspect the product
74
+ bundle for review modules/CSS; passing static checks does not prove bundle parity.
75
+
76
+ Use `ads_units` for `review/<Owner>` units. Scenarios, local specs and helper files
77
+ follow ordinary flat/directory ownership. A review patch may update only its own
78
+ re-exports in the development entry and its own documented style boundaries.
79
+ Product owners retain the separate production entry companion. Use prepared
80
+ patches/dry runs and coupled transactions as described in
81
+ [guarded-editing.md](guarded-editing.md); do not bypass a rejected mutation.
82
+
83
+ For an existing project, identify helpers by responsibility and actual consumers,
84
+ not names or the number of imported components. Preserve real application patterns.
85
+ Move only demo helpers, their styles and relevant guides to `review/`; update
86
+ scenario/preview imports, style-boundary paths, TypeScript/bundler aliases and
87
+ links. Remove their production exports and obsolete standalone product scenarios.
88
+ Do not copy old example fixtures or export demonstration controls as product UI.
89
+
90
+ Upgrade ADS before migrating a consuming project: older versions do not know the
91
+ separate review entry. For staged guarded edits, first add distinctly named review
92
+ exports, migrate consumers in passing owner patches, then remove the old pattern
93
+ exports/owners once unused. Required coupled changes use a transaction. Check
94
+ source gates, typecheck, preview and production builds, real browser rendering,
95
+ registered behaviors and token bindings. A source move alone establishes none
96
+ of those rendered guarantees.
@@ -34,10 +34,31 @@ do not add scenario `preventDefault` handlers merely to hide it. Explicit App
34
34
  bases retain their declared behavior and CSP requirements; external hosts own
35
35
  their document-loading policy. Verify link activation as well as rendering.
36
36
 
37
+ ## Forms inside Apps
38
+
39
+ Use real form semantics and the runtime owner's intended submit handler. ADS's
40
+ showcase and diagnostic explorer permit `allow-forms` at every iframe layer,
41
+ including legacy widgets. Browser constraint validation, Submit clicks, Enter and
42
+ `requestSubmit()` can reach the normal submit path. Client-side forms call
43
+ `preventDefault()` in their submit handlers; the host does not synthesize clicks
44
+ or submit events. Native action requests are blocked by CSP `form-action 'none'`.
45
+ Submit effects that use tools or resources still follow the MCP bridge.
46
+
47
+ If a click fires but the `submit` handler never runs, inspect the browser's sandbox
48
+ diagnostic and every ancestor iframe's permissions. Distinguish that host problem
49
+ from native constraint validation legitimately preventing submission. Do not add
50
+ scenario click interception to disguise a missing sandbox permission. External
51
+ MCP hosts control their own sandbox/CSP policy.
52
+
53
+ Verify an invalid submit, a valid submit, implicit Enter submission and the promised
54
+ state effects. A working Next button is not evidence that form submission works.
55
+ Keep native action navigation separate from client-side submission behavior;
56
+ `allow-forms` does not grant host DOM access or top-level navigation.
57
+
37
58
  ## Owner-local token previews load their own definitions
38
59
 
39
60
  Keep the registered token sheet imported by its runtime owner for product use.
40
- A colocated `kind: "tokens"` scenario may render only the public review pattern
61
+ A colocated `kind: "tokens"` scenario may render only the development-only review renderer
41
62
  with its fixture samples. Discovery adds the registered owner sheet to the
42
63
  generated record's `stylesheets`; `previewEntriesPlugin` imports those paths
43
64
  into the token preview independently of the runtime component. Custom builders
@@ -91,7 +112,7 @@ These examples describe verification mistakes, not component-specific rules:
91
112
 
92
113
  | Situation | Do not | Do instead |
93
114
  |-----------|--------|------------|
94
- | A reference example sets `width: 15rem`, while the native popup uses its default width. | Remove the reference width and claim the original example now matches. | Keep the baseline intact. Reproduce demo sizing through the project's public review/layout pattern or supported style helper. If a different native size is intentional, document it. Label any additional normalized comparison separately. |
115
+ | A reference example sets `width: 15rem`, while the native popup uses its default width. | Remove the reference width and claim the original example now matches. | Keep the baseline intact. Reproduce demo sizing through the project's development-only review helper or supported style helper. If a different native size is intentional, document it. Label any additional normalized comparison separately. |
95
116
  | Static tracing cannot prove that a public clear control renders when a value is selected. | Remove its export, drop its required coverage, or change runtime behavior merely to pass the gate. | Preserve the intended public API. Try a meaningful selected-state fixture or another real scenario. If valid rendering remains untraceable, report the tooling limitation with a small reproduction. |
96
117
  | A screenshot shows the clear control in a selected state. | Treat its presence as evidence that clearing works. | Add a browser check: start selected, activate Clear, assert the value and selection are empty, verify the control's resulting visibility and documented focus behavior, then select again. |
97
118
 
@@ -207,6 +228,6 @@ An `exercises` entry records behavioral use; it never grants styling permission.
207
228
  Keep helper signatures compatible with the product API. Fix ownership/provenance
208
229
  in the runtime owner when genuinely wrong; retain intentional public APIs when
209
230
  reporting an unsupported trace. Demo-only sizing, framing and arrangement still
210
- belong in public review/layout patterns. A style helper is not permission to
231
+ belong in development-only review helpers. A style helper is not permission to
211
232
  author a second design in the scenario. For cascade risks and extraction issues,
212
233
  read [atomic-styles.md](atomic-styles.md).
package/dist/units.mjs CHANGED
@@ -25,7 +25,7 @@ export function configurationFiles(options) {
25
25
  // fixtures to configuration. Those remain in the behavior owner's patch.
26
26
  if (isInside(dsRoot, file) && isDevelopmentFile(file, options)) return;
27
27
  if (!entrypoint && isInside(sourceRoot, file) && !isInside(dsRoot, file)) return;
28
- if (!entrypoint && isInside(dsRoot, file) && /^(?:components|patterns|controllers|composition|tokens)[\\/]/.test(path.relative(dsRoot, file))) {
28
+ if (!entrypoint && isInside(dsRoot, file) && /^(?:components|patterns|controllers|composition|review|tokens)[\\/]/.test(path.relative(dsRoot, file))) {
29
29
  if (isInside(path.join(dsRoot, "controllers"), file) || isDevelopmentFile(file, options)) return;
30
30
  const folder = path.dirname(file), stem = path.basename(file).split(".")[0];
31
31
  const anchored = ["index", path.basename(folder)].some(name => [".ts", ".tsx", ".js", ".jsx", ".mjs", ".mts"].some(extension => existsSync(path.join(folder, name + extension))));
@@ -102,30 +102,31 @@ export function inspectUnits(options) {
102
102
  const directories = new Set(files.filter(file => /(?:^|\/)Scenario\.[cm]?[jt]sx?$/.test(file)).map(file => slash(path.dirname(file))));
103
103
  for (const file of files.filter(file => /^(?:components|patterns)\/.+\/tokens\.json$/.test(file))) directories.add(path.posix.dirname(file));
104
104
  for (const file of files) {
105
- if (!/^(?:components|patterns|controllers|composition)\//.test(file) || !source.test(file)) continue;
105
+ if (!/^(?:components|patterns|controllers|composition|review)\//.test(file) || !source.test(file)) continue;
106
106
  const directory = slash(path.dirname(file)), name = path.basename(file).replace(source, "");
107
107
  if (!directory.includes("/") || /\.(?:scenario|fixture|scenario-adapter)$/.test(name)) continue;
108
108
  if (flatFamilies.has(directory)) continue;
109
109
  if (name === "index" || sameName(name) === sameName(path.posix.basename(directory)) || name === "fixture") directories.add(directory);
110
110
  }
111
111
  const directoryUnits = [...directories].sort((a, b) => b.length - a.length);
112
- const flatUnits = [...new Set(files.filter(file => /^(?:components|patterns|controllers|composition)\//.test(file) && source.test(file) && !directoryUnits.some(directory => file.startsWith(directory + "/"))).map(file => {
112
+ const flatUnits = [...new Set(files.filter(file => /^(?:components|patterns|controllers|composition|review)\//.test(file) && source.test(file) && !directoryUnits.some(directory => file.startsWith(directory + "/"))).map(file => {
113
113
  const base = path.basename(file).split(".")[0];
114
114
  return slash(path.join(path.dirname(file), base));
115
115
  }))].sort((a, b) => b.length - a.length);
116
116
  const publicEntry = slash(path.relative(dsRoot, path.join(dsRoot, config.publicEntry)));
117
+ const reviewEntry = slash(path.relative(dsRoot, path.join(dsRoot, config.reviewEntry)));
117
118
  const tokenDir = slash(path.relative(dsRoot, path.join(dsRoot, config.tokenDir)));
118
119
  const stylesEntry = slash(path.relative(dsRoot, path.join(dsRoot, config.stylesEntry)));
119
120
  function owner(relative) {
120
121
  const projectFile = slash(path.relative(root, path.resolve(dsRoot, relative)));
121
122
  if (setup.has(projectFile)) return "configuration";
122
123
  if (!isInside(dsRoot, path.resolve(dsRoot, relative))) return isProjectDocument(projectFile) ? "documentation" : null;
123
- if (relative === publicEntry) return null; // Controlled re-export bookkeeping.
124
+ if (relative === publicEntry || relative === reviewEntry) return null; // Controlled re-export bookkeeping.
124
125
  if (relative.startsWith(tokenDir + "/")) return "tokens";
125
126
  if (relative.startsWith("assets/")) return relative.split("/").length > 2 ? relative.split("/").slice(0, 2).join("/") : "assets";
126
127
  if (isProjectDocument(relative)) return "documentation";
127
128
  if (!relative.includes("/")) return /(?:\.(?:md|txt)$|^LICENSE$)/i.test(relative) ? "documentation" : "foundation";
128
- if (!/^(?:components|patterns|controllers|composition)\//.test(relative)) return relative.split("/")[0] === "documentation" ? null : relative.split("/")[0];
129
+ if (!/^(?:components|patterns|controllers|composition|review)\//.test(relative)) return relative.split("/")[0] === "documentation" ? null : relative.split("/")[0];
129
130
  for (const directory of directoryUnits) if (relative.startsWith(directory + "/")) return directory;
130
131
  for (const unit of flatUnits) if (relative.startsWith(unit + "/") || relative.startsWith(unit + ".")) return unit;
131
132
  const base = path.basename(relative).split(".")[0];
@@ -146,22 +147,23 @@ export function inspectUnits(options) {
146
147
  if (!units.get(id).files.includes(file)) units.get(id).files.push(file);
147
148
  }
148
149
  for (const unit of units.values()) if (boundaryCompanion(unit.id)) {
150
+ if (unit.id.startsWith("review/")) (unit.companionFiles ??= []).push({ path: slash(path.relative(root, path.join(dsRoot, reviewEntry))), allowedChanges: "Only this review owner's re-exports in the separate development entry; never the production public entry." });
149
151
  (unit.companionFiles ??= []).push({ path: "ds.config.json", allowedChanges: "Only this owner's inlineStyleFiles and boundaries.styleWrites entries, together with its source change; preserve all other configuration and peer permissions." });
150
- if (/^(?:components|patterns|controllers|composition)\//.test(unit.id)) {
152
+ if (/^(?:components|patterns|controllers|composition|review)\//.test(unit.id)) {
151
153
  for (let directory = unit.id; directory !== "."; directory = path.posix.dirname(directory)) {
152
154
  const marker = path.join(dsRoot, directory, ".gitkeep");
153
155
  if (existsSync(marker) && readFileSync(marker).length === 0) (unit.companionFiles ??= []).push({ path: slash(path.relative(root, marker)), allowedChanges: "Delete this empty placeholder only while adding real source in the selected owner below it." });
154
156
  }
155
157
  }
156
158
  }
157
- return { units: [...units.values()].sort((a, b) => a.id.localeCompare(b.id)), owner, publicEntry, stylesEntry, tokenDir,
159
+ return { units: [...units.values()].sort((a, b) => a.id.localeCompare(b.id)), owner, publicEntry, reviewEntry, stylesEntry, tokenDir,
158
160
  relative: file => slash(path.relative(dsRoot, path.resolve(root, file))) };
159
161
  }
160
162
 
161
163
  function boundaryCompanion(unit) { return !["configuration", "documentation", "assets"].includes(unit.split("/")[0]); }
162
164
 
163
165
  export function validateUnitId(unit) {
164
- if (typeof unit !== "string" || unit.length > 256 || !/^[A-Za-z0-9_-]+(?:\/[A-Za-z0-9_-]+)*$/.test(unit) || ["components", "patterns", "controllers", "composition"].includes(unit)) throw fail("Select one ADS unit ID from ads_units or an unoccupied owner path following its colocation convention.");
166
+ if (typeof unit !== "string" || unit.length > 256 || !/^[A-Za-z0-9_-]+(?:\/[A-Za-z0-9_-]+)*$/.test(unit) || ["components", "patterns", "controllers", "composition", "review"].includes(unit)) throw fail("Select one ADS unit ID from ads_units or an unoccupied owner path following its colocation convention.");
165
167
  }
166
168
 
167
169
  /** Reject arbitrary file batches, even when every path is inside the ADS. */
@@ -171,7 +173,7 @@ export function checkUnitFiles(options, unit, changes, inventory = inspectUnits(
171
173
  const relative = inventory.relative(change.path);
172
174
  if (path.posix.basename(relative) === ".gitkeep") {
173
175
  const directory = path.posix.dirname(relative);
174
- if (change.originalContent !== "" || change.content !== null || !/^(?:components|patterns|controllers|composition)\//.test(relative)
176
+ if (change.originalContent !== "" || change.content !== null || !/^(?:components|patterns|controllers|composition|review)\//.test(relative)
175
177
  || !(unit === directory || unit.startsWith(directory + "/"))
176
178
  || !changes.some(item => item.originalContent === null && item.content !== null && source.test(item.path)
177
179
  && (inventory.relative(item.path).startsWith(unit + "/") || inventory.relative(item.path).startsWith(unit + ".")))) throw fail("Only delete an existing empty .gitkeep while adding source in the selected owner beneath it. Other hidden-file changes are not allowed.", change.path);
@@ -179,7 +181,7 @@ export function checkUnitFiles(options, unit, changes, inventory = inspectUnits(
179
181
  }
180
182
  if (allowNew && unit === "configuration") continue; // The candidate must register every setup/extension file.
181
183
  if (change.path === "ds.config.json" && boundaryCompanion(unit)) continue; // Validated against only this owner below.
182
- if (relative === inventory.publicEntry) continue;
184
+ if (relative === inventory.publicEntry || relative === inventory.reviewEntry) continue;
183
185
  if (unit === "tokens" && relative === inventory.stylesEntry) continue; // Controlled foundation import bookkeeping.
184
186
  if (allowNew && change.originalContent === null && (relative.startsWith(unit + "/") || relative.startsWith(unit + "."))) continue;
185
187
  const owner = inventory.owner(relative);
@@ -232,13 +234,14 @@ export function checkUnitCandidate(afterOptions, unit, changes, before) {
232
234
  }
233
235
  if (JSON.stringify(unrelated(current)) !== JSON.stringify(unrelated(proposed))) throw fail("Foundation companion patches may change only canonical imports for token files created/deleted in this patch; preserve all other imports and comments.", foundationChange.path);
234
236
  }
235
- const exportChange = changes.find(change => before.relative(change.path) === before.publicEntry);
236
- if (exportChange) {
237
- if (!["components", "patterns", "controllers"].includes(unit.split("/")[0])) throw fail("Only a component/pattern/controller unit may update its public re-exports.", exportChange.path);
237
+ for (const entry of [before.publicEntry, before.reviewEntry]) {
238
+ const exportChange = changes.find(change => before.relative(change.path) === entry);
239
+ if (!exportChange) continue;
240
+ if (!(entry === before.reviewEntry ? ["review"] : ["components", "patterns", "controllers"]).includes(unit.split("/")[0])) throw fail("Only its own layer may update re-exports: product owners use the public entry, review owners use the development review entry.", exportChange.path);
238
241
  const current = exportChange.originalContent ?? "", proposed = exportChange.content;
239
242
  if (proposed === null) throw fail("The shared public entry cannot be deleted.", exportChange.path);
240
243
  const resolve = importResolver(afterOptions);
241
- const file = path.join(afterOptions.dsRoot, afterOptions.config.publicEntry);
244
+ const file = path.join(afterOptions.dsRoot, entry);
242
245
  const original = ts.createSourceFile(file, current, ts.ScriptTarget.Latest, true);
243
246
  const candidate = ts.createSourceFile(file, proposed, ts.ScriptTarget.Latest, true);
244
247
  const emptyExport = statement => ts.isExportDeclaration(statement) && !statement.moduleSpecifier && statement.exportClause && ts.isNamedExports(statement.exportClause) && !statement.exportClause.elements.length;
package/docs/ADS.md CHANGED
@@ -114,7 +114,7 @@ are generated development evidence, outside source ownership and product bundles
114
114
  See the portable [capture workflow](../skills/ads-designer/references/captures.md).
115
115
  Token entries under the configured token directory declare
116
116
  `export const scenario = { title: fixture.title, covers: ["TokenSamples"], samples: fixture.samples };`.
117
- `TokenSamples` is any project-owned public review pattern, not a required name.
117
+ `TokenSamples` is any project-owned development-only review renderer, not a required name.
118
118
  Its colocated fixture declares literal `samples: [{ token, property, probe }]`.
119
119
  Each token must exist and have sample coverage; duplicate bindings, missing probes,
120
120
  empty covers and value-only inspectors fail. The default entry passes the declared
@@ -184,6 +184,19 @@ instead of assigning shared tokens in JavaScript. Full application harnesses
184
184
  belong in application test support. Run ADS/project checks before application,
185
185
  preview builds; review meaningful states in both themes and sizes.
186
186
 
187
+ ## Development review layer
188
+
189
+ `review/` contains demo framing, demonstration controls and token renderers.
190
+ It has a separate `reviewEntry` (default `review/index.ts`), imported through
191
+ `${publicAlias}/review` (`@ds/review` by default). Product patterns are production
192
+ application UI. The public production barrel and product catalogue exclude review
193
+ exports; production code cannot depend on their implementation, types or styles.
194
+ Review rendering stays inside the App and retains the normal token/style and
195
+ public product-contract gates. See the portable
196
+ [review guide](../skills/ads-designer/references/review.md) for scenarios, guarded
197
+ owners, build aliases and migration. `ads_status.project.review` discovers the
198
+ connected project's actual entry. Older tooling must be upgraded before migration.
199
+
187
200
  ## Shared token contract
188
201
 
189
202
  ### Owner-local tokens
@@ -198,7 +211,7 @@ components/Notice/
198
211
  tokens.css # :root { --notice-width: 356px; }
199
212
  Scenario.tsx
200
213
  fixture.ts
201
- Tokens.scenario.tsx # kind: "tokens", public review pattern + samples
214
+ Tokens.scenario.tsx # kind: "tokens", development-only review renderer + samples
202
215
  Tokens.fixture.ts
203
216
  ```
204
217
 
@@ -216,7 +229,7 @@ Measured runtime variables retain their existing exact `styleWrites` boundary.
216
229
  `ads_tokens` returns each token's owner, definitions and local namespace.
217
230
 
218
231
  A colocated scenario sets `kind:"tokens"` and declares real fixture `samples`
219
- consumed by a public review pattern. Its ID still derives from its source path.
232
+ consumed by a development-only review renderer. Its ID still derives from its source path.
220
233
  Discovery attaches its owner's registered definition sheet as `stylesheets` on
221
234
  the generated scenario record; `previewEntriesPlugin` imports it directly into
222
235
  that preview's module graph. CSS-only package side effects can then tree-shake
@@ -259,6 +272,16 @@ custom styling in fixture files. The ADS frame pattern uses `--ux-*`. Foreign br
259
272
  CSS imports the approved token files in order; shared assignments belong in
260
273
  those token files, never in consumer styles or component state overrides.
261
274
 
275
+ Typed custom-property registrations follow the same ownership. Runtime-variable
276
+ `@property` metadata lives in component/pattern Linaria; shared and owner-local
277
+ token registrations live beside real token definitions. Names are document-global:
278
+ unrelated owners and conflicting descriptor sets cannot claim the same name.
279
+ Descriptors have their own CSS grammar and independent literal defaults; normal
280
+ visual styling still uses tokens. Registration does not create token/sample
281
+ coverage, and base resets/font metadata cannot host it. Preserve whole rules with
282
+ the ADS Linaria resolver in product and MCP preview builds. See the portable
283
+ [atomic styling guide](../skills/ads-designer/references/atomic-styles.md).
284
+
262
285
  Foundation roles are enforced by `foundation-role`, `foundation-selector` and
263
286
  `foundation-import`, alongside the regular token checks. Shared definitions
264
287
  belong on the document root or explicit root themes; ordinary declarations belong
@@ -284,7 +307,7 @@ layout, component-specific focus rules and hover/disabled skins are rejected.
284
307
  Shared token definitions belong in value sheets, not `base.css`. No project token
285
308
  names are embedded in this policy. A zero-specificity `:where()` wrapper does not
286
309
  change ownership. Put component design and animation in Linaria owners, and
287
- scenario layout variations in typed public review-pattern props. Browser review
310
+ scenario layout variations in typed review-helper props. Browser review
288
311
  still checks the effects and accessibility of permitted defaults.
289
312
 
290
313
 
@@ -384,6 +407,8 @@ The checks enforce the architecture's ownership boundaries:
384
407
  |----------|------------------|
385
408
  | Tokens and styles | Fixed token vocabulary, required definitions, declared value types and references, raw visual values, shared-token assignments, foundation import order, and component/pattern namespaces |
386
409
  | Public API and dependencies | Consumers use public ADS imports; ADS implementations and showcase do not import application source; runtime code does not import showcase fixtures |
410
+ | Component and pattern layers | Component runtime cannot depend on patterns/composition, including through resolved aliases, re-exports and helpers; patterns consume public component symbols, not implementation helpers/types |
411
+ | Component styling contracts | Patterns cannot target proven private component classes/data markers or read known private component variables; public hooks and registered non-state customization variables remain available; ancestor context for a pattern's own styles is allowed |
387
412
  | Interaction policy | Primitive state variables stay inside components; non-state customization hooks require explicit registration |
388
413
  | Renderer exceptions | Inline styles and imperative writes require used, narrow configured boundaries; stale entries fail; public props omit inherited style and reject open-ended visual strings |
389
414
  | Preview ownership | Scenarios define no CSS, custom classes, or standalone native controls; native slot children require public runtime cloning evidence; all declared tokens and public renderable UI have reachable registered scenarios; token references must exist; legacy catalogue pages are checked when present |
@@ -408,6 +433,18 @@ tests. Passing static checks establishes only the policies and source formats
408
433
  they cover. Browser review and behavior tests still verify accessibility,
409
434
  interaction, responsive layout, themes, and motion.
410
435
 
436
+ A component provides one cohesive UI capability; a pattern arranges capabilities
437
+ into a reusable structure or workflow. Component count is not a rule. Components
438
+ may compose components/controllers; layout patterns can arrange content slots;
439
+ component scenarios may use development-only review helpers. Classification is design
440
+ guidance, while `component-dependency`, `component-contract` and `component-style`
441
+ are blocking source-ownership rules. Type-only higher-layer references are not
442
+ runtime edges. Relative component imports inside the ADS are valid when the
443
+ selected symbols are public; a self-import through the root barrel is not required.
444
+ Opaque/computed dependencies and ambiguous/generated style hooks require review.
445
+ See the skill-local [layer guide](../skills/ads-designer/references/layers.md), also
446
+ available through MCP at `ads://guides/layers`.
447
+
411
448
  Component-specific usage rules belong to that component in the receiving
412
449
  project. Import applicable rules with the item and register them through
413
450
  project configuration or maintained tooling integration. Core tooling must
@@ -438,7 +475,7 @@ Root [bootstrap-ds/](../bootstrap-ds/README.md) is the canonical empty scaffold.
438
475
  Its identical copy under `skills/ads-designer/assets/bootstrap-ds/` makes the
439
476
  skill self-contained. Run `npm run sync:skill-starter` after edits and
440
477
  `npm run check:skill-starter` to verify the copy. Both contain empty product component/composition directories and a minimal project-owned
441
- token review pattern. The scaffold pattern can be renamed or replaced; the tool
478
+ token review renderer. The scaffold pattern can be renamed or replaced; the tool
442
479
  does not require that name or its styles and ships no product UI catalogue.
443
480
 
444
481
  Tool releases should version contract changes, rules, skills, bootstrap support,