@reqvire-org/ads 0.5.1 → 0.5.3

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 (136) hide show
  1. package/dist/ads-errors.mjs +143 -51
  2. package/dist/analysis/composition-axes.mjs +48 -0
  3. package/dist/analysis/construction-memo.mjs +38 -0
  4. package/dist/analysis/context.mjs +19 -0
  5. package/dist/analysis/design-reads.mjs +177 -0
  6. package/dist/analysis/design-usage.mjs +4 -20
  7. package/dist/analysis/factored-classes.mjs +90 -0
  8. package/dist/analysis/helpers.mjs +5 -7
  9. package/dist/analysis/mock-check.mjs +4 -5
  10. package/dist/analysis/native-project.mjs +12 -0
  11. package/dist/analysis/owner-accessibility.mjs +4 -4
  12. package/dist/analysis/owner-analysis-cache.mjs +86 -23
  13. package/dist/analysis/owner-analysis-key.mjs +42 -10
  14. package/dist/analysis/owner-choices.mjs +56 -7
  15. package/dist/analysis/owner-composition.mjs +179 -45
  16. package/dist/analysis/owner-reuse.mjs +8 -6
  17. package/dist/analysis/owner-source.mjs +304 -110
  18. package/dist/analysis/scenario-keys.mjs +10 -7
  19. package/dist/analysis/service.mjs +50 -3
  20. package/dist/analysis/standalone.mjs +7 -4
  21. package/dist/analysis/syntax.mjs +59 -1
  22. package/dist/analysis/worker-protocol.mjs +14 -2
  23. package/dist/analysis/worker.mjs +32 -10
  24. package/dist/architecture-report.mjs +26 -0
  25. package/dist/asset-view-facts.mjs +16 -2
  26. package/dist/boundaries.mjs +26 -10
  27. package/dist/bun-compiler.mjs +2 -2
  28. package/dist/check-service.mjs +29 -17
  29. package/dist/check.mjs +13 -6
  30. package/dist/cli.mjs +1 -1
  31. package/dist/composed-contrast.mjs +143 -62
  32. package/dist/composed-keyline.mjs +2 -2
  33. package/dist/config.mjs +2 -1
  34. package/dist/construction-output.mjs +9 -3
  35. package/dist/construction-spec.d.mts +145 -31
  36. package/dist/construction-spec.mjs +204 -74
  37. package/dist/corner-overpaint.mjs +20 -7
  38. package/dist/derived-states.mjs +182 -0
  39. package/dist/design-foundation.mjs +16 -0
  40. package/dist/design-inputs.mjs +18 -3
  41. package/dist/design-system-closure.mjs +12 -7
  42. package/dist/design-usage.mjs +2 -8
  43. package/dist/emit/contract.mjs +24 -5
  44. package/dist/emit/emission.mjs +6 -9
  45. package/dist/emit/integrity.mjs +8 -2
  46. package/dist/emit/output-watch.mjs +120 -0
  47. package/dist/emit/owner-emission-cache.mjs +4 -4
  48. package/dist/emit/preview-emitter.mjs +4 -2
  49. package/dist/emit/preview-tree.mjs +1 -1
  50. package/dist/emit/service.mjs +8 -2
  51. package/dist/finding-rules.mjs +3 -0
  52. package/dist/form-states.mjs +8 -0
  53. package/dist/frame-regions.mjs +29 -9
  54. package/dist/grid-lowering.mjs +3 -1
  55. package/dist/hover-geometry.mjs +15 -0
  56. package/dist/input-digests.mjs +17 -10
  57. package/dist/linaria/delivery.mjs +2 -0
  58. package/dist/lowering-enter.mjs +6 -6
  59. package/dist/lowering-properties.mjs +5 -0
  60. package/dist/lowering-region-layout.mjs +7 -2
  61. package/dist/lowering-session.mjs +10 -0
  62. package/dist/mcp/build-status.mjs +9 -1
  63. package/dist/mcp/compiler-channel.mjs +11 -4
  64. package/dist/mcp/mutations.mjs +1 -0
  65. package/dist/mcp/preview-http.bundle.js +1 -1
  66. package/dist/mcp/preview-watch.mjs +2 -1
  67. package/dist/mcp/preview-widget.bundle.js +1 -1
  68. package/dist/mcp/server-observation.mjs +6 -4
  69. package/dist/mcp/server-project.mjs +4 -1
  70. package/dist/motion-model.mjs +1 -1
  71. package/dist/owner-analysis-check.mjs +23 -6
  72. package/dist/owner-errors.mjs +6 -3
  73. package/dist/owner-lowering.mjs +78 -13
  74. package/dist/owner-scenarios.mjs +6 -23
  75. package/dist/ownership-model.mjs +24 -8
  76. package/dist/paint-contrast.mjs +6 -0
  77. package/dist/placeholder-contrast.mjs +17 -1
  78. package/dist/platform-features.mjs +10 -1
  79. package/dist/profile-macro.d.mts +7 -0
  80. package/dist/profile-view-facts.mjs +1 -1
  81. package/dist/recipe-macro.d.mts +103 -40
  82. package/dist/recipe-model.mjs +18 -13
  83. package/dist/region-lowering.mjs +266 -123
  84. package/dist/render-audit/layout-shift.page.mjs +24 -0
  85. package/dist/render-audit/render-states.mjs +122 -1
  86. package/dist/render-audit/render-states.page.mjs +140 -0
  87. package/dist/render-audit/worker.mjs +18 -3
  88. package/dist/render-audit.mjs +114 -1
  89. package/dist/role-vocabulary.d.mts +9 -0
  90. package/dist/role-vocabulary.mjs +16 -1
  91. package/dist/runtime-paint-contrast.mjs +5 -2
  92. package/dist/scenarios-compiler.mjs +20 -6
  93. package/dist/showcase/assets-view.mjs +29 -13
  94. package/dist/showcase/client.bundle.js +50 -50
  95. package/dist/showcase/http-client.bundle.js +15 -15
  96. package/dist/showcase/ui/ui.css +1 -1
  97. package/dist/showcase/ui/ui.js +5 -5
  98. package/dist/skills/ads-designer/references/accessibility.md +10 -4
  99. package/dist/skills/ads-designer/references/branding.md +13 -3
  100. package/dist/skills/ads-designer/references/contracts.md +5 -2
  101. package/dist/skills/ads-designer/references/design-data.md +13 -7
  102. package/dist/skills/ads-designer/references/layout.md +12 -4
  103. package/dist/skills/ads-designer/references/motion.md +11 -2
  104. package/dist/skills/ads-designer/references/recipes.md +49 -15
  105. package/dist/skills/ads-import/references/contracts.md +5 -2
  106. package/dist/skills/ads-import/references/design-data.md +13 -7
  107. package/dist/skills/ads-import/references/layout.md +12 -4
  108. package/dist/skills/ads-import/references/recipes.md +49 -15
  109. package/dist/skills/ads-migrate/SKILL.md +2 -0
  110. package/dist/skills/ads-migrate/references/0.5.1-to-0.5.2.md +185 -0
  111. package/dist/skills/ads-migrate/references/0.5.2-to-0.5.3.md +71 -0
  112. package/dist/skills/ads-port/references/contracts.md +5 -2
  113. package/dist/skills/ads-port/references/design-data.md +13 -7
  114. package/dist/skills/ads-port/references/layout.md +12 -4
  115. package/dist/skills/ads-port/references/recipes.md +49 -15
  116. package/dist/spatial-model.mjs +2 -2
  117. package/dist/surface-contrast.mjs +7 -2
  118. package/dist/surface-effects.mjs +5 -3
  119. package/dist/target-size.mjs +21 -3
  120. package/dist/task-cache.mjs +8 -18
  121. package/dist/validation-checks.mjs +1 -1
  122. package/docs/ADS.md +9 -3
  123. package/docs/ARCHITECTURE.md +96 -30
  124. package/docs/CACHING.md +152 -24
  125. package/docs/CHANGELOG.md +307 -23
  126. package/docs/GUIDE.md +109 -20
  127. package/docs/LANGUAGE.md +262 -117
  128. package/docs/MCP.md +5 -1
  129. package/docs/MOTION.md +15 -4
  130. package/docs/PROFILE-KINDS.md +54 -4
  131. package/docs/RULES.md +34 -25
  132. package/docs/TOKEN-ROLES.md +7 -1
  133. package/package.json +1 -1
  134. package/dist/analysis/prose-owners.mjs +0 -57
  135. package/dist/prose-model.d.mts +0 -81
  136. package/dist/prose-model.mjs +0 -101
