@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
@@ -23,6 +23,11 @@ authors, and identify the influenced behavior, layout, or motion. Explain agreed
23
23
  differences so the result's closeness to the reference can be assessed. Preserve
24
24
  applicable license notices when implementation or assets are copied/adapted.
25
25
 
26
+ Record which source roles map to existing project tokens, which genuinely new
27
+ shared decisions were added, and why intentional visual differences follow
28
+ project policy. Keep this explanation focused on meaningful choices; a second
29
+ hand-maintained catalogue of every CSS declaration is unnecessary.
30
+
26
31
  The receiving project's main README owns discovery/quick start and a short
27
32
  upstream inspiration credit. Its project ADS guide (often `ADS.md`) owns shared
28
33
  architecture, token and CSS ownership, central enforcement, and links to component
@@ -19,25 +19,58 @@ Use a small contract table during work:
19
19
  | Concern | Original observation | Native requirement | Verification |
20
20
  |---------|----------------------|--------------------|--------------|
21
21
  | States | Defaults, active/loading/error, disabled | Supported states and transitions | Trigger each public path |
22
- | Layout | Dimensions, gap, natural height, overflow | Measured/token mapping | Computed styles and rectangles |
22
+ | Layout | Dimensions, gap, natural height, overflow | Project token mapping and usable geometry | Computed styles and rectangles |
23
23
  | Lifecycle | Updates, expiry, removal, route teardown | Observable timing and callbacks | Timed state assertions |
24
24
  | Input | Pointer/touch, keys, focus targets | Same behavior or user-agreed change | Real input plus active-element checks |
25
- | Motion | Entry/exit, interruption, transform origin | Duration, easing, trajectory | Transition events and sampled frames |
25
+ | Motion | Entry/exit, interruption, transform origin | Required choreography using project motion roles | Transition events and sampled frames |
26
26
 
27
27
  This is a working aid, not a required standalone report. Keep settled public
28
28
  contracts in the component guide and executable evidence in appropriate tests.
29
29
 
30
- ## Map into the target system
31
-
32
- Use existing primitives for icons, buttons, spinners, surfaces, and typography.
33
- Map dimensions, colors, radii, shadows, durations, easing, and layering to tokens.
34
- Add a narrowly named token only when the existing vocabulary cannot express the
35
- required behavior; preserve unrelated token contracts.
36
-
37
- Keep the result close to the reference's function, layout, interaction, and
38
- motion. Native integration should not become a redesign. Account for each
39
- material difference with a user requirement or an agreed target-system tradeoff;
40
- compare again after token/primitive substitutions to detect accidental drift.
30
+ ## Converge on the project's design language
31
+
32
+ A port contributes to the destination design system; it does not preserve a
33
+ separate design system for each upstream package. A library assembled from
34
+ several dependencies may repeat font stacks, scales, radii, shadows or motion
35
+ constants under different names. Those source boundaries do not define project
36
+ design roles. Reuse existing primitives, controls and controllers where their
37
+ contracts fit, and map source styling into the one shared foundation.
38
+
39
+ Before introducing tokens, compare the selected source roles with destination
40
+ definitions and their actual consumers. Map by purpose, value type, theme/state
41
+ behavior and intended relationship, not by name or a matching number alone:
42
+
43
+ | Source finding | Port decision |
44
+ |----------------|---------------|
45
+ | A dependency uses its own system font and a slightly different label size | Use the project's font and label/text role; do not add a dependency-specific font or size to recover its exact pixels |
46
+ | Several source packages define the same muted surface or control gap | Map equivalent uses to the existing shared role; consolidate duplicates introduced during this port |
47
+ | Two tokens happen to have the same value but describe different states | Keep distinct semantic roles when their themes or future changes need to differ; alias a shared primitive only when that relationship is intended |
48
+ | A genuinely missing visual decision is needed | Add the smallest coherent shared role or scale extension, with themes and token samples; explain its purpose beyond copying one upstream constant |
49
+
50
+ When the destination is empty, establish a coherent initial vocabulary across
51
+ the selected scope instead of appending each package's constants independently.
52
+ When it already has a visual policy, that policy takes precedence by default.
53
+ Review [design-data.md](design-data.md) for value-source and overlap rules.
54
+
55
+ Consolidate equivalent roles created by the port and update all their affected
56
+ references and samples. Remove temporary duplicates and obsolete source sheets
57
+ once they have no consumers. Existing public-token removals or unrelated design
58
+ cleanup need their own scope/compatibility decision; do not sweep through the
59
+ whole project or merge distinct meanings just because values are equal.
60
+
61
+ Dependency installation does not establish styling ownership. Keep only needed,
62
+ declared runtime dependencies; inspect any stylesheet, reset, theme provider or
63
+ visual default they require. Do not introduce a dependency's styling system or
64
+ global reset to make its pixels match. Adapt owned styles through Linaria and
65
+ shared Data; preserve any supported headless dependency's behavior contract.
66
+
67
+ Preserve required capabilities, accessibility and interactions while applying
68
+ the project's visual language. Source pixels are a reference, not an automatic
69
+ acceptance target. Document intentional changes to type, spacing, color, motion
70
+ roles or composition; inspect related controls together to verify consistency.
71
+ Exact visual or API fidelity applies when the user requests it. Resolve a real
72
+ conflict with project policy explicitly rather than creating duplicate tokens
73
+ or silently dropping capabilities.
41
74
 
