@uselazuli/cli 1.0.2 → 1.0.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 (36) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +4 -4
  3. package/bin/lazuli.mjs +4 -2
  4. package/package.json +1 -1
  5. package/rules/content/HYPOTHESES.md +2 -2
  6. package/rules/content/review.yaml +2 -2
  7. package/rules/graphic/HYPOTHESES.md +1 -1
  8. package/rules/graphic/review.yaml +3 -3
  9. package/rules/ui/HYPOTHESES.md +2 -2
  10. package/rules/ui/compose.yaml +1 -1
  11. package/rules/ui/review.yaml +2 -2
  12. package/skills/lazuli/SKILL.md +4 -4
  13. package/skills/lazuli/procedures/show-options.md +1 -1
  14. package/skills/lazuli-content-interface-writing/SKILL.md +1 -1
  15. package/skills/lazuli-ui-layout-review/SKILL.md +1 -1
  16. package/src/commands/capture.mjs +1 -1
  17. package/src/commands/catalog.mjs +1 -1
  18. package/src/commands/check-design.mjs +15 -5
  19. package/src/commands/compare-designs.mjs +12 -8
  20. package/src/commands/draft-memo.mjs +3 -0
  21. package/src/commands/record-log.mjs +33 -0
  22. package/src/commands/render-options.mjs +5 -2
  23. package/src/measure/cases.mjs +5 -3
  24. package/src/measure/in-page/a11y.js +54 -3
  25. package/src/measure/in-page/composition.js +10 -3
  26. package/src/measure/in-page/extreme.js +20 -9
  27. package/src/measure/layout.mjs +12 -3
  28. package/src/measure/rhythm.mjs +8 -0
  29. package/src/project/lazuli-md.mjs +8 -2
  30. package/src/project/log.mjs +2 -2
  31. package/src/project/match.mjs +11 -2
  32. package/src/report/evaluators/a11y.mjs +4 -1
  33. package/src/report/evaluators/color.mjs +32 -3
  34. package/src/report/evaluators/extreme.mjs +5 -3
  35. package/src/report/evaluators/rhythm.mjs +1 -1
  36. package/templates/LAZULI.md +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.3
4
+
5
+ ### Added
6
+
7
+ - Break status `superseded`: `record-break --status superseded` marks a break whose piece or break no longer exists as written; nothing is claimed about its effect. `draft-memo` and the review packet leave superseded breaks out, and `LAZULI.md` reports a live break whose piece matches no goal.
8
+ - GR10: when the first view holds no Brand color, the hint names colors of a Brand color's hue at another lightness or chroma. The cutoffs are `maxHueDeg` 30 and `minChroma` 10, both hypotheses.
9
+
10
+ ### Fixed
11
+
12
+ - `check-design` reads a file covered by an options goal by its data-block marks, as `render-options` does, and says so in a note. The options sheet names the UR3 pair it compared.
13
+ - UR5 gives no finding on a file covered only by an options goal with no Rhythm line, and a note says why.
14
+ - A declared UC1 bleed is read on any text past the edge at rest, decorative (`aria-hidden`) text included. A page with no such text, or a page that scrolls sideways at rest, says so.
15
+ - CR14 names each recolored image by its alt text or file name, and reads filters at any nesting.
16
+ - `check-design --out` writes the text report to a `.txt` name.
17
+ - `compare-designs` and `render-options` call the distance a structure distance, list options from low to high, and say it does not read color, typefaces, images or texture.
18
+ - An unapplied break on a move is matched by its piece, and says when the move is not on the page.
19
+
3
20
  ## 1.0.2
4
21
 
5
22
  ### Added
package/README.md CHANGED
@@ -8,7 +8,7 @@ A design kit for AI agents. Lazuli turns design knowledge into rules an agent ca
8
8
 
9
9
  ## Status
10
10
 
11
- Version 1.0.2. Nine areas are available: color, typography, accessibility, UI, UX, graphic design, motion, content and data.
11
+ Version 1.0.3. Nine areas are available: color, typography, accessibility, UI, UX, graphic design, motion, content and data.
12
12
 
13
13
  Every rule that uses a number says where the number comes from: it is a norm (a standard such as WCAG) or a hypothesis, labeled with its id in that area's `HYPOTHESES.md`. A hypothesis is a claim to test with people, and the report shows it as a hint, never as a failure.
14
14
 
@@ -37,7 +37,7 @@ Write `delegate` under `## Mode` in `LAZULI.md`. The agent then makes the design
37
37
 
38
38
  What you get on your side:
39
39
 
40
- - `check-design <file-or-url>` opens the page in a real browser and reports what it found, rule by rule. Exit code 0 means no failures, 1 means at least one failure (or a required check that could not run), 2 means bad usage, a missing file or no browser. `--json` gives machine output for scripts and CI; `--out <file>` also writes the report to a file you name.
40
+ - `check-design <file-or-url>` opens the page in a real browser and reports what it found, rule by rule. Exit code 0 means no failures, 1 means at least one failure (or a required check that could not run), 2 means bad usage, a missing file or no browser. `--json` gives machine output for scripts and CI; `--out <file>` also writes the report to a file you name (the text report for a `.txt` name, JSON otherwise).
41
41
  - The post-edit hook (`install-hooks`, opt-in) runs `check-design` after the agent edits an HTML or CSS file and hands it a short list of failures to fix, so problems are caught while the agent works.
42
42
  - `check-goals` is the gate before delivery. It exits 0 only when every goal tied to a page was judged met and approved by a separate reviewer and no rule break on it is still being tried. In delegate mode the end-of-turn hook asks the agent, once, to close that gate before it finishes.
43
43
 
@@ -102,7 +102,7 @@ Available now:
102
102
  | `/lazuli remember-this` | Turns a correction into a rule in `.lazuli/rules/learned.yaml`, with a condition and a test. |
103
103
  | `/lazuli explain-decisions` | Runs `draft-memo`, then writes `DECISIONS.md` for the client and updates `DESIGN.md`. |
104
104
 