package/docs/CHANGELOG.md CHANGED
@@ -1,61 +1,345 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
4
-
5
- ## 0.5.1
3
+ ## 0.5.3
6
4
 
7
5
  <!-- ads-local-tests:start -->
8
- Local verification: **1971/1971 passed** with `bun run test`.
9
- Tested commit: `c1f3a2a0fc34fd9df4e9e48faca2990876eebd3b`; Bun 1.4.4.
10
- Completed 2026-11-20T23:43:33.242Z (1229 seconds).
6
+ Local verification: **2084/2084 passed** with `bun run test`.
7
+ Tested commit: `711c30248604d51ecdc97d29646e5ecdd5678882`; Bun 1.4.4.
8
+ Completed 2026-11-23T09:25:04.569Z (1184 seconds).
11
9
 
12
10
  <!-- ads-local-test-proof
13
11
  {
14
12
  "schema": 3,
15
- "version": "0.5.1",
16
- "commit": "c1f3a2a0fc34fd9df4e9e48faca2990876eebd3b",
17
- "sourceSha256": "54d382a6d8c0c0f14435061163097474de91c091cde83598ffb368c5c1370c30",
13
+ "version": "0.5.3",
14
+ "commit": "711c30248604d51ecdc97d29646e5ecdd5678882",
15
+ "sourceSha256": "502077186e3c070c9d51fabe16bab71fb7a6562aa892f65f686e7f749cd64afc",
18
16
  "command": "bun run test",
19
17
  "result": "pass",
20
- "tests": 1971,
21
- "pass": 1971,
18
+ "tests": 2084,
19
+ "pass": 2084,
22
20
  "fail": 0,
23
21
  "skipped": 0,
24
22
  "groups": [
25
23
  {
26
24
  "name": "unit",
27
- "tests": 744,
28
- "pass": 744,
25
+ "tests": 803,
26
+ "pass": 803,
29
27
  "fail": 0,
30
28
  "skipped": 0,
31
- "reportSha256": "23b8fcb121a9352378aec550eb898cc965758ef5735cd7d3be6ddfd6ddadc277"
29
+ "reportSha256": "c8f17e0c1eeec0163f2c1f18855627a3058daa01440ed90226a56bd36c1ceb09"
32
30
  },
33
31
  {
34
32
  "name": "integration",
35
- "tests": 927,
36
- "pass": 927,
33
+ "tests": 974,
34
+ "pass": 974,
37
35
  "fail": 0,
38
36
  "skipped": 0,
39
- "reportSha256": "1718b43fb0f2394578d8668f697fea9b417fe08ad6f949b31817961c76046deb"
37
+ "reportSha256": "2c14c1c8fb8b405bab9b1809a3890e6f5fdf34e95944dc7382b64dc2ff3781a8"
40
38
  },
41
39
  {
42
40
  "name": "browser",
43
- "tests": 300,
44
- "pass": 300,
41
+ "tests": 307,
42
+ "pass": 307,
45
43
  "fail": 0,
46
44
  "skipped": 0,
47
- "reportSha256": "dcea267c35cb4953d9790d9e1eb9109f5b931a4a391437b0c2357e5f724b8267"
45
+ "reportSha256": "6e0fe63a3fec9b2dffa14e48769f22f9c4bb8c040e45398cb08a6e5835e45a68"
48
46
  }
49
47
  ],
50
48
  "testOverrides": {},
51
49
  "bun": "1.4.4",
52
- "completedAt": "2026-11-20T23:43:33.242Z",
53
- "durationMs": 1228954,
54
- "logSha256": "7e87e28c41d83bf929e094d12d0ad4d0863483e5ff399d1a15616142ec95fad4"
50
+ "completedAt": "2026-11-23T09:25:04.569Z",
51
+ "durationMs": 1184094,
52
+ "logSha256": "bdd920145024bad87c373ad0751b99cb20731f28efd76ea4b68b8fe65f50aec2"
55
53
  }