42
75
  Keep the reference's state machine and motion choreography distinct from the
43
76
  native skin. Typography and controls can change wrapping and natural height,
@@ -57,7 +90,8 @@ target framework. With the default root ADS layout:
57
90
 
58
91
  Preserve the reference's required capabilities while assigning each concern to
59
92
  its owner. Demo utilities for container size, border or framing become a public
60
- review/layout pattern around the real component. Add component props for a
93
+ development-only `review/` helper around the real component, exported through the
94
+ separate review entry. Add component props for a
61
95
  deliberate runtime API requirement; missing demo layout alone is not justification.
62
96
  For imperative geometry, register exact `styleWrites` properties. After migrating
63
97
  from JSX inline geometry, change source and its own config companion together:
@@ -117,7 +151,7 @@ Document material adaptations and agreed deviations beside the public contract.
117
151
 
118
152
  Keep private controllers in their owner; extract a shared controller only for a
119
153
  real reuse need. Register optional behavior guarantees and real colocated checks;
120
- see `ads://guides/behaviors` or the installed package's `docs/BEHAVIORS.md`. Link
154
+ see [behaviors.md](behaviors.md), also served as `ads://guides/behaviors`. Link
121
155
  public hooks with scenario `exercises`, while `covers` still requires rendered UI.
122
156
  Move reviewed scratchpad investigations into maintained owner checks. Disabling
123
157
  StrictMode can isolate an upstream lifecycle defect; keep a development StrictMode