105
- Agent helpers, which the procedures above call through the CLI (they are not slash commands): `list-rules`, `record-break`, `record-decision`, `capture`, `record-first-look`, `record-review`, `check-goals`, `draft-memo`, `render-options` (`--height` sets the viewport height, `--screens` shows the first screens of each option on the sheet, `--baseline` adds each option's distance from a page), `compare-designs` (`--options <folder>` places a folder of options from near to far), `map-page`, `record-task`. Run `lazuli --help` for what each one does, or `lazuli <command> --help` for one command's options (from a checkout, `node bin/lazuli.mjs <command> --help`).
105
+ Agent helpers, which the procedures above call through the CLI (they are not slash commands): `list-rules`, `record-break`, `record-decision`, `capture`, `record-first-look`, `record-review`, `check-goals`, `draft-memo`, `render-options` (`--height` sets the viewport height, `--screens` shows the first screens of each option on the sheet, `--baseline` adds each option's structure distance from a page), `compare-designs` (`--options <folder>` lists a folder of options by structure distance, low to high; it reads layout structure only, not color, typefaces, images or texture), `map-page`, `record-task`. Run `lazuli --help` for what each one does, or `lazuli <command> --help` for one command's options (from a checkout, `node bin/lazuli.mjs <command> --help`).
106
106
 
107
107
  Examples:
108
108
 
@@ -130,7 +130,7 @@ node bin/lazuli.mjs check-design ./index.html
130
130
  - Feel: safe
131
131
  - Do: finish the payment
132
132
  ```
133
- - **Your breaks.** A break is logged under `## Breaks` with `Rule`, `Piece`, `Effect`, `Check` and `Status` (`trying`, `kept` or `reverted`). When its `Piece` is a goal of the checked page, a fail or hint of that rule is reported as a `break` with the declared effect. A `reverted` break changes nothing. `record-break` sets a break to `kept` only when a review of its piece is recorded on a capture taken after the break was last set, so the separate reviewer, not the builder, has seen the declared effect.
133
+ - **Your breaks.** A break is logged under `## Breaks` with `Rule`, `Piece`, `Effect`, `Check` and `Status` (`trying`, `kept`, `reverted` or `superseded`). When its `Piece` is a goal of the checked page, a fail or hint of that rule is reported as a `break` with the declared effect. A `reverted` or `superseded` break changes nothing; `superseded` retires a break whose piece or break no longer exists as written. `record-break` sets a break to `kept` only when a review of its piece is recorded on a capture taken after the break was last set, so the separate reviewer, not the builder, has seen the declared effect.
134
134
  - **Norms are never waived.** A rule with `origin: norm` (a standard such as WCAG) keeps its fail even when a break is declared on it, and the report says the break was not applied.
135
135
  - **Hypotheses are hints.** A finding from a hypothesis rule is at most a hint and carries a label such as `(hypothesis H1, color)`, the id in that area's `HYPOTHESES.md` and the area.
136
136
 
package/bin/lazuli.mjs CHANGED
@@ -11,7 +11,7 @@ import { recordFirstLook, recordReview } from "../src/commands/record-answers.mj
11
11
  import { checkGoals, formatGate } from "../src/commands/check-goals.mjs";
12
12
  import { draftMemo } from "../src/commands/draft-memo.mjs";
13
13
  import { droppedLine, optionLabel, renderOptions, screensNote } from "../src/commands/render-options.mjs";
14
- import { compareDesigns, compareOptions, formatCompare, formatCompareOptions } from "../src/commands/compare-designs.mjs";
14
+ import { STRUCTURE_READS, compareDesigns, compareOptions, formatCompare, formatCompareOptions } from "../src/commands/compare-designs.mjs";
15
15
  import { mapPage } from "../src/commands/map-page.mjs";
16
16
  import { recordTaskStep } from "../src/commands/record-task.mjs";
17
17
  import { handlePostEdit, handleStop } from "../src/commands/hooks.mjs";
@@ -26,6 +26,7 @@ const USAGE = {
26
26
  "check-design": [
27
27
  "Usage: lazuli check-design <url-or-path> [<more screens>...] [--site] [--width 1440,390] [--height <px>] [--area color,typography] [--json] [--out <file>]",
28
28
  " lazuli check-design --asset <file-or-url> [--size 1200x630] [--area graphic] [--json] [--out <file>]",
29
+ "--out <file> writes the text report to a .txt name and the JSON otherwise.",
29
30
  ],
30
31
  capture: ["Usage: lazuli capture <url-or-path> [--width 1440,390]"],
31
32
  "check-goals": ["Usage: lazuli check-goals [<url-or-path>]"],
@@ -35,7 +36,7 @@ const USAGE = {
35
36
  "compare-designs": ["Usage: lazuli compare-designs <url-or-path> --baseline <url-or-path> [--width 1440,390] [--json]", " lazuli compare-designs --options <folder> --baseline <url-or-path> [--width 1440] [--height <px>] [--json]"],
36
37
  "map-page": ["Usage: lazuli map-page <url-or-path> --piece <name> [--width 390]", " lazuli map-page --task <id> [<url-or-path>]"],
37
38
  "record-task": ["Usage: lazuli record-task --file <json>"],
38
- "record-break": ["Usage: lazuli record-break --rule <id>[,<id>...] --piece <name> [--target <path>] [--effect <text>] [--check <text>] --status trying|kept|reverted"],
39
+ "record-break": ["Usage: lazuli record-break --rule <id>[,<id>...] --piece <name> [--target <path>] [--effect <text>] [--check <text>] --status trying|kept|reverted|superseded"],
39
40
  "record-decision": ['Usage: lazuli record-decision --decision <text> --piece <name> [--target <path>] --goal <text> --rule "<id> followed|broken|accepted|none" --measure <text>'],
40
41
  "record-first-look": ["Usage: lazuli record-first-look --file <json>"],
41
42
  "record-review": ["Usage: lazuli record-review --file <json>"],
@@ -525,6 +526,7 @@ async function main(argv) {
525
526
  for (const o of r.options) {
526
527
  lines.push(`${o.file} ${r.widths.map((w) => `${w}: ${optionLabel(o.measures[String(w)], o.findings.filter((f) => f.width === w), o.notes?.[String(w)], screensNote(r.screensAt?.[String(w)] ?? r.screens, r.height), o.distances?.[String(w)]).join("; ")}`).join(" | ")}`);
527
528
  }
529
+ if (r.options.some((o) => o.distances && Object.keys(o.distances).length > 0)) lines.push(STRUCTURE_READS);
528
530
  if (r.kept?.length) lines.push(...r.kept.map((w) => `Kept the earlier measures at ${w} px.`));
529
531
  if (r.dropped?.length) lines.push(...r.dropped.map((w) => droppedLine(r, w)));
530
532
  if (r.missingSheets?.length) lines.push(...r.missingSheets.map((w) => `The earlier sheet at ${w} px is missing; run that width again.`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uselazuli/cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "bin": { "lazuli": "bin/lazuli.mjs" },
6
6
  "files": ["bin/", "src/", "rules/", "skills/", "agents/", "templates/", "CHANGELOG.md"],
@@ -12,8 +12,8 @@ Where a row or a rule cites the kit author's internal product plan, that plan is
12
12
  | H4 | CW4 and CR4 (an error message says what went wrong, on which field, and how to fix it) | Our claim, a hint only; no number is used as a cutoff. A visible error message is listed when its normalized text is one of the generic-error phrases of CR4, when it is a code alone, or when it is tied to a field and does not name it. How it was picked: the phrase list is rule data, our claim, fixed before any page was read. What counts as naming the field: the message and the field's label share a folded word (lowercase, accents removed) of MIN_WORD_LETTERS letters or more. Limits: only messages shown on this render are read, since the CLI never submits a form; the fix part is read by the reviewer, not by the CLI; a message that names the field with a synonym is missed; text the composition walk does not keep (inside a clipping parent that is not its containing block, below an app shell's scroll area) is not read. Observed so far, not evidence: errors.html at 1440 px: 4 of 5 messages say too little ("Invalid" a generic phrase, "ERR_422" a code alone, the date message does not name its field, the alert "Something went wrong" a generic phrase); "Enter your full name" names its field; the hidden template and the sr-only error are not read; no-errors.html, no message and the staged-error note. | Needs error messages outside the test fixtures that people from the audience could or could not act on, checked against the list and the field-name match before they are applied |
13
13
  | H5 | CW2 and CR5 (one destination, one name) | Our claim, a hint only; no number is used as a cutoff. A destination is listed when links to it in navigation regions (NAV_REGIONS) carry two names across the screens checked. How it was picked: no value to pick; what one destination is was fixed before any page was measured: names are compared as folded word sequences, and one name inside another is the same name ("Contact" and "Contact us"). Limits: navigation regions only; a destination reached through a redirect or a query is another destination; a link named only by an image or a label (a logo link) is not a name, but a logo written as text is, so a text wordmark and a "Home" link to one page read as two names; a closed drawer or a sheet moved off the page is not read; it runs only when check-design gets two or more screens. Observed so far, not evidence: terms-a.html and terms-b.html at 1440 px: 1 destination named two ways (pricing.html); terms-home-a.html and terms-home-b.html, 1 destination named two ways ("Contact" and "Get in touch" to the fragment #contact), while "Home" keeps one name; terms-pt-a.html and terms-pt-b.html, no destination linked more than once, so names were not compared. | Needs products outside the test fixtures whose owners say which pairs of names are one thing, checked against the pairs listed before the reading is applied |
14
14
  | H6 | CW2 and CR6 (one term, one spelling) | Our claim, a hint only; no number is used as a cutoff. A term is listed when it is written two ways across the screens checked. How it was picked: no value to pick; the comparison was fixed before any page was measured: spellings are compared with separators (space, hyphen, period) removed and accents and apostrophes kept (a curly apostrophe reads as a straight one), so "E-mail" and "Email", "Log in" and "Login" are one term written two ways, while "você" and "voce", "it's" and "its" are not merged. Limits: "a gente" and "agente", "por que" and "porque", "se não" and "senão" read as one key; digits are not words, so "1.000" and "1000" never form a term; it runs only when check-design gets two or more screens. Observed so far, not evidence: terms-a.html and terms-b.html at 1440 px: 2 terms written two ways ("log in" and "login", "e-mail" and "email"); terms-pt-a.html and terms-pt-b.html, 1 ("bem-vindo" and "bem vindo"), with "1.000" and "1000" not listed; terms-apos-a.html and terms-apos-b.html, 1 ("e-mail" and "email"), with "it's" and "its" not listed. | Needs products outside the test fixtures whose owners mark which listed pairs are the same term, checked before the reading is applied; the accent and separator misreads are counted apart |
15
- | H7 | CW7 and CR7 (text that grows does not break the layout) | Cutoff: growth 1.3. How it was picked: a round starting value, our claim, set before any page was measured, standing for Portuguese or another language taking more room than English (the kit author's internal product plan: Portuguese takes more room than English). Related reading, opened on 2026-11-26, never moves it, even where it gives larger factors for short strings: W3C Internationalization, Text size in translation, https://www.w3.org/International/articles/article-text-size.en gives a table of average expansion from English to European languages that is larger the shorter the source text. What is done: on a script-free copy of the page, every visible text node grows to at least 1.3 times its length with GROWTH_FILL words, and only the spills, cuts and overlaps the case adds over the untouched copy are reported. Limits: real translations grow unevenly, short labels most; the reverse direction, Portuguese to English, is not read; text the composition walk does not keep (a box under a clipping parent that is not its containing block, content below an app shell's scroll area) is not tested. Inline elements moved by position relative or negative margins inside one block are never compared for overlap (texts that share one block container never form a pair); text hidden from assistive technology (aria-hidden) is neither changed nor read; for overlap, each line box is clamped to its computed line-height, so texts of two blocks that touch only through tight leading are not reported; a visible layer behind the text can form overlap pairs when the text grows over it. Each element that breaks is one evidence line, marked when its box already crossed the left or right edge of the viewport at rest on a page that does not scroll sideways, and a declared UC1 makes the hint declared only when every such element bleeds at rest. A page whose html or body hides horizontal overflow does not scroll: there the case says how much further text runs past the clipped right edge, and names only texts newly past the right edge or further past it than at rest. Observed so far, not evidence: clean.html, fixed-card.html, overlap.html, many-cut.html, nowrap-nav.html, already-broken.html and tight-heading.html pass at 1440 and 390 px; split-words.html, split-words-flex.html (a heading of word boxes at line-height 0.9) and ghost.html (an aria-hidden ghost word) pass at 1440 px; list-clip.html passes at 1440 px and adds 1 text that spills out of its box at 390 px. Each width took from 1.2 to 2.0 s on these fixtures on this machine. | Needs translated versions of real pages, checked for breaks against what the growth case predicted before the factor is applied; then compare neighboring factors on how many real breaks each predicts |
16
- | H8 | CW7 and CR8 (long Portuguese text breaks nothing) | Our claim, a hint only; no number is used as a cutoff. How it was picked: no value to pick; the three fixed samples were written before any page was measured: LONG_LABEL goes into labels (LABEL_SCOPE), LONG_HEADING into headings (HEADING_SCOPE), and LONG_TEXT, which holds one very long dictionary word, into the other text. Limits: inputs and placeholders are not filled; text drawn in images, canvas or SVG is not read; a closed drawer or a sheet moved off the page is not read; text the composition walk does not keep (a box under a clipping parent that is not its containing block, content below an app shell's scroll area) is not tested. Inline elements moved by position relative or negative margins inside one block are never compared for overlap (texts that share one block container never form a pair); text hidden from assistive technology (aria-hidden) is neither changed nor read; for overlap, each line box is clamped to its computed line-height, so texts of two blocks that touch only through tight leading are not reported; a visible layer behind the text can form overlap pairs when the text grows over it; absolutely positioned labels that receive long text overlap every neighbour they reach, and those pairs are true by definition; text in a fixed or sticky box can form pairs with the text that moves under it. Each element that breaks is one evidence line, marked when its box already crossed the left or right edge of the viewport at rest on a page that does not scroll sideways, and a declared UC1 makes the hint declared only when every such element bleeds at rest. A page whose html or body hides horizontal overflow does not scroll: there the case says how much further text runs past the clipped right edge, and names only texts newly past the right edge or further past it than at rest. Observed so far, not evidence: fixed-card.html at 1440 and 390 px: 1 text cut and 1 cut away entirely (the link); overlap.html, 1 text cut and 1 pair of texts overlapping; nowrap-nav.html, the page scrolls sideways by 585 px at 1440 and 1635 px at 390; already-broken.html, 2 pairs of texts overlapping that the case adds; tight-heading.html and clean.html pass; split-words.html, split-words-flex.html and ghost.html pass at 1440 px. | Needs real Portuguese content of the audience's products, checked for breaks against what the long-text case predicted before the samples are applied |
15
+ | H7 | CW7 and CR7 (text that grows does not break the layout) | Cutoff: growth 1.3. How it was picked: a round starting value, our claim, set before any page was measured, standing for Portuguese or another language taking more room than English (the kit author's internal product plan: Portuguese takes more room than English). Related reading, opened on 2026-11-26, never moves it, even where it gives larger factors for short strings: W3C Internationalization, Text size in translation, https://www.w3.org/International/articles/article-text-size.en gives a table of average expansion from English to European languages that is larger the shorter the source text. What is done: on a script-free copy of the page, every visible text node grows to at least 1.3 times its length with GROWTH_FILL words, and only the spills, cuts and overlaps the case adds over the untouched copy are reported. Limits: real translations grow unevenly, short labels most; the reverse direction, Portuguese to English, is not read; text the composition walk does not keep (a box under a clipping parent that is not its containing block, content below an app shell's scroll area) is not tested. Inline elements moved by position relative or negative margins inside one block are never compared for overlap (texts that share one block container never form a pair); text hidden from assistive technology (aria-hidden) is never changed, and is read only for the UC1 count at rest; for overlap, each line box is clamped to its computed line-height, so texts of two blocks that touch only through tight leading are not reported; a visible layer behind the text can form overlap pairs when the text grows over it. Each element that breaks is one evidence line, marked when its box already crossed the left or right edge of the viewport at rest on a page that does not scroll sideways, and a declared UC1 makes the hint declared only when every such element bleeds at rest. With no text past the edge at rest, or on a page that scrolls sideways at rest, a declared UC1 leaves the hint saying the move is not on that page at that width. A page whose html or body hides horizontal overflow does not scroll: there the case says how much further text runs past the clipped right edge, and names only texts newly past the right edge or further past it than at rest. Observed so far, not evidence: clean.html, fixed-card.html, overlap.html, many-cut.html, nowrap-nav.html, already-broken.html and tight-heading.html pass at 1440 and 390 px; split-words.html, split-words-flex.html (a heading of word boxes at line-height 0.9) and ghost.html (an aria-hidden ghost word) pass at 1440 px; list-clip.html passes at 1440 px and adds 1 text that spills out of its box at 390 px. Each width took from 1.2 to 2.0 s on these fixtures on this machine. | Needs translated versions of real pages, checked for breaks against what the growth case predicted before the factor is applied; then compare neighboring factors on how many real breaks each predicts |
16
+ | H8 | CW7 and CR8 (long Portuguese text breaks nothing) | Our claim, a hint only; no number is used as a cutoff. How it was picked: no value to pick; the three fixed samples were written before any page was measured: LONG_LABEL goes into labels (LABEL_SCOPE), LONG_HEADING into headings (HEADING_SCOPE), and LONG_TEXT, which holds one very long dictionary word, into the other text. Limits: inputs and placeholders are not filled; text drawn in images, canvas or SVG is not read; a closed drawer or a sheet moved off the page is not read; text the composition walk does not keep (a box under a clipping parent that is not its containing block, content below an app shell's scroll area) is not tested. Inline elements moved by position relative or negative margins inside one block are never compared for overlap (texts that share one block container never form a pair); text hidden from assistive technology (aria-hidden) is never changed, and is read only for the UC1 count at rest; for overlap, each line box is clamped to its computed line-height, so texts of two blocks that touch only through tight leading are not reported; a visible layer behind the text can form overlap pairs when the text grows over it; absolutely positioned labels that receive long text overlap every neighbour they reach, and those pairs are true by definition; text in a fixed or sticky box can form pairs with the text that moves under it. Each element that breaks is one evidence line, marked when its box already crossed the left or right edge of the viewport at rest on a page that does not scroll sideways, and a declared UC1 makes the hint declared only when every such element bleeds at rest. With no text past the edge at rest, or on a page that scrolls sideways at rest, a declared UC1 leaves the hint saying the move is not on that page at that width. A page whose html or body hides horizontal overflow does not scroll: there the case says how much further text runs past the clipped right edge, and names only texts newly past the right edge or further past it than at rest. Observed so far, not evidence: fixed-card.html at 1440 and 390 px: 1 text cut and 1 cut away entirely (the link); overlap.html, 1 text cut and 1 pair of texts overlapping; nowrap-nav.html, the page scrolls sideways by 585 px at 1440 and 1635 px at 390; already-broken.html, 2 pairs of texts overlapping that the case adds; tight-heading.html and clean.html pass; split-words.html, split-words-flex.html and ghost.html pass at 1440 px. | Needs real Portuguese content of the audience's products, checked for breaks against what the long-text case predicted before the samples are applied |
17
17
  | H9 | CW8 and CR9 to CR11 (an empty list, one item and hundreds of items break nothing) | Our claim, a hint only; no number is used as a cutoff. How it was picked: no value to pick; how lists are found was fixed before any page was measured: LIST_SELECTOR plus repeated siblings, with lists inside navigation, menus, tab lists, selects and forms left out; MANY_ITEMS is the size of the hundreds case, not a cutoff. Limits: a list rendered by script shows no empty state in a script-free copy, so the app's own empty state is judged from a staged render; virtualized lists are not lists in the DOM; a carousel that already hides some items is not judged for cut items; a closed drawer or a sheet moved off the page is not read; a slow page may leave the list cases unchecked; text the composition walk does not keep (a box under a clipping parent that is not its containing block, content below an app shell's scroll area) is not tested. Inline elements moved by position relative or negative margins inside one block are never compared for overlap (texts that share one block container never form a pair); text hidden from assistive technology (aria-hidden) is neither changed nor read; for overlap, each line box is clamped to its computed line-height, so texts of two blocks that touch only through tight leading are not reported; a visible layer behind the text can form overlap pairs when the text grows over it; list items are block-level: a child whose computed display is inline, inline-block, inline-flex or inline-grid is never an item, so the inline word or letter spans of a heading are never a list (a flex or grid heading's word spans are blockified and can still be read as a list) and an inline chip row is not tested with many items. Observed so far, not evidence: clean.html at 1440 and 390 px: empty, one and many pass (1 list); list-clip.html at 1440 px: empty adds 1 pair of texts overlapping, one passes, many cuts away 2 texts (2 lists); many-cut.html, many cuts away 2 texts; nowrap-nav.html, many scrolls the page sideways by 14944 px (a nowrap row); split-words.html and split-letters.html (a heading of word or letter spans) find no list at 1440 px. | Needs real lists with no, one and many items from the audience's products, checked for breaks against what the cases predicted before the cases are applied |
18
18
  | H10 | CV2 and CR12 (text only this product could have) | Our claim, judged in words; no number is used as a cutoff. How it was picked: no value to pick; the swap test was fixed in advance from the award line of the kit author's internal product plan: a fresh agent that did not write the copy replaces the product name with a competitor's in each headline and lead sentence and lists the ones that still hold; the CLI never says copy has a voice. Limits: an agent's sense of "generic" is not a person's; a competitor the agent does not know cannot be swapped in. Observed so far, not evidence: nothing measured; judged in words by the reviewer. | Needs headlines outside the test fixtures that people from the audience call generic or specific, checked against the agent's swap test lists before the test is relied on |
19
19
  | H11 | CR14 (proof images keep the look of the original, a11y.image-treatment) | Our claim, judged in words after a measure picks the images; the list is our claim, not a cutoff. The filter functions read are grayscale, sepia, saturate, hue-rotate, invert, contrast, brightness and url (a url() filter points to an SVG filter that can recolor); drop-shadow and blur are not read, since they do not change the colors; a function at its identity value (grayscale(0), sepia(0), invert(0), saturate(1), contrast(1), brightness(1), hue-rotate(0deg)) leaves the colors as they are and is not counted. A blend counts when the image or an ancestor up to its nearest section, article or body has a mix-blend-mode other than normal. How it was picked: no value is picked from a page; the list was written before any page was read, from the functions of the CSS filter property that change color. Large means the AP6 size: visible img elements at least minSidePx on both sides. Limits: a treatment on a wrapper above the nearest section is not read; background images, svg, canvas and video are not read; a treatment applied by a script after load is read only if it is in place when the page is measured; whether an image is proof is not read, the reviewer says. Observed so far, not evidence: proof-duotone.html reads one portrait with grayscale, contrast and a multiply blend, and no treatment on an image with drop-shadow only, on a plain image, or under a filter set above its section; identity-filters.html reads no treatment on an image whose every function is at its identity value, sepia next to grayscale(0), and url on an SVG filter | Needs pages whose large images people sorted into proof and not proof, and pages where the same photo is shown with and without a treatment, to ask whether the treated version reads as staged; then compare the list with and without contrast and brightness, which only change tone |
@@ -188,7 +188,7 @@
188
188
  break_effect: >-
189
189
  Tighter boxes where the text cannot change, at the cost of a fix if it ever does.
190
190
  test: >-
191
- The cases run on a script-free copy of the page and report only what the case adds: at each width check-design loads the copy untouched and with every visible text grown, and compares them. Hint when the grown copy adds a sideways scroll, a text that spills out of its box, a text cut or cut away, or a pair of texts that overlap, naming each; pass when it adds none; nothing when the case did not run. Text the composition walk does not keep (a box under a clipping parent that is not its containing block, content below an app shell's scroll area) is never tested; inline elements moved by position relative or negative margins inside one block are never compared for overlap; text hidden from assistive technology (aria-hidden) is neither changed nor read; for overlap, each line box is clamped to its computed line-height, so texts of two blocks that touch only through tight leading are not reported; a visible layer behind the text can form overlap pairs when the text grows over it. What the case adds is grouped by element, one line each, marked (bleeds at rest) when its box already crossed the left or right edge of the viewport in the untouched copy, on a page that does not scroll sideways at rest (the gate of the layout bleeds); a page whose html or body hides horizontal overflow does not scroll, so there the case says how much further text runs past the clipped right edge instead of a sideways scroll; for either, the texts past the right edge that were not past it at rest, or run further past it, are named. With UC1 followed or broken for the piece, the hint becomes declared only when every element that breaks already bleeds at rest and a sideways scroll or text past the clipped right edge is named by one of them; otherwise it stays a hint and names the elements that do not bleed at rest; on a page where no text bleeds at rest the move is not measured.
191
+ The cases run on a script-free copy of the page and report only what the case adds: at each width check-design loads the copy untouched and with every visible text grown, and compares them. Hint when the grown copy adds a sideways scroll, a text that spills out of its box, a text cut or cut away, or a pair of texts that overlap, naming each; pass when it adds none; nothing when the case did not run. Text the composition walk does not keep (a box under a clipping parent that is not its containing block, content below an app shell's scroll area) is never tested; inline elements moved by position relative or negative margins inside one block are never compared for overlap; text hidden from assistive technology (aria-hidden) is never changed, and is read only for the UC1 count at rest; for overlap, each line box is clamped to its computed line-height, so texts of two blocks that touch only through tight leading are not reported; a visible layer behind the text can form overlap pairs when the text grows over it. What the case adds is grouped by element, one line each, marked (bleeds at rest) when its box already crossed the left or right edge of the viewport in the untouched copy, on a page that does not scroll sideways at rest (the gate of the layout bleeds); a page whose html or body hides horizontal overflow does not scroll, so there the case says how much further text runs past the clipped right edge instead of a sideways scroll; for either, the texts past the right edge that were not past it at rest, or run further past it, are named. With UC1 followed or broken for the piece, the hint becomes declared only when every element that breaks already bleeds at rest and a sideways scroll or text past the clipped right edge is named by one of them; otherwise it stays a hint and names the elements that do not bleed at rest; on a page where no text crosses the edge at rest, or that scrolls sideways at rest, the hint says the move is not on that page at that width.
192
192
  example: >-
193
193
  Buttons that wrap a longer label onto two lines and keep all of it.
194
194
  counterexample: >-
@@ -215,7 +215,7 @@
215
215
  break_effect: >-
216
216
  Boxes sized to the fixed text, at the cost of a fix if the text ever changes.
217
217
  test: >-
218
- The cases run on a script-free copy of the page and report only what the case adds: at each width check-design loads the copy untouched and with the long samples in labels, headings and the other text, and compares them. Hint when the case adds a sideways scroll, a spill, a cut, a text cut away or an overlap, naming each; pass when it adds none; nothing when the case did not run. Inputs, placeholders and text drawn in images, canvas or SVG are not filled; text the composition walk does not keep (a box under a clipping parent that is not its containing block, content below an app shell's scroll area) is never tested; inline elements moved by position relative or negative margins inside one block are never compared for overlap; text hidden from assistive technology (aria-hidden) is neither changed nor read; for overlap, each line box is clamped to its computed line-height, so texts of two blocks that touch only through tight leading are not reported; a visible layer behind the text can form overlap pairs when the text grows over it; absolutely positioned labels that receive long text overlap every neighbour they reach, and those pairs are true by definition; text in a fixed or sticky box can form pairs with the text that moves under it. What the case adds is grouped by element, one line each, marked (bleeds at rest) when its box already crossed the left or right edge of the viewport in the untouched copy, on a page that does not scroll sideways at rest (the gate of the layout bleeds); a page whose html or body hides horizontal overflow does not scroll, so there the case says how much further text runs past the clipped right edge instead of a sideways scroll; for either, the texts past the right edge that were not past it at rest, or run further past it, are named. With UC1 followed or broken for the piece, the hint becomes declared only when every element that breaks already bleeds at rest and a sideways scroll or text past the clipped right edge is named by one of them; otherwise it stays a hint and names the elements that do not bleed at rest; on a page where no text bleeds at rest the move is not measured.
218
+ The cases run on a script-free copy of the page and report only what the case adds: at each width check-design loads the copy untouched and with the long samples in labels, headings and the other text, and compares them. Hint when the case adds a sideways scroll, a spill, a cut, a text cut away or an overlap, naming each; pass when it adds none; nothing when the case did not run. Inputs, placeholders and text drawn in images, canvas or SVG are not filled; text the composition walk does not keep (a box under a clipping parent that is not its containing block, content below an app shell's scroll area) is never tested; inline elements moved by position relative or negative margins inside one block are never compared for overlap; text hidden from assistive technology (aria-hidden) is never changed, and is read only for the UC1 count at rest; for overlap, each line box is clamped to its computed line-height, so texts of two blocks that touch only through tight leading are not reported; a visible layer behind the text can form overlap pairs when the text grows over it; absolutely positioned labels that receive long text overlap every neighbour they reach, and those pairs are true by definition; text in a fixed or sticky box can form pairs with the text that moves under it. What the case adds is grouped by element, one line each, marked (bleeds at rest) when its box already crossed the left or right edge of the viewport in the untouched copy, on a page that does not scroll sideways at rest (the gate of the layout bleeds); a page whose html or body hides horizontal overflow does not scroll, so there the case says how much further text runs past the clipped right edge instead of a sideways scroll; for either, the texts past the right edge that were not past it at rest, or run further past it, are named. With UC1 followed or broken for the piece, the hint becomes declared only when every element that breaks already bleeds at rest and a sideways scroll or text past the clipped right edge is named by one of them; otherwise it stays a hint and names the elements that do not bleed at rest; on a page where no text crosses the edge at rest, or that scrolls sideways at rest, the hint says the move is not on that page at that width.
219
219
  example: >-
220
220
  A card whose title wraps "Informações completas sobre atendimento" and pushes the link below it down.
221
221
  counterexample: >-
@@ -15,4 +15,4 @@ Where a row or a rule cites the kit author's internal product plan, that plan is
15
15
  | H7 | GR7 (every color of a piece is a Brand color, piece.palette) | Our claim, a hint only; no number is used as a cutoff. How it was picked: no value is picked; each color read is compared with the Brand Color lines as an exact lowercase hex. Read: the html and body backgrounds, then each visible element the walk keeps (text color where it has its own text, background color, border colors, gradient stops converted by the browser into sRGB) and the drawn fill and stroke of the shapes inside each inline svg (a shape drawn through a use of an in-document symbol is read with the paint its copy gets). Limits: colors in images, canvas and filters are not read; alpha is dropped, so a token used at 40 percent opacity counts as the token; pseudo-element colors (::before, ::after) are not read; a paint that is not a color (a url() paint server) is counted as unread in a note, never compared; a shape drawn through a use whose fill comes only from a style sheet rule on the referenced symbol is read with the use's own color; an element hidden or clipped away is not read. Observed so far, not evidence: og-good.html reads #23399a and #f4efe6, both Brand colors; og-off.html reads #e0457b on a band and a badge, off brand; body-bg.html reads #e0457b on body; sprite.html reads #e0457b on one use and #23399a on the other; svg.html reads two rect colors and one url() paint unread; smoke (2026-11-26): no og:image was read (an SVG on test site A, none on test site B), and a raster piece is read for its size only | Needs pieces outside the test assets: pieces whose authors list the colors they meant, checked against what the hint lists and misses, before the read is trusted as complete |
16
16
  | H8 | GR8 (every font of a piece is a Brand font, piece.fonts) | Our claim, a hint only; no number is used as a cutoff. How it was picked: no value is picked; each rendered family is compared with the Brand Font lines by name, as the type measurer matches names. The families are those the browser reports it rendered for the visible text, read by the type measurer. Limits: fallbacks are counted as the type measurer counts them: a family that paints most of an element's glyphs counts (a font that did not load), one that paints only a few glyphs the main font lacks (an arrow, an accent) does not; text that is hidden, clipped away by a box or placed off the canvas is never counted, so an off-brand font there is not listed; a box that scrolls and spans the canvas does not clip; text drawn in images, canvas or SVG outlines is not read; a piece with no text gives no reading. Observed so far, not evidence: og-good.html renders one family, the Brand font of its test; favicon.html renders no text, so its fonts were not checked; smoke (2026-11-26): no og:image was read (an SVG on test site A, none on test site B), and a raster piece is read for its size only | Needs pieces outside the test assets: renders where the author checks which font shows on screen, against the families the hint lists |
17
17
  | H9 | GR9 (the piece shows the Brand symbol file, piece.symbol) | Our claim, a hint only; no number is used as a cutoff. How it was picked: no value is picked; the address of each image, SVG image, use of another file and CSS background url of the visible piece is compared with the Brand Symbol files as the goal matcher compares targets. Limits: an inline copy of the symbol's markup is not recognized, so reference the file; a copy of the file under another name or address is not recognized; the size reported is the box the reference is drawn in, not the symbol's own pixels; whether the version fits the size (GS2) is left to the reviewer. Observed so far, not evidence: og-good.html shows lazuli-symbol.svg at 240 px; svg.html shows it at 160 px through an SVG image; favicon.html at 32 px shows lazuli-symbol-simple.svg at 24 px; og-off.html shows no Brand symbol file; smoke (2026-11-26): no og:image was read (an SVG on test site A, none on test site B), and a raster piece is read for its size only | Needs pieces outside the test assets: pieces that show the symbol in each way (file, inline copy, redrawn), checked against what the hint finds |
18
- | H10 | GR10 (the first view shows a Brand color, color.brand) | Cutoff: maxDeltaE 10, minShare 0.005. How it was picked: carried over, not picked from a site, both set before any page was read. maxDeltaE is data H4's minDeltaE, the kit's distance under which two colors read as one (our claim there too). minShare is the chart measurer's MIN_SERIES_SHARE, the share at which a color bucket counts as present. Distance: Delta E 1976 with the conversion of in-page/cvd.js. A Brand color is present when the first-view area entries within maxDeltaE of it cover at least minShare of the first view. Definitions it rests on, fixed in advance and not cutoffs: the first view is the first viewport at the run's width and height; the entries are the color measurer's buckets (4 bits per channel, mean color of each bucket, share in percent). Limits: the screenshot is read as drawn, so text and images count by their pixels; a Brand color that appears only as a thin line or a small icon may stay under minShare; a photo of the product in brand colors counts as the brand; Delta E 1976 is not uniform across hues, so a pair near the cutoff can read differently to a person. Observed so far, not evidence: a synthetic page with a hero in the Brand blue covers 85.8% of the first view; one with a red hero finds the blue absent, its nearest bucket at Delta E 5.3 holding under 0.1% of the view (the share is rounded to 0.1 in the color report, so a bucket under 0.05% reads 0); smoke (2026-11-29, one made-up Brand blue, 1440 px): the first views of test site A and test site B found it absent, the nearest buckets at Delta E 9.3 and 60.8, both at 0% | Needs pages whose first views people sorted into showing and not showing the brand, with the Brand tokens written by the brand's own team, checked against the cutoffs before they are applied; then compare Delta E of 5, 10 and 15 and shares of 0.005, 0.02 and 0.05 |
18
+ | H10 | GR10 (the first view shows a Brand color, color.brand) | Cutoff: maxDeltaE 10, minShare 0.005, maxHueDeg 30, minChroma 10. maxHueDeg and minChroma are our claim, set in the 1.0.3 plan before any page was read: hue `h = atan2(b, a)` in degrees and chroma `C = sqrt(a^2 + b^2)` of the Lab the kit already computes (CSS Color 4 Lab to LCH, section 19 sample code); the hue difference is the smaller angle; below minChroma a color has no reliable hue. They only feed a line in the hint (the share of the first view in the token's hue at another lightness or chroma) and never change the level. How it was picked: for maxDeltaE and minShare, carried over, not picked from a site, both set before any page was read. maxDeltaE is data H4's minDeltaE, the kit's distance under which two colors read as one (our claim there too). minShare is the chart measurer's MIN_SERIES_SHARE, the share at which a color bucket counts as present. Distance: Delta E 1976 with the conversion of in-page/cvd.js. A Brand color is present when the first-view area entries within maxDeltaE of it cover at least minShare of the first view. Definitions it rests on, fixed in advance and not cutoffs: the first view is the first viewport at the run's width and height; the entries are the color measurer's buckets (4 bits per channel, mean color of each bucket, share in percent). Limits: the screenshot is read as drawn, so text and images count by their pixels; a Brand color that appears only as a thin line or a small icon may stay under minShare; a photo of the product in brand colors counts as the brand; Delta E 1976 is not uniform across hues, so a pair near the cutoff can read differently to a person. Observed so far, not evidence: a synthetic page with a hero in the Brand blue covers 85.8% of the first view; one with a red hero finds the blue absent, its nearest bucket at Delta E 5.3 holding under 0.1% of the view (the share is rounded to 0.1 in the color report, so a bucket under 0.05% reads 0); smoke (2026-11-29, one made-up Brand blue, 1440 px): the first views of test site A and test site B found it absent, the nearest buckets at Delta E 9.3 and 60.8, both at 0% | Needs pages whose first views people sorted into showing and not showing the brand, with the Brand tokens written by the brand's own team, checked against the cutoffs before they are applied; then compare Delta E of 5, 10 and 15 and shares of 0.005, 0.02 and 0.05 |
@@ -256,15 +256,15 @@
256
256
  status: hypothesis
257
257
  hypothesis: H10
258
258
  source: >-
259
- Our claim, not verified yet. Both cutoffs are carried over from numbers the kit already uses, set before any page was read; the H10 row says where each comes from and lists what was observed afterwards, which is not evidence. Declaring the Brand tokens is GI4.
259
+ Our claim, not verified yet. maxDeltaE and minShare are carried over from numbers the kit already uses; maxHueDeg and minChroma are our claim; all four were set before any page was read; the H10 row says where each comes from and lists what was observed afterwards, which is not evidence. Declaring the Brand tokens is GI4.
260
260
  measure: color.brand
261
- threshold: { maxDeltaE: 10, minShare: 0.005 }
261
+ threshold: { maxDeltaE: 10, minShare: 0.005, maxHueDeg: 30, minChroma: 10 }
262
262
  when_to_break: >-
263
263
  A page that moves the brand to another color on purpose (a campaign, a rebrand in progress), declared with break-a-rule first.
264
264
  break_effect: >-
265
265
  The page shows the new color in the first view, and a visitor who knows the brand may not recognize it at first sight.
266
266
  test: >-
267
- check-design reads the colors of the first view from the screenshot and takes, for each Brand Color line, the colors within the cutoff distance (Delta E 1976). A Brand color is present when those colors cover at least the cutoff share of the first view, summed on the unrounded shares. Hint when none is, naming for each Brand color the nearest color of the view, its distance and its share, and the share covered within the cutoff distance. With no Brand Color line there is no finding, and a note says so.
267
+ check-design reads the colors of the first view from the screenshot and takes, for each Brand Color line, the colors within the cutoff distance (Delta E 1976). A Brand color is present when those colors cover at least the cutoff share of the first view, summed on the unrounded shares. Hint when none is, naming for each Brand color the nearest color of the view, its distance and its share, and the share covered within the cutoff distance. When a Brand color has a chroma of at least minChroma, the hint also says how much of the first view is in its hue at another lightness or chroma: the colors of the view with a chroma of at least minChroma, a hue within maxHueDeg of the token's and a distance above the cutoff distance, summed on the unrounded shares, when that sum reaches the cutoff share; this line never turns a hint into a pass. With no Brand Color line there is no finding, and a note says so.
268
268
  example: >-
269
269
  A first view whose hero is the brand's blue, or whose button and logo carry it.
270
270
  counterexample: >-
@@ -6,13 +6,13 @@ Where a row or a rule cites the kit author's internal product plan, that plan is
6
6
 
7
7
  | ID | Principle | Candidate limit | How to validate in the A/B |
8
8
  |---|---|---|---|
9
- | H1 | Distance from default (compare-designs) | The structural signature distance between a page and a no-kit baseline for the same brief, components weighted equally (our claim) | Ask reviewers which of several pairs "looks different" and check the distance ranks the pairs the same way |
9
+ | H1 | Structure distance from default (compare-designs) | The structure distance between a page and a no-kit baseline for the same brief, components weighted equally (our claim). It reads sections (height, density, scale), section count, centering, uniform grid, text and area scale, empty space and the focal point. It does not read color, typefaces, images or texture, so it does not rank how different the options look | Ask reviewers which of several pairs "looks different" and check the structure distance ranks the pairs the same way |
10
10
  | H2 | UR1 (scale contrast of the first view, layout.scale-contrast) | Cutoff: minTextRatio 2, minAreaRatio 2. The first view has contrast when the largest text is at least 2 times the body size or the largest block is at least 2 times the median block; the hint fires only when both fall below. How it was picked: a round starting value, our claim, set before any real page was measured (the stub used the same). Observed so far, not evidence: layout-flat 1 and 1, layout-tension 12.5 and 16.32; test site A 2.81 and 9.59 at 1440 px, 1.94 and 7.33 at 390 px; test site B 2.56 and 5.31 at 1440 px, 1.92 and 14.77 at 390 px. The text cutoff sits within 0.08 of two site readings at 390 px (1.94 and 1.92) | Needs pages outside the test sites: a set of award-listed pages against default-template pages for the same brief, judged by reviewers ("has a clear top?") before the cutoff is applied; then compare text ratios of 1, 2 and 4 |
11
11
  | H3 | UR2 (empty space has a shape, layout.empty-space) | Cutoff: minSpread 0.5. The first view is read as a shape when the emptiest and the fullest of its 9 areas differ by at least 0.5 (50 percentage points of empty share); below that the space is spread evenly. How it was picked: a midpoint between the two fixtures (layout-flat 0.11, layout-tension 1), our claim, set before any real page was measured. It was briefly lowered to 0.3 and restored, because a cutoff tuned to the sites it runs on cannot be tested by them. Observed so far, not evidence: test site A 0.54 at 1440 px and 0.25 at 390 px; test site B 0.42 at 1440 px and 0.75 at 390 px. The cutoff sits within 0.04 of test site A at 1440 px | Needs pages outside the test sites: award-listed pages against default templates, judged by reviewers ("looks placed or looks left over?") before the cutoff is applied; then compare spreads of 0.1, 0.3, 0.5 and 0.7 |
12
12
  | H4 | UR3 (one focal point, layout.focal-point) | Cutoff: minDominance 2. One block leads the first view when its area is at least 2 times the next largest block. The pair of the two largest blocks (UC9) leads when the second is at least 2 times the third, the same cutoff applied to the pair. How it was picked: a round starting value, our claim, set before any real page was measured (the stub used the same). It was briefly lowered to 1.5 after the site readings were known and restored, because a cutoff tuned to the sites it runs on cannot be tested by them. Observed so far, not evidence: layout-flat 1, layout-tension 16.32; test site A 1.52 at 1440 px and 2.48 at 390 px; test site B 1.06 at 1440 px and 3.76 at 390 px. At this cutoff both sites get the hint at 1440 px (test site A sits at 1.52) and neither does at 390 px | Needs pages outside the test sites: a five second test ("where did you look first?") on award-listed pages and default-template pages before the cutoff is applied; then compare dominance 1, 1.5, 2 and 3 on how often reviewers agree on one element |
13
13
  | H5 | UR4 (the page changes pace, rhythm.pace) | Cutoff: minSections 3, minHeightRatio 1.5, minDensityRatio 1.5. A page of at least 3 sections changes pace when its tallest section is at least 1.5 times its shortest, or its densest at least 1.5 times its sparsest; the hint fires only when both ratios stay below. How it was picked: round starting values, our claim, set before any real page was measured. Observed so far, not evidence: height ratios rhythm-flat 1, rhythm-sequence 3, test site A 23.38 at 1440 px and 33.5 at 390 px, test site B 15 at 1440 px and 16.55 at 390 px; density ratios rhythm-flat 1, test site A 9.02 at 1440 px and 4.56 at 390 px, test site B has a section of density 0 so the ratio has no bound | Needs pages outside the test sites: scroll recordings of award-listed pages and default-template pages, judged by reviewers ("does the page have a beat or does it repeat?") before the cutoff is applied; then compare height ratios of 1, 1.5 and 3 |
14
14
  | H6 | UR6 (the climax sits where it was declared, rhythm.climax) | Cutoff: maxShift 0.2. The measured climax (the section with the largest type, centered on its position in the page) may sit up to 0.2 of the page height from the climax beat of the declared map. How it was picked: a round starting value, our claim, set before any real page was measured. Observed so far, not evidence: on rhythm-sequence the climax is 0.01 from a map with the climax third and 0.39 from a map with the climax first; the two real sites declare no map, so no real page has tested it | Needs pages outside the test sites: pages whose climax was placed on purpose and mapped by their authors, judged "on the beat" or not by reviewers before the cutoff is applied |
15
- | H7 | UR5 (the sequence follows the declared map, rhythm.map) | A section marked "breathe" should not be denser than the median section of the page and one marked "accelerate" should not be sparser; the beat count must equal the section count. Our claim, a hint only; no number is used as a cutoff. A section is flagged only when its density differs from the median by more than densityStep, the share of one row of the coverage grid in that section (8 px over the measured section height): that is the measuring resolution, not a cutoff, so a difference smaller than one row is not read as a difference. Observed so far: no real page declares a map | Needs pages outside the test sites: pages whose authors say they followed their map against pages built without one, before the hint is applied |
15
+ | H7 | UR5 (the sequence follows the declared map, rhythm.map) | A section marked "breathe" should not be denser than the median section of the page and one marked "accelerate" should not be sparser; the beat count must equal the section count. Our claim, a hint only; no number is used as a cutoff. A section is flagged only when its density differs from the median by more than densityStep, the share of one row of the coverage grid in that section (8 px over the measured section height): that is the measuring resolution, not a cutoff, so a difference smaller than one row is not read as a difference. A file covered only by an options goal with no Rhythm line is not compared, and the notes say so. Observed so far: no real page declares a map | Needs pages outside the test sites: pages whose authors say they followed their map against pages built without one, before the hint is applied |
16
16
  | H8 | UG2 (the grid is not the inherited default, layout.grid) | Cutoff: minViewport 768. The grid is judged only at viewports of 768 px and wider. How it was picked: 768 is the kit's default middle width (check-design reads 1440, 768 and 390), so a phone width is never judged; at a phone width almost every page is one column between two margins. It was not picked from a reading. The grid looks inherited when every section of the page sits between the same left and right edges, centered in the viewport. Our claim, a hint only. Observed so far, not evidence: uniformGrid is false on test site A and test site B at both widths and true on the layout-uniform fixture | Needs pages outside the test sites: ask "was this layout chosen or inherited?" for award-listed pages and default-template pages and check the flag matches the answers |
17
17
  | H9 | UR9 (hover changes the look, states.hover) | Our claim, a hint only; no number is used as a cutoff. With :hover forced by DevTools on one button or link per distinct look, the computed look of the element, its ::before, ::after and its children (the properties the states measurer reads) differs from its look at rest. Limits: a hover added by a script or styled on a parent is not seen and reads as unchanged; a property outside the read list is not seen; at most 40 looks are forced per page (a sampling limit, noted when it cuts); looks are read at rest (running animations finished or stopped), so a hover or press shown only by an animation is not seen, and motion driven by requestAnimationFrame (GSAP and similar) cannot be stopped and may be read mid-frame. Observed so far, not evidence: states-controls fixture 5 of 9 looks unchanged (dead, scripted, parent-styled, a big descendant tree, an endless animation read at rest); test site A 4 of 4 unchanged at 1440 and 390 px; test site B 7 of 8 at 1440 px and 6 of 8 at 390 px, where one hover comes from a script | Needs pages outside the test sites: pointer recordings of award-listed and default-template pages, with reviewers marking which controls answer the pointer, against the list of unchanged looks |
18
18
  | H10 | UR10 (pressed changes the look, states.active) | Our claim, a hint only; no number is used as a cutoff. With :active forced alone on one button or link per distinct look, the computed look differs from its look at rest, on the same properties as H9. Limits: :active is forced alone, so a pressed look written for :hover:active is not seen; the H9 limits apply, among them that motion driven by requestAnimationFrame (GSAP and similar) cannot be stopped and may be read mid-frame. Observed so far, not evidence: states-controls fixture 8 of 9 looks unchanged; test site A 3 of 4 unchanged at 1440 and 390 px; test site B 0 of 8 at both widths (a site-wide pressed transform) | Needs pages outside the test sites: reviewers pressing each control of award-listed and default-template pages and saying whether the press showed, against the list |
@@ -23,7 +23,7 @@
23
23
  break_effect: >-
24
24
  The viewer feels the page shout one fact, so the number becomes the memory of the page and everything else reads as its footnote.
25
25
  test: >-
26
- The layout report shows a text element whose box crosses the viewport edge and is the largest element of the first view (the focal point). The reviewer checks the figure is still readable at every width. Choosing the move is logged with record-decision as followed; pushing it past its excess is a break, declared with break-a-rule, and its broken decision is logged only after the break is kept after review.
26
+ The longer-text cases (CR7, CR8) read the move: a text element whose box crosses the viewport edge at rest, decorative ones included. The reviewer checks that the bleeding text is the subject of the view and still readable at every width. Choosing the move is logged with record-decision as followed; pushing it past its excess is a break, declared with break-a-rule, and its broken decision is logged only after the break is kept after review.
27
27
  example: >-
28
28
  An architecture studio opens with the year it was founded set so large that the last digit is sliced by the right edge, with one line of text below.
29
29
  counterexample: >-
@@ -131,7 +131,7 @@
131
131
  break_effect: >-
132
132
  The page keeps its freedom to find its own sequence while it is built, at the cost of a check that the sequence was meant.
133
133
  test: >-
134
- The rhythm report compares each section with its beat. Hint when the counts differ, when a section marked breathe is denser than the median, or when one marked accelerate is sparser. A goal with no map gets a hint asking for one.
134
+ The rhythm report compares each section with its beat. Hint when the counts differ, when a section marked breathe is denser than the median, or when one marked accelerate is sparser. A goal with no map gets a hint asking for one. On a file covered only by an options goal with no Rhythm line there is no finding, and a note says so.
135
135
  example: >-
136
136
  A map of five beats that the page follows with five sections, the third the densest.
137
137
  counterexample: >-
@@ -172,7 +172,7 @@
172
172
  rule: >-
173
173
  Compare the page with a baseline built for the same brief without the kit, using compare-designs, and read the distance together with the reviewer's own look: the page should not sit where the default sits.
174
174
  why: >-
175
- A page can pass every check and still look like what any tool would produce for the same brief; the distance from that default is the only way to see how far the composition went.
175
+ A page can pass every check and still look like what any tool would produce for the same brief; the structure distance from that default shows how far the layout structure moved. Color, type, images and texture are not in that distance; the reviewer judges them.
176
176
  origin: hypothesis
177
177
  status: hypothesis
178
178
  hypothesis: H1
@@ -39,7 +39,7 @@ The procedures below call these through the CLI (see "Running the CLI"). They ar
39
39
  | `check-goals` | Reports each goal's recorded check (met, partly, missed, stale or not checked) and whether the gate passes. |
40
40
  | `draft-memo` | Gathers decisions, breaks, first looks and verdicts per goal into a draft for explain-decisions, and lists the gaps. |
41
41
  | `render-options` | Renders 6 to 9 option HTML files, measures each and writes one contact sheet per width, with no ranking. `--height <px>` sets the viewport height and `--screens <n>` shows the first n screens in each thumbnail, and `--baseline <page>` adds each option's distance from that page to its label. |
42
- | `compare-designs` | Reports the structural distance of a page from a baseline made without the kit, per width, with no verdict (hypothesis H1). `--options <folder>` places each option file of a folder from near to far against the baseline. |
42
+ | `compare-designs` | Reports the structure distance of a page from a baseline made without the kit, per width, with no verdict (hypothesis H1); it reads layout structure only, not color, typefaces, images or texture. `--options <folder>` lists each option file of a folder by structure distance, low to high, against the baseline. |
43
43
  | `map-page` | Maps one step of a simulated task, read only: screenshots and a numbered list of what can be used, stopping at forms and checkout off local targets. |
44
44
  | `record-task` | Stores the tester's answer for the last mapped step of a simulated task and prints the next step, or closes the task with counts. |
45
45
 
@@ -102,7 +102,7 @@ A color is an optional name and a hex. One Symbol line is the main symbol; a sim
102
102
  4. When a goal line changes later (`Understand`, `Feel`, `Do`, `Target`, `Rhythm`), log it with `lazuli record-decision --rule none --decision "<Field> changed: was <old>; now <new>. <reason>"`, so `explain-decisions` can say why the goal moved.
103
103
 
104
104
  ## check-design
105
- Run `node "<KIT_PATH>/bin/lazuli.mjs" check-design <url-or-html-path>` (see "Running the CLI"). Options: `--width 1440,390`, `--height <px>` (the viewport height, 100 to 10000, 900 by default; `--height 844` reads a phone's first view; not with `--asset`), `--area color` (a comma list; an unknown name exits 2 and lists the known areas), `--json`, `--out <file>` (also writes the report there; `.lazuli/report.json` is still written). More screens of the same product follow the first target (`check-design ./index.html ./about.html`); `--site` adds the `Target` line of every page goal in `LAZULI.md` (not the pieces and symbols), since those are the screens of one product. Page findings stay for the first target; findings that compare screens are marked "across N screens". With `--site` and fewer than two distinct screens it exits 2. `LAZULI_RULES_DIR` points the CLI at another rules folder; it is a debugging switch, so leave it unset in normal work.
105
+ Run `node "<KIT_PATH>/bin/lazuli.mjs" check-design <url-or-html-path>` (see "Running the CLI"). Options: `--width 1440,390`, `--height <px>` (the viewport height, 100 to 10000, 900 by default; `--height 844` reads a phone's first view; not with `--asset`), `--area color` (a comma list; an unknown name exits 2 and lists the known areas), `--json`, `--out <file>` (also writes the report there, as text for a `.txt` name and JSON otherwise; `.lazuli/report.json` is still written). More screens of the same product follow the first target (`check-design ./index.html ./about.html`); `--site` adds the `Target` line of every page goal in `LAZULI.md` (not the pieces and symbols), since those are the screens of one product. Page findings stay for the first target; findings that compare screens are marked "across N screens". With `--site` and fewer than two distinct screens it exits 2. `LAZULI_RULES_DIR` points the CLI at another rules folder; it is a debugging switch, so leave it unset in normal work.
106
106
 
107
107
  `check-design --asset <file-or-url>` checks one symbol or derived piece instead of a page: an SVG, PNG or ICO is a symbol; an HTML file, or a PNG, JPG or WebP with a size, is a piece. A piece takes its sizes from the `Size:` line of its goal or from `--size 1200x630`. Only the areas with a rule the asset measurers read are reported (unless `--area` names others); the report reads `Asset:` and `Sizes:` and lists the `Files written:`, and a finding's width is a size label such as `1200x630`. It takes no page target, `--site` or `--width`; a piece with no size exits 2 naming the line to write. A piece or a symbol is delivered like a page: `capture` it and have it reviewed (review-design) before check-goals counts its goal; `--asset` measures it but is not that review.
108
108
 
@@ -115,7 +115,7 @@ The data area reads the charts of the page (svg geometry and paint, canvas pixel
115
115
  What the report shows:
116
116
  - One block per area, with how many of its rules `check-design` measures (the others are checked by you or by people). An area with no measured rule says so instead of looking like a pass.
117
117
  - The goals declared for the page checked (`Target:`). They are shown, not measured.
118
- - `break` findings: a declared break whose `Status` is `trying` or `kept` and whose `Piece` is a goal of the page turns a fail or hint of that rule into a `break` that shows the declared effect. A `reverted` break changes nothing. Norms are never waived: a break on a norm rule leaves the fail as it is and the report says the break was not applied.
118
+ - `break` findings: a declared break whose `Status` is `trying` or `kept` and whose `Piece` is a goal of the page turns a fail or hint of that rule into a `break` that shows the declared effect. A `reverted` or `superseded` break changes nothing. Norms are never waived: a break on a norm rule leaves the fail as it is and the report says the break was not applied.
119
119
  - Notes, for example a measurer that failed while the others still ran.
120
120
 
121
121
  Quote the report's measurements, rule ids and notes. A finding names the rule, the widths where it appears and the measured evidence. A main action found without `data-primary` is a guess, so say so. A finding marked as a hypothesis is a hint from a claim that is not verified yet, never a verdict. Never say an effect was achieved because the report is clean: it measures, it does not ask people.
@@ -168,7 +168,7 @@ Each rule has `when_to_break` and `break_effect`. To break one:
168
168
  4. Director mode: ask the person before applying. Delegate mode: apply the break only if the check passes.
169
169
  5. Record it with `record-break`, then run the check after applying:
170
170
  `node "<KIT_PATH>/bin/lazuli.mjs" record-break --rule PA2 --piece "checkout page" --effect "the black block makes the payment button feel heavy and final" --check "check-design on ./checkout.html, plus a short test with people from the audience" --status trying`
171
- 6. Entries under `## Breaks` are written and changed only with `record-break`, never by hand. `--rule` takes one id or a comma list (`--rule PA11,RV9`), one entry per id; when a rule shares its measure with others, the command names them, because the same finding is reported under each id. `--status` is `trying`, `kept` or `reverted`; call it again for the same rule and piece to change the status. `--target <file>` limits the entry to one file the piece covers (one option of a folder goal), written relative to the project folder; a file outside the piece or a glob is refused; `record-decision` takes it too. The entry it writes looks like this:
171
+ 6. Entries under `## Breaks` are written and changed only with `record-break`, never by hand. `--rule` takes one id or a comma list (`--rule PA11,RV9`), one entry per id; when a rule shares its measure with others, the command names them, because the same finding is reported under each id. `--status` is `trying`, `kept`, `reverted` or `superseded`; call it again for the same rule and piece to change the status. Use `superseded` when the piece or the break no longer exists as written: it only retires an existing entry (it works even when the piece has no goal any more), claims nothing about the effect, and needs no review. `--target <file>` limits the entry to one file the piece covers (one option of a folder goal), written relative to the project folder; a file outside the piece or a glob is refused; `record-decision` takes it too. The entry it writes looks like this:
172
172
  ```
173
173
  - Rule: PA2
174
174
  - Piece: checkout page
@@ -17,7 +17,7 @@ Read `## Mode` in `LAZULI.md`.
17
17
  ## Steps
18
18
  1. **Read the moves and the grid.** `lazuli list-rules --moment create --area ui`. The moves are UC ids, the grid rules are UG ids. Read each move's `works_when` and `excess_when`.
19
19
  2. **Write 6 to 9 option files** in `.lazuli/options/<piece>/` (or another folder you name), one HTML file each, starting from `../../lazuli-ui-composition/references/option-template.html` (that path is from this file's folder). Each option is a different composition: different moves or a different grid, not a different palette or font on the same layout. In an HTML comment at the top of each file, name the moves it uses by UC id and the grid it follows by UG id. Fewer than 6 or more than 9 files is refused.
20
- 3. **Render and measure.** `lazuli render-options .lazuli/options/<piece> --width 1440`. The option canvas is one first view, 900 px tall and 1440 px wide by default, so render it at its own width only: a narrower width shows a crop of it, and the sheet says so. When `## Audience` in `LAZULI.md` names a phone as the main device, set `body` to `390px` wide in each option and render with `--width 390 --height 844` instead (a 390 by 844 phone, the kit's phone width); add `--screens 3` when the brief asks to see proof or offer, so each thumbnail shows the first three screens (the measures still read the first view). A later run at another width keeps the earlier measures in `options.json` while the option file names and the height stay the same; if you rename, add or remove a file, or render at another height, the earlier widths are dropped and the output says so. It writes one contact sheet, with the measures under each thumbnail. With `--baseline <page>` (a page made without the kit for the same brief) each label also gives the option's distance from it, a measurement under hypothesis H1 and not a verdict. `lazuli compare-designs --options <folder> --baseline <page>` lists the options from near to far on the same distance; give it the same `--width` and `--height` as `render-options`, so each option is read at its own canvas (1440 wide by default). Open the sheet and look at it.
20
+ 3. **Render and measure.** `lazuli render-options .lazuli/options/<piece> --width 1440`. The option canvas is one first view, 900 px tall and 1440 px wide by default, so render it at its own width only: a narrower width shows a crop of it, and the sheet says so. When `## Audience` in `LAZULI.md` names a phone as the main device, set `body` to `390px` wide in each option and render with `--width 390 --height 844` instead (a 390 by 844 phone, the kit's phone width); add `--screens 3` when the brief asks to see proof or offer, so each thumbnail shows the first three screens (the measures still read the first view). A later run at another width keeps the earlier measures in `options.json` while the option file names and the height stay the same; if you rename, add or remove a file, or render at another height, the earlier widths are dropped and the output says so. It writes one contact sheet, with the measures under each thumbnail. With `--baseline <page>` (a page made without the kit for the same brief) each label also gives the option's structure distance from it, a measurement under hypothesis H1 and not a verdict; it reads layout structure only, not color, typefaces, images or texture, so it does not say which option looks most different. `lazuli compare-designs --options <folder> --baseline <page>` lists the options by structure distance, low to high; give it the same `--width` and `--height` as `render-options`, so each option is read at its own canvas (1440 wide by default). Open the sheet and look at it.
21
21
  4. **Read the measures and name the tension.** The sheet prints scale contrast, empty space and focal point for each option. Tension (what pulls against what) is not computed: judge it from the sheet, where the focal offset and the empty cells help, and say it in words for each option. The sheet never ranks options and never picks a best one, and neither do you: the choice is a judgment about the idea. A hint id on a thumbnail is a hint from a hypothesis, not a failure.
22
22
  5. **Choose.** Director mode: show the sheet with the measures and your words on each, then wait. Delegate mode: choose one, and justify it from the idea and the measures in plain language.
23
23
  6. **Log the choice.**
@@ -27,7 +27,7 @@ The same decision text on the same piece replaces the earlier entry, so each lin
27
27
  ## Check
28
28
  1. Run `check-design <target> --area content` at the widths of the project. Copy the words of CR1 to CR4 with their limits: only buttons and messages already on the page are read, the phrase lists are our claim, each a hypothesis, and meaning is never judged.
29
29
  2. CR5 and CR6 compare screens and run only with two or more screens: add `--site`, or give every screen as a target. On one screen they do not run, and the report says so.
30
- 3. CR7 to CR11 open a script-free copy of the page (nothing runs, and nothing but styles, fonts and images is requested, on any host) and report only what the case adds over the untouched copy. Quote their limits: text the walk does not keep is never tested, inline elements moved inside one block are not compared for overlap, text hidden from assistive technology (aria-hidden) is neither changed nor read, line boxes are clamped to their line-height for overlap, a visible layer behind the text or an absolutely positioned label taking long text can form pairs, and the inline word or letter spans of a heading are never a list (a flex or grid heading's word spans can still be read as one). A slow page may leave the list cases unchecked, with a note.
30
+ 3. CR7 to CR11 open a script-free copy of the page (nothing runs, and nothing but styles, fonts and images is requested, on any host) and report only what the case adds over the untouched copy. Quote their limits: text the walk does not keep is never tested, inline elements moved inside one block are not compared for overlap, text hidden from assistive technology (aria-hidden) is never changed, and is read only for the UC1 count at rest of CR7 and CR8, line boxes are clamped to their line-height for overlap, a visible layer behind the text or an absolutely positioned label taking long text can form pairs, and the inline word or letter spans of a heading are never a list (a flex or grid heading's word spans can still be read as one). A slow page may leave the list cases unchecked, with a note.
31
31
  4. Judge in words what no measure reads: whether a label's outcome is true, whether an error's fix is useful (CW4), the heading words (CW6) and what an empty list says (CW8).
32
32
  5. A hint judged false is noted with its evidence. Do not rewrite the page to silence a hint. Hints never block.
33
33
  6. A kept break goes through `break-a-rule` and is kept only after `review-design`. When the content area ran, the reviewer also runs the swap test (CR12, see `lazuli-content-voice`).
@@ -5,7 +5,7 @@ description: Use when a rendered page needs its layout judged as a composition (
5
5
 
6
6
  # Reviewing the composition of a rendered page
7
7
 
8
- A page can pass every check and still look like what any tool would make for the same brief. This skill reads the render as a composition: the first view, the sequence down the scroll and the distance from the default. The rules are UR1 to UR8 (`../lazuli/rules/ui/review.yaml`), with UC1 to UC9 and UG1 to UG3 as the choices they review (`compose.yaml`, `grid.yaml` in the same folder), after install (in a kit checkout: `rules/ui/`). Every cutoff is a hypothesis in `HYPOTHESES.md`: the report gives hints, never verdicts.
8
+ A page can pass every check and still look like what any tool would make for the same brief. This skill reads the render as a composition: the first view, the sequence down the scroll and the structure distance from the default. The rules are UR1 to UR8 (`../lazuli/rules/ui/review.yaml`), with UC1 to UC9 and UG1 to UG3 as the choices they review (`compose.yaml`, `grid.yaml` in the same folder), after install (in a kit checkout: `rules/ui/`). Every cutoff is a hypothesis in `HYPOTHESES.md`: the report gives hints, never verdicts.
9
9
 
10
10
  Do not use when:
11
11
  - no page exists yet: use `lazuli-ui-composition`;
@@ -154,7 +154,7 @@ function tasksText(tasks) {
154
154
  // The reviewer packet: declared effects, captures and measures. Never the Decisions log.
155
155
  function reviewText(manifest, md, goals, tasks) {
156
156
  const pieces = new Set(goals.map((g) => norm(g.piece)));
157
- const breaks = (md?.breaks ?? []).filter((b) => pieces.has(norm(b.piece)));
157
+ const breaks = (md?.breaks ?? []).filter((b) => pieces.has(norm(b.piece)) && b.status !== "superseded");
158
158
  const lines = ["# Review packet", "", `Target: ${oneLine(manifest.target)}`, `Capture: ${manifest.captureId}`, "", "## Idea", "", md?.idea ? oneLine(md.idea) : "No idea is written for this project.", "", "## Goals for this page", ""];
159
159
  if (goals.length === 0) {
160
160
  lines.push("No goal is written for this page.", "");
@@ -31,7 +31,7 @@ export const HELPERS = [
31
31
  { name: "check-goals", summary: "Reports each goal's recorded check (met, partly, missed, stale or not checked) and whether the gate passes." },
32
32
  { name: "draft-memo", summary: "Gathers decisions, breaks, first looks and verdicts per goal into a draft for explain-decisions, and lists the gaps." },
33
33
  { name: "render-options", summary: "Renders 6 to 9 option HTML files, measures each and writes one contact sheet per width, with no ranking." },
34
- { name: "compare-designs", summary: "Reports the structural distance of a page from a baseline made without the kit, per width, with no verdict (hypothesis H1). `--options <folder>` places each option file of a folder from near to far against the baseline." },
34
+ { name: "compare-designs", summary: "Reports the structure distance of a page from a baseline made without the kit, per width, with no verdict (hypothesis H1); it reads layout structure only, not color, typefaces, images or texture. `--options <folder>` lists each option file of a folder by structure distance, low to high, against the baseline." },
35
35
  { name: "map-page", summary: "Maps one step of a simulated task, read only: screenshots and a numbered list of what can be used, stopping at forms and checkout off local targets." },
36
36
  { name: "record-task", summary: "Stores the tester's answer for the last mapped step of a simulated task and prints the next step, or closes the task with counts." },
37
37
  ];
@@ -5,6 +5,7 @@ import { FULL_PAGE_CAP_PX } from "./capture.mjs";
5
5
  import { MEASURERS, measurersFor } from "../measure/registry.mjs";
6
6
  import { KIT_RULES_DIR, loadKit } from "../rules/load.mjs";
7
7
  import { evaluate } from "../report/evaluate.mjs";
8
+ import { formatReport } from "../report/format.mjs";
8
9
  import { noteGuessChanges } from "../report/evaluators/weight.mjs";
9
10
  import { emptyBrand, isAssetGoal, isOptionsGoal, readLazuliMd } from "../project/lazuli-md.mjs";
10
11
  import { AssetInputError, assetDir, assetOfType, loadAssetBytes, resolveAsset } from "../measure/asset.mjs";
@@ -340,6 +341,8 @@ export async function checkDesign({
340
341
  width,
341
342
  target,
342
343
  goals,
344
+ // A file an options goal covers is read as an option, by its data-block marks, as render-options reads it.
345
+ options: goals.some(isOptionsGoal),
343
346
  brand: md?.brand ?? emptyBrand(),
344
347
  once,
345
348
  cwd,
@@ -407,16 +410,21 @@ async function summarize({ kit, chosen, rules, measurers, registered, measures,
407
410
  const broken = applyBreaks([...noteGuessChanges(evaluate(rules, measures, measurers), measures), ...siteFindings], md?.breaks ?? [], goals, kit.rules, new Set(kit.rules.map((r) => r.id)), target, cwd);
408
411
  const { applied, unapplied: allUnapplied } = broken;
409
412
  // A declared move (UC9 for UR3) changes a hint only where the finding measured the move.
410
- const { findings, applied: declarations } = applyDeclarations(broken.findings, md, goals, kit.rules, target, cwd);
413
+ const { findings, applied: declarations, notHeld } = applyDeclarations(broken.findings, md, goals, kit.rules, target, cwd);
411
414
  // With --area, a break on a rule of an area that was not selected has no findings here, which is not a fault of the break.
412
415
  const selected = new Set(rules.map((r) => r.id.toLowerCase()));
413
416
  // A break on a move that declared a finding did its work, so it is not listed as unapplied.
414
417
  const declaredBy = (u) => declarations.some((d) => d.by === "break" && d.move.toLowerCase() === String(u.rule).trim().toLowerCase() && d.piece === u.piece);
415
- // A break on a move that a finding read here, where the move did not hold, was measured: it says so.
416
- const readNotHeld = (u) => findings.some((f) => Object.entries(f.moves ?? {}).some(([move, read]) => move.toLowerCase() === String(u.rule).trim().toLowerCase() && read?.holds === false));
418
+ // A break on a move that a finding read here for its piece, where the move did not hold, was measured: it says so,
419
+ // and says the move is not on the page when every such reading was absent.
420
+ const readReason = (u) => {
421
+ const reads = notHeld.filter((n) => n.move.toLowerCase() === String(u.rule).trim().toLowerCase() && n.piece.trim().toLowerCase() === String(u.piece).trim().toLowerCase());
422
+ if (reads.length === 0) return null;
423
+ return reads.every((n) => n.absent) ? "the move was read and is not on this page" : "the move was read and did not hold on this page";
424
+ };
417
425
  const unapplied = allUnapplied
418
426
  .filter((u) => (!(u.reason.startsWith("no fail or hint") || u.reason === "not measured by check-design") || selected.has(String(u.rule).trim().toLowerCase())) && !declaredBy(u))
419
- .map((u) => (u.reason === "not measured by check-design" && readNotHeld(u) ? { ...u, reason: "the move was read and did not hold on this page" } : u));
427
+ .map((u) => (u.reason === "not measured by check-design" && readReason(u) ? { ...u, reason: readReason(u) } : u));
420
428
  // A records file that cannot be read never stops the measuring: the goals just show no recorded check.
421
429
  let effects = [];
422
430
  const problems = [...(md?.problems ?? [])];
@@ -457,7 +465,9 @@ async function summarize({ kit, chosen, rules, measurers, registered, measures,
457
465
  await fs.writeFile(outFile, JSON.stringify(result, null, 2));
458
466
  if (copyFile) {
459
467
  await fs.mkdir(path.dirname(copyFile), { recursive: true });
460
- await fs.writeFile(copyFile, JSON.stringify(result, null, 2));
468
+ // A .txt name (any case) gets the text report the CLI prints; any other name gets the JSON.
469
+ const asText = path.extname(copyFile).toLowerCase() === ".txt";
470
+ await fs.writeFile(copyFile, asText ? formatReport(result) + "\n" : JSON.stringify(result, null, 2));
461
471
  }
462
472
  return result;
463
473
  }
@@ -11,9 +11,11 @@ import { sameTarget } from "../project/match.mjs";
11
11
  // Listing limit, not a rule: how many of the most different components the text names per width.
12
12
  const TOP_PARTS = 3;
13
13
 
14
- export const H1_LINE = 'This is hypothesis H1 (ui): it is not yet validated that this distance tracks what people call "looks different".';
14
+ export const H1_LINE = 'This is hypothesis H1 (ui): it is not yet validated that this structure distance tracks what people call "looks different".';
15
15
  // Carried by the text output, --json and compare.json, so the number never travels without it.
16
- export const COMPARE_NOTE = 'Hypothesis H1 (ui): a measurement, not a verdict. No cutoff says what distance is "different enough".';
16
+ export const COMPARE_NOTE = 'Hypothesis H1 (ui): a measurement, not a verdict. No cutoff says what structure distance is "different enough".';
17
+ // Printed after the value of a compare and after the per-option lines of --options, so the number never travels without what it reads.
18
+ export const STRUCTURE_READS = "It reads layout structure only: sections (height, density, scale), section count, centering, uniform grid, text and area scale, empty space and the focal point. It does not read color, typefaces, images or texture, so it does not rank how different the options look.";
17
19
 
18
20
  export class CompareInputError extends Error {
19
21
  constructor(message) {
@@ -36,7 +38,7 @@ export async function signatureAt(browser, target, width, cwd, height) {
36
38
  }
37
39
  }
38
40
 
39
- // Structural distance of a page from a baseline made without the kit for the same brief, per width.
41
+ // Structure distance of a page from a baseline made without the kit for the same brief, per width.
40
42
  // It measures; it gives no verdict, because no cutoff for "different enough" exists yet (H1).
41
43
  export async function compareDesigns({ target, baseline, widths = [1440, 390], cwd = process.cwd(), out = path.join(".lazuli", "compare.json"), browser: givenBrowser }) {
42
44
  if (typeof baseline !== "string" || baseline.trim() === "") {
@@ -92,7 +94,8 @@ export function formatCompare(r) {
92
94
  .map(({ c }) => `${c.name} ${c.diff} (target ${shown(c.name, c.a)}, baseline ${shown(c.name, c.b)})`);
93
95
  lines.push(`At ${w.width} px: ${w.value}; differs most in ${top.join("; ")}`);
94
96
  }
95
- lines.push(`Distance from default: ${r.value} (0 is the same structure, 1 shares nothing). ${H1_LINE}`);
97
+ lines.push(`Structure distance from default: ${r.value} (0 is the same structure, 1 shares nothing). ${H1_LINE}`);
98
+ lines.push(STRUCTURE_READS);
96
99
  lines.push(COMPARE_NOTE);
97
100
  lines.push(`Measures: ${r.path}`);
98
101
  return lines.join("\n");
@@ -101,7 +104,7 @@ export function formatCompare(r) {
101
104
  // The name a baseline goes by in a label: its file name, or the URL as given.
102
105
  export const baselineName = (baseline) => (/^https?:\/\//i.test(baseline.trim()) ? baseline.trim() : path.basename(baseline.trim()));
103
106
 
104
- // A folder of options placed from near to far against one baseline, per width (1440 by default, like render-options: an option is one canvas).
107
+ // A folder of options placed from low to high structure distance against one baseline, per width (1440 by default, like render-options: an option is one canvas).
105
108
  // Give it the same widths and height render-options used, so each option is read at its own canvas.
106
109
  // The baseline is read once per width; ties keep file order. Like compareDesigns, it measures and gives no verdict (H1).
107
110
  export async function compareOptions({ folder: given, baseline, widths = [1440], height, cwd = process.cwd(), out = path.join(".lazuli", "compare.json"), browser: givenBrowser }) {
@@ -147,13 +150,14 @@ export async function compareOptions({ folder: given, baseline, widths = [1440],
147
150
  return result;
148
151
  }
149
152
 
150
- // Each option in file order with its value, then the near-to-far line, the H1 caveat and the measures path.
153
+ // Each option in file order with its value, then the low-to-high line, the H1 caveat and the measures path.
151
154
  export function formatCompareOptions(r) {
152
155
  const value = (file) => r.options.find((o) => o.file === file).value;
153
156
  const lines = [`Baseline: ${r.baseline}`];
154
157
  for (const o of r.options) lines.push(`${o.file}: ${o.value}`);
155
- lines.push(`Near to far: ${r.order.map((f) => `${f} ${value(f)}`).join(", ")}`);
156
- lines.push(`Distance from the baseline: 0 is the same structure, 1 shares nothing. ${H1_LINE}`);
158
+ lines.push(`Structure distance, low to high: ${r.order.map((f) => `${f} ${value(f)}`).join(", ")}`);
159
+ lines.push(`Structure distance from the baseline: 0 is the same structure, 1 shares nothing. ${H1_LINE}`);
160
+ lines.push(STRUCTURE_READS);
157
161
  lines.push(r.note ?? COMPARE_NOTE);
158
162
  lines.push(`Measures: ${r.path}`);
159
163
  return lines.join("\n");
@@ -94,6 +94,9 @@ export async function draftMemo({ cwd = process.cwd(), target } = {}) {
94
94
  // Every break on a piece that is not a goal, and every break whose rule does not exist, once.
95
95
  const unknownBreaks = new Set();
96
96
  for (const b of md.breaks) {
97
+ if (b.status === "superseded") {
98
+ continue;
99
+ }
97
100
  if (!allPieces.has(norm(b.piece))) {
98
101
  gaps.push(`Break "${b.rule}" on ${b.piece}: "${b.piece}" is not a goal.`);
99
102
  } else if (!ruleOf(b.rule)) {
@@ -186,6 +186,9 @@ async function assertReviewed({ cwd, goals, rule, piece, target, was, given }) {
186
186
  if (was.status === "kept") {
187
187
  return;
188
188
  }
189
+ if (was.status === "superseded") {
190
+ refuse("it is superseded. Set it to trying again with record-break --status trying, then review the page with review-design.");
191
+ }
189
192
  if (was.status === "reverted") {
190
193
  refuse("it is reverted. Set it to trying again with record-break --status trying, then review the page with review-design.");
191
194
  }
@@ -242,6 +245,19 @@ async function checkBreak({ cwd, rule, piece, target, targetArg, status, effect,
242
245
  return { ...base, given, next, isTarget, keeping };
243
246
  }
244
247
 
248
+ // Retiring a break: the entry must already exist for this rule, piece and target. The piece may have no goal any more,
249
+ // so the goal and the rule are not looked up; only the status changes, with no review and no stamp.
250
+ async function supersedeOne({ cwd, rule, piece, target, targetArg }) {
251
+ const file = await findFile(cwd);
252
+ const text = await readText(file);
253
+ const was = parseLazuliMd(text).breaks.find((b) => norm(b.rule) === norm(rule) && norm(b.piece) === norm(piece) && sameEntryTarget(b.target, target, cwd));
254
+ if (!was) {
255
+ throw new RecordInputError([`No break ${rule} on ${piece} to supersede.`]);
256
+ }
257
+ const isTarget = (b) => norm(b.rule) === norm(was.rule) && norm(b.piece) === norm(was.piece) && sameEntryTarget(b.target, target, cwd);
258
+ return { file, isTarget, rule: was.rule, piece: was.piece };
259
+ }
260
+
245
261
  async function breakOne(args) {
246
262
  const { cwd, status, target } = args;
247
263
  const { file, text, goal, known, given, next, isTarget, keeping } = await checkBreak(args);
@@ -273,6 +289,23 @@ export async function recordBreak({ cwd = process.cwd(), rule, piece, target: ta
273
289
  if (ids.length === 0) {
274
290
  throw new RecordInputError(["--rule needs a rule id."]);
275
291
  }
292
+ if (String(status ?? "").trim() === "superseded") {
293
+ if (effect !== undefined || check !== undefined) {
294
+ throw new RecordInputError(["--status superseded changes only the status; give no --effect or --check."]);
295
+ }
296
+ const planned = [];
297
+ for (const id of ids) {
298
+ planned.push(await supersedeOne({ cwd, rule: id, piece, target, targetArg }));
299
+ }
300
+ const entries = [];
301
+ for (const p of planned) {
302
+ const text = await readText(p.file);
303
+ const next = guard(() => writeBreak(text, { rule: p.rule, piece: p.piece, ...(target !== undefined ? { target } : {}), status: "superseded" }, { sameTarget: (a, b) => sameEntryTarget(a, b, cwd) }));
304
+ await commit({ file: p.file, text, next, kind: "breaks", isTarget: p.isTarget, expected: (now, was) => now.status === "superseded" && ["effect", "check", "piece"].every((k) => now[k] === was?.[k]) });
305
+ entries.push({ path: p.file, rule: p.rule, piece: p.piece, status, notes: [] });
306
+ }
307
+ return { path: entries[0].path, rule: entries[0].rule, rules: entries.map((e) => e.rule), piece: entries[0].piece, status, entries, notes: [] };
308
+ }
276
309
  const args = (id) => ({ cwd, rule: id, piece, target, targetArg, effect, check, status });
277
310
  const checked = [];
278
311
  for (const id of ids) {
@@ -32,7 +32,8 @@ const show = (v, unit = "") => (v === null || v === undefined ? "n/a" : `${v}${u
32
32
 
33
33
  // One line under a thumbnail: the measures the agent reads to name scale, empty space, focal point and tension.
34
34
  // The sheet gives no ranking and no combined score.
35
- // A failed rule is never hidden: fails, breaks and declared moves are named next to the hints. A crop note, when given, is a third line.
35
+ // A failed rule is never hidden: fails, breaks and declared moves are named next to the hints. A UR3 finding that read
36
+ // the UC9 pair names the pair it compared on the next line. A crop note, when given, follows.
36
37
  export function optionLabel(layout, findings, note, screensLine, distanceLine) {
37
38
  const f = layout.focal;
38
39
  const focal = f ? `focal ${f.selector} ${show(f.dominance, "x")} at (${show(f.x)}, ${show(f.y)})` : "focal none";
@@ -41,9 +42,11 @@ export function optionLabel(layout, findings, note, screensLine, distanceLine) {
41
42
  const named = [["fails", ids("fail")], ["breaks", ids("break")], ["declared", ids("declared")], ["hints", ids("hint")]]
42
43
  .filter(([, list]) => list.length)
43
44
  .map(([word, list]) => `${word} ${list.join(", ")}`);
45
+ const pair = findings.find((x) => x.ruleId === "UR3" && x.moves?.UC9)?.moves.UC9.detail;
44
46
  return [
45
47
  `scale ${show(layout.textRatio, "x")} text, ${show(layout.areaRatio, "x")} area; empty ${empty}, spread ${show(layout.emptySpread)}; ${focal}`,
46
48
  named.length ? named.join("; ") : "no hints",
49
+ ...(pair ? [`UR3 pair: ${pair}`] : []),
47
50
  ...(note ? [note] : []),
48
51
  ...(screensLine ? [screensLine] : []),
49
52
  ...(distanceLine ? [distanceLine] : []),
@@ -191,7 +194,7 @@ export async function renderOptions({ folder: given, widths = [1440], height = V
191
194
  // The baseline is read once per width, not once per option.
192
195
  if (!baselineSigs.has(width)) baselineSigs.set(width, await signatureAt(browser, baseline, width, cwd, height));
193
196
  const d = distance(await signatureAt(browser, file, width, cwd, height), baselineSigs.get(width));
194
- (option.distances ??= {})[String(width)] = `distance ${d.value} from ${baselineName(baseline)} (H1)`;
197
+ (option.distances ??= {})[String(width)] = `structure distance ${d.value} from ${baselineName(baseline)} (H1)`;
195
198
  }
196
199
  option.findings.push(...declared(evaluate(rules, [{ width, layout }], MEASURERS), file));
197
200
  } finally {
@@ -476,7 +476,8 @@ export function loadsDiffer(base, kase) {
476
476
  // adds (null on a page that hides its sideways overflow); clippedX: on such a page, how much further the content
477
477
  // runs past the clipped right edge. wide: the texts whose right edge passes the viewport in the case and did not
478
478
  // at rest, or passes it further than at rest, listed only when the case adds one of the two. restBleeds: how many texts of the
479
- // base bleed at rest (null when the base reading has no bleed fields).
479
+ // base bleed at rest, the kept texts that bleed plus restDecorative (null when the base reading has no bleed fields);
480
+ // restSideways: the base scrolls sideways at rest (overflowX past ALIGN_PX on a page that does not hide it), where no text bleeds.
480
481
  export function compareBreaks(base, kase, injected = { removed: [] }) {
481
482
  const baseText = new Map(base.texts.map((t) => [t.id, t]));
482
483
  const baseKept = new Set(base.kept);
@@ -545,8 +546,9 @@ export function compareBreaks(base, kase, injected = { removed: [] }) {
545
546
  return !b?.pastRight || grew(t.right, b.right) !== null;
546
547
  };
547
548
  const wide = overflowX === null && clippedX === null ? [] : group(kase.texts.filter((t) => t.pastRight && newlyPast(t)).map((t) => t.id));
548
- const restBleeds = base.texts.some((t) => "bleeds" in t) ? base.texts.filter((t) => t.bleeds).length : null;
549
- return { overflowX, clippedX, spills, cut, lost, overlaps, wide, restBleeds };
549
+ const restBleeds = Array.isArray(base.restDecorative) || base.texts.some((t) => "bleeds" in t) ? base.texts.filter((t) => t.bleeds).length + (base.restDecorative?.length ?? 0) : null;
550
+ const restSideways = Number.isFinite(base.overflowX) && base.overflowX > ALIGN_PX;
551
+ return { overflowX, clippedX, spills, cut, lost, overlaps, wide, restBleeds, restSideways };
550
552
  }
551
553
 
552
554
  // The verdict of one case: breaks are reported only when every stylesheet was
@@ -473,6 +473,38 @@
473
473
  if (!Number.isFinite(n)) return false;
474
474
  return (a.endsWith("%") ? n / 100 : n) === FILTER_IDENTITY[name];
475
475
  };
476
+ // The top-level name(argument) calls of a filter value, in order. Parentheses are counted to any depth and
477
+ // a quoted string (a url) is skipped whole, so an argument that holds its own calls or parentheses never hides
478
+ // the function after it.
479
+ const filterCalls = (text) => {
480
+ const calls = [];
481
+ const s = String(text);
482
+ let i = 0;
483
+ while (i < s.length) {
484
+ const m = /[a-z-]+\(/y;
485
+ m.lastIndex = i;
486
+ const hit = m.exec(s);
487
+ if (!hit) { i += 1; continue; }
488
+ const name = hit[0].slice(0, -1);
489
+ let depth = 1;
490
+ let j = i + hit[0].length;
491
+ const from = j;
492
+ let quote = null;
493
+ for (; j < s.length && depth > 0; j += 1) {
494
+ const c = s[j];
495
+ if (quote) {
496
+ if (c === "\\") j += 1;
497
+ else if (c === quote) quote = null;
498
+ } else if (c === '"' || c === "'") quote = c;
499
+ else if (c === "(") depth += 1;
500
+ else if (c === ")") depth -= 1;
501
+ }
502
+ if (depth > 0) break;
503
+ calls.push([name, s.slice(from, j - 1)]);
504
+ i = j;
505
+ }
506
+ return calls;
507
+ };
476
508
  const treatmentOf = (el) => {
477
509
  const rule = opts.treatment;
478
510
  if (!rule || !Array.isArray(rule.filters)) return null;
@@ -480,9 +512,9 @@
480
512
  let blend = null;
481
513
  for (let node = el; node && node.nodeType === 1; node = node.parentElement) {
482
514
  const cs = getComputedStyle(node);
483
- for (const m of String(cs.filter).matchAll(/([a-z-]+)\(((?:[^()]|\([^()]*\))*)\)/g)) {
484
- if (identity(m[1], m[2])) continue;
485
- if (rule.filters.includes(m[1]) && !names.includes(m[1])) names.push(m[1]);
515
+ for (const [name, arg] of filterCalls(cs.filter)) {
516
+ if (identity(name, arg)) continue;
517
+ if (rule.filters.includes(name) && !names.includes(name)) names.push(name);
486
518
  }
487
519
  if (rule.blends === true && !blend && cs.mixBlendMode && cs.mixBlendMode !== "normal") blend = cs.mixBlendMode;
488
520
  if (/^(section|article|body)$/i.test(node.tagName) && node !== el) break;
@@ -490,6 +522,23 @@
490
522
  const parts = [...names, ...(blend ? ["mix-blend-mode " + blend] : [])];
491
523
  return parts.length > 0 ? parts.join(", ") : null;
492
524
  };
525
+ // The last path segment of an image's full address, for naming an image that has no alt: query, fragment and
526
+ // host dropped, decoded when percent-encoded, whitespace collapsed, clipped to 40. A data: or blob: source, or
527
+ // an address with no path segment, has no name ("").
528
+ const fileNameOf = (el) => {
529
+ // No source at all would resolve to the page itself and name the image after it.
530
+ if (!(el.currentSrc || el.getAttribute("src"))) return "";
531
+ try {
532
+ const u = new URL(el.currentSrc || el.getAttribute("src") || "", document.baseURI);
533
+ if (!/^(https?|file):$/.test(u.protocol)) return "";
534
+ const seg = u.pathname.split("/").filter(Boolean).pop() || "";
535
+ let name = seg;
536
+ try { name = decodeURIComponent(seg); } catch { /* keep the raw segment */ }
537
+ return clip(norm(name), 40);
538
+ } catch {
539
+ return "";
540
+ }
541
+ };
493
542
  const largeImages = [];
494
543
  let totalLarge = 0;
495
544
  if (Number.isFinite(opts.minSidePx) && opts.minSidePx > 0) {
@@ -502,6 +551,8 @@
502
551
  largeImages.push({
503
552
  selector: info.selector,
504
553
  src: info.src.slice(0, 200),
554
+ alt: clip(norm(el.getAttribute("alt")), 40),
555
+ fileName: fileNameOf(el),
505
556
  decorative: info.decorative || Boolean(el.closest("[aria-hidden=true]")),
506
557
  widthPx: round(r.width),
507
558
  heightPx: round(r.height),
@@ -1,7 +1,7 @@
1
1
  // Evaluated inside the page as a function expression: (opts, lookOf) => plain data. Plain script, no imports.
2
2
  // The shared composition library (blocks, sections, coverage, body size) lives inside; opts.read picks
3
3
  // the reader that turns it into plain data ("layout", "rhythm", "components", "forms", "actions", "piece",
4
- // "motion" or "chart").
4
+ // "motion", "chart" or "viewport").
5
5
  // opts.options true is the render-options reading: elements marked data-block are the option blocks. Without it
6
6
  // the marks are ignored (a finished page measures as a page) and counted in the reader's marks.
7
7
  // lookOf is the look.js function, injected as source by the caller:
@@ -1488,9 +1488,16 @@
1488
1488
  return { charts, notes };
1489
1489
  };
1490
1490
 
1491
- const readers = { layout, rhythm, components, forms, actions, piece, motion, content, seen: contentKept, chart };
1491
+ // The viewport reader: whether the page hides its overflow on each axis (the one place this lock is read).
1492
+ const viewport = () => ({ lockedX: locked(viewportOverflow("x")), lockedY: locked(viewportOverflow("y")) });
1493
+
1494
+ const readers = { layout, rhythm, components, forms, actions, piece, motion, content, seen: contentKept, chart, viewport };
1492
1495
  // Every reader says how many data-block marks the page carries; Node notes them when they were not read.
1493
1496
  const out = readers[opts.read](opts);
1494
- if (out && typeof out === "object" && !Array.isArray(out)) out.marks = document.querySelectorAll("[data-block]").length;
1497
+ if (out && typeof out === "object" && !Array.isArray(out)) {
1498
+ out.marks = document.querySelectorAll("[data-block]").length;
1499
+ // With options asked, whether the blocks were the marks (a mark in the walk) or the finished-page blocks.
1500
+ if (opts.options === true) out.byMarks = isOptions();
1501
+ }
1495
1502
  return out;
1496
1503
  }
@@ -5,15 +5,17 @@
5
5
  // the case page only: it never clicks, focuses, types, selects or submits, and sends nothing.
6
6
  //
7
7
  // Kept elements are those the composition walk keeps (read "seen", keepPinned) outside DECORATIVE (aria-hidden)
8
- // subtrees: hidden, clipped, off-page and decorative content is never read, changed or reported.
8
+ // subtrees: hidden, clipped, off-page and decorative content is never changed or reported; decorative text the
9
+ // walk keeps is read only for restDecorative.
9
10
  // tag(): data-lazuli-x on body and every element in it, a sequential index in document order; returns the count.
10
11
  // inject(kind, params) -> { lists, added, shortLists, cut, removed } for kind "base", "growth", "long-text",
11
12
  // "empty", "one", "many". shortLists: the lists many filled with fewer than MANY_ITEMS items. removed lists the data-lazuli-x of every element removed, descendants included. The k-th copy of an
12
13
  // item (many) has its data-lazuli-x and those of its descendants rewritten to <original>~c<k> and its id
13
14
  // attributes removed, so every copy stays apart and is compared through its original. The caller runs
14
15
  // the at-rest walk again (restStill) before read().
15
- // read() -> { overflowX, clippedX, texts: { id, selector, text, spills, cut, whole, bleeds, pastRight, right }[], kept, overlaps,
16
- // rectsCut, away, fonts, sheets, brokenImages }. overflowX: how far the page scrolls sideways, null when the
16
+ // read() -> { overflowX, clippedX, texts: { id, selector, text, spills, cut, whole, bleeds, pastRight, right }[], restDecorative, kept, overlaps,
17
+ // rectsCut, away, fonts, sheets, brokenImages }. restDecorative: { selector, text }[], the decorative text elements
18
+ // the walk keeps whose box crosses the left or right edge, with the gate of bleeds; read only, no case changes them. overflowX: how far the page scrolls sideways, null when the
17
19
  // viewport hides its sideways overflow (html, or body when html is visible, has overflow-x hidden or clip, as
18
20
  // composition reads it); clippedX: on such a page, how far the content runs past the clipped right edge, else
19
21
  // null. whole: every line box of the text was read for overlap. bleeds:
@@ -34,7 +36,8 @@
34
36
  const SCROLLS = new Set(["auto", "scroll", "overlay"]);
35
37
 
36
38
  const INLINE = new Set(INLINE_ITEMS);
37
- const keptEls = () => composition({ read: "seen", keepPinned: true }).filter((el) => !el.closest(DECORATIVE));
39
+ const seenEls = () => composition({ read: "seen", keepPinned: true });
40
+ const keptEls = () => seenEls().filter((el) => !el.closest(DECORATIVE));
38
41
  const idOf = (el) => el.getAttribute(ATTR);
39
42
  const ownTexts = (el) => [...el.childNodes].filter((n) => n.nodeType === 3 && /\S/.test(n.nodeValue));
40
43
  const isInputButton = (el) => el.tagName === "INPUT" && INPUT_BUTTONS.has((el.getAttribute("type") || "").toLowerCase());
@@ -269,16 +272,23 @@
269
272
  };
270
273
 
271
274
  const read = () => {
272
- const kept = keptEls();
275
+ const seen = seenEls();
276
+ const kept = seen.filter((el) => !el.closest(DECORATIVE));
273
277
  const keptSet = new Set(kept);
274
278
  const root = document.documentElement;
275
279
  const vw = root.clientWidth;
276
280
  // As composition's bleeds: a page that scrolls sideways (html, or body when html is visible, does not
277
281
  // hide that overflow) has no bleed.
278
- const rootStyle = getComputedStyle(root);
279
- const viewStyle = rootStyle.overflowX === "visible" && rootStyle.overflowY === "visible" ? getComputedStyle(document.body) : rootStyle;
280
- const lockedX = CLIPS.has(viewStyle.overflowX);
282
+ const { lockedX } = composition({ read: "viewport" });
281
283
  const sideways = root.scrollWidth > vw + ALIGN_PX && !lockedX;
284
+ const crosses = (box) => !sideways && box.right > 0 && box.left < vw && (box.left < -ALIGN_PX || box.right > vw + ALIGN_PX);
285
+ const restDecorative = [];
286
+ for (const el of seen) {
287
+ if (!el.closest(DECORATIVE)) continue;
288
+ const nodes = ownTexts(el);
289
+ if (nodes.length === 0 || !crosses(across(el, rectsOf(nodes)))) continue;
290
+ restDecorative.push({ selector: selectorOf(el), text: collapse(nodes.map((n) => n.nodeValue).join(" ")).slice(0, 40) });
291
+ }
282
292
  const entries = [];
283
293
  for (const el of kept) {
284
294
  const id = idOf(el);
@@ -289,7 +299,7 @@
289
299
  const container = containerOf(el);
290
300
  const box = across(el, rects);
291
301
  const pastRight = box.right > vw + ALIGN_PX;
292
- const bleeds = !sideways && box.right > 0 && box.left < vw && (box.left < -ALIGN_PX || pastRight);
302
+ const bleeds = crosses(box);
293
303
  entries.push({
294
304
  el, rects, container,
295
305
  text: { id, selector: selectorOf(el), text: collapse(nodes.map((n) => n.nodeValue).join(" ")).slice(0, 40), spills: spillsOf(container, rects), cut: cutOf(container, rects), whole: true, bleeds, pastRight, right: box.right },
@@ -363,6 +373,7 @@
363
373
  overflowX: lockedX ? null : root.scrollWidth - root.clientWidth,
364
374
  clippedX: lockedX ? root.scrollWidth - root.clientWidth : null,
365
375
  texts: entries.map((e) => e.text),
376
+ restDecorative,
366
377
  kept: kept.map(idOf).filter((id) => id !== null),
367
378
  overlaps,
368
379
  rectsCut,
@@ -1,4 +1,5 @@
1
1
  import fs from "node:fs/promises";
2
+ import { isOptionsGoal } from "../project/lazuli-md.mjs";
2
3
 
3
4
  // Resolution, not a composition rule: the first view is read as SPACE_CELLS by SPACE_CELLS cells for
4
5
  // where its empty space sits.
@@ -19,8 +20,9 @@ const unique = (list) => [...new Set(list)];
19
20
  // First view scale contrast, empty space and focal point; sections and their grid edges; bleeds and crossings.
20
21
  // Report shape as in LayoutReport, except sections[].left and sections[].right are
21
22
  // number | null: null (and centered false) for a section with no blocks, which uniformGrid leaves out.
22
- // ctx.options true is the render-options reading: elements marked data-block are the option blocks. Any other
23
- // caller measures a finished page, and the marks it carries are ignored and noted.
23
+ // ctx.options true is the options reading: elements marked data-block are the option blocks (render-options, and
24
+ // check-design on a file an options goal covers, whose pieces come from ctx.goals). Any other caller measures a
25
+ // finished page, and the marks it carries are ignored and noted.
24
26
  export async function measureLayout(page, ctx = {}) {
25
27
  script ??= await fs.readFile(new URL("./in-page/composition.js", import.meta.url), "utf8");
26
28
  const raw = await page.evaluate(`(${script})(${JSON.stringify({ read: "layout", spaceCells: SPACE_CELLS, options: ctx?.options === true })})`);
@@ -58,7 +60,14 @@ export async function measureLayout(page, ctx = {}) {
58
60
 
59
61
  const emptyCells = raw.emptyCells.map(round);
60
62
  if (raw.ground.length) notes.push(`Covers the whole first view, read as ground and not as a block: ${unique(raw.ground).join(", ")}.`);
61
- if (raw.marks > 0 && ctx?.options !== true) notes.push("This page has data-block marks; check-design measures it as a finished page and ignores them (only render-options reads them).");
63
+ if (raw.marks > 0 && ctx?.options !== true) notes.push("This page has data-block marks; check-design measures it as a finished page and ignores them (only a file covered by an options goal is read by its marks).");
64
+ const pieces = (ctx?.goals ?? []).filter(isOptionsGoal).map((g) => g.piece);
65
+ if (ctx?.options === true && pieces.length && raw.byMarks) {
66
+ const named = pieces.length === 1 ? `the options goal "${pieces[0]}"` : `the options goals ${pieces.map((p) => `"${p}"`).join(", ")}`;
67
+ notes.push(`Read as an option (covered by ${named}): its data-block marks are the blocks, as render-options reads them.`);
68
+ } else if (ctx?.options === true && pieces.length && raw.marks > 0) {
69
+ notes.push("This file is covered by an options goal, but none of its data-block marks is in the first view, so it was read as a finished page.");
70
+ }
62
71
  if (raw.spaces.length) notes.push(`Space blocks are not counted as figure: ${unique(raw.spaces).join(", ")}.`);
63
72
  if (!raw.scrolls) notes.push("The page does not scroll; it was read as one section.");
64
73
  if (raw.noSections && raw.pinnedContent) notes.push("Content sits in a fixed container and was not measured.");
@@ -1,4 +1,5 @@
1
1
  import fs from "node:fs/promises";
2
+ import { isOptionsGoal } from "../project/lazuli-md.mjs";
2
3
 
3
4
  let script;
4
5
 
@@ -62,6 +63,12 @@ export async function measureRhythm(page, ctx = {}) {
62
63
  }
63
64
  }
64
65
 
66
+ // A page covered only by options goals, none with a Rhythm line: the map belongs to the chosen page, not to a folder of options.
67
+ const optionsOnly = goals.length > 0 && goals.every(isOptionsGoal) && declared === null;
68
+ if (optionsOnly) {
69
+ notes.push(`The goals of this page cover a folder of options (${goals.map((g) => g.piece).join(", ")}) and none has a Rhythm line, so the rhythm map was not compared; give the chosen page its own goal with a Rhythm line.`);
70
+ }
71
+
65
72
  if (!raw.scrolls) notes.push(NO_SCROLL_NOTE);
66
73
  if (raw.noSections && raw.pinnedContent) notes.push("Content sits in a fixed container and was not measured.");
67
74
 
@@ -76,6 +83,7 @@ export async function measureRhythm(page, ctx = {}) {
76
83
  climax,
77
84
  declared,
78
85
  hasGoal: goals.length > 0,
86
+ optionsOnly,
79
87
  notes,
80
88
  };
81
89
  }
@@ -2,7 +2,7 @@ import { readFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
 
4
4
  const MODES = ["director", "delegate"];
5
- const STATUSES = ["trying", "kept", "reverted"];
5
+ const STATUSES = ["trying", "kept", "reverted", "superseded"];
6
6
  const BEATS = ["breathe", "steady", "accelerate", "climax"];
7
7
  export const SECTION_NAMES = [
8
8
  "platform and constraints",
@@ -440,7 +440,7 @@ function parseBreaks(lines, problems) {
440
440
  if (STATUSES.includes(value)) {
441
441
  status = value;
442
442
  } else {
443
- problems.push(`Break ${rule}: status must be trying, kept or reverted`);
443
+ problems.push(`Break ${rule}: status must be trying, kept, reverted or superseded`);
444
444
  }
445
445
  }
446
446
  const target = entryTarget(f.target);
@@ -503,6 +503,12 @@ export function parseLazuliMd(text) {
503
503
  const brand = parseBrand(found.get("brand") ?? [], problems);
504
504
  const goals = parseGoals(found.get("goals") ?? [], problems);
505
505
  const breaks = parseBreaks(found.get("breaks") ?? [], problems);
506
+ const pieces = new Set(goals.map((g) => g.piece.trim().toLowerCase()));
507
+ for (const b of breaks) {
508
+ if ((b.status === "trying" || b.status === "kept") && !pieces.has(b.piece.trim().toLowerCase())) {
509
+ problems.push(`Break ${b.rule}: Piece "${b.piece}" matches no goal under ## Goals, so it never applies. If the piece is gone, set its status to superseded with record-break.`);
510
+ }
511
+ }
506
512
  const decisions = parseDecisions(found.get("decisions") ?? [], problems);
507
513
  return { mode, idea, audience, brand, goals, breaks, decisions, problems };
508
514
  }
@@ -4,7 +4,7 @@ import { BULLET, FIELD, HEADING, SECTION_NAMES, knownSection, stripComments } fr
4
4
  // Everything the entry does not own stays byte for byte: other sections, comments, hand-written lines
5
5
  // and the line ending (LF or CRLF), including a file that has no final newline.
6
6
 
7
- const STATUSES = ["trying", "kept", "reverted"];
7
+ const STATUSES = ["trying", "kept", "reverted", "superseded"];
8
8
  const norm = (s) => String(s ?? "").trim().toLowerCase();
9
9
  const label = (key) => key.charAt(0).toUpperCase() + key.slice(1);
10
10
 
@@ -313,7 +313,7 @@ export function writeBreak(text, brk, { sameTarget } = {}) {
313
313
  }
314
314
  }
315
315
  if (given.status !== undefined && given.status !== "" && !STATUSES.includes(given.status)) {
316
- problems.push("Status must be trying, kept or reverted.");
316
+ problems.push("Status must be trying, kept, reverted or superseded.");
317
317
  }
318
318
  return write(text, BREAKS, rule, given, problems, sameTarget);
319
319
  }
@@ -136,6 +136,9 @@ export function applyBreaks(findings, breaks, goals, rules, knownIds, target, cw
136
136
  const unapplied = [];
137
137
  for (const b of breaks) {
138
138
  let reason = null;
139
+ if (b.status === "superseded") {
140
+ continue;
141
+ }
139
142
  if (known && !known.has(norm(b.rule))) {
140
143
  reason = "unknown rule id";
141
144
  } else if (!pieces.has(norm(b.piece)) || !here(b)) {
@@ -161,7 +164,8 @@ export function applyBreaks(findings, breaks, goals, rules, knownIds, target, cw
161
164
  // declared_by is explained by a decision "<move> followed|broken" or a live break (trying or kept) on the
162
165
  // move, of a goal of this page, with no Target or this Target. Only where the finding measured the move
163
166
  // (moves[move].holds) does the hint become level declared; elsewhere it stays a hint and says why.
164
- // The original message always stays as the first evidence line of a declared finding.
167
+ // The original message always stays as the first evidence line of a declared finding. notHeld lists every
168
+ // move read here that did not hold, with the piece it was declared for and absent: true when the move is not on the page.
165
169
  export function applyDeclarations(findings, md, goals, rules, target, cwd) {
166
170
  const pieces = new Set(goals.map((g) => norm(g.piece)));
167
171
  const here = (e) => pieces.has(norm(e.piece)) && (!e.target || sameTarget(e.target, target, cwd));
@@ -174,6 +178,7 @@ export function applyDeclarations(findings, md, goals, rules, target, cwd) {
174
178
  return b ? { piece: b.piece, by: "break", text: b.effect } : null;
175
179
  };
176
180
  const applied = [];
181
+ const notHeld = [];
177
182
  const out = findings.map((f) => {
178
183
  if (f.level !== "hint") {
179
184
  return f;
@@ -189,6 +194,10 @@ export function applyDeclarations(findings, md, goals, rules, target, cwd) {
189
194
  return { ...f, evidence: [`${move} is declared for ${found.piece}, but the move was not measured here.`, ...(f.evidence ?? [])] };
190
195
  }
191
196
  if (!read.holds) {
197
+ notHeld.push({ ruleId: f.ruleId, move, piece: found.piece, width: f.width, ...(read.absent ? { absent: true } : {}) });
198
+ if (read.absent) {
199
+ return { ...f, evidence: [`${move} is declared for ${found.piece}, but here ${read.detail}, so the move is not on this page at this width.`, ...(f.evidence ?? [])] };
200
+ }
192
201
  return { ...f, evidence: [`${move} is declared for ${found.piece}, but here ${read.detail}, so it reads as the move's excess, not the move.`, ...(f.evidence ?? [])] };
193
202
  }
194
203
  applied.push({ ruleId: f.ruleId, move, piece: found.piece, width: f.width, by: found.by, text: found.text });
@@ -196,5 +205,5 @@ export function applyDeclarations(findings, md, goals, rules, target, cwd) {
196
205
  }
197
206
  return f;
198
207
  });
199
- return { findings: out, applied };
208
+ return { findings: out, applied, notHeld };
200
209
  }
@@ -113,7 +113,10 @@ function imageTreatment(rule, m) {
113
113
  // The measurer reads at most a fixed number of large images; past it the count says so.
114
114
  const read = Number.isFinite(m.a11y.totalLarge) && m.a11y.totalLarge > list.length ? `, of the first ${plural(list.length, "large image")} read` : "";
115
115
  if (treated.length === 0) return makeFinding(rule, m.width, "pass", `No large image is shown recolored by a filter or a blend mode${read}.`);
116
- const lines = treated.map((i) => `${clip(i.selector)} (${i.treatment})`);
116
+ const lines = treated.map((i) => {
117
+ const file = i.alt ? "" : clip(i.fileName ?? "");
118
+ return `${clip(i.selector)}${i.alt ? ` "${clip(i.alt)}"` : file ? ` ${file}` : ""} (${i.treatment})`;
119
+ });
117
120
  const shown = lines.slice(0, SHOWN).join(", ") + (lines.length > SHOWN ? `, and ${lines.length - SHOWN} more` : "");
118
121
  return makeFinding(
119
122
  rule,
@@ -93,7 +93,18 @@ const shareOf = (a) => (Number.isFinite(a.share) ? a.share : a.pct / 100);
93
93
 
94
94
  // GR10: a Brand color is present when the first-view area entries within maxDeltaE of it (Delta E 1976, the
95
95
  // chart measurer's conversion) cover at least minShare of the view, on the unrounded shares. Silent without
96
- // Brand colors or area entries; the measurer notes the missing lines.
96
+ // Brand colors or area entries; the measurer notes the missing lines. The hint only gains a line per token when
97
+ // the view holds the token's hue at another lightness or chroma (maxHueDeg, minChroma; LCH hue and chroma from
98
+ // the Lab the kit already computes, CSS Color 4 section 19); it never turns a hint into a pass.
99
+ const lch = (rgb) => {
100
+ const { a, b } = cvd.toLab(rgb);
101
+ return { h: ((Math.atan2(b, a) * 180) / Math.PI + 360) % 360, c: Math.hypot(a, b) };
102
+ };
103
+ const hueGap = (h1, h2) => {
104
+ const d = Math.abs(h1 - h2);
105
+ return Math.min(d, 360 - d);
106
+ };
107
+
97
108
  function brand(rule, m) {
98
109
  const t = rule.threshold;
99
110
  if (!m.color || !hasNumbers(t, ["maxDeltaE", "minShare"])) return null;
@@ -109,9 +120,27 @@ function brand(rule, m) {
109
120
  if (d <= t.maxDeltaE) covered += shareOf(a);
110
121
  if (!nearest || d < nearest.d) nearest = { hex: a.hex, d, pct: a.pct };
111
122
  }
112
- return { tok, covered, nearest };
123
+ return { tok, rgb, covered, nearest };
113
124
  });
114
125
  const label = (tok) => (tok.name ? `${tok.name} ${tok.hex}` : tok.hex);
126
+ const hueLine = (r) => {
127
+ if (!hasNumbers(t, ["maxHueDeg", "minChroma"])) return "";
128
+ const tok = lch(r.rgb);
129
+ if (tok.c < t.minChroma) return "";
130
+ let sum = 0;
131
+ let largest = null;
132
+ for (const a of area) {
133
+ const rgb = rgbOf(a.hex);
134
+ const e = lch(rgb);
135
+ if (e.c < t.minChroma || cvd.deltaE(r.rgb, rgb) <= t.maxDeltaE) continue;
136
+ const gap = hueGap(tok.h, e.h);
137
+ if (gap > t.maxHueDeg) continue;
138
+ sum += shareOf(a);
139
+ if (!largest || shareOf(a) > largest.share) largest = { hex: a.hex, share: shareOf(a), gap };
140
+ }
141
+ if (!largest || sum < t.minShare) return "";
142
+ return `; the first view has ${round1(sum * 100)}% in its hue at another lightness or chroma (largest ${largest.hex} at ${round1(largest.share * 100)}%, hue ${Math.round(largest.gap)} degrees off)`;
143
+ };
115
144
  const present = rows.filter((r) => r.covered >= t.minShare).sort((a, b) => b.covered - a.covered);
116
145
  if (present.length > 0) {
117
146
  return makeFinding(rule, m.width, "pass", `${label(present[0].tok)} covers ${round1(present[0].covered * 100)}% of the first view.`);
@@ -121,7 +150,7 @@ function brand(rule, m) {
121
150
  m.width,
122
151
  "hint",
123
152
  "None of the Brand colors is in the first view.",
124
- rows.map((r) => `${label(r.tok)}: nearest ${r.nearest.hex} at Delta E ${round1(r.nearest.d)}, ${round1(r.nearest.pct)}% of the first view, covered ${round2(r.covered * 100)}% within Delta E ${t.maxDeltaE}`),
153
+ rows.map((r) => `${label(r.tok)}: nearest ${r.nearest.hex} at Delta E ${round1(r.nearest.d)}, ${round1(r.nearest.pct)}% of the first view, covered ${round2(r.covered * 100)}% within Delta E ${t.maxDeltaE}${hueLine(r)}`),
125
154
  );
126
155
  }
127
156
 
@@ -29,10 +29,12 @@ function byElement(b) {
29
29
  }
30
30
 
31
31
  // UC1 read through CR7 and CR8: the move holds when every element the case names already bleeds at rest and
32
- // the sideways scroll or the text past a clipped right edge, if any, is named by an element past the right edge. A page where no text bleeds at rest
33
- // does not show the move: no reading.
32
+ // the sideways scroll or the text past a clipped right edge, if any, is named by an element past the right edge. A page where no text
33
+ // (decorative included) bleeds at rest does not show the move: it reads as absent, and says when that is because the page
34
+ // scrolls sideways at rest. A reading without the count gives none.
34
35
  function bleedMove(b, els) {
35
- if (!Number.isFinite(b.restBleeds) || b.restBleeds === 0) return null;
36
+ if (!Number.isFinite(b.restBleeds)) return null;
37
+ if (b.restBleeds === 0) return { holds: false, absent: true, detail: b.restSideways ? "the page scrolls sideways at rest, and a text past the edge of a scrolling page is not a bleed" : "no text crosses the edge of the view at rest" };
36
38
  if (!(b.wide?.length > 0)) {
37
39
  if (Number.isFinite(b.overflowX) && b.overflowX > 0) return { holds: false, detail: "no element was named for the sideways scroll" };
38
40
  if (Number.isFinite(b.clippedX) && b.clippedX > 0) return { holds: false, detail: "no element was named for the text past the clipped right edge" };
@@ -40,7 +40,7 @@ function pace(rule, m) {
40
40
 
41
41
  function map(rule, m) {
42
42
  const r = m.rhythm;
43
- if (!r || notComparable(r)) return null;
43
+ if (!r || notComparable(r) || r.optionsOnly) return null;
44
44
  if (!r.declared) {
45
45
  if (!r.hasGoal) return null;
46
46
  return makeFinding(rule, m.width, "hint", "No rhythm map is declared for this page. Add a Rhythm line under its goal in LAZULI.md.");
@@ -68,7 +68,7 @@ A log of rules broken on purpose, one entry each. Copy the format below outside
68
68
  - Piece: (name of the piece, as in Goals)
69
69
  - Effect: (the effect you intend)
70
70
  - Check: (the check planned for the effect when the break is logged: a measurement, a separate reviewer or a test with people)
71
- - Status: (trying, kept or reverted)
71
+ - Status: (trying, kept, reverted or superseded)
72
72
  -->
73
73
 
74
74
  ## Decisions