56
54
  -->
57
55
  <!-- ads-local-tests:end -->
58
56
 
57
+ ### Removed
58
+
59
+ - **Prose (`layout: "prose"`) is retired.** Long-form content is assembled from the design system's own components,
60
+ checked as any component is (see Added). `rhythm`, `elements`, the `ads-prose.json` manifest, the guard's
61
+ `design-usage/prose-element-undeclared` and `construction/prose-contrast-insufficient` are gone; a recipe with
62
+ `layout: "prose"` fails as an unknown layout. The migration guide maps every Prose element to its component.
63
+
64
+ ### Added
65
+
66
+ - **Long-form content as components.** A `stack` may place public components as parts (`kind: "component"`, matched
67
+ by the marker the placement passes, as a grid cell is), each repeated and optional, in any order; a part's
68
+ `spaceBefore` and `spaceAfter` replace the gap on its side (a heading one section gap from what precedes it; the
69
+ larger applies where two meet), also in the block flow of a parent without an arrangement (a list item that keeps
70
+ its marker). A content tree typed as a union is rendered with a finite choice over `node.type`; composed contrast
71
+ follows a renderer that places itself (nested inline content) through each recursive placement. The example
72
+ design system's `Content` pattern shows the set: headings, paragraphs, links, lists with nested lists, quotes,
73
+ code blocks, dividers and tables.
74
+ - **Contextual roles (`provides`).** A surface profile may re-bind paint tokens for the subtree of every element that
75
+ takes it: `provides: { "--link-ink": "--heading-ink" }` on a heading's surface makes a link inside it take the
76
+ heading's ink, with no prop and no rule on the link. A state's surface provides while the state holds (a selected
77
+ row's cells). Composed contrast proves the text inside with the provided values on the container's background; a
78
+ surface that provides a token it reads itself is refused (`foundation/provided-role-self`). This settles the
79
+ surface-context gap the guide listed (selected rows, tinted banners).
80
+
81
+ - **Design state derived from data.** A `const` with an explicit finite type (`const overflow: "fits" | "overflows" =
82
+ members.length > 3 ? …`) or an optional value (`const fourth: Member | undefined = members[3]`, a `find` result) is a
83
+ choice over its declared type when its initializer reads data the analysis does not evaluate. Every value is
84
+ checked; the derivation stays the component's own logic. Before, a count, an element or a lookup selecting markup
85
+ was "not from a finite set", and a component needed an inner owner taking the result as an optional prop.
86
+ - **A heading level the caller chooses.** A capitalised JSX tag that names a variable holding an element name is
87
+ that element: a constant (`const Heading = "h3"`), or a prop typed as a union of heading levels
88
+ (`level?: "h2" | "h3" | "h4"`, `const Heading = level`). The levels are checked as one heading. Before, such a tag
89
+ was read as an unknown component, so an Accordion could not take its heading level from its place in the page.
90
+ - **Standalone artwork binds its asset in its own recipe.** A standalone logo's one visual part may state
91
+ `asset`, `set`, `glyph`, `state` and `visual` itself, as a region's visual part may; before, those fields were
92
+ refused on an artwork recipe and the binding needed a separate fragment.
93
+ - **A drawn checkbox's native input takes no room.** `drawnBy: "<part>"` on the part holding a native control
94
+ (a checkbox's, radio's or switch's `<input>`) makes it invisible and out of the flow, laid over the named part
95
+ at that part's frame size: pointer and keyboard still reach the real control, its states still reach the
96
+ drawing part, and the label starts one gap after the box. The drawing part follows it and shows its focus
97
+ (`focus: { of }`). Before, a direct input part took its native size, the browser's margins and the row's gap.
98
+ - **Parts and grid cells rendered once per list item.** `repeat: true` on a region part lets `tabs.map(…)` render
99
+ it any number of times, each instance taking the part's construction (`extent: "fill"` shares the row among
100
+ them); a repeated control part is checked for hit-area overlap and spacing against its next instance. On a grid
101
+ cell, `repeat: true` lets mapped elements flow one after another (`start: "auto"` implied) over a numeric span or
102
+ `"full"`. Before, a mapped part was "rendered zero or several times", and a mapped cell had to repeat the column
103
+ count by hand (`span: 14, start: "auto"`), since `span: "full"` was refused with auto placement; it is now accepted
104
+ there too.
105
+ - **An optional grid cell.** `required: false` lets a cell be absent (a page's notice rendered only when given). A
106
+ cell that may be absent and is pinned to a `row` is listed for review (`review/optional-cell-row`): absent, it
107
+ leaves that row empty with its gaps. Before, a cell had to render exactly once.
108
+ - **A radius per corner.** A frame profile's `startStartRadius`, `startEndRadius`, `endStartRadius` and
109
+ `endEndRadius` replace its `radius` on that corner, so a chat bubble keeps its small tail corner. Before,
110
+ `frame: { corners }` could only round a corner by the one radius or square it.
111
+ - **A pushed screen can slide in from the side.** `enter.from.translateInline` moves an entrance on the inline axis
112
+ by the motion profile's `distance`, mirrored right to left. Before, an entrance moved on the block axis only.
113
+ - **WCAG 2.5.8's spacing exception.** A `frame: "control"` part smaller than 24 px passes when it sits between
114
+ targets of a stack or inline arrangement and a 24 px circle centred on it reaches neither a neighbouring target
115
+ nor a smaller neighbour's circle, at every gap (window controls 20 px wide and 28 px apart). A root, or a part
116
+ with no neighbouring target, keeps the 24 px minimum.
117
+ - **A glyph shown only on hover.** A fully transparent text or glyph colour draws nothing, so it has no contrast
118
+ minimum where it is transparent; the states that show it keep theirs. Before, a control whose glyph was
119
+ transparent at rest on a faint fill was checked at 1:1. Focus indicators and boundaries stay checked.
120
+ - **A control's label can fill the row.** `extent: "fill"` on the text part of an `inline` control makes the
121
+ label take the room the control's other content leaves, so a visual after it stands at the far end: a
122
+ full-width disclosure or FAQ trigger with its sign at the edge, a select trigger with its chevron.
123
+
124
+ ### Fixed
125
+
126
+ - **`showcase-ui`'s Popover opens at its control.** `placement: "trigger"` opens the panel in the top layer at the
127
+ control that opens it, measured from that control (as the example design system's Popover does); the default
128
+ keeps it pinned under the header's end. It was built on 2026-11-20 and withdrawn because the showcase server ran
129
+ out of memory warming it; that no longer happens (peak about 1 GiB while warming, under the 2 GiB limit).
130
+ - **The showcase sidebar fills in after the first preview.** A showcase opened before any revision was previewed
131
+ (right after the server started) showed the Tokens, Profiles and Artwork sections without their pages, and kept
132
+ them empty until a reload: the explorer was announced only when discovery or drafts changed. It is now also
133
+ announced when an emitted revision changes what the views offer. The Tokens view's Problems page has browser
134
+ coverage.
135
+ - **A release re-run finishes a half-published release.** When ADS was published and the guard package was not,
136
+ re-running the release workflow refused because one package already had the version. It now publishes only the
137
+ missing package and keeps an existing GitHub release.
138
+ - **Composed contrast follows plain modules.** A module with no recipe that arranges components (a sheet placing
139
+ rows and avatars) ended every chain at its placements with a `component-contrast-unresolved` review item. It now
140
+ records composition facts as an owner does, so those pairs are proven or reported as failures. Only a module
141
+ whose facts cannot be read keeps the review item.
142
+ - **Composed contrast checks a placement with what it selects.** A placement that leaves a prop out was paired
143
+ with every value of that prop, and an owner state was paired wherever its construction appeared: a shared
144
+ Avatar was held against a Row's selected tints in every colour where the Row was given no `state` and no
145
+ `color`. A prop left out now takes its default (or its absence), and a state that tests an attribute the
146
+ markup writes (`&[data-state="selected"]` with `data-state={state}`) holds only where that value is rendered.
147
+ Every value is still checked on the document surface, where applications place a public component. Owner
148
+ analysis schema `ads-owner-analysis/12`.
149
+ - **An optional glyph in a region.** A region whose optional visual part draws a received glyph only when one is
150
+ given (`icon && <span …/>`, alone or in a ternary's branch) failed with `construction/artwork-binding-missing`:
151
+ the combination without the glyph had nothing to bind, and lowering asked for a binding anyway. A combination
152
+ that does not render an optional visual part now writes no drawing for it.
153
+ - **A glyph's presence test anywhere in a chain of tests.** `lead === undefined && icon && <span …/>` reported
154
+ `glyph-reference-read`, while `icon && lead === undefined && …` passed. The glyph is tested in either position.
155
+ - **`construction/artwork-binding-missing` names what is missing.** A binding that names its asset but no visual
156
+ profile now says so (the drawing has no size), and the repair shows the binding's `visual` field.
157
+ - **A fixed-size box keeps its size in a row.** A frame that states `inlineSize` or `blockSize` now also states
158
+ that size as its minimum on the axis, unless the frame states its own minimum or a maximum there. Before, a
159
+ fixed box in an `inline` row shrank beside long wrapping text: a 22 px disc came out at 9 px. Emitted CSS changes
160
+ for every such frame (`min-inline-size` and `min-block-size`).
161
+
162
+ ## 0.5.2
163
+
164
+ ### Fixed
165
+
166
+ - Accepting a draft while its preview was still building could log a background compiler
167
+ error (`ENOENT` on the draft preview's page): the build finished after the draft's preview
168
+ output had been removed. Such a build is no longer reported as ready, and nothing is logged.
169
+ - The MCP server keeps watching emitted files after `ads emit` replaces the output
170
+ tree. Watch handles are reopened for replaced directories at the same paths, so
171
+ a later edit still fails a reused check with `generated-modified`.
172
+ - **MCP previews reuse the emitter's check.** The server's emitter and preview
173
+ compiler checked each revision separately. The emitter now sends its passing
174
+ report over their private IPC channel, kept in memory for the MCP process's
175
+ lifetime. The compiler reuses it when all task inputs match, refreshing output
176
+ integrity and retaining the publication fence. Missing or stale evidence checks
177
+ normally, as does standalone compilation. Emission also prepares the server's
178
+ saved report, so its first ordinary check can be a direct hit; acceptance
179
+ candidates do not eagerly occupy that live-project shortcut.
180
+ - A part with `extent: "fill"` no longer collapses in a stack whose height is only a minimum. Such a stack (its
181
+ frame states `minBlockSize` and nothing fixes, caps, clips or scrolls its height) grows with its content, but the
182
+ filling part gave up its minimum height, so tall content ran past it and under the next part: a page's main area
183
+ came out as tall as the free space while its content continued beneath the footer. The part now keeps its
184
+ content's height there. Stacks with a fixed height, a cap, a ratio or `overflow` are unchanged: the part's content
185
+ stays confined to it. Emitted CSS changes only for a filling part in such a minimum-height stack (it loses
186
+ `min-block-size: 0`).
187
+ - Testing whether an optional glyph was given (`icon !== undefined && …`, `icon && …`, `icon ? a : b`, `!icon`) is
188
+ accepted, as the language reference says. It was reported as `source/glyph-reference-read`.
189
+ - A recipe's setters for values declared on a part are typed correctly under TypeScript 5: `measured.props({
190
+ focus: [x, y] })` and `({ intrinsic: [width, height] })` were typed as a number there, so a project's own
191
+ type check failed on an owner that `ads check` accepted. Verified under TypeScript 5.5 and ADS's own compiler.
192
+ - `choice/branch-limit` names the limit and every value the selection branched on, with how many values each
193
+ takes, so the props to merge or move are in the message.
194
+ - An optional slot no longer multiplies its parent's class analysis. A child rendered under `condition && …` whose
195
+ presence changes nothing the parent is checked for (an element that is no declared part, such as an indent
196
+ spacer with its own recipe, or an optional part that is neither artwork nor a control's text) is analysed as
197
+ present without branching on its condition. An ordinary list row with an optional lead, line, end and indent
198
+ spacer went from 8064 branches, past the limit, to well under it. Its parts are still checked whenever they
199
+ render.
200
+ - **Large variant matrices are checked in full and emitted as groups.** Every reachable combination of a class
201
+ expression is still lowered and checked; the limits now follow the measured cost (about 2 ms per construction):
202
+ 4096 constructions per owner and 16384 branches per selection. A selection of 32 combinations or more whose class
203
+ strings are the classes they all share plus, per group of inputs, classes that depend on that group alone is
204
+ emitted as one lookup per group, joined, verified against every combination; otherwise as before. An owner with
205
+ seven colours and four two-way props went from a 2.7 MB emitted module to 8 KB.
206
+ - **Draft acceptance reuses the owners a draft leaves unchanged.** Each acceptance checks a candidate copy of the
207
+ project, and owner analyses and emitted modules were keyed by the folder they were analysed in, so every
208
+ acceptance re-analysed every owner. Keys are now root-relative and a reused outcome's paths are moved to the
209
+ requesting copy: an acceptance, an MCP check or the emit after it analyzes only the owners the change reaches.
210
+ Within an edited owner, each construction's lowering and checks are reused when the construction is unchanged,
211
+ and each distinct list of recipe fragments is combined once per analysis. Measured on the reference project
212
+ with a 1792-combination owner: a later acceptance that edits another owner went from 3.1 s to 0.85 s, and one
213
+ that edits the large owner itself from 3.2 s to 2.45 s.
214
+ - **Large variant matrices get their cross-owner contrast proven.** A text position recorded every prop of its
215
+ component with each chain above it, so an owner with 1792 combinations kept 1792 distinct leaves per position,
216
+ passed the 512 limit and reported `component-contrast-unresolved` for review. Only the props that change the
217
+ chain are recorded now (exactly), and the chains are proven. Positions on the same path share one enumeration and
218
+ element reads are reused across choices; an edit to such an owner is about 10 % faster.
219
+ - **Analysis reads the captured configuration.** Inside an analysis, `ds.config.json` and the TypeScript
220
+ configuration (with its `extends` chain) were read from disk, so an edit after the capture could mix revisions.
221
+ Both are now read through the capture, including `extends` targets named by absolute path.
222
+ - **A TypeScript configuration that does not parse is an error.** A `tsconfig.json`, or a configuration it extends,
223
+ with a syntax error, a rejected option or an `extends` target that does not exist left ADS analysing with other
224
+ compiler options than the project's, silently. Check reports `typescript-config-invalid` at the file. A circular
225
+ `extends` chain, or one longer than 64 levels, is reported the same way; neither is finished from disk.
226
+ - **Fewer output-folder reads per check.** The emitted files were read and digested for every report-cache key
227
+ (two to three times per check); a returned report now reads them once. A returned report whose output folder
228
+ was edited since it was cached is the evidence a fresh check gives: failed, with acceptance not established.
229
+ The MCP server keeps its project's output folder event-fed: a reused report reads no emitted file unless one was
230
+ edited.
231
+ - **Drafts reuse scenario results, closure checks and design inputs.** Their keys named the analysed root, so a
232
+ draft or acceptance candidate recomputed every scenario's facts and styling, every file's import closure and the
233
+ design inputs. They are now root-relative and relocated, as owner analyses are.
234
+ - **A profile or asset edit re-analyzes only what read it.** Owner analyses and construction lowerings record the
235
+ profiles and assets they read and are reused while those read the same; a comment-only profile edit, or an edit
236
+ to a profile an owner does not use, no longer re-analyzes every owner.
237
+ - **Cancelling an analysis stops it.** A canceled request was still computed to the end in the analysis worker,
238
+ holding the requests behind it. The worker now stops it at its next owner, choice, scenario or file, and skips
239
+ it if it had not started.
240
+ - **Library calls keep their compiler session between calls.** Direct library clients closed their session one
241
+ second after each call, losing programs and ASTs. Sessions now stay for 60 seconds without keeping a finished
242
+ process alive.
243
+ - **Analysis requests send only changed files.** An unregistered request sent the worker the whole project
244
+ inventory each time; it now sends the files changed since the last request, and the complete inventory only
245
+ when the worker does not hold that base.
246
+ - A visual part with `frame: { profile }` keeps the frame profile's size. The profile's `inlineSize` and
247
+ `blockSize` were written and then replaced by the drawing's own size, so a 22 px disc behind an 11 px mark came
248
+ out 11 px, with no error. The frame now sizes the box and the drawing keeps its visual profile's size, centred.
249
+
250
+ ### Added
251
+
252
+ - **The render audit measures owner states by itself.** Every state a recipe declares is switched on, on each
253
+ scenario that renders the owner, and measured for colour contrast, non-text contrast and layout overflow; findings
254
+ name the state. Nothing is written for it: ADS derives the states from the compiled constructions into a
255
+ preview-only file (`ads-preview-audit.json`), which `ads emit` never writes, and the page finds each construction
256
+ by the preview's owner marker and its classes. Over a full audit, constructions with states that no scenario
257
+ renders are a new review item, `render-audit-construction-unrendered`. The `Covered:` line counts the derived
258
+ states measured; states the audit cannot set are `render-audit-skipped` info items. In each state the audit
259
+ also re-measures image shape, corner overpaint and layout that keeps moving once the state has settled. Each
260
+ runtime paint value and each glyph set member is drawn in turn and measured. A state measured by setting its
261
+ attribute where the owner's markup also depends on that prop is `render-audit-state-forced` (review); a scenario
262
+ state that only shows what the audit derives is `render-audit-state-derivable` (info).
263
+ - **The audit renders at the widths a condition flips at.** Besides 390, 768 and 1280 px, layout overflow, image
264
+ shape and corner overpaint are measured just inside and just outside each viewport width the design system's
265
+ compiled CSS changes at (named conditions and breakpoints), up to eight widths.
266
+ - **Hover geometry is reviewed.** A state that changes an in-flow element's geometry under `:hover` is
267
+ `review/hover-geometry-shift`: what follows it moves as the pointer passes.
268
+
269
+ - **A turn under a state.** `rotate` joins the state effects of a control's visual part and of a region part
270
+ (`when: { '&[aria-expanded="true"]': { rotate: { slot: "motion", field: "angle" } } }`, with `"rotate"` in
271
+ `transition` to animate it): a plus that becomes a cross while its panel is open. Reduced motion keeps the turned
272
+ shape and drops only its animation. A control's artwork effects are also accepted under
273
+ `&[aria-expanded="true"]` and `&[aria-pressed="true"]`.
274
+ - **Brightness.** A surface profile's `brightness` field reads a token of the new `brightness` role
275
+ (`brightness.ads.css`, a percentage) and lowers to `filter: brightness()`: a picture with no dark version takes a
276
+ token that is `100%` in the light theme and lower in the dark one. It belongs to a visual part; anywhere else it
277
+ is `construction/surface-effect-misplaced`, because text under it could not be proven readable.
278
+ - **An outset as a share of the box.** The new `box-share` role (`box-share.ads.css`, a percentage) is accepted by
279
+ two new spacing profile fields, `outsetBlock` and `outsetInline`, which `outset` binds like any spacing field. A
280
+ backdrop then extends by that share of its own box on each axis and grows with it.
281
+ - **Focus on a stand-in.** `focus: { of: "<sibling part>" }` on a region part draws the focus profile's outline on
282
+ that part while the named part of the same parent has keyboard focus: the drawn box of a checkbox, radio or
283
+ switch whose native `<input>` is visually hidden.
284
+ - **Where a jump lands.** `anchorClear` on a region root, a part or a prose block element lowers to
285
+ `scroll-margin-block-start`. It reads the layer profile's `clearBlockStart` (right under the region sticky
286
+ elements clear) or the spacing profile's new `anchorGap` (the element's own distance, for a target that lines
287
+ up with a sticky column beside it).
288
+ - **Geometry by state.** A `when` entry on a region root or a part selects another frame profile
289
+ (`frame: { profile }`) and another spacing profile (`spacing`), each lowered and checked whole; a part is
290
+ `collapsed` at rest or under a state (no room, transparent, out of the accessibility tree and focus; open, its
291
+ content's size). `overlap` on an `inline` or `stack` arrangement makes neighbours overlap by a spacing value
292
+ from the new `overlap` token role, in real layout. `geometryTransition: { channels, motion }` animates the
293
+ channels `size`, `inset`, `gap`, `radius`, `border-width` and `overlap`. A `:hover` geometry state needs a focus
294
+ or attribute state of the same geometry; geometry under the autofill state is refused. Not on text-entry
295
+ control parts, controls or top-layer roots. A frame a state selects is checked as the element's own is: the
296
+ text keyline, the fit in a grid cell and corner overpaint run for it; a hit area never changes by state,
297
+ neighbouring targets are proven at every gap a state selects, and overlapping targets are refused.
298
+ - **Standalone artwork with its own colour.** A recipe that is only a visual part takes `surface` on its root: a
299
+ colour-only surface, the colour its foreground drawing takes (an Icon's quiet tone, so a slot that holds it
300
+ sets none).
301
+ - **Decorative boxes in a control.** A control holds at most one text part and one visual part, and any number of
302
+ decorative boxes (parts without a `kind`, each with `frame: { profile }`): a switch is a control with a knob
303
+ that travels under `&[aria-checked="true"]`. The text part is no longer required. The knob's position is the
304
+ state's shape, kept under reduced motion.
305
+ - **Several drawings in one region.** A region may declare several visual parts, each bound to its own asset
306
+ and read by its own name: a row with a leading mark and a trailing one, a tile with a picture and a badge.
307
+ `construction/parts-visual-repeated` is retired. A control and standalone artwork still have one visual part.
308
+ - **A visual part inside another part.** An owner reads the class and drawing of a visual part nested in
309
+ another part of the same recipe by the part's name (`recipe.parts.glyph`, `recipe.assets.glyph.source`), as it
310
+ does for a top-level part: a mark inside a boxed cell beside a label needs no owner of its own. A name several
311
+ nested parts share is `choice/part-ambiguous`.
312
+ - **Any artwork in a control.** A control's visual part draws slot artwork (several paints, each a token or the
313
+ text colour) and intrinsic artwork (a product's logo in its own colours, as an `<img>`), not only foreground
314
+ glyphs. Slot artwork needs one paint at 3:1 on the control's own background in every theme, brand and state
315
+ (`construction/artwork-paint-contrast-insufficient`); a logo is not checked. Where the control paints no
316
+ background of its own the static check has nothing to prove against, and the render audit's icon contrast
317
+ applies. `construction/paint-unsupported` is retired.
318
+ - **A progress bar's fill.** `pseudo: { progressValue: { surface } }` on a `<progress>` part paints the filled part
319
+ over the part's own surface, the track, in each engine's own pseudo-element, and proves the fill at 3:1 against
320
+ the track.
321
+ - **Prose.** `spaceAfter` on a block (the space to whatever follows it, in place of the rhythm; the larger of it and
322
+ the next block's own `spaceBefore`, where that block states one); `markers` on `list` (an unordered list's marker shape per depth of nesting); `markerText` on `item` (a
323
+ text profile whose weight the marker takes); `elements.component` (`spaceBefore` and `spaceAfter` for any
324
+ component placed directly among the blocks).
325
+ - `textAlign` on a control's text part (`"start" | "center" | "end"`): how a button's label lines sit once the label
326
+ wraps or the control is wider than it. It was accepted on other text parts and refused here
327
+ (`spec/field-unsupported`).
328
+ - **Showcase: where each asset is drawn, and at what size.** Each Artwork tile says which owners draw the asset and
329
+ at what size ("drawn at 20px by Button; 16px by Menu"). Owner analysis records each binding's visual size (a glyph
330
+ set's members at the set's size); the preview facts carry it, sorted, so an owner edit that leaves its artwork as it
331
+ was does not rebuild the view. Owner analyses and lowered constructions cached by an earlier version are computed
332
+ once again.
333
+ - **Showcase: artwork beside text.** The Artwork page's settings gain **Place**: alone, or beside text, where each
334
+ tile draws its asset at the chosen size before its title in body text, as a control places a glyph before its
335
+ label.
336
+ - **Showcase: the section menu on a phone.** Below 36rem the header's row of sections is one select naming the
337
+ current section, so the tools keep their room; wider, the row returns.
338
+ - **Showcase: the artwork catalogue.** The "all sizes" page of an artwork folder (formerly the icon catalogue) is
339
+ named for what it draws: any artwork, whatever its paint.
340
+
341
+ ## 0.5.1
342
+
59
343
  Upgrade from 0.5.0 with the `ads-migrate` skill
60
344
  (`skills/ads-migrate/references/0.5.0-to-0.5.1.md`): the text keyline check can
61
345
  fail a design system that passed before, animation defined in script is now
package/docs/GUIDE.md CHANGED
@@ -318,7 +318,10 @@ explicitly.
318
318
  - Writes `tsconfig.json` and `ads-env.d.ts` when the package has no tsconfig:
319
319
  bundler resolution, the framework's JSX, `@ds` mapped to the barrel, and SVG
320
320
  module declarations. Editors and the package's own typecheck thus never use
321
- the tsconfig of an enclosing application.
321
+ the tsconfig of an enclosing application. `ads check` analyses with these
322
+ compiler options, following its `extends` chain; a configuration in the chain
323
+ that does not parse, has an option TypeScript rejects, extends a missing file
324
+ or extends in a circle is a `typescript-config-invalid` error.
322
325
  - Never edits `.gitignore`, never writes a lockfile, never follows symlinks and
323
326
  never overwrites a project file. Ignore `.ds/` (ADS's caches and working
324
327
  files) yourself.
@@ -695,6 +698,39 @@ What the audit measures in each render:
695
698
  printed as a `Covered:` line, gives what was measured. What was skipped is a
696
699
  `render-audit-skipped` info item. A render that measured none of its targets
697
700
  is a `render-audit-nothing-measured` review item.
701
+ - **Owner states, derived by ADS**: every state a recipe declares (`when` entries
702
+ of a root or a part, whatever they select) is measured on each scenario that
703
+ renders the owner, without a scenario showing it. ADS writes what each
704
+ construction declares to a file of the preview tree only
705
+ (`ads-preview-audit.json`; `ads emit` never writes it); the audit finds each
706
+ construction's first rendered element by the preview's owner marker and its
707
+ classes, switches each state on (an attribute, a native property such as
708
+ `:checked`, or a direct part's), measures colour contrast, non-text contrast,
709
+ layout overflow, image shape and corner overpaint, and layout that keeps
710
+ moving once the state has settled (`layout-shift`), and puts it back. Each
711
+ declared runtime paint value and each member of a glyph set the element draws
712
+ is drawn in turn and measured for contrast (and a member for its shape). Findings name the state
713
+ (`state &[data-expanded="true"] of patterns/Pile/Pile.tsx`). Pointer and
714
+ keyboard states stay the interaction pass's. A state the audit cannot set is a
715
+ `render-audit-skipped` info item (`derived-state-unsupported`,
716
+ `derived-state-not-applied`). The `Covered:` line counts the states measured.
717
+ Setting an attribute shows that state's CSS, not what the component's script
718
+ renders with it: where owner analysis proves the prop behind the attribute
719
+ also changes the owner's markup, that state is a `render-audit-state-forced`
720
+ review item until a scenario shows it. A scenario state that only shows an
721
+ attribute state the audit derives anyway, on an owner rendered elsewhere, is a
722
+ `render-audit-state-derivable` info item: it can go unless people need to see
723
+ it.
724
+ - **Widths from the design system's conditions**: besides 390, 768 and
725
+ 1280 px, layout overflow, image shape and corner overpaint are measured just
726
+ inside and just outside each viewport width the design system's CSS changes
727
+ at (a spatial profile's named conditions and breakpoints, read from the
728
+ compiled media queries at 16 px per rem), up to eight widths between 320 and
729
+ 1920 px. A layout that only breaks one pixel before a condition flips is found.
730
+ - **Constructions no scenario renders**: over a full audit (no scenarios named),
731
+ each owner with constructions that declare states and appear on no audited
732
+ page is a `render-audit-construction-unrendered` review item: what those
733
+ states do once laid out is unmeasured. Render that variant in a scenario.
698
734
  - **Settling**: the audit waits up to 5 s for the page to settle, and each
699
735
  measurement waits for layout to stop moving. A page that never settles is
700
736
  measured anyway and reported as `content-still-changing`.
@@ -825,6 +861,14 @@ edit appears after it is emitted.
825
861
  inert by ADS's sanitizer, and shows its title, aliases, glyph sets, what
826
862
  differs between its drawings (themes, sizes, states), its optical centre
827
863
  when that is not the middle of its box, and where it is declared. A themed asset shows the drawing of the preview's theme.
864
+ Each tile also says which owners draw the asset and at what size ("drawn at
865
+ 20px by Button; 16px by Menu"): the visual size of each binding, a glyph set's
866
+ members at the set's size, and a `glyph()` reference without a size (its
867
+ caller gives it). A folder's settings choose the size the tiles draw at
868
+ (**Size**), the construction grid and optical centre (**Guides**), and
869
+ whether each asset stands alone or before its title in body text
870
+ (**Place**); **View: all sizes** shows the artwork catalogue: the folder at
871
+ text size, then each asset enlarged on its grid and at every artwork size.
828
872
  `ads_show_scenario({ id: "assets" })` opens the view like a scenario.
829
873
  - **Tokens** (id `tokens`, the Tokens section) lists every token of the
830
874
  token inventory (`ads tokens`), whether or not an owner uses it. No scenario
@@ -1119,7 +1163,7 @@ when it is enough for every place the design system uses the profile (the
1119
1163
  table above). A quiet icon colour at 3:1 is its own surface profile, selected
1120
1164
  only by visual parts or text-less controls. These keep 4.5:1: a profile
1121
1165
  nothing uses, one a composite slot supplies, the document surface, and one the
1122
- recipe also names for a pseudo-element, a prose element, a backdrop or an
1166
+ recipe also names for a pseudo-element, a backdrop or an
1123
1167
  entrance. Nothing is released while an owner fails, because its uses are not
1124
1168
  known.
1125
1169
 
@@ -1903,7 +1947,11 @@ follows:
1903
1947
  and the finding names it (for example `:root under @media (pointer: coarse)`).
1904
1948
  - `ads emit` writes the overrides into the emitted sheets unchanged. Nothing
1905
1949
  runs at runtime.
1906
- - ADS checks WCAG 2.2 AA (2.5.8): 24 px, whatever the pointer. Larger touch
1950
+ - ADS checks WCAG 2.2 AA (2.5.8): 24 px, whatever the pointer. A smaller part
1951
+ between targets of one arrangement passes by the spacing exception: a 24 px
1952
+ circle centred on it reaches neither a neighbouring target nor a smaller
1953
+ neighbour's circle, at every gap (window controls 20 px wide, 28 px apart).
1954
+ A root or a part with no neighbouring target keeps the minimum. Larger touch
1907
1955
  targets (44 px is a common platform guideline) are a design choice that the
1908
1956
  tokens express, not a rule that ADS enforces. An owned hit area
1909
1957
  (`minTargetBlockSize`, `minTargetInlineSize` on a frame profile) can enlarge
@@ -1935,7 +1983,60 @@ translucent surface and a lifted drawing.
1935
1983
  Some UI must change its colours with what it sits on. Examples are a dark footer
1936
1984
  or dark card on a light page, a button over a photo or a strongly coloured
1937
1985
  banner, the cells and icons of a selected table row, and the links inside a
1938
- warning banner. ADS has two checked patterns for this.
1986
+ warning banner. ADS has three checked patterns for this; pick one by where the
1987
+ difference comes from:
1988
+
1989
+ | The colour follows | Pattern |
1990
+ | --- | --- |
1991
+ | The container it sits in: links in a heading or a banner, the cells of a selected row, actions on a dark card | [Contextual roles](#contextual-roles) (`provides` on the container's surface) |
1992
+ | A whole theme or brand for a section of the page: a dark footer | [Nested theme and brand sections](#nested-theme-and-brand-sections) |
1993
+ | A look the caller chooses for a background the design system does not know: a button over a photo | [Explicit choices](#explicit-choices) |
1994
+
1995
+ #### Contextual roles
1996
+
1997
+ A container's surface profile re-binds the paint roles its subtree reads
1998
+ ([`provides`](PROFILE-KINDS.md#contextual-roles-provides)). The children keep
1999
+ one design each and read their own roles; inside the container those roles take
2000
+ the container's values. Nothing is passed through props, and the container never
2001
+ styles a child's elements.
2002
+
2003
+ ```css
2004
+ /* tokens/Surfaces/paint.ads.css: the roles children read. */
2005
+ :root {
2006
+ --link-ink: var(--action-fill);
2007
+ --icon-ink: var(--text-secondary);
2008
+ }
2009
+ ```
2010
+
2011
+ ```ts
2012
+ // A warning banner: links and icons inside it take its on-warning ink.
2013
+ profile({ name: "banner-warning", kind: "surface", fields: { background: "--warning-fill", color: "--on-warning" }, provides: { "--link-ink": "--on-warning", "--icon-ink": "--on-warning" } });
2014
+ // A selected row: while the row is selected, its cells' inks follow it.
2015
+ profile({ name: "row-selected", kind: "surface", fields: { background: "--selected-fill", color: "--on-selected" }, provides: { "--link-ink": "--on-selected", "--icon-ink": "--on-selected" } });
2016
+ ```
2017
+
2018
+ ```ts
2019
+ // The row's recipe selects the providing surface under its state; the cells need no prop.
2020
+ recipe({ layout: "inline", surface: "row", when: { '&[aria-selected="true"]': { surface: "row-selected" } } });
2021
+ ```
2022
+
2023
+ **Guarantees.**
2024
+
2025
+ - Lowering writes the provided roles as custom properties on the element that
2026
+ takes the surface (`.row[aria-selected="true"] { --link-ink: var(--on-selected) }`);
2027
+ CSS inheritance carries them to every descendant, components included.
2028
+ - Composed contrast proves the text of everything that can sit inside the
2029
+ container with the provided values on the container's background, in every
2030
+ theme and brand. A provider under a state holds only with that state, so the
2031
+ on-selected ink is paired with the selected background, never the resting one.
2032
+ The nearest provider wins.
2033
+ - Only paint roles are provided, each to another paint token. A surface that
2034
+ provides a token its own fields read is refused
2035
+ (`foundation/provided-role-self`): the element would repaint itself.
2036
+
2037
+ **Limits.** Composed contrast covers text. An icon or a boundary that reads a
2038
+ provided role is checked with its own default value where it is defined; check
2039
+ such non-text paints in the rendered container (the render audit).
1939
2040
 
1940
2041
  #### Nested theme and brand sections
1941
2042
 
@@ -2069,21 +2170,6 @@ static paints do not change between contexts. The on-dark treatment is thus
2069
2170
  readable whatever theme the page uses. Whether the photo needs the treatment is
2070
2171
  the caller's decision, which the type makes explicit.
2071
2172
 
2072
- #### What neither pattern covers
2073
-
2074
- Two cases are not covered:
2075
-
2076
- - state that cascades to children: a selected table row whose cells, icons and
2077
- checkbox switch to "on selected" colours;
2078
- - tinted containers: a success or warning banner whose links and icons must stay
2079
- readable on its tint.
2080
-
2081
- These cases need a prop passed through each child (an explicit choice at every
2082
- level), or a construct that lets a surface set the context that its descendants
2083
- read. ADS has no such surface-context construct. Do not emulate one with a theme
2084
- per state: a theme is a whole colour mode, and the checks would prove every
2085
- token of it.
2086
-
2087
2173
  ### Emitting the design system
2088
2174
 
2089
2175
  `ads emit [directory] [--json] [--force] [--watch]` compiles the design system
@@ -2611,7 +2697,10 @@ tag; see [npm publishing rules](https://docs.npmjs.com/cli/v11/commands/npm-publ
2611
2697
  the release notes. It does not repeat the local browser and package suite.
2612
2698
  Stable tags publish as `latest`; prerelease tags publish as `next`.
2613
2699
  4. Check the workflow result and the npm version before you update consumer
2614
- dependencies.
2700
+ dependencies. If the second publish failed, re-run the workflow for the same
2701
+ tag: it publishes only the package that does not have the version yet, and
2702
+ leaves an existing GitHub release as it is. A version both packages already
2703
+ have needs a new tag.
2615
2704
 
2616
2705
  The manual workflow moves a label to an existing published version. It does not
2617
2706
  publish new source.