@@ -0,0 +1,101 @@
1
+ # Record an ADS problem or capability request
2
+
3
+ Use this reference when targeted investigation suggests an ADS defect or a
4
+ legitimate workflow needs a missing capability. MCP serves it as
5
+ `ads://guides/reporting`. Reports collect observations for later triage; they do
6
+ not prove an ADS cause, open an upstream issue or change architecture policy.
7
+
8
+ ## Choose the tool
9
+
10
+ - `ads_report_bug`: existing ADS behavior appears broken, including an apparently
11
+ false guard rejection, stale preview, resource delivery or runner defect.
12
+ - `ads_request_feature`: an intended workflow needs a capability ADS does not
13
+ currently provide. Explain the workflow and impact before proposing a design.
14
+
15
+ When classification is uncertain, choose the best fit and state the uncertainty.
16
+ Both tools mark reports `untriaged` and classification `agent-supplied`.
17
+
18
+ Investigate the failing boundary first using [evidence.md](evidence.md). Correct
19
+ ordinary invalid tool arguments, component defects and legitimate guard failures
20
+ in their owner. Do not label every failed check as an ADS bug. A transport error
21
+ does not prove a network-interface cause, and a failed assertion may be a test
22
+ defect. Describe observations separately from `suspectedCause` or `proposal`.
23
+
24
+ ## Submit compact, actionable observations
25
+
26
+ Bug reports require `title`, `expected`, `observed`, nonempty `steps` and
27
+ `frequency` (`always`, `intermittent`, `once` or `unknown`). A one-time failure can
28
+ be reported honestly; repeated reproduction is not required. `suspectedCause` is
29
+ optional. Feature requests require `title`, `workflow`, `capability` and `impact`;
30
+ `proposal` is optional.
31
+
32
+ Both accept optional `unit`, `scenario`, `reporter` and up to three `evidence`
33
+ selectors. Use discovered target IDs where possible. A new draft may not yet be
34
+ registered; naming it is a claim rather than registration or coverage credit.
35
+ Reporter names are agent-supplied metadata, not authenticated identity.
36
+
37
+ ```js
38
+ ads_report_bug({
39
+ title: "Consumer proof rejects a child reached through a local helper",
40
+ unit: "components/Example",
41
+ expected: "The real child and its props are recognized through the helper.",
42
+ observed: "The candidate is rejected by declarative-consumer.",
43
+ steps: ["Render the registered part through its parent.", "Dry-run its owner patch."],
44
+ frequency: "always",
45
+ evidence: [{resultId: "<returned execution ID>"}],
46
+ });
47
+
48
+ ads_request_feature({
49
+ title: "Select checks directly from a prepared draft",
50
+ workflow: "Investigate one registered behavior before validating a large draft.",
51
+ capability: "Run selected draft checks against an isolated candidate.",
52
+ impact: "Avoid repeating unrelated checks during investigation.",
53
+ });
54
+ ```
55
+
56
+ An evidence selector is either `{resultId}` from `ads_verify`/guarded editing,
57
+ or the exact `{unit, check, runId}` from a check outcome. ADS verifies the selector
58
+ and saves a compact completion-time snapshot. Superseded or fabricated IDs fail;
59
+ do not attach another run's evidence. If the older slot is gone, omit the selector
60
+ and state what was observed rather than claiming it remains verified.
61
+
62
+ ADS also captures its version, configured framework, Node/platform, source and
63
+ configuration revisions, available build metadata and capture time. Missing
64
+ metadata is explicitly unobserved. Context capture does not rerun checks or
65
+ establish current passing behavior. A report can refer to a candidate while its
66
+ current-project context describes the live source; compare the labeled revisions.
67
+
68
+ Include a minimal reproduction, not whole component files, complete runner logs,
69
+ customer fixtures, credentials or request headers. The tools accept no file
70
+ attachment path and upload nothing. Artifact links may later become unavailable;
71
+ reports preserve compact text evidence, not image/trace bytes. Snapshot truncation
72
+ is explicit. A saved record is limited to 32 KiB; shorten oversized narrative.
73
+ Keep each report focused on one problem or capability rather than a session dump.
74
+
75
+ The reply is a compact receipt with `reportId`, `revision` and local `storagePath`. Equivalent submissions
76
+ for the same ADS version/framework reuse the ID and increment `submissionCount`.
77
+ This counts submissions, not independent reproductions. The latest submission,
78
+ context and evidence replace that report's details; there is no occurrence log.
79
+
80
+ ## Storage and receipt
81
+
82
+ Both kinds are stored as ordinary JSON files at
83
+ `<projectRoot>/.ds/reports/<reportId>.json`. They are development metadata,
84
+ excluded from production code. Reports do not expire or get deleted by a count
85
+ limit. Archiving/deletion are deliberate maintenance actions; neither intake tool
86
+ performs them. This is project-local collection, not automatic delivery to ADS
87
+ maintainers or GitHub. Share selected reports explicitly when needed.
88
+
89
+ MCP intake is submission-only. There are no tools or resources for listing,
90
+ reading or subscribing to saved reports. The receipt acknowledges local storage;
91
+ it does not return the report body. Inspect or share the local JSON files through
92
+ normal project maintenance when needed. `ads_status.reports` identifies the two
93
+ submission tools, storage directory and this guidance, without listing reports.
94
+
95
+ ## Continue without distorting the design
96
+
97
+ Preserve the draft and legitimate public API while reporting a tooling gap.
98
+ Do not privatize parts, add demo-only props, alter the reference baseline, weaken
99
+ guards or bypass a rejected MCP patch merely to proceed. Continue independent
100
+ work when possible. Tell the user the report ID, the exact blocked step and what
101
+ remains unverified; do not restate the entire stored report in conversation.
@@ -4,8 +4,8 @@ Use this reference for `scenario-render`, `scenario-coverage`, `showcase-control
4
4
  diagnostics. MCP serves the same guide as `ads://guides/scenarios`.
5
5
 
6
6
  All preview kinds open at `?scenario=<discovered-id>`. Use the returned showcase
7
- link instead of inferring a section from an ID's directory: an owner-local token
8
- scenario may live under `components/` or `patterns/`, with `kind: "tokens"`.
7
+ link instead of inferring a section from an ID's directory. Token scenarios and
8
+ their fixtures belong in the configured shared token directory, with `kind: "tokens"`.
9
9
  Legacy `?category=` links remain aliases. The `ads_show_tokens` tool retains its
10
10
  `category` argument; both preview tools return canonical `?scenario=` links.
11
11
 
@@ -55,20 +55,14 @@ state effects. A working Next button is not evidence that form submission works.
55
55
  Keep native action navigation separate from client-side submission behavior;
56
56
  `allow-forms` does not grant host DOM access or top-level navigation.
