@reqvire-org/ads 0.3.52 → 0.4.0

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 (151) hide show
  1. package/README.md +10 -9
  2. package/dist/assets.mjs +16 -2
  3. package/dist/behaviors.mjs +6 -5
  4. package/dist/boundaries.mjs +5 -5
  5. package/dist/browser-audit/first-render.mjs +22 -0
  6. package/dist/browser-audit/image-shape.mjs +36 -0
  7. package/dist/browser-audit/render-states.mjs +61 -35
  8. package/dist/browser-audit/worker.mjs +47 -12
  9. package/dist/browser-audit.mjs +75 -12
  10. package/dist/bun-compiler.mjs +14 -7
  11. package/dist/check-service.mjs +83 -0
  12. package/dist/check.mjs +20 -18
  13. package/dist/cli.mjs +5 -3
  14. package/dist/config.mjs +20 -41
  15. package/dist/contracts.d.mts +9 -0
  16. package/dist/finding-rules.mjs +8 -1
  17. package/dist/font-rules.mjs +103 -0
  18. package/dist/fonts-generated.mjs +32 -12
  19. package/dist/generated-entries.mjs +131 -0
  20. package/dist/icons.mjs +1 -1
  21. package/dist/init.mjs +11 -32
  22. package/dist/layers.mjs +7 -3
  23. package/dist/lint-config.mjs +4 -2
  24. package/dist/mcp/catalog.mjs +2 -1
  25. package/dist/mcp/context.mjs +3 -3
  26. package/dist/mcp/drafts.mjs +136 -121
  27. package/dist/mcp/mutations.mjs +65 -19
  28. package/dist/mcp/preview-watch.mjs +31 -5
  29. package/dist/mcp/preview-widget.bundle.js +50 -47
  30. package/dist/mcp/project-widget.bundle.js +45 -42
  31. package/dist/mcp/prompts.mjs +1 -1
  32. package/dist/mcp/server.mjs +81 -40
  33. package/dist/mcp/showcase-host.mjs +20 -7
  34. package/dist/mcp/widget.bundle.js +49 -46
  35. package/dist/oxlint.mjs +3 -2
  36. package/dist/program-cache.mjs +36 -0
  37. package/dist/public-api.mjs +2 -1
  38. package/dist/scenarios-compiler.mjs +82 -14
  39. package/dist/scenarios-vite.mjs +1 -1
  40. package/dist/scenarios.mjs +4 -3
  41. package/dist/showcase/client.bundle.js +27 -27
  42. package/dist/showcase/index.html +2 -2
  43. package/dist/skills/ads-break-ui/SKILL.md +25 -28
  44. package/dist/skills/ads-break-ui/references/behaviors.md +7 -6
  45. package/dist/skills/ads-break-ui/references/captures.md +7 -32
  46. package/dist/skills/ads-break-ui/references/contracts.md +58 -25
  47. package/dist/skills/ads-break-ui/references/drafts.md +59 -43
  48. package/dist/skills/ads-break-ui/references/evidence.md +1 -1
  49. package/dist/skills/ads-break-ui/references/guarded-editing.md +58 -47
  50. package/dist/skills/ads-break-ui/references/review.md +9 -8
  51. package/dist/skills/ads-break-ui/references/scenarios.md +1 -1
  52. package/dist/skills/ads-break-ui/references/validation.md +8 -4
  53. package/dist/skills/ads-break-ui/references/workflows.md +15 -8
  54. package/dist/skills/ads-designer/SKILL.md +30 -31
  55. package/dist/skills/ads-designer/references/accessibility.md +9 -5
  56. package/dist/skills/ads-designer/references/behaviors.md +7 -6
  57. package/dist/skills/ads-designer/references/branding.md +2 -2
  58. package/dist/skills/ads-designer/references/captures.md +7 -32
  59. package/dist/skills/ads-designer/references/cli.md +5 -1
  60. package/dist/skills/ads-designer/references/contracts.md +58 -25
  61. package/dist/skills/ads-designer/references/drafts.md +59 -43
  62. package/dist/skills/ads-designer/references/evidence.md +1 -1
  63. package/dist/skills/ads-designer/references/guarded-editing.md +58 -47
  64. package/dist/skills/ads-designer/references/performance.md +57 -6
  65. package/dist/skills/ads-designer/references/review.md +9 -8
  66. package/dist/skills/ads-designer/references/scenarios.md +1 -1
  67. package/dist/skills/ads-designer/references/validation.md +8 -4
  68. package/dist/skills/ads-designer/references/workflows.md +15 -8
  69. package/dist/skills/ads-import/SKILL.md +25 -28
  70. package/dist/skills/ads-import/references/behaviors.md +7 -6
  71. package/dist/skills/ads-import/references/captures.md +7 -32
  72. package/dist/skills/ads-import/references/cli.md +5 -1
  73. package/dist/skills/ads-import/references/contracts.md +58 -25
  74. package/dist/skills/ads-import/references/drafts.md +59 -43
  75. package/dist/skills/ads-import/references/evidence.md +1 -1
  76. package/dist/skills/ads-import/references/guarded-editing.md +58 -47
  77. package/dist/skills/ads-import/references/review.md +9 -8
  78. package/dist/skills/ads-import/references/scenarios.md +1 -1
  79. package/dist/skills/ads-import/references/validation.md +8 -4
  80. package/dist/skills/ads-import/references/workflows.md +15 -8
  81. package/dist/skills/ads-motion/SKILL.md +25 -28
  82. package/dist/skills/ads-motion/references/behaviors.md +7 -6
  83. package/dist/skills/ads-motion/references/captures.md +7 -32
  84. package/dist/skills/ads-motion/references/contracts.md +58 -25
  85. package/dist/skills/ads-motion/references/drafts.md +59 -43
  86. package/dist/skills/ads-motion/references/evidence.md +1 -1
  87. package/dist/skills/ads-motion/references/guarded-editing.md +58 -47
  88. package/dist/skills/ads-motion/references/review.md +9 -8
  89. package/dist/skills/ads-motion/references/scenarios.md +1 -1
  90. package/dist/skills/ads-motion/references/validation.md +8 -4
  91. package/dist/skills/ads-motion/references/workflows.md +15 -8
  92. package/dist/skills/ads-port/SKILL.md +25 -28
  93. package/dist/skills/ads-port/references/behaviors.md +7 -6
  94. package/dist/skills/ads-port/references/captures.md +7 -32
  95. package/dist/skills/ads-port/references/cli.md +5 -1
  96. package/dist/skills/ads-port/references/contracts.md +58 -25
  97. package/dist/skills/ads-port/references/drafts.md +59 -43
  98. package/dist/skills/ads-port/references/evidence.md +1 -1
  99. package/dist/skills/ads-port/references/guarded-editing.md +58 -47
  100. package/dist/skills/ads-port/references/native-implementation.md +6 -6
  101. package/dist/skills/ads-port/references/review.md +9 -8
  102. package/dist/skills/ads-port/references/scenarios.md +1 -1
  103. package/dist/skills/ads-port/references/validation.md +8 -4
  104. package/dist/skills/ads-port/references/workflows.md +15 -8
  105. package/dist/starters/preact/design-system/components/Layout/Grid/Grid.ads.contract.ts +6 -0
  106. package/dist/starters/preact/design-system/review/token-preview/TokenPreview.ads.contract.ts +6 -0
  107. package/dist/starters/preact/ds.config.json +0 -14
  108. package/dist/starters/react/README.md +9 -5
  109. package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.fixture.ts +1 -1
  110. package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.fixture.ts +2 -2
  111. package/dist/starters/react/design-system/components/Actions/Button/Button.ads.exports.ts +1 -0
  112. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.exports.ts +1 -0
  113. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.exports.ts +1 -0
  114. package/dist/starters/react/design-system/components/Content/Image/Image.ads.exports.ts +1 -0
  115. package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.exports.ts +1 -0
  116. package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +2 -2
  117. package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.exports.ts +1 -0
  118. package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.contract.ts +6 -0
  119. package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.exports.ts +1 -0
  120. package/dist/starters/react/design-system/controllers/Palette/Palette.ads.exports.ts +1 -0
  121. package/dist/starters/react/design-system/index.ts +3 -7
  122. package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.exports.ts +1 -0
  123. package/dist/starters/react/design-system/review/brand-preview/BrandPreview.ads.exports.ts +1 -0
  124. package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.exports.ts +1 -0
  125. package/dist/starters/react/design-system/review/grid-cell/GridCell.ads.exports.ts +1 -0
  126. package/dist/starters/react/design-system/review/index.ts +4 -3
  127. package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.exports.ts +1 -0
  128. package/dist/starters/react/design-system/review/token-preview/TokenPreview.ads.contract.ts +6 -0
  129. package/dist/starters/react/design-system/review/token-preview/TokenPreview.ads.exports.ts +1 -0
  130. package/dist/starters/react/design-system/styles.css +1 -0
  131. package/dist/starters/react/ds.config.json +0 -14
  132. package/dist/style-boundaries.mjs +7 -6
  133. package/dist/test-boundaries.mjs +2 -2
  134. package/dist/themes-watch.mjs +9 -3
  135. package/dist/token-fixtures.mjs +1 -1
  136. package/dist/unit-contracts.mjs +38 -4
  137. package/dist/units.mjs +16 -91
  138. package/dist/validation-checks.mjs +7 -1
  139. package/docs/ADS.md +10 -10
  140. package/docs/ARCHITECTURE.md +104 -44
  141. package/docs/BEHAVIORS.md +8 -7
  142. package/docs/CACHING.md +15 -6
  143. package/docs/CHANGELOG.md +107 -12
  144. package/docs/COMPARISON.md +1 -1
  145. package/docs/CONTRACTS.md +10 -25
  146. package/docs/GUIDE.md +98 -57
  147. package/docs/MCP.md +116 -151
  148. package/package.json +7 -7
  149. package/dist/contract-migration.mjs +0 -110
  150. package/dist/mcp/draft-exports.mjs +0 -40
  151. package/dist/mcp/edit-preparation.mjs +0 -115
