@reqvire-org/ads 0.3.49 → 0.3.50
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.
- package/README.md +36 -6
- package/dist/active-clock.mjs +34 -0
- package/dist/assets.mjs +20 -2
- package/dist/boundaries.mjs +2 -0
- package/dist/browser-audit/layout-overflow.mjs +57 -0
- package/dist/browser-audit/layout-shift.mjs +32 -0
- package/dist/browser-audit/non-text-contrast.mjs +87 -0
- package/dist/browser-audit/worker.mjs +36 -7
- package/dist/browser-audit.mjs +198 -22
- package/dist/check.mjs +14 -1
- package/dist/cli.mjs +7 -4
- package/dist/component-contrast.mjs +138 -0
- package/dist/config.mjs +12 -6
- package/dist/finding-rules.mjs +11 -1
- package/dist/fonts-generated.mjs +85 -0
- package/dist/image-attributes.mjs +110 -0
- package/dist/init.mjs +2 -0
- package/dist/layout-widths.mjs +184 -0
- package/dist/mcp/context.mjs +1 -1
- package/dist/mcp/mutations.mjs +7 -5
- package/dist/mcp/preview-watch.mjs +9 -8
- package/dist/mcp/server.mjs +6 -4
- package/dist/preview-files.mjs +3 -0
- package/dist/project-boundary.mjs +23 -0
- package/dist/project-documents.mjs +2 -1
- package/dist/scenarios-compiler.mjs +23 -3
- package/dist/showcase/client.bundle.js +11 -11
- package/dist/showcase/icons.js +5 -5
- package/dist/showcase/style.css +1 -1
- package/dist/skills/ads-break-ui/SKILL.md +8 -0
- package/dist/skills/ads-break-ui/references/atomic-styles.md +2 -0
- package/dist/skills/ads-break-ui/references/design-data.md +39 -0
- package/dist/skills/ads-break-ui/references/drafts.md +1 -1
- package/dist/skills/ads-break-ui/references/guarded-editing.md +1 -1
- package/dist/skills/ads-break-ui/references/validation.md +9 -5
- package/dist/skills/ads-designer/SKILL.md +24 -4
- package/dist/skills/ads-designer/references/accessibility.md +30 -13
- package/dist/skills/ads-designer/references/atomic-styles.md +2 -0
- package/dist/skills/ads-designer/references/branding.md +10 -5
- package/dist/skills/ads-designer/references/cli.md +2 -1
- package/dist/skills/ads-designer/references/design-data.md +39 -0
- package/dist/skills/ads-designer/references/drafts.md +1 -1
- package/dist/skills/ads-designer/references/guarded-editing.md +1 -1
- package/dist/skills/ads-designer/references/mobile.md +3 -0
- package/dist/skills/ads-designer/references/performance.md +89 -0
- package/dist/skills/ads-designer/references/validation.md +9 -5
- package/dist/skills/ads-import/references/atomic-styles.md +2 -0
- package/dist/skills/ads-import/references/cli.md +2 -1
- package/dist/skills/ads-import/references/design-data.md +39 -0
- package/dist/skills/ads-import/references/drafts.md +1 -1
- package/dist/skills/ads-import/references/guarded-editing.md +1 -1
- package/dist/skills/ads-import/references/validation.md +9 -5
- package/dist/skills/ads-motion/references/atomic-styles.md +2 -0
- package/dist/skills/ads-motion/references/design-data.md +39 -0
- package/dist/skills/ads-motion/references/drafts.md +1 -1
- package/dist/skills/ads-motion/references/guarded-editing.md +1 -1
- package/dist/skills/ads-motion/references/validation.md +9 -5
- package/dist/skills/ads-port/references/atomic-styles.md +2 -0
- package/dist/skills/ads-port/references/cli.md +2 -1
- package/dist/skills/ads-port/references/design-data.md +39 -0
- package/dist/skills/ads-port/references/drafts.md +1 -1
- package/dist/skills/ads-port/references/guarded-editing.md +1 -1
- package/dist/skills/ads-port/references/validation.md +9 -5
- package/dist/starters/preact/ds.config.json +1 -0
- package/dist/starters/preact/package.json +1 -0
- package/dist/starters/react/ADS.md +1 -1
- package/dist/starters/react/README.md +14 -2
- package/dist/starters/react/design-system/components/Actions/Button/Button.tsx +1 -1
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.fixture.ts +2 -0
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.scenario.tsx +13 -0
- package/dist/starters/react/design-system/components/Content/Image/Image.tsx +48 -0
- package/dist/starters/react/design-system/components/Content/Image/README.md +20 -0
- package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +2 -2
- package/dist/starters/react/design-system/index.ts +1 -0
- package/dist/starters/react/design-system/tokens/Layout.ads.fixture.ts +16 -0
- package/dist/starters/react/design-system/tokens/spacing.css +18 -0
- package/dist/starters/react/ds.config.json +1 -0
- package/dist/starters/react/package-lock.json +47 -0
- package/dist/starters/react/package.json +2 -1
- package/dist/test-boundaries.mjs +30 -1
- package/dist/themes-generated.mjs +15 -4
- package/dist/token-quality.mjs +27 -17
- package/dist/units.mjs +2 -1
- package/dist/validation-checks.mjs +5 -4
- package/dist/validation.mjs +1 -1
- package/dist/verification/browser.mjs +28 -2
- package/dist/verification.mjs +5 -4
- package/docs/ADS.md +4 -1
- package/docs/ARCHITECTURE.md +13 -3
- package/docs/CHANGELOG.md +92 -12
- package/docs/GUIDE.md +208 -14
- package/docs/MCP.md +14 -10
- package/package.json +1 -1
package/docs/GUIDE.md
CHANGED
|
@@ -58,7 +58,8 @@ optionally a named `captureTargets` element, theme and viewport. To compare a
|
|
|
58
58
|
proposed change before applying it, add `screenshot:true` and an explicit
|
|
59
59
|
`captures:[{scenario:"<discovered ID>"}]` selection to the patch/transaction dry run.
|
|
60
60
|
Normal patches and dry runs create no screenshots. Capture uses project-installed
|
|
61
|
-
Playwright and its browser; ADS installs neither
|
|
61
|
+
Playwright and its browser; ADS installs neither (`ads create` and `ads init` declare
|
|
62
|
+
`@playwright/test`; run `npx playwright install chromium` once).
|
|
62
63
|
|
|
63
64
|
Read `ads://project/captures` and the returned PNG image URIs through MCP
|
|
64
65
|
`resources/read`. Each target keeps only current and candidate: a successful
|
|
@@ -189,12 +190,13 @@ Node/npm or Bun pipeline. Run inside the project containing `package.json`:
|
|
|
189
190
|
```sh
|
|
190
191
|
npx @reqvire-org/ads init --framework react
|
|
191
192
|
npm install
|
|
193
|
+
npx playwright install chromium # browser for the accessibility audit
|
|
192
194
|
npm run build
|
|
193
195
|
```
|
|
194
196
|
|
|
195
197
|
For a Bun-managed project, use
|
|
196
|
-
`bunx @reqvire-org/ads init --framework react`, followed by `bun install
|
|
197
|
-
and `bun --bun run build`. Node is unnecessary. No archive or directory argument is needed for a published
|
|
198
|
+
`bunx @reqvire-org/ads init --framework react`, followed by `bun install`,
|
|
199
|
+
`bunx playwright install chromium` and `bun --bun run build`. Node is unnecessary. No archive or directory argument is needed for a published
|
|
198
200
|
release. `init` requires an existing project; it does not create an application.
|
|
199
201
|
For starting from zero, `ads create <folder> --framework react|preact` copies the
|
|
200
202
|
TypeScript/Linaria starter shipped in the same ADS version into a new or empty
|
|
@@ -439,13 +441,14 @@ dependencies. Project scripts default to 60 seconds each; use the explicit
|
|
|
439
441
|
Behavior profiles have a separate whole-run budget.
|
|
440
442
|
Set `acceptance.behaviorChecks` to require affected registered tests at acceptance.
|
|
441
443
|
Set `validation.checks` and `validation.behaviorChecks` independently for audits.
|
|
442
|
-
Both script lists default to empty; no names are inferred.
|
|
444
|
+
Both script lists default to empty; no names are inferred. Both policies run the
|
|
445
|
+
browser audit; `"browserAudit": false` in a policy turns its audit off. Direct source edits
|
|
443
446
|
can run `ads validate --policy acceptance`; ordinary `ads validate` selects the
|
|
444
447
|
validation policy. See [policy guidance](../skills/ads-designer/references/validation.md).
|
|
445
448
|
When the acceptance policy requires affected registered behavior checks (or
|
|
446
449
|
a capture was requested), ADS builds and shares production previews with browser
|
|
447
|
-
verification.
|
|
448
|
-
for
|
|
450
|
+
verification. The acceptance policy's browser audit renders the candidate's affected UI
|
|
451
|
+
scenarios for axe-core on that host, or compiles only those scenarios when nothing
|
|
449
452
|
else needs previews. Core-only acceptance does not build the whole graph. Remove `build:mcp-previews`
|
|
450
453
|
from `acceptance.checks`; keep that script in the ordinary project build.
|
|
451
454
|
See the [editing contract](MCP.md#guarded-editing) for unit ownership,
|
|
@@ -480,6 +483,187 @@ component tests, and browser comparisons. Register component-specific guards as
|
|
|
480
483
|
explicit project scripts; include them in builds and `acceptance.checks` when
|
|
481
484
|
required. `ads check` does not invoke project linter plugins.
|
|
482
485
|
|
|
486
|
+
### Checks and guards
|
|
487
|
+
|
|
488
|
+
Every finding has one of three kinds, and no setting changes a finding's kind:
|
|
489
|
+
|
|
490
|
+
- **Error**: fails `ads check`, `ads audit`, `ads validate` and MCP acceptance.
|
|
491
|
+
- **Review**: shown, never blocks; it names something only a person can judge.
|
|
492
|
+
- **Info**: notes an analysis limit, such as a color `token-contrast` cannot resolve
|
|
493
|
+
statically.
|
|
494
|
+
|
|
495
|
+
There is no warning level.
|
|
496
|
+
|
|
497
|
+
**Gates.**
|
|
498
|
+
|
|
499
|
+
| Gate | What runs |
|
|
500
|
+
|---|---|
|
|
501
|
+
| `ads check` | Static token, theme, brand, accessibility, ownership, import and coverage rules; no browser |
|
|
502
|
+
| `ads audit` | axe-core (WCAG A/AA rules), ADS's non-text contrast check, `layout-shift` and `layout-overflow` at 390, 768 and 1280 px in every component, pattern and composition scenario, once per brand and theme |
|
|
503
|
+
| `ads validate` | The validation policy: `ads check` rules, `validation.checks` scripts, current previews, registered behavior checks (`validation.behaviorChecks`, default `true`) and the browser audit |
|
|
504
|
+
| `ads validate --policy acceptance` | The acceptance policy against current source, applying nothing: `ads check` rules, `acceptance.checks` scripts, affected behavior checks when `acceptance.behaviorChecks` is `true` (default `false`) and the browser audit |
|
|
505
|
+
| MCP acceptance | `ads_accept`, `ads_apply_patch` and `ads_apply_transaction` run the acceptance policy on an isolated candidate and write no source unless it passes; the audit covers the candidate's affected UI scenarios (all of them after configuration, foundation, token or asset changes) |
|
|
506
|
+
|
|
507
|
+
**Browser audit.** Both policies run it by default. Each `a11y-axe`,
|
|
508
|
+
`a11y-non-text-contrast`, `layout-overflow` and `layout-shift` finding is an error that fails the policy, and an audit that cannot run fails it with a `browser-audit` error
|
|
509
|
+
naming what to install. The audit needs the project's Playwright and a browser:
|
|
510
|
+
|
|
511
|
+
```sh
|
|
512
|
+
npm install -D @playwright/test # ads create and ads init declare it
|
|
513
|
+
npx playwright install chromium # Bun: bunx playwright install chromium
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
`mcp.capture` selects `browser` (`chromium`, `firefox`, `webkit`), an installed Chrome
|
|
517
|
+
`channel` such as `"chrome"`, and `timeoutMs`. To turn the audit off for a policy, set
|
|
518
|
+
`browserAudit` to `false` in `ds.config.json`:
|
|
519
|
+
|
|
520
|
+
```json
|
|
521
|
+
{
|
|
522
|
+
"acceptance": { "checks": [], "behaviorChecks": false, "browserAudit": false },
|
|
523
|
+
"validation": { "checks": [], "behaviorChecks": true, "browserAudit": false }
|
|
524
|
+
}
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
Declare `"sideEffects": ["**/*.css"]` in `package.json`, as the starters do, so a
|
|
528
|
+
component change audits only the scenarios that import it.
|
|
529
|
+
|
|
530
|
+
A render that fails because the preview dropped or was slow is retried on its own, up to 3
|
|
531
|
+
attempts, with a new browser and preview; the others keep their results, and findings never
|
|
532
|
+
cause a retry. The JSON result and the check list retried passes under `retries`, and `ads
|
|
533
|
+
audit` prints them. A scenario that still fails is a `browser-audit` error naming it and the
|
|
534
|
+
last cause, beside any findings. A project that fails validation stops the audit.
|
|
535
|
+
|
|
536
|
+
**Non-text contrast.** axe-core does not check WCAG 1.4.11, so the audit adds
|
|
537
|
+
`a11y-non-text-contrast` for every visible, enabled `button`, `input`, `select`, `textarea`,
|
|
538
|
+
`a[href]` and `switch`, `checkbox`, `radio`, `slider` and `tab` role in the rendered state:
|
|
539
|
+
|
|
540
|
+
- A control whose background has less than 3:1 against the background around it and that
|
|
541
|
+
has a visible border needs that border at 3:1 against the surrounding background. Use
|
|
542
|
+
`--border-strong` (or a stronger step) for a field or control outline; `--border-default`
|
|
543
|
+
is for dividers and card edges. A button, link or tab with text or an icon is exempt: that
|
|
544
|
+
content identifies it.
|
|
545
|
+
- An icon-only control (an `svg`, no text) needs the icon's stroke or fill at 3:1 against
|
|
546
|
+
the control's background. Paint icons with a text or `-fg` token.
|
|
547
|
+
|
|
548
|
+
Disabled and `aria-disabled="true"` controls, controls whose background has 3:1 against
|
|
549
|
+
their surroundings, browser-drawn native checkboxes, radios and ranges, and controls over a
|
|
550
|
+
background image are exempt. Each finding names the scenario, themes and brands, element
|
|
551
|
+
selectors and the lowest ratio. Hover and focus states are not rendered by the audit.
|
|
552
|
+
|
|
553
|
+
**Contrast.** `token-contrast` checks the role pairs that meet on screen in every theme and
|
|
554
|
+
brand: text, link, accent and status text on their backgrounds need 4.5:1; focus indicators
|
|
555
|
+
and control borders on canvas and surface need 3:1. It resolves every CSS color syntax,
|
|
556
|
+
including `oklch()` and `color-mix()`, and composites translucent colors over their
|
|
557
|
+
background and the canvas. A pair color it cannot resolve statically (`currentColor`,
|
|
558
|
+
relative color syntax) is a `token-contrast-unresolved` info item. Fix a failing pair by
|
|
559
|
+
choosing another ramp step.
|
|
560
|
+
|
|
561
|
+
`component-contrast` checks the pairs components and patterns make themselves. Where one
|
|
562
|
+
Linaria style block (the template's top level, a nested block such as `&:hover` or
|
|
563
|
+
`&[aria-selected="true"]`, or an at-rule) declares both `color: var(--a)` and
|
|
564
|
+
`background` or `background-color: var(--b)`, the pair needs 4.5:1 in every theme and brand,
|
|
565
|
+
resolved and composited as `token-contrast` resolves it. Local custom properties set in the
|
|
566
|
+
block or an enclosing block resolve one level; an undeclared one reads its `var()` fallback.
|
|
567
|
+
Fix it with the role contract: `--x-text` on
|
|
568
|
+
`--x-bg`, `--x-fg` on `--x` (not `--success` as text on `--success-bg`). Disabled states
|
|
569
|
+
(`:disabled`, `[disabled]`, `[aria-disabled="true"]`, `[data-disabled]`) are exempt;
|
|
570
|
+
`currentColor`, `inherit`, `transparent`, fully transparent backgrounds, one token on both
|
|
571
|
+
sides and native `<progress>`, `<meter>` and range parts are skipped. A side that names no
|
|
572
|
+
declared color token is a `component-contrast-unresolved` info item; so is text matching the
|
|
573
|
+
canvas (under 1.25:1) over a translucent background, which sits on another backdrop.
|
|
574
|
+
Pairs `token-contrast` checks are not repeated. A `color-contrast` audit finding that
|
|
575
|
+
neither static check reports comes from colors the block does not pair itself, such as text
|
|
576
|
+
inheriting its color onto a nested background.
|
|
577
|
+
|
|
578
|
+
**Static accessibility.** Errors: `a11y-target-size` (`--control-height-*` at least 24 px),
|
|
579
|
+
`a11y-focus` (`--focus-w` at least 2 px and a `:focus-visible` indicator in `base.css`),
|
|
580
|
+
`a11y-text-resize` (font sizes in `rem`), `a11y-reduced-motion` (every non-zero `--dur-*`
|
|
581
|
+
set to 0 under `prefers-reduced-motion`), `a11y-text-spacing` (`--leading-normal` at least
|
|
582
|
+
1.5, `--content-max` under 80 characters), `a11y-image-alt` and `a11y-icon-label`.
|
|
583
|
+
`a11y-keyboard` is a review item.
|
|
584
|
+
|
|
585
|
+
**Layout.** Widths are fluid on the grid.
|
|
586
|
+
|
|
587
|
+
`layout-fixed-width` (`ads check`) reads component, pattern and composition styles: `width`,
|
|
588
|
+
`min-width`, `max-width`, `inline-size`, `min-inline-size`, `max-inline-size`, `flex-basis`,
|
|
589
|
+
the basis of `flex`, and `grid-template-columns` tracks. Component variables declared in the
|
|
590
|
+
same template and `var()` fallbacks are read through.
|
|
591
|
+
|
|
592
|
+
| Value | Result |
|
|
593
|
+
|---|---|
|
|
594
|
+
| A fixed length above 48 px, raw, through a token or by arithmetic: `var(--space-32)` (64 px), `calc(var(--space-32) * 10)` | Error; 48 px is the top of the control-height and icon range |
|
|
595
|
+
| A flex item that grows and shrinks: `flex: 1 1 var(--space-80)` | Pass |
|
|
596
|
+
| `%`, `fr`, `ch`, `em`, `ex`, `lh`, viewport and container units, `auto`, `min-content`, `max-content`, `fit-content` | Pass |
|
|
597
|
+
| `min()`, `max()`, `clamp()` or `calc()` with a fluid part: `min(100%, var(--space-80))` | Pass |
|
|
598
|
+
| A `minmax()` track with a fluid maximum: `minmax(var(--space-80), 1fr)` | Pass |
|
|
599
|
+
| `--icon-*`, `--control-*`, `--avatar-*`, `--border-*`, `--focus-*`, `--ring-*`, `--radius-*`, `--side-pane-*`, `--toast-*`, `--navigation-rail-width`, `--app-header-height`, `--row-height-compact`, `--compact-column-min` | Pass: these size parts, not layouts |
|
|
600
|
+
| A token named by `layout.widthTokens` | Pass |
|
|
601
|
+
|
|
602
|
+
`layout` in `ds.config.json` has two fields:
|
|
603
|
+
|
|
604
|
+
```json
|
|
605
|
+
{ "layout": {
|
|
606
|
+
"widthTokens": ["--grid-span-*", "--container-*"],
|
|
607
|
+
"fixedWidthUnits": ["components/Overlays/*", "design-system/patterns/Menu/**"]
|
|
608
|
+
} }
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
- `widthTokens`: token names or globs. Each must be defined with `%` or container units; a
|
|
612
|
+
fixed definition is an error at the token. A fixed `--container-*` or `--content-max` token
|
|
613
|
+
is the exception, a cap valid only as `max-width` or `max-inline-size`.
|
|
614
|
+
- `fixedWidthUnits`: unit ids or project-relative file globs (`*` within a path segment, `**`
|
|
615
|
+
across them) that may use fixed widths. List overlays here: dialogs, menus, popovers and
|
|
616
|
+
tooltips. There is no per-declaration exception.
|
|
617
|
+
|
|
618
|
+
An entry that matches no token, unit or file is a `layout-config` error. The fix for a fixed
|
|
619
|
+
width: a `--grid-span-N` token in a container query, `%` or `fr`, or a `ch` measure for text
|
|
620
|
+
(`max-inline-size: 65ch`).
|
|
621
|
+
|
|
622
|
+
`layout-overflow` (browser audit) resizes each rendered scenario, in every theme and brand, to
|
|
623
|
+
390, 768 and 1280 px. Each finding names the scenario, widths, themes, brands and elements:
|
|
624
|
+
|
|
625
|
+
- The document scrolls horizontally.
|
|
626
|
+
- An element reaches past the viewport's edge; the outermost such element is named.
|
|
627
|
+
- An element with `overflow-x: hidden` or `clip` cuts off content more than 4 px wider.
|
|
628
|
+
|
|
629
|
+
Exempt: `overflow-x: auto` or `scroll` scrollers and their content, `text-overflow: ellipsis`,
|
|
630
|
+
carousels (`aria-roledescription="carousel"`), native text fields, fixed-position layers and visually hidden content.
|
|
631
|
+
|
|
632
|
+
**Web performance.** MCP serves this as `ads://guides/performance`.
|
|
633
|
+
|
|
634
|
+
| Rule | Gate | Fails |
|
|
635
|
+
|---|---|---|
|
|
636
|
+
| `img-attributes` | `ads check` | A raw `<img>` in components, patterns or compositions without `loading`, or without `width` and `height`, a visible `aspect-ratio`, a width and height in its style, or out-of-flow positioning. A `srcset` with width descriptors and no `sizes`, on `<img>` or the project's `Image`. A spread or a class from elsewhere is an `img-attributes-unresolved` info item |
|
|
637
|
+
| `asset-image-budget` | `ads check` | An image in `assets/` over its limit: SVG 100 KB, WebP and AVIF 300 KB, JPEG 400 KB, PNG and GIF 500 KB. `assets.imageBudgetKb` is one limit for every format |
|
|
638
|
+
| `layout-shift` | `ads audit` | A scenario with Cumulative Layout Shift above 0.1 on first render, where the browser reports it (Chromium) |
|
|
639
|
+
| `themes-generated` | `ads check` | A stale `tokens/fonts.preload.generated.ts` |
|
|
640
|
+
|
|
641
|
+
The starters' `Image` lazily loads and reserves space; `priority` marks the view's main visible
|
|
642
|
+
image. When body or heading text uses a font from `tokens/fonts.css`, `ads assets` writes
|
|
643
|
+
`tokens/fonts.preload.generated.ts`: call its `preloadFonts()` in the app entry before the first
|
|
644
|
+
render. It imports the files through the bundler, so the preload and the stylesheet share one URL.
|
|
645
|
+
ADS does not cover page metadata, `noindex`, sitemaps or hosting; run Lighthouse on a production
|
|
646
|
+
build with real URLs.
|
|
647
|
+
|
|
648
|
+
**Themes and brands.** Themed tokens are per-theme halves (`--x-light`, `--x-dark`) on
|
|
649
|
+
`:root`; brands set their own halves on `[data-brand]`. `ads assets` generates
|
|
650
|
+
`themes.generated.css` and `.ts`. Missing or conflicting halves, empty themes or brands,
|
|
651
|
+
stale generated files, `light-dark()` and `[data-theme]`/`[data-brand]` ancestor selectors
|
|
652
|
+
in components are errors; see [Tokens, grid, icons and accessibility](#tokens-grid-icons-and-accessibility).
|
|
653
|
+
|
|
654
|
+
**Tokens.** Ownership, naming, the 2 px spacing rhythm (`token-rhythm`), missing names and
|
|
655
|
+
scenario references are errors; equal values in different roles are a
|
|
656
|
+
`token-overlap-review` item.
|
|
657
|
+
|
|
658
|
+
**Architecture.** Data, UX and Skin ownership, project structure, unit and paint contracts,
|
|
659
|
+
and binding and variable ownership are errors; Linaria atomic composition risks are
|
|
660
|
+
`atomic-composition-review` items. See [Generic architecture guards](#generic-architecture-guards).
|
|
661
|
+
|
|
662
|
+
**Behavior.** A registered guarantee needs current passing execution evidence. `ads verify`
|
|
663
|
+
runs the registered checks against current source (`--unit` and `--check` select); the
|
|
664
|
+
validation policy runs all of them, the acceptance policy the affected ones when
|
|
665
|
+
`acceptance.behaviorChecks` is `true`.
|
|
666
|
+
|
|
483
667
|
## Showcase
|
|
484
668
|
|
|
485
669
|
ADS ships a minimal browser shell, MCP client and Apps host. `ads mcp` serves the
|
|
@@ -724,8 +908,11 @@ nothing. Commit outputs and the manifest together.
|
|
|
724
908
|
becomes `glyphAliases`. `ads assets` writes it and `ads check` fails when it is stale.
|
|
725
909
|
Other products' logos are not brand artwork or glyphs: keep them, in their own
|
|
726
910
|
colors and under their owners' trademark and usage terms, in `assets/logos/` and
|
|
727
|
-
show them as images
|
|
728
|
-
|
|
911
|
+
show them as images; ADS generates and checks nothing there. Never mute, tint or recolor
|
|
912
|
+
another product's logo. Use a one-color version only where its owner's published rules allow
|
|
913
|
+
it and in the colors they name; a CSS mask over a color token then keeps the shape and
|
|
914
|
+
follows the theme. A quieter version needs the owner's rule or written permission. Record each
|
|
915
|
+
file's source and rule in `assets/logos/README.md`.
|
|
729
916
|
|
|
730
917
|
### Tokens, grid, icons and accessibility
|
|
731
918
|
|
|
@@ -748,16 +935,17 @@ can judge: `atomic-composition-review`, `token-overlap-review`, `pointer-capture
|
|
|
748
935
|
changes a finding's kind. The showcase's grid button overlays the project's grid on every
|
|
749
936
|
preview, and its **Icons** tab shows the glyph set: every glyph at the size used beside
|
|
750
937
|
text, each one on its grid at every `--icon-*` size with its aliases and glyph errors, and
|
|
751
|
-
|
|
938
|
+
each file in `assets/logos/` as it is, on a white and a black tile.
|
|
752
939
|
|
|
753
940
|
`ads audit` adds a rendered check: axe-core (WCAG A/AA rules) in every component, pattern
|
|
754
941
|
and composition scenario, once per declared brand and theme (`--scenario`, `--theme` and
|
|
755
942
|
`--brand` narrow it). Each violation is an `a11y-axe` error naming the axe rule, WCAG
|
|
756
943
|
criterion, themes and brands, failing elements and help link, and `ads audit` exits 1. It
|
|
757
|
-
needs the project's Playwright and browser, as captures do
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
writing source, and an `a11y-axe` error rejects
|
|
944
|
+
needs the project's Playwright and browser, as captures do. The validation and acceptance
|
|
945
|
+
policies run it too unless their `browserAudit` is `false`; MCP draft acceptance and
|
|
946
|
+
guarded patches audit the candidate's affected scenarios before
|
|
947
|
+
writing source, and an `a11y-axe`, `a11y-non-text-contrast` or `layout-overflow` error rejects
|
|
948
|
+
the change.
|
|
761
949
|
`ads tokens --format dtcg` exports the tokens as W3C Design Tokens JSON for design tools
|
|
762
950
|
(`--theme <name>` and `--brand <name>` select one context).
|
|
763
951
|
|
|
@@ -973,7 +1161,9 @@ inspection errors fail the check. These guards read files and never delete them.
|
|
|
973
1161
|
|
|
974
1162
|
## Configuration and component rules
|
|
975
1163
|
|
|
976
|
-
`ds.config.json` uses schema version 1.
|
|
1164
|
+
`ds.config.json` uses schema version 1. A subfolder with its own `ds.config.json` is a separate
|
|
1165
|
+
project: check, validation, audits, previews and watches stop there and run in it on their own.
|
|
1166
|
+
Paths stay within the receiving project:
|
|
977
1167
|
|
|
978
1168
|
```json
|
|
979
1169
|
{
|
|
@@ -987,10 +1177,14 @@ inspection errors fail the check. These guards read files and never delete them.
|
|
|
987
1177
|
"tokenDir": "tokens",
|
|
988
1178
|
"themes": [{ "name": "light", "scheme": "light" }, { "name": "dark", "scheme": "dark" }],
|
|
989
1179
|
"inlineStyleFiles": [],
|
|
1180
|
+
"layout": { "widthTokens": [], "fixedWidthUnits": [] },
|
|
990
1181
|
"oxlint": { "plugins": [], "rules": {} }
|
|
991
1182
|
}
|
|
992
1183
|
```
|
|
993
1184
|
|
|
1185
|
+
`layout` declares allowed width tokens and owners with fixed widths; see
|
|
1186
|
+
[Checks and guards](#checks-and-guards).
|
|
1187
|
+
|
|
994
1188
|
These source-layout defaults apply when the file is absent; the example omits
|
|
995
1189
|
the required init-time framework choice. Run `ads init --framework react` (or
|
|
996
1190
|
`preact`) to save it. To use another layout, write this configuration before init. Configure TypeScript and the app bundler to resolve
|
package/docs/MCP.md
CHANGED
|
@@ -96,9 +96,10 @@ is explicitly `previewOnly`, not behavioral or acceptance evidence.
|
|
|
96
96
|
|
|
97
97
|
`ads_accept({id,revision})` validates and applies the exact reviewed revision in
|
|
98
98
|
one operation. Architecture, configured project commands and affected
|
|
99
|
-
behavior checks remain mandatory.
|
|
99
|
+
behavior checks remain mandatory. Unless `acceptance.browserAudit` is false, axe-core
|
|
100
100
|
also renders the candidate's affected UI scenarios in every declared brand and
|
|
101
|
-
theme
|
|
101
|
+
theme, with the non-text contrast and overflow checks; any `a11y-axe`,
|
|
102
|
+
`a11y-non-text-contrast` or `layout-overflow` error rejects acceptance. Edits during checking and baseline conflicts
|
|
102
103
|
prevent application; failures retain the draft and return execution evidence.
|
|
103
104
|
Successful acceptance removes draft source, records an event and resolves draft
|
|
104
105
|
dependencies in remaining proposals. Accept dependencies first and review their
|
|
@@ -571,7 +572,7 @@ contracts do not register token namespaces or independent value sheets. Read
|
|
|
571
572
|
`ads://guides/tokens` for state mappings, color roles, the grid, contrast/rhythm/overlap
|
|
572
573
|
reviews and the token export; `ads://guides/branding` for brand artwork, web icons,
|
|
573
574
|
committed targets and glyph sets; `ads://guides/accessibility` for the WCAG 2.2 AA
|
|
574
|
-
guards (`token-contrast`, `a11y-*`) and the practice no tool can check.
|
|
575
|
+
guards (`token-contrast`, `component-contrast`, `a11y-*`) and the practice no tool can check.
|
|
575
576
|
|
|
576
577
|
The `tokens` manifest also returns `companionFiles` with the configured foundation
|
|
577
578
|
entry path. When creating or deleting a canonical token foundation file, include
|
|
@@ -676,7 +677,7 @@ freshness and owner paths and returns a `patchFile`; it changes no live source.
|
|
|
676
677
|
Pass that `patchFile` to `ads_apply_patch` with `dryRun:true` to validate before
|
|
677
678
|
applying. This runs the normal candidate gates, including affected registered
|
|
678
679
|
behavior checks against an isolated candidate and its configured browser preview
|
|
679
|
-
and,
|
|
680
|
+
and, unless `acceptance.browserAudit` is false, the candidate accessibility audit.
|
|
680
681
|
It writes no live source and does not persist passing evidence for live inputs.
|
|
681
682
|
Read the summary, then use its `resultId` with `ads_results` for failing
|
|
682
683
|
`outcomes`, `diagnostics` or named pipeline `checks`; update the draft, diff again
|
|
@@ -710,7 +711,7 @@ It accepts 2–64 distinct owners, at most 256 distinct files and 16 MiB of comb
|
|
|
710
711
|
Git diff text. Each patch obeys its own ownership/companion rules. Patches apply
|
|
711
712
|
in order inside one candidate; shared-entry hunks in a later patch must match
|
|
712
713
|
the earlier candidate's content. Core checks, configured project commands,
|
|
713
|
-
all affected behavior checks and,
|
|
714
|
+
all affected behavior checks and, unless `acceptance.browserAudit` is false, the
|
|
714
715
|
accessibility audit run against the final candidate. No intermediate
|
|
715
716
|
candidate is published. Dry runs, failures, conflicts and cancellation write no
|
|
716
717
|
source; a publication failure rolls back prior writes. This coordinates owned
|
|
@@ -1423,13 +1424,16 @@ scenario's failure. A retained earlier view is not current-source evidence.
|
|
|
1423
1424
|
it checks the acceptance policy against current source without applying anything.
|
|
1424
1425
|
Validation and acceptance keep separate baselines; acceptance cannot establish
|
|
1425
1426
|
full validation. Each policy chooses `checks`, `behaviorChecks` and `browserAudit` (the
|
|
1426
|
-
axe-core audit of every UI scenario in every brand and theme
|
|
1427
|
-
errors); skipped tests are reported as skipped, without a passing label. Draft preview/edit triggers
|
|
1427
|
+
axe-core audit of every UI scenario in every brand and theme, on by default and turned off
|
|
1428
|
+
with `false`; its `a11y-axe`, `a11y-non-text-contrast` and `layout-overflow` findings are errors); skipped tests are reported as skipped, without a passing label. Draft preview/edit triggers
|
|
1428
1429
|
neither policy. Draft acceptance, `ads_apply_patch` and `ads_apply_transaction` run
|
|
1429
|
-
the acceptance policy on their candidate:
|
|
1430
|
+
the acceptance policy on their candidate: unless `acceptance.browserAudit` is false they audit
|
|
1430
1431
|
the candidate's affected UI scenarios (all of them after configuration, foundation,
|
|
1431
|
-
token or asset changes) before writing source. Any `a11y-axe`
|
|
1432
|
-
|
|
1432
|
+
token or asset changes) before writing source. Any `a11y-axe`, `a11y-non-text-contrast` or
|
|
1433
|
+
`layout-overflow` error, a scenario that fails all 3 attempts (`browser-audit`, naming it and the
|
|
1434
|
+
last cause, with retried passes listed under `retries`), or an audit that
|
|
1435
|
+
cannot run (`browser-audit`: no project Playwright or browser; the message names what to
|
|
1436
|
+
install), rejects the change; findings are in `diagnostics` and the
|
|
1433
1437
|
`browser-accessibility-audit` check lists the audited scenarios, themes, brands and
|
|
1434
1438
|
timing. Explicit `ads_verify` remains independent of gating choices. The MCP tool
|
|
1435
1439
|
runs trusted configured project commands with cancellation and bounded output; it
|