57
57
 
58
- ## Owner-local token previews load their own definitions
58
+ ## Independent shared token previews
59
59
 
60
- Keep the registered token sheet imported by its runtime owner for product use.
61
- A colocated `kind: "tokens"` scenario may render only the development-only review renderer
62
- with its fixture samples. Discovery adds the registered owner sheet to the
63
- generated record's `stylesheets`; `previewEntriesPlugin` imports those paths
64
- into the token preview independently of the runtime component. Custom builders
65
- that replace this plugin must preserve these explicit stylesheet dependencies.
66
- Do not render the runtime owner merely to retain its CSS or add unrelated sheets.
67
-
68
- Open the exact token scenario in a fresh App and verify resolved values and sample
69
- effects in both themes. A successful ordinary component preview does not prove
70
- the independently bundled token preview loads the same definitions. Shared
71
- foundation styling still follows the project's mount/build integration.
60
+ All token scenarios/fixtures belong under the shared token directory. They render
61
+ project-owned review UI with real sample bindings and probes. The project mount
62
+ adapter loads the shared foundation, so a token preview does not need to render a
63
+ runtime component merely to retain its CSS. There is no owner token-sheet injection.
64
+ Open each affected token scenario in a fresh App and verify sample effects in both
65
+ themes. A component preview alone does not establish token-preview correctness.
72
66
 
73
67
  ## Public children can share their parent's scenario
74
68
 
@@ -26,6 +26,15 @@ mounting, routing, CSS-entry, or scope integration problem.
26
26
 
27
27
  ## Select tests by observable risk
28
28
 
29
+ Judge the port against the destination contract as well as the source. Check
30
+ that it uses shared project roles, fits beside existing controls and remains
31
+ usable after typography/spacing substitutions. Exercise wrapping, focus rings,
32
+ disabled/error states, both themes and narrow containers where those adaptations
33
+ can change geometry or contrast. Record expected visual differences rather than
34
+ adding source-specific tokens to satisfy an exact-pixel assertion. Strict visual
35
+ parity is required only when it is part of the agreed brief; never edit the
36
+ reference to conceal an adaptation or a regression.
37
+
29
38
  Use the cases relevant to the component, not a universal checklist:
30
39
 
31
40
  | Area | Useful observations |
@@ -106,7 +115,8 @@ do not run Toast tests as a substitute. Once checks pass, rerun only when change
106
115
  or unresolved observations justify it. Save browser artifacts in the repository's existing ignored location
107
116
  (for example `output/playwright/`) or an isolated temporary directory.
108
117
 
109
- Report matches and differences with their evidence and reference version. Distinguish
118
+ Report destination consistency and required behavioral matches separately from
119
+ intentional source-style differences, with evidence and the reference version. Distinguish
110
120
  observed behavior, source inference, and untested cases. Give full native/reference
111
121
  playground URLs when they exist. Do not report a static server as running without
112
122
  checking it, or call screenshots proof of full animation/behavior parity.
package/dist/tokens.mjs CHANGED
@@ -6,7 +6,7 @@ import { loadConfig, sourceFiles } from "./config.mjs";
6
6
  import { foundationFiles, isSharedToken, tokenContract } from "./token-policy.mjs";
7
7
  import { dimensionValue, numericCssUnit } from "./css-values.mjs";
8
8
  import { checkComponentVariable } from "./boundaries.mjs";
9
- import { scopedTokens, scopedTokenOwner } from "./scoped-tokens.mjs";
9
+ import { tokenOverlapAdvisories } from "./design-values.mjs";
10
10
 
11
11
  export { tokenContract };
12
12
 