@@ -1,9 +1,10 @@
1
1
  # Tracked drafts and auto-mode acceptance
2
2
 
3
- Use this workflow for MCP-only iterative design, or when a direct editor chooses
4
- tracked proposals for isolation and comparison. Ordinary direct source edits use
5
- the separate [direct editing workflow](workflows.md#direct-design-system-code-access)
6
- and do not require draft acceptance. Auto mode means the agent reviews the
3
+ Every MCP source change goes through a draft: only `ads_accept` of an exact draft
4
+ revision writes accepted source. Direct editors can choose drafts too, for isolation
5
+ and comparison; ordinary direct source edits use the separate
6
+ [direct editing workflow](workflows.md#direct-design-system-code-access) and do not
7
+ require draft acceptance. Auto mode means the agent reviews the
7
8
  rendered result and accepts it; it does not introduce a human approval gate.
8
9
  Human acceptance controls are not part of this version.
9
10
 
@@ -33,19 +34,29 @@ use one multi-owner draft: its previews share a compiler workspace and acceptanc
33
34
  validates the combined candidate once, then applies all changes together. The
34
35
  existing source and patch byte budgets still apply.
35
36
 
36
- A Git checkout is not required to create or recover a draft. Refresh uses the
37
- installed Git executable for three-way text merging. Restarting ADS or cloning the
38
- project discovers the same source. Generated compiler workspaces and execution
39
- events remain under ignored `.ds/`; an interrupted check is never a pass.
40
-
41
- The manifest maps each proposed file to its normal project target and records
42
- its baseline fingerprint, original baseline source and owner. Baseline files under
43
- `bases/` are recovery data; edit only the proposed `files/` source. Edit returned source files with local file
44
- tools. `ads_read_file` reads mapped draft source in bounded ranges.
45
- `ads_update_draft` registers additions/deletions or edits source for remote
46
- clients; pass the current revision from `ads_drafts`. `content:null` proposes a
47
- deletion. Binary content uses `encoding:"base64"`; acceptance uses Git's existing
48
- binary patch support. Do not edit accepted source to iterate a proposal.
37
+ **An owner is in at most one open draft.** Creating a draft for an owner that another
38
+ open draft holds is refused and names that draft, so concurrent clients edit
39
+ different owners and drafts never share a file. Accepting or dropping a draft frees
40
+ its owners. To build on an unaccepted change of another owner, depend on its draft.
41
+
42
+ A draft starts with only its owners' own files. A shared companion such as
43
+ `ds.config.json` joins the draft when the draft changes it. Shared entries are never
44
+ in a draft: the public barrel, the review entry and the styles entry are generated
45
+ from the owners' `.ads.exports.ts` files and token sheets (see
46
+ [contracts.md](contracts.md)).
47
+
48
+ A Git checkout is not required to create or recover a draft. Restarting ADS or
49
+ cloning the project discovers the same source. Generated compiler workspaces and
50
+ execution events remain under ignored `.ds/`; an interrupted check is never a pass.
51
+
52
+ The manifest maps each proposed file to its normal project target and records its
53
+ baseline fingerprint and owner. Edit the proposed `files/` source with local file
54
+ tools, or send changes through `ads_update_draft` (pass the current revision from
55
+ `ads_drafts`): `changes` with contents (`content:null` proposes a deletion; binary
56
+ content uses `encoding:"base64"`), or `patch`/`patchFile` with a Git unified diff
57
+ written against canonical paths, applied exactly to the draft's current proposal.
58
+ New paths join their declared owner. `ads_read_file` reads mapped draft source in
59
+ bounded ranges. Do not edit accepted source to iterate a proposal.
49
60
 
50
61
  `ads_drafts` lists only drafts. Filter by unit/query, page with offset/limit, or
51
62
  pass id to inspect file mappings. Catalogue and scenario entries expose their
@@ -57,8 +68,12 @@ create component-local value catalogues.
57
68
  ## Preview and dependencies
58
69
 
59
70
  Call `ads_show_draft({id,scenario?})`, then inspect its actual `showcaseUrl` in a
60
- browser. The preview reuses an isolated compiler workspace across edits and does
61
- not run acceptance checks. Up to four draft compiler sessions stay warm; opening
71
+ browser: the project's own showcase with the draft beside its accepted version
72
+ (`?draft=<id>&split=1`). `isolatedShowcaseUrl` (`/draft/<id>/` on the same host)
73
+ shows the draft's workspace alone. A draft has no server, port or compiler of its
74
+ own: its workspace is compiled by the project's one compiler, which builds the draft
75
+ being viewed first, then the project, then background work. The preview reuses that
76
+ workspace across edits and does not run acceptance checks. Up to four draft compiler sessions stay warm; opening
62
77
  more reclaims an older generated workspace without deleting its tracked proposal.
63
78
  Creation queues compiler prewarming without delaying its response. Bursts of
64
79
  creations coalesce, and only one queued compiler initializes at a time. A newer
@@ -75,25 +90,20 @@ refreshes catalogue metadata. Read `discovery.state` (`current`, `pending`,
75
90
  New/missing scenario identities wait for fresh discovery. A previous preview may
76
91
  stay visible until compilation finishes; pending/stale output is not evidence.
77
92
  Preview workspaces follow current project inputs, including deletions, and overlay
78
- only actual draft changes. A restarted session rebuilds its disposable workspace;
93
+ only actual draft changes. A draft's own edits and the draft being viewed resync at
94
+ once; other drafts behind an accepted-source change catch up in the background
95
+ without delaying the viewed one. A restarted session rebuilds its disposable workspace;
79
96
  a missing workspace is recreated. Accept/drop removes it even after a restart,
80
97
  and startup prunes workspaces whose proposals no longer exist.
81
98
  When discovery fails, `ads_show_draft` returns the draft's own diagnostics and
82
99
  `diagnosticsUri`; the accepted `ads://project/scenarios` is a different registry.
83
100
  Read the scoped URI even when the compiler could not start.
84
101
 
85
- If accepted source advanced, use
86
- `ads_update_draft({id,revision,refresh:true})` after accepted source changes.
87
- Stored originals allow non-overlapping text edits and independent owner exports
88
- to merge. Untouched copies advance to current source. Overlaps return
89
- `refreshed:false` plus file diagnostics and leave the proposal unchanged; resolve
90
- them deliberately by passing `refresh:true` with `changes` containing the
91
- resolved contents of those existing files and their owners. Refresh separately
92
- from dependency changes. Non-overlapping JSON object fields merge structurally;
93
- conflicting arrays/values remain explicit. Older drafts without originals can refresh untouched files,
94
- but overlapping changed files require explicit resolution. Review the new
95
- revision and preview after every successful refresh.
96
- Reopen after edits to obtain the current revision.
102
+ ADS does not merge. With one draft per owner, drafts never overlap; accepted source
103
+ can still change underneath a draft through a direct edit or a Git pull. Then
104
+ `ads_accept` refuses with a baseline conflict naming the files: drop the draft and
105
+ create a new one from current source. Reopen after edits to obtain the current
106
+ revision.
97
107
  Compilation is feedback, not passing behavior/visual evidence.
98
108
 
99
109
  For model-visible images, use `ads_capture({scenario,draft:id,revision,...settings})`
@@ -108,13 +118,13 @@ pattern and token drafts. Declare their IDs in `dependencies` when creating or
108
118
  updating the dependent draft. Keep normal `@ds` imports in all implementations
109
119
  and scenarios. The preview overlays the proposed files at canonical paths; no
110
120
  project code imports `.ads` draft source. Cycles, missing dependencies and
111
- overlapping non-barrel edits are errors. Use one coupled draft for overlapping
112
- changes. A coupled draft may declare up to 64 existing/new owners.
121
+ an owner held by another open draft are errors. Use one coupled draft for coupled
122
+ owners. A coupled draft may declare up to 64 existing/new owners.
113
123
 
114
124
  Accept dependencies first. ADS removes resolved dependency IDs from dependent
115
- manifests and their previews use the final accepted implementation automatically.
116
- Independent shared-barrel exports are merged; overlapping source changes remain
117
- explicit conflicts. Review the dependent's new revision before accepting it.
125
+ manifests and their previews use the final accepted implementation automatically;
126
+ each owner's exports file feeds the generated barrel, so dependents need no barrel
127
+ edit. Review the dependent's new revision before accepting it.
118
128
  If a dependency is dropped, correct the remaining draft's dependency list.
119
129
 
120
130
  DS Explorer keeps drafts in the ordinary Tokens, Components, Patterns and
@@ -149,12 +159,18 @@ current rendered revision and complete acceptance before finishing the change.
149
159
 
150
160
  ## Accept or drop
151
161
 
152
- After rendered review, call `ads_accept({id,revision})` once. It checks that exact
153
- revision, runs mandatory ADS guards plus `acceptance.checks` and, when
154
- `acceptance.behaviorChecks` is enabled, affected registered behavior checks against an isolated candidate, and applies passing changes at
155
- their normal paths. Unless `acceptance.browserAudit` is false it also runs the axe-core
156
- audit on the candidate's affected UI scenarios; an `a11y-axe` error rejects the draft.
157
- Fix it in the component and accept the new revision. Changes during checking or baseline conflicts prevent
162
+ After rendered review, call `ads_accept({id,revision})`, or first
163
+ `ads_accept({id,revision,dryRun:true})` to run every check without writing. It checks
164
+ that exact revision, runs mandatory ADS guards plus `acceptance.checks` and, when
165
+ `acceptance.behaviorChecks` is enabled, affected registered behavior checks, and
166
+ applies passing changes at their normal paths. `acceptance.browserAudit` chooses the
167
+ axe-core audit: `"owners"` (default) the draft owners' own UI scenarios, `"affected"`
168
+ every scenario the change reaches, `false` none; an `a11y-axe` error rejects the
169
+ draft. Checks and renders run in the draft's reviewed workspace through the project's
170
+ compiler and showcase, and accepting a revision a dry run just passed reuses its
171
+ results. Fix a failure in the component and accept the new revision. After a series
172
+ of accepted drafts, run the full audit of everything affected as a stage:
173
+ `ads_validate` with the validation policy and `scope:"changed"`. Changes during checking or baseline conflicts prevent
158
174
  application. Successful acceptance removes the proposal and records an event.
159
175
  There is no separate Apply or Iterate action. A failed attempt retains the draft;
160
176
  inspect its returned resultId with `ads_results` and fix the reported boundary.
@@ -22,7 +22,7 @@ a pass. Keep the reported case outcome separate from whole-run acceptance.
22
22
 
23
23
  ## Retrieve only the evidence needed
24
24
 
25
- `ads_verify`, `ads_apply_patch` and `ads_apply_transaction` reply with counts,
25
+ `ads_verify` and `ads_accept` reply with counts,
26
26
  bounded acceptance, at most three failure previews and `resultId`, within 4096
27
27
  UTF-8 JSON bytes. Full validation still decides acceptance. Do not repeat a suite
28
28
  merely to recover its output, or restate the complete report in conversation.
@@ -1,42 +1,49 @@
1
1
  # Advanced guarded editing
2
2
 
3
3
  Choose [direct editing or MCP-only editing](workflows.md) first. This reference
4
- covers MCP's guarded patch tools, not a requirement to route direct source edits
5
- through MCP. For MCP-only iterative design, prefer [tracked drafts](drafts.md):
6
- edit and preview the proposal, then review and accept its exact revision.
7
- The disposable `.ds/patch-drafts/` copies described below are low-level patch
8
- staging for focused repairs and migrations, not tracked review proposals.
4
+ covers what MCP's guarded editing checks and how; it does not require direct source
5
+ edits to go through MCP. Every MCP source change goes through a [tracked draft](drafts.md):
6
+ only `ads_accept` of an exact draft revision writes accepted source. There is no
7
+ direct patch or transaction tool.
9
8
 
10
- Use `ads_apply_patch` for independent owner edits. `ads_prepare_patch` can create a
11
- local draft of one owner and its companions; edit that directory with local file
12
- tools, request `action:"diff"`, then apply the returned patchFile. Discard the
13
- draft afterward. Remote clients can keep sending inline Git diffs. Neither draft
14
- preparation nor diff generation validates or changes live source.
15
-
16
- To verify a draft before applying it, diff it and dry-run the returned patch:
9
+ For a focused repair, create a one-owner draft and send a Git unified diff to it:
17
10
 
18
11
  ```js
19
- ads_prepare_patch({"unit":"components/Example","action":"diff","draft":"<returned draft ID>"})
20
- ads_apply_patch({"unit":"components/Example","patchFile":"<returned patchFile>","dryRun":true})
12
+ ads_create_draft({"units":["components/Example"]})
13
+ ads_update_draft({"id":"<id>","revision":"<revision>","patch":"--- a/design-system/components/Example.tsx\n+++ b/..."})
14
+ ads_accept({"id":"<id>","revision":"<new revision>","dryRun":true})
15
+ ads_accept({"id":"<id>","revision":"<new revision>"})
21
16
  ```
22
17
 
23
- The dry run validates the candidate in an isolated project copy using mandatory
24
- ADS guards, `acceptance.checks` and, when `acceptance.behaviorChecks` is enabled,
25
- affected registered behavior checks. Registration alone does not require a test
26
- at acceptance. Unless `acceptance.browserAudit` is false, axe-core also audits the candidate's
27
- affected UI scenarios; `a11y-axe` errors reject the patch. See [validation policies](validation.md).
28
- Configured browser checks use that candidate's managed preview, not the live showcase. Read the summary, then page failing
29
- `outcomes`, `diagnostics` or pipeline `checks` through `ads_results` with its
30
- `resultId`. Inspect one exact outcome with `ads_investigate({unit,check,runId})`;
31
- fix the draft and diff again. See [evidence.md](evidence.md) for page/range limits.
32
- Keep `<Owner>.ads.contract.ts` and specs with their owner and use registered checks; a scratchpad
33
- run against live source cannot verify unapplied changes. After validation, apply
34
- with `dryRun:false`; ADS revalidates before writing. Dry-run evidence is not saved
35
- as passing evidence for the live project.
18
+ Diff headers name canonical paths; hunks must match the draft's current proposal
19
+ exactly (no fuzzy matching). Large diffs can go in a `.ds/patches/<name>.patch` file
20
+ passed as `patchFile`. Binary files go through `changes` with `encoding:"base64"`.
21
+ Coupled owners share one draft (1–64 owners); a pattern that needs an unaccepted
22
+ component change depends on that component's draft instead of including its owner.
23
+
24
+ `dryRun:true` runs every acceptance check on the candidate and writes nothing; the
25
+ draft stays. The candidate is checked with mandatory ADS guards, `acceptance.checks`
26
+ and, when `acceptance.behaviorChecks` is enabled, affected registered behavior
27
+ checks. Registration alone does not require a test at acceptance.
28
+ `acceptance.browserAudit` chooses the accessibility audit: `"owners"` (default) audits
29
+ the draft owners' own UI scenarios, `"affected"` every scenario the change reaches,
30
+ `false` none; `a11y-axe` errors reject the draft. Run the full audit of everything
31
+ affected as a stage after a series of accepted drafts: `ads_validate` with the
32
+ validation policy and `scope:"changed"` (see [validation policies](validation.md)).
33
+
34
+ Checks and browser renders run in the draft's reviewed preview workspace, compiled by
35
+ the project's one compiler and served by its one showcase. Accepting the revision a
36
+ dry run just passed reuses that run's `ads check` and audit results. Read the
37
+ summary, then page failing `outcomes`, `diagnostics` or pipeline `checks` through
38
+ `ads_results` with its `resultId`. Inspect one exact outcome with
39
+ `ads_investigate({unit,check,runId})`; fix the draft and check again. See
40
+ [evidence.md](evidence.md) for page/range limits. Keep `<Owner>.ads.contract.ts` and
41
+ specs with their owner and use registered checks; a scratchpad run against live
42
+ source cannot verify unapplied changes. Acceptance revalidates before writing.
43
+ Dry-run evidence is not saved as passing evidence for the live project.
36
44
 
37
45
  `ads_verify({unit,checks?})` selects checks for current project source; it has no
38
- draft argument. There is no dedicated selected-check runner for drafts yet.
39
- Use a dry-run transaction for genuinely coupled draft patches.
46
+ draft argument.
40
47
 
41
48
  Build notifications are deferred until the showcase finishes initial discovery;
42
49
  a preview cannot be opened with an incomplete tool list. A missing App tool is a
@@ -47,6 +54,9 @@ Registered project scripts default to 60 seconds each. A guarded configuration
47
54
  change can set `mcp.mutationCheckTimeoutMs` (100–300000 ms) after measuring build
48
55
  duration and contention. Timeouts name the command, budget and elapsed time;
49
56
  behavior-profile budgets are separate. Do not drop checks to fit either budget.
57
+ A preview waits up to 5 minutes for its build, including the first build after the
58
+ MCP server starts; `mcp.previewBuildTimeoutMs` (1000–3600000 ms) changes that wait.
59
+ The accessibility audit renders `mcp.auditPages` pages at once (1–16, default 4).
50
60
 
51
61
  Behavior-run performance belongs to both orchestration and project checks. ADS
52
62
  selects affected owners, filters registered Playwright case tags and shares one
@@ -92,7 +102,11 @@ Do not change the policy merely to suppress verification of real side effects.
92
102
 
93
103
  For registered measured-geometry style writes, use direct `element.style.transform =
94
104
  value` or `element.style.setProperty("--ds-measured-value", value)` with the exact
95
- file/property boundary. The current guard rejects a style-object alias such as
105
+ file/property boundary, declared in the owner's contract:
106
+ `styles: { writes: { "./Menu.tsx": ["--ds-menu-x"] } }`. Inline JSX/factory styles
107
+ for measured geometry are declared as `styles: { inline: ["./Menu.tsx"] }`, and a
108
+ component's `--ds-*` variables that patterns, the showcase or the application may set
109
+ as `customization: ["--ds-tabs-h"]`. `ds.config.json` holds no per-owner entries. The current guard rejects a style-object alias such as
96
110
  `const style = element.style` as an escape; it does not trace the alias to later
97
111
  writes. Keep writes explicit when adapting local controller code. This syntax
98
112
  constraint is separate from deciding which measured properties belong to the
@@ -108,29 +122,26 @@ of duplicating them across units. Do not create an asset group or bypass a guard
108
122
  to add these documents. Code/configuration and hidden/generated paths remain
109
123
  outside documentation ownership.
110
124
 
111
- For genuinely coupled changes, `ads_apply_transaction` accepts 2–64 distinct owner
112
- patches (256 distinct files and 16 MiB combined). Each patch keeps its ownership and
113
- companion restrictions. Patches apply in order; later shared-entry hunks match the
114
- earlier candidate. All guards, registered checks and affected behavior checks run
115
- on the final candidate before live source is written. Dry-run first. Rejection,
116
- conflict and cancellation publish nothing. Dependency installation remains local;
117
- the candidate uses installed node_modules. Never bypass a rejected gate directly.
118
-
119
125
  Static design values and formulas belong in the shared Data foundation. Components
120
126
  map those values with `--ds-*` variables; patterns use `--ux-*`. There are no private
121
127
  token namespaces/value sheets or token sections in owner contracts. Keep measured
122
128
  runtime geometry separate. Read [design-data.md](design-data.md) before adding a
123
129
  design value or repairing an ownership/value-source diagnostic.
124
130
 
125
- `ads_prepare_token_samples({id, bindings?})` preserves existing project samples,
126
- removes undeclared names and returns an owner patchFile. Supply explicit
127
- `{token,property,probe}` bindings for new samples; unresolved tokens stay reported.
128
- ADS does not infer visual meaning or fabricate renderers. Apply through the guard,
129
- then inspect the actual App sample effects.
130
-
131
- An empty .gitkeep can be deleted alongside new source beneath it in the selected
132
- owner. Nonempty markers and other hidden files stay protected. A redundant
133
- Scenario.tsx can be deleted when real coverage remains elsewhere; removing a
131
+ `ads_prepare_token_samples({id, bindings?, draft?})` preserves existing project
132
+ samples, removes undeclared names and writes the result into a draft (the given one,
133
+ or a new one for the scenario's owner). Supply explicit `{token,property,probe}`
134
+ bindings for new samples; unresolved tokens stay reported. ADS does not infer visual
135
+ meaning or fabricate renderers. Show the draft, inspect the actual App sample
136
+ effects, then accept it.
137
+
138
+ Every authored file has one owner, and drafts carry only their owners' files. Shared
139
+ entries are generated: the public barrel and review entry from each owner's
140
+ `<Owner>.ads.exports.ts`, the styles entry from the token sheets, and the theme
141
+ files. A draft that edits a generated entry is refused. ADS deletes an empty
142
+ `.gitkeep` itself when accepted source is added beneath it; owners never edit
143
+ placeholders. Other hidden files stay protected. A redundant
144
+ scenario can be deleted when real coverage remains elsewhere; removing a
134
145
  scenario does not erase ownership of the unit's runtime source.
135
146
 
136
147
  Keep contextual public parts public when they are intended consumer API. Demonstrate
@@ -72,8 +72,8 @@ ADS checks the declaration and installation, not third-party dependency internal
72
72
 
73
73
  Floating UI's `computePosition` can feed `x`/`y` through exact allowlisted writes
74
74
  such as `element.style.setProperty("--ds-popover-x", x + "px")` and the equivalent
75
- `--ds-popover-y`. Register only these measured properties in
76
- `boundaries.styleWrites`; keep placement CSS and visual treatment in project
75
+ `--ds-popover-y`. Declare only these measured properties in the owner contract's
76
+ `styles.writes`; keep placement CSS and visual treatment in project
77
77
  Linaria and clean up `autoUpdate` observers on unmount. Library approval creates
78
78
  no additional inline-style or CSSProperties exception.
79
79
 
@@ -106,10 +106,10 @@ its owner. Demo utilities for container size, border or framing become a public
106
106
  development-only `review/` helper around the real component, exported through the
107
107
  separate review entry. Add component props for a
108
108
  deliberate runtime API requirement; missing demo layout alone is not justification.
109
- For imperative geometry, register exact `styleWrites` properties. After migrating
110
- from JSX inline geometry, change source and its own config companion together:
111
- remove the obsolete `inlineStyleFiles` exception and register only properties the
112
- implementation actually writes. Verify the final component with that boundary.
109
+ For imperative geometry, declare exact `styles.writes` properties in the owner's
110
+ contract. After moving from JSX inline geometry, change source and its contract
111
+ together: remove the obsolete `styles.inline` entry and declare only properties the
112
+ implementation actually writes. Verify the final component with that permission.
113
113
 
114
114
  Keep presentational building blocks independent of an unnecessary form controller
115
115
  or other state engine. Scenario adapters may own demo state and validation. When
@@ -18,10 +18,11 @@ inside the preview App with the project's framework, foundation, fonts and style
18
18
  Nothing depends on particular helper names or an imported component library.
19
19
 
20
20
  The development entry defaults to `review/index.ts` relative to `dsDir`; configure
21
- `reviewEntry` for another script inside `review/`. Its import alias is the
21
+ `reviewEntry` for another script inside `review/`. ADS generates it from the review
22
+ owners' `<Owner>.ads.exports.ts` files; never edit it by hand. Its import alias is the
22
23
  configured `publicAlias` plus `/review`, normally `@ds/review`. Discover the actual
23
- entry/alias through `ads_status.project.review`. Export helpers there, never from
24
- the production public barrel. Review implementations, types and styles must not
24
+ entry/alias through `ads_status.project.review`. Declare a review helper's exports in
25
+ its own exports file, never in a product owner's. Review implementations, types and styles must not
25
26
  enter application, component, pattern or controller dependencies. Tests, fixtures,
26
27
  scenarios and preview mounts can consume review code.
27
28
 
@@ -74,11 +75,11 @@ Production entrypoints never import the development entry. Inspect the product
74
75
  bundle for review modules/CSS; passing static checks does not prove bundle parity.
75
76
 
76
77
  Use `ads_units` for `review/<Owner>` units. Scenarios, local specs and helper files
77
- follow ordinary flat/directory ownership. A review patch may update only its own
78
- re-exports in the development entry and its own documented style boundaries.
79
- Product owners retain the separate production entry companion. Use prepared
80
- patches/dry runs and coupled transactions as described in
81
- [guarded-editing.md](guarded-editing.md); do not bypass a rejected mutation.
78
+ follow ordinary flat/directory ownership. A review owner declares its public
79
+ names in its own `<Owner>.ads.exports.ts`, from which ADS generates the development
80
+ entry, and its own style permissions in its contract. Use drafts and acceptance dry
81
+ runs as described in [guarded-editing.md](guarded-editing.md); do not bypass a
82
+ rejected acceptance.
82
83
 
83
84
  For an existing project, identify helpers by responsibility and actual consumers,
84
85
  not names or the number of imported components. Preserve real application patterns.
@@ -95,7 +95,7 @@ export function Frame({ visible = true } = {}) {
95
95
  return <section>{visible && <Part />}</section>;
96
96
  }
97
97
 
98
- // Colocated Scenario.tsx
98
+ // Colocated Frame.ads.scenario.tsx
99
99
  import { Frame } from "@ds";
100
100
  export const scenario = { title: "Frame", covers: ["Frame", "Part"] };
101
101
  export default function Scenario() { return <Frame />; }
@@ -41,9 +41,12 @@ implicitly requiring them at acceptance.
41
41
  all registered behavior checks. Use before a release, after ownership/test/config
42
42
  migrations and for an explicit complete audit. Changed scope narrows registered
43
43
  owners while project scripts and core gates retain full scope.
44
- - Both policies run the axe-core audit of every rendered UI scenario in every brand
45
- and theme (`browser-accessibility-audit`); `browserAudit: false` turns it off for
46
- that policy. An `a11y-incomplete` info item means axe could not decide that rule on those elements: check it by hand, using the reason it names (`bgGradient` is text over a gradient). Its `a11y-axe`, `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the policy, and an audit
44
+ - The validation policy runs the axe-core audit of every rendered UI scenario in
45
+ every brand and theme (`browser-accessibility-audit`); it is the stage check after a
46
+ series of accepted drafts (`scope:"changed"` audits what changed since the last
47
+ full audit). `validation.browserAudit: false` turns it off. Draft acceptance audits
48
+ per `acceptance.browserAudit`: `"owners"` (default, the draft owners' own scenarios),
49
+ `"affected"` (every scenario the change reaches) or `false`. An `a11y-incomplete` info item means axe could not decide that rule on those elements: check it by hand, using the reason it names (`bgGradient` is text over a gradient). Its `a11y-axe`, `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the policy, and an audit
47
50
  that cannot run (no project Playwright or browser) fails it with a `browser-audit`
48
51
  error naming what to install. Under the acceptance policy, draft
49
52
  acceptance and guarded patches/transactions audit the candidate's affected UI
@@ -62,7 +65,8 @@ implicitly requiring them at acceptance.
62
65
  disable tests or weaken configuration to make a failing change pass.
63
66
 
64
67
  Defaults: both script lists are empty, acceptance `behaviorChecks:false`,
65
- validation `behaviorChecks:true`, both `browserAudit:true`. No lint/test/build script names are inferred.
68
+ validation `behaviorChecks:true`, acceptance `browserAudit:"owners"`, validation
69
+ `browserAudit:true`. No lint/test/build script names are inferred.
66
70
  Every listed script must exist; commands are trusted project configuration, not
67
71
  MCP arguments. `mcp.mutationChecks` is a configuration error: list those scripts in
68
72
  `acceptance.checks` and set `acceptance.behaviorChecks`. `mcp.mutationCheckTimeoutMs`
@@ -55,14 +55,21 @@ When no authorized source editor/filesystem channel is available, use the
55
55
  server's tools for source reads and changes. Do not assume returned server-local
56
56
  paths can be opened by the client. Discover capabilities with `ads_status`.
57
57
 
58
- With mutation tools enabled, follow [tracked drafts](drafts.md): discover owners
59
- with `ads_units`, create a coherent proposal with `ads_create_draft`, read/edit its
60
- marked source through `ads_read_file` and `ads_update_draft`, preview with
61
- `ads_show_draft`, review the rendered result and accept its exact revision with
58
+ With mutation tools enabled, every source change follows [tracked drafts](drafts.md):
59
+ discover owners with `ads_units`, create a coherent proposal with `ads_create_draft`,
60
+ read/edit its marked source through `ads_read_file` and `ads_update_draft` (file
61
+ contents or a Git diff), preview with `ads_show_draft`, review the rendered result,
62
+ optionally check with `ads_accept({dryRun:true})`, and accept its exact revision with
62
63
  `ads_accept`. Accept dependencies first and review dependents again. The agent
63
- performs auto-mode review; no additional human approval step is implied.
64
-
65
- Use [guarded patches](guarded-editing.md) for focused repairs and migrations.
64
+ performs auto-mode review; no additional human approval step is implied. An owner is
65
+ in at most one open draft, so concurrent clients work on different owners.
66
+
67
+ After a series of accepted drafts, run the stage check before reporting the work
68
+ complete or committing: `ads_validate` with the validation policy and
69
+ `scope:"changed"`. It runs the full accessibility audit of everything the changes
70
+ reached and the registered behavior checks; acceptance itself audits only the draft
71
+ owners' own scenarios by default. See [guarded editing](guarded-editing.md) for
72
+ focused repairs and what acceptance checks.
66
73
  Without mutation tools, an MCP-only client can inspect, preview and validate,
67
74
  but cannot change source. Report that capability limit if editing is required.
68
75
 
@@ -72,7 +79,7 @@ Both routes preserve project ownership, framework, public APIs, shared tokens,
72
79
  styling/geometry boundaries and configured checks. Compilation and HTML delivery
73
80
  do not prove visual or behavioral correctness. Report the scope and revision of
74
81
  actual passing checks; stale, failed or incomplete evidence remains unfinished.
75
- Never change access routes to bypass a rejected patch or failed acceptance.
82
+ Never change access routes to bypass a failed acceptance.
76
83
 
77
84
  Direct editors may deliberately choose tracked drafts for isolation, comparison
78
85
  or PR review. Once using a tracked proposal, finish a coherent design change by
@@ -0,0 +1,6 @@
1
+ import type { UnitContract } from "@reqvire-org/ads/contracts";
2
+
3
+ export default {
4
+ schemaVersion: 1,
5
+ styles: { writes: { "./Grid.tsx": ["--ds-grid-span-sm", "--ds-grid-span-md", "--ds-grid-span-lg"] } },
6
+ } satisfies UnitContract;
@@ -0,0 +1,6 @@
1
+ import type { UnitContract } from "@reqvire-org/ads/contracts";
2
+
3
+ export default {
4
+ schemaVersion: 1,
5
+ styles: { writes: { "./TokenPreview.tsx": ["--ux-token-preview-value"] } },
6
+ } satisfies UnitContract;
@@ -7,20 +7,6 @@
7
7
  "mcp": {
8
8
  "previewManifest": ".ds/preview/manifest.json"
9
9
  },
10
- "boundaries": {
11
- "styleWrites": [
12
- {
13
- "file": "design-system/components/Layout/Grid/Grid.tsx",
14
- "properties": ["--ds-grid-span-sm", "--ds-grid-span-md", "--ds-grid-span-lg"]
15
- },
16
- {
17
- "file": "design-system/review/token-preview/TokenPreview.tsx",
18
- "properties": [
19
- "--ux-token-preview-value"
20
- ]
21
- }
22
- ]
23
- },
24
10
  "assets": {
25
11
  "iconSource": "assets/brand/app-icon.svg",
26
12
  "glyphs": {
@@ -159,7 +159,10 @@ Managed sessions own their graph output; standalone prebuilds cannot replace it.
159
159
  Verified generated graph snapshots preserve warm-start reuse across sessions.
160
160
 
161
161
  The application and previews use the same foundation CSS and Linaria pipeline.
162
- The source barrel loads the foundation once. The private `build:lib` script uses
162
+ Each owner names its public exports in its own `<Owner>.ads.exports.ts`; ADS
163
+ generates the public barrel (`design-system/index.ts`), the review entry and the
164
+ `styles.css` foundation entry from those files and the token sheets, so never edit
165
+ them. The barrel loads the foundation once. The private `build:lib` script uses
163
166
  Vite library mode plus declarations as a source compile check; this is not a
164
167
  published UI library. General CSS checks use pinned Biome; architectural and
165
168
  registered component checks come from initialized ADS tooling.
@@ -176,7 +179,8 @@ from a user-selected external repository, preserving revisions and licenses.
176
179
  inspection builds it automatically, then loads selected entries. Browser review
177
180
  still checks layout, accessibility, keyboard/focus, states, themes and motion. A clean
178
181
  build or delivered HTML alone does not establish those behaviors.
179
- Opt-in MCP editing uses owner Git patches. `ads_prepare_patch` creates a temporary
180
- owner draft/diff; `ads_apply_transaction` validates bounded coupled owner patches
181
- against one final candidate. Preparation changes no live source. Keep all guards
182
- and review the rendered result after applying.
182
+ Opt-in MCP editing goes through drafts: `ads_create_draft` opens a draft of one or
183
+ more owners, `ads_update_draft` patches it, `ads_show_draft` renders it beside the
184
+ accepted version, and `ads_accept` validates and applies the exact revision you
185
+ reviewed (`dryRun` runs every check without writing). Drafts change no live source
186
+ until accepted; one open draft holds each owner.
@@ -1,4 +1,4 @@
1
- import appIcon from "../../../assets/brand/app-icon.svg?url";
1
+ import appIcon from "../../../assets/brand/app-icon.svg";
2
2
 
3
3
  export const fixture = {
4
4
  title: "App icon",
@@ -1,5 +1,5 @@
1
- import logo from "../../../assets/brand/logo.svg?url";
2
- import logoDark from "../../../assets/brand/logo.dark.svg?url";
1
+ import logo from "../../../assets/brand/logo.svg";
2
+ import logoDark from "../../../assets/brand/logo.dark.svg";
3
3
 
4
4
  export const fixture = {
5
5
  title: "Logo",
@@ -0,0 +1 @@
1
+ export { Button, type ButtonProps } from "./Button";
@@ -0,0 +1 @@
1
+ export { IconButton, type IconButtonProps } from "./IconButton";
@@ -0,0 +1 @@
1
+ export { Icon, iconNames, type IconName, type IconProps } from "./Icon";
@@ -0,0 +1 @@
1
+ export { Image, type ImageProps } from "./Image";
@@ -0,0 +1 @@
1
+ export { Logo, type LogoProps } from "./Logo";
@@ -1,6 +1,6 @@
1
1
  import { css, cx } from "@linaria/atomic";
2
- import logo from "../../../assets/brand/logo.svg?url";
3
- import logoDark from "../../../assets/brand/logo.dark.svg?url";
2
+ import logo from "../../../assets/brand/logo.svg";
3
+ import logoDark from "../../../assets/brand/logo.dark.svg";
4
4
 
5
5
  export interface LogoProps {
6
6
  /** The product name, read by assistive technology. */
@@ -0,0 +1 @@
1
+ export { TextField, type TextFieldProps } from "./TextField";
@@ -0,0 +1,6 @@
1
+ import type { UnitContract } from "@reqvire-org/ads/contracts";
2
+
3
+ export default {
4
+ schemaVersion: 1,
5
+ styles: { writes: { "./Grid.tsx": ["--ds-grid-span-sm", "--ds-grid-span-md", "--ds-grid-span-lg"] } },
6
+ } satisfies UnitContract;
@@ -0,0 +1 @@
1
+ export { Grid, GridItem, type GridProps, type GridItemProps } from "./Grid";
@@ -0,0 +1 @@
1
+ export { observePalette, paletteContext, paletteFor, resolveColor, type ColorToken, type Palette, type PaletteColor, type PaletteContext } from "./Palette";
@@ -1,15 +1,11 @@
1
- // Load local foundation styles; the compile check also extracts dist/styles.css.
1
+ // Generated by ADS from each owner's .ads.exports.ts; do not edit. Declare an owner's public names in its exports file.
2
2
  import "./styles.css";
3
-
4
- // Public components and patterns. Add new ones here as they are implemented.
5
3
  export { Button, type ButtonProps } from "./components/Actions/Button/Button";
6
4
  export { IconButton, type IconButtonProps } from "./components/Actions/IconButton/IconButton";
7
5
  export { Icon, iconNames, type IconName, type IconProps } from "./components/Content/Icon/Icon";
8
- export { Logo, type LogoProps } from "./components/Content/Logo/Logo";
9
6
  export { Image, type ImageProps } from "./components/Content/Image/Image";
7
+ export { Logo, type LogoProps } from "./components/Content/Logo/Logo";
10
8
  export { TextField, type TextFieldProps } from "./components/Forms/TextField/TextField";
11
9
  export { Grid, GridItem, type GridProps, type GridItemProps } from "./components/Layout/Grid/Grid";
12
- export { SearchBar, type SearchBarProps } from "./patterns/Search/SearchBar/SearchBar";
13
-
14
- // Renderer colors for Canvas, WebGL and SVG drawing, from the generated tokens/themes.generated.ts.
15
10
  export { observePalette, paletteContext, paletteFor, resolveColor, type ColorToken, type Palette, type PaletteColor, type PaletteContext } from "./controllers/Palette/Palette";
11
+ export { SearchBar, type SearchBarProps } from "./patterns/Search/SearchBar/SearchBar";