@@ -51,10 +51,7 @@ export function inspectTokens(directory, suppliedOptions) {
51
51
  const { root, dsRoot, config } = options;
52
52
  const definitions = new Map();
53
53
  const diagnostics = [];
54
- const scoped = scopedTokens(options);
55
- diagnostics.push(...scoped.diagnostics);
56
54
  const files = sourceFiles(path.join(dsRoot, config.tokenDir)).filter((file) => file.endsWith(".css"));
57
- files.push(...scoped.definitions.map(entry => path.join(root, entry.file)));
58
55
  files.sort((a, b) => foundationFiles.indexOf(path.basename(a)) - foundationFiles.indexOf(path.basename(b)) || a.localeCompare(b));
59
56
  for (const file of files) {
60
57
  let css;
@@ -73,7 +70,6 @@ export function inspectTokens(directory, suppliedOptions) {
73
70
  column: decl.source.start.column,
74
71
  scope: context(decl),
75
72
  value: decl.value,
76
- ...(scoped.definitions.some(entry => entry.file === path.relative(root, file).replaceAll("\\", "/")) ? { owner:scoped.definitions.find(entry => entry.file === path.relative(root, file).replaceAll("\\", "/")).unit } : {}),
77
73
  };
78
74
  if (!definitions.has(decl.prop)) definitions.set(decl.prop, []);
79
75
  definitions.get(decl.prop).push(definition);
@@ -113,8 +109,7 @@ export function inspectTokens(directory, suppliedOptions) {
113
109
  }
114
110
  const resolvedReferences = new Map();
115
111
  for (const ref of references(entry.value)) {
116
- const local = scopedTokenOwner(options, ref.name);
117
- if (local ? entry.owner !== local.unit : !isSharedToken(ref.name)) report("token-name", name, entry, `${name} references ${ref.name} outside its shared/owner token contract.`);
112
+ if (!isSharedToken(ref.name)) report("token-name", name, entry, `${name} references ${ref.name} outside the shared Data token contract.`);
118
113
  if (!scope.has(ref.name) && !ref.fallback) report("token-reference", name, entry, `${name} references undefined ${ref.name}.`);
119
114
  else if (scope.has(ref.name)) resolvedReferences.set(ref.name, resolveAlias(ref.name, [...chain, name]));
120
115
  }
@@ -142,9 +137,11 @@ export function inspectTokens(directory, suppliedOptions) {
142
137
  if (type && resolved !== undefined && !matchesType(resolved, type)) report("token-type", name, entry, `${name} expects ${type}; found ${resolved}.`);
143
138
  }
144
139
  }
140
+ const tokens = [...definitions].sort(([a], [b]) => a.localeCompare(b)).map(([name, entries]) => ({ name, ...tokenContract.tokens[name], owner:"tokens", definitions: entries }));
145
141
  return options.tokenInventory = {
146
142
  contractVersion: tokenContract.version,
147
- tokens: [...definitions].sort(([a], [b]) => a.localeCompare(b)).map(([name, entries]) => ({ name, ...tokenContract.tokens[name], ...(scopedTokenOwner(options, name) ? {owner:scopedTokenOwner(options, name).unit, namespace:scopedTokenOwner(options, name).namespace} : {owner:"tokens"}), definitions: entries })),
143
+ tokens,
144
+ advisories: tokenOverlapAdvisories(tokens),
148
145
  diagnostics,
149
146
  };
150
147
  }
@@ -1,4 +1,4 @@
1
- import { existsSync, realpathSync, statSync } from "node:fs";
1
+ import { realpathSync, statSync } from "node:fs";
2
2
  import path from "node:path";
3
3
  import ts from "typescript";
4
4
  import { z } from "zod";
@@ -17,7 +17,6 @@ const binding = z.object({ input: z.object({ api: ref, property: field }).strict
17
17
  variable: z.string().regex(/^--[a-z][\w-]*\$\{key\}[\w-]*$/), scope: z.object({ api: ref, selector: z.string().min(1).max(200) }).strict(), checks }).strict();
18
18
  const part = z.object({ api: ref, parent: ref, consumer: ref, checks }).strict();
19
19
  const schema = z.object({ schemaVersion: z.literal(1),
20
- tokens: z.object({ namespace: z.string(), stylesheet: z.string().min(1).max(256) }).strict().optional(),
21
20
  paintInputs: z.array(paint).max(100).optional(), bindings: z.record(id, binding).optional(),
22
21
  declarativeParts: z.array(part).max(100).optional(), behavior: z.record(z.string(), z.unknown()).optional(),
23
22
  }).strict();
@@ -146,12 +145,6 @@ export function inspectUnitContracts(options) {
146
145
  const absolute = path.resolve(options.root, reference.source);
147
146
  if (!isInside(options.dsRoot, absolute) || inventory.owner(inventory.relative(reference.source)) !== unit || isDevelopmentFile(absolute, options)&&!isReviewFile(absolute,options)) report(`${fieldName} must reference runtime or review implementation inside ${unit}, not a contract, fixture or spec.`, fieldName);
148
147
  }
149
- if (data.tokens) {
150
- if(!/^(?:components|patterns)\//.test(unit))report("Owner-local design token namespaces belong to components or patterns. Controllers remain headless; review uses the shared vocabulary and its own presentation state.","tokens");
151
- const absolute = path.resolve(path.dirname(file), data.tokens.stylesheet);
152
- if (!isInside(options.dsRoot, absolute) || inventory.owner(inventory.relative(slash(path.relative(options.root, absolute)))) !== unit || !absolute.endsWith(".css") || !existsSync(absolute)) report("Token stylesheet must be a real CSS file in this owner.", "tokens.stylesheet");
153
- data.tokens.file = slash(path.relative(options.root, absolute));
154
- }
155
148
  for (const [index, input] of (data.paintInputs ?? []).entries()) {
156
149
  if(data.paintInputs.slice(0,index).some(prior=>prior.api.identity===input.api.identity&&prior.property===input.property))report("Duplicate paint-input registration is ambiguous.",`paintInputs.${index}`);
157
150
  input.apiName = apiName(input.api, `paintInputs.${index}.api`);
package/docs/ADS.md CHANGED
@@ -50,7 +50,7 @@ The shell owns section tabs, collapsible navigation, theme controls and the App
50
50
  slot. The browser host uses a separate-origin sandbox proxy; project runtimes,
51
51
  styles, fonts and UI execute/apply only in the App iframe. Components, patterns,
52
52
  token values, scenarios, fixtures and their Linaria styles remain project-owned.
53
- App presentation comes from the selected compiled scenario; reusable review layouts live in public ADS patterns. Do not recreate
53
+ App presentation comes from the selected compiled scenario; reusable review layouts live in development-only `review/` through its separate public entry. Do not recreate
54
54
  production widgets inside the client or scenario.
55
55
 
56
56
  There are four sections: Tokens, Components, Patterns and Composition. There are
@@ -72,19 +72,19 @@ Colocate development entries and fixture inputs:
72
72
  design-system/
73
73
  tokens/
74
74
  typography.css
75
- Typography.scenario.tsx
76
- Typography.fixture.ts
75
+ Typography.ads.scenario.tsx
76
+ Typography.ads.fixture.ts
77
77
  components/core/Button/
78
78
  Button.tsx
79
- Scenario.tsx
80
- fixture.ts
79
+ Button.ads.scenario.tsx
80
+ Button.ads.fixture.ts
81
81
  patterns/Editor/
82
82
  Editor.tsx
83
- Scenario.tsx
84
- fixture.ts
83
+ Editor.ads.scenario.tsx
84
+ Editor.ads.fixture.ts
85
85
  composition/Workspace/
86
- Scenario.tsx
87
- fixture.ts
86
+ Workspace.ads.scenario.tsx
87
+ Workspace.ads.fixture.ts
88
88
  showcase/mcp/ Project compiler adapter
89
89
  main.tsx
90
90
  ```
@@ -95,9 +95,8 @@ guarded public re-exports. They may use the configured framework and declared
95
95
  dependencies, plain TypeScript and browser APIs; CSS/Linaria and visual DOM belong
96
96
  to consumers. They require no artificial visual scenario.
97
97
 
98
- Optional `<Owner>.ads.contract.ts` registers behavior with actual symbol references.
99
- Legacy colocated `behavior.json` (flat: `<Owner>.behavior.json`) also registers
100
- subjects, guarantees and owner-local checks against project-configured runner
98
+ Optional `<Owner>.ads.contract.ts` registers behavior with actual symbol references:
99
+ subjects, guarantees and colocated checks against project-configured runner
101
100
  profiles. `exercises` records public behavioral APIs demonstrated by a scenario;
102
101
  `covers` retains its rendered UI contract. ADS validates references and reachable
103
102
  uses; execution evidence is separate and becomes stale when its inputs change.
@@ -105,8 +104,8 @@ Runtime imports/re-exports of manifests, tests, fixtures and scenarios are rejec
105
104
  See [controllers and behavioral verification](BEHAVIORS.md) for the schema,
106
105
  framework/dependency gates and MCP execution contract.
107
106
 
108
- Flat owners may use `Button.scenario.tsx` and `Button.fixture.ts` instead.
109
- `Scenario.tsx` exports a default independently mountable view and literal metadata
107
+ Use `<Owner>.ads.scenario.tsx` and `<Owner>.ads.fixture.ts` for new entries.
108
+ The scenario exports a default independently mountable view and literal metadata
110
109
  `export const scenario = { title: "Button states", covers: ["Button"] };`.
111
110
  Optional static `captureTargets` maps up to 20 names to CSS selectors scoped to
112
111
  that scenario's App. These support explicitly requested element screenshots; they
@@ -119,7 +118,7 @@ Token entries under the configured token directory declare
119
118
  Its colocated fixture declares literal `samples: [{ token, property, probe }]`.
120
119
  Each token must exist and have sample coverage; duplicate bindings, missing probes,
121
120
  empty covers and value-only inspectors fail. The default entry passes the declared
122
- samples to a rendered public pattern's `samples` prop. No token-name/property mapping
121
+ samples to a rendered public review renderer's `samples` prop. No token-name/property mapping
123
122
  or sample values are embedded in the tool. Display values come from foundation CSS;
124
123
  probes are isolated verification inputs owned by the fixture.
125
124
 
@@ -137,12 +136,12 @@ mandatory caller inputs or prior page initialization. Related parts may share a
137
136
  scenario containing their required public parent. Larger composition scenarios
138
137
  reuse production screen patterns; that screen reuse remains skill guidance.
139
138
 
140
- IDs derive from the ADS-relative path: `components/core/Button/Scenario.tsx` and
141
- `components/core/Button.scenario.tsx` both identify `components/core/Button`.
139
+ IDs derive from the ADS-relative path: `components/core/Button/Button.ads.scenario.tsx` and
140
+ `components/core/Button.ads.scenario.tsx` both identify `components/core/Button`.
142
141
  Use one form per owner. Renaming moves the ID. No manually assigned ID or parallel
143
- registry is maintained. Fixture files use `fixture.ts`/`<Owner>.fixture.ts`; JS,
144
- TSX or JSON equivalents are supported. An empty fixture is valid without inputs. Extra development helpers use
145
- `scenario/` or `fixtures/` subfolders, or `<Owner>.scenario-adapter.ts`.
142
+ registry is maintained. Use marked `<Owner>.ads.fixture.ts` files and
143
+ `<Owner>.ads.helpers.ts` adapters for new source. An empty fixture is valid without inputs.
144
+ All `.ads.` files stay outside the production import graph.
146
145
 
147
146
  `scenario-contract`, `scenario-render` and `scenario-coverage` checks require valid
148
147
  entries and reachable public render references for every public renderable
@@ -157,7 +156,7 @@ mounting, correct props, every branch/state or visual parity. The older
157
156
 
158
157
  `token-scenario-reference` rejects undeclared token names in metadata and reachable
159
158
  inputs. `token-scenario-render` rejects claimed tokens with no reachable input
160
- reference; `token-scenario-coverage` requires every discovered shared or owner-local token
159
+ reference; `token-scenario-coverage` requires every discovered shared token
161
160
  to have coverage. A new or removed token therefore needs a scenario/fixture
162
161
  update. All three are errors in `ads check`, run by `lint:ds` and the build.
163
162
  Coverage is static reachability, not proof that every branch actually renders
@@ -200,56 +199,27 @@ connected project's actual entry. Older tooling must be upgraded before migratio
200
199
 
201
200
  ## Shared token contract
202
201
 
203
- ### Owner-local tokens
202
+ ### Shared Data and component mappings
204
203
 
205
- New owner declarations use `tokens: { namespace, stylesheet }` in
206
- `<Owner>.ads.contract.ts`. The legacy JSON layout below remains supported.
207
- Use one authoring form per section; competing registrations fail. See the
208
- [static contract reference](CONTRACTS.md) for paint bindings, declarative APIs,
209
- marked development files and guarded migration.
204
+ Design values, semantic roles, formulas and themes have one shared source in the
205
+ configured token foundation. Independent owner-local token namespaces, value
206
+ sheets and owner-contract `tokens` sections are not supported. Components map
207
+ shared values into `--ds-*` state/implementation variables; patterns use `--ux-*`.
208
+ These variables cannot hide raw design values, including in fallbacks, themes or
209
+ statically resolved helper/import interpolation. Typography/layering checks follow
210
+ aliases to their actual CSS consumers. Measured geometry and typed instance paint
211
+ bindings retain their narrow runtime contracts; they are not static design scales.
210
212
 
211
- Shared semantics remain in the configured token foundation. Constants specific
212
- to one component or pattern may live beside it:
213
+ Shared token previews and sample coverage live under the configured token directory.
214
+ The project mount adapter imports its foundation for both runtime and independent
215
+ token previews. No owner stylesheet dependencies are injected into preview entries.
216
+ `ads_prepare_token_samples` reconciles real shared bindings from project-selected
217
+ properties/probes; it does not invent missing semantics.
213
218
 
214
- ```text
215
- components/Notice/
216
- Notice.tsx # imports ./tokens.css; UI styling stays in Linaria
217
- tokens.json # {"schemaVersion":1,"namespace":"--notice-"}
218
- tokens.css # :root { --notice-width: 356px; }
219
- Scenario.tsx
220
- fixture.ts
221
- Tokens.scenario.tsx # kind: "tokens", development-only review renderer + samples
222
- Tokens.fixture.ts
223
- ```
224
-
225
- Flat owners use `<Owner>.tokens.json` and `<Owner>.tokens.css`. A unit has one
226
- explicit namespace, unique across owners and separate from shared/runtime-variable
227
- prefixes. The stylesheet contains only namespaced custom-property definitions
228
- under root/theme conditions; imports, selectors for UI, ordinary declarations,
229
- font faces and animations remain outside it. Its runtime owner imports it, so
230
- product and preview consume the same values. Raw UI styling remains token-backed.
231
-
232
- Local token aliases may reference shared tokens or their own namespace, with
233
- undefined references and cycles rejected. Other owners consume shared tokens;
234
- they cannot redefine, write or directly consume another owner's local namespace.
235
- Measured runtime variables retain their existing exact `styleWrites` boundary.
236
- `ads_tokens` returns each token's owner, definitions and local namespace.
237
-
238
- A colocated scenario sets `kind:"tokens"` and declares real fixture `samples`
239
- consumed by a development-only review renderer. Its ID still derives from its source path.
240
- Discovery attaches its owner's registered definition sheet as `stylesheets` on
241
- the generated scenario record; `previewEntriesPlugin` imports it directly into
242
- that preview's module graph. CSS-only package side effects can then tree-shake
243
- the runtime component without dropping the token definitions. Keep the runtime
244
- CSS import for product use; the token scenario need not import or render its owner.
245
- Every local token needs this real sample coverage, just like shared tokens.
246
- Definitions, metadata, fixture and token scenario belong to the same edit unit.
247
- Manifests/fixtures are development inputs; production includes the runtime's
248
- imported CSS definitions, never the preview adapter or tooling manifest.
249
-
250
- Use `ads_prepare_token_samples` to propose sample reconciliation from explicit
251
- project property/probe bindings. The tool preserves project sample meaning and
252
- reports missing mappings instead of choosing them from token prefixes.
219
+ `token-overlap-review` warns about identical normalized shared definitions across
220
+ their declared theme scopes. It never merges semantic roles or blocks a build merely
221
+ because values coincide. Shared Data boundary violations are errors. See the
222
+ [portable Data guide](../skills/ads-designer/references/design-data.md).
253
223
 
254
224
  ### Shared definitions
255
225
 
@@ -280,8 +250,7 @@ CSS imports the approved token files in order; shared assignments belong in
280
250
  those token files, never in consumer styles or component state overrides.
281
251
 
282
252
  Typed custom-property registrations follow the same ownership. Runtime-variable
283
- `@property` metadata lives in component/pattern Linaria; shared and owner-local
284
- token registrations live beside real token definitions. Names are document-global:
253
+ `@property` metadata lives in component/pattern Linaria; shared token registrations live beside real token definitions. Names are document-global:
285
254
  unrelated owners and conflicting descriptor sets cannot claim the same name.
286
255
  Descriptors have their own CSS grammar and independent literal defaults; normal
287
256
  visual styling still uses tokens. Registration does not create token/sample
@@ -470,8 +439,8 @@ Validate accepted and rejected cases, configuration, and false-positive limits.
470
439
 
471
440
  ## Bootstrap and updates
472
441
 
473
- The atomic composition and scenario contract guides live in each skill's
474
- `references/atomic-styles.md` and `references/scenarios.md`. The maintained copies
442
+ Portable architecture and workflow guides live in each skill's `references/`,
443
+ including shared Data, behavior contracts, atomic styles and scenarios. The maintained copies
475
444
  are in `skills/ads-designer/references/`; MCP serves those packaged references.
476
445
  `npm run sync:skill-references` copies them to the other skills for standalone use;
477
446
  `npm run check:skill-references`
@@ -482,7 +451,7 @@ Root [bootstrap-ds/](../bootstrap-ds/README.md) is the canonical empty scaffold.
482
451
  Its identical copy under `skills/ads-designer/assets/bootstrap-ds/` makes the
483
452
  skill self-contained. Run `npm run sync:skill-starter` after edits and
484
453
  `npm run check:skill-starter` to verify the copy. Both contain empty product component/composition directories and a minimal project-owned
485
- token review renderer. The scaffold pattern can be renamed or replaced; the tool
454
+ token review renderer. The scaffold review renderer can be renamed or replaced; the tool
486
455
  does not require that name or its styles and ships no product UI catalogue.
487
456
 
488
457
  Tool releases should version contract changes, rules, skills, bootstrap support,