mosaic-headless 1.40.2 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ja.md CHANGED
@@ -18,7 +18,7 @@
18
18
  <img src="https://img.shields.io/badge/node_properties-120-success?style=flat-square" alt="120 個の node プロパティ">
19
19
  <img src="https://img.shields.io/badge/style_properties-101-success?style=flat-square" alt="101 個のスタイルプロパティ">
20
20
  <img src="https://img.shields.io/badge/responsive_checks-733-blueviolet?style=flat-square" alt="733 件のレスポンシブ検査">
21
- <img src="https://img.shields.io/badge/self--tests-55-blueviolet?style=flat-square" alt="55 項目のセルフテスト">
21
+ <img src="https://img.shields.io/badge/self--tests-56-blueviolet?style=flat-square" alt="56 項目のセルフテスト">
22
22
  </p>
23
23
 
24
24
  <p align="center">
@@ -33,7 +33,7 @@
33
33
 
34
34
  ## 機能
35
35
 
36
- Mosaic はページを独自のデータベーステーブルに、要素 1 つにつき 1 行で保存します(`post_content` ではありません)。この skill はそのデータモデルの計測済みマップと、それを通して書き込むツールです。データは Mosaic Pro 1.0.13 から抽出し、実サイトで 1 つずつ計測しています。
36
+ Mosaic はページを独自のデータベーステーブルに、要素 1 つにつき 1 行で保存します(`post_content` ではありません)。この skill はそのデータモデルの計測済みマップと、それを通して書き込むツールです。データは Mosaic Pro 1.0.14 から抽出し、実サイトで 1 つずつ計測しています。
37
37
 
38
38
  | 分野 | 内容 |
39
39
  |---|---|
@@ -183,7 +183,7 @@ node type、node プロパティ、スタイルプロパティ、スタイル状
183
183
  | `data/theme-zip-verification.csv` | 22 | Mosaic 自身のテーマ ZIP を往復させて比較 |
184
184
  | `data/conversion-batch.csv` | 19 | あるサイトのすべての Elementor ページを変換・構築・検査 |
185
185
 
186
- - セルフテスト:`python tools/test_mosaic.py`、オフラインの 55 項目(検索、中国語の用語、構築結果の形と拒否ルール、公開されている構築インターフェース、このリポジトリの数値とプライバシー)。
186
+ - セルフテスト:`python tools/test_mosaic.py`、オフラインの 56 項目(検索、中国語の用語、構築結果の形と拒否ルール、公開されている構築インターフェース、このリポジトリの数値とプライバシー)。
187
187
  - evals:Mosaic 1.0.10〜1.0.12 の挙動に関する 16 問。skill ありで 16/16、なしで 0/16。結果:[evals/RESULTS.md](evals/RESULTS.md)。
188
188
  - `SKILL.md`、これらの README、バッジの数値は、`tools/check_numbers.py` がデータと照合しています。詳細:[verification-record.md](references/verification-record.md)。
189
189
 
@@ -200,7 +200,7 @@ node type、node プロパティ、スタイルプロパティ、スタイル状
200
200
 
201
201
  ## 制限
202
202
 
203
- - Mosaic Pro 1.0.13 まで計測済みです。1.0.13 のエディターにしかない機能(新しいスタイル変数の種類、List のクラス、pageLoad の遅延など)はまだ計測しておらず、ツールも書き込みません。
203
+ - Mosaic Pro 1.0.14 まで計測済みです。1.0.13 のエディターにしかない機能(新しいスタイル変数の種類、List のクラス、pageLoad の遅延など)はまだ計測しておらず、ツールも書き込みません。
204
204
  - グリッド子要素の配置プロパティは headless で書き込んでも出力されません。一部のインタラクションの形はまだ計測していません。
205
205
  - ブラウザー検証ツールには Playwright と書き込み可能なサイトが必要で、オフラインのセルフテストには含まれません。
206
206
  - 未解決の項目:[data/pending.csv](data/pending.csv)。詳しいガイド(失敗モード、Elementor 変換、作例):[docs/guide.md](docs/guide.md)(英語)。
package/README.ko.md CHANGED
@@ -18,7 +18,7 @@
18
18
  <img src="https://img.shields.io/badge/node_properties-120-success?style=flat-square" alt="120개 node 속성">
19
19
  <img src="https://img.shields.io/badge/style_properties-101-success?style=flat-square" alt="101개 스타일 속성">
20
20
  <img src="https://img.shields.io/badge/responsive_checks-733-blueviolet?style=flat-square" alt="733개 반응형 검사">
21
- <img src="https://img.shields.io/badge/self--tests-55-blueviolet?style=flat-square" alt="55개 자체 테스트">
21
+ <img src="https://img.shields.io/badge/self--tests-56-blueviolet?style=flat-square" alt="56개 자체 테스트">
22
22
  </p>
23
23
 
24
24
  <p align="center">
@@ -33,7 +33,7 @@
33
33
 
34
34
  ## 기능
35
35
 
36
- Mosaic는 페이지를 자체 데이터베이스 테이블에 요소 하나당 한 행으로 저장합니다(`post_content`가 아닙니다). 이 skill은 그 데이터 모델의 측정된 지도와, 그것을 통해 기록하는 도구입니다. 데이터는 Mosaic Pro 1.0.13에서 추출해 실제 사이트에서 하나씩 측정했습니다.
36
+ Mosaic는 페이지를 자체 데이터베이스 테이블에 요소 하나당 한 행으로 저장합니다(`post_content`가 아닙니다). 이 skill은 그 데이터 모델의 측정된 지도와, 그것을 통해 기록하는 도구입니다. 데이터는 Mosaic Pro 1.0.14에서 추출해 실제 사이트에서 하나씩 측정했습니다.
37
37
 
38
38
  | 분야 | 내용 |
39
39
  |---|---|
@@ -183,7 +183,7 @@ node type, node 속성, 스타일 속성, 스타일 상태는 플러그인 소
183
183
  | `data/theme-zip-verification.csv` | 22 | Mosaic 자체 테마 ZIP을 왕복시켜 비교 |
184
184
  | `data/conversion-batch.csv` | 19 | 한 사이트의 모든 Elementor 페이지를 변환, 구축, 검사 |
185
185
 
186
- - 자체 테스트: `python tools/test_mosaic.py`, 오프라인 테스트 55개(조회, 중국어 용어, 구축 결과의 형태와 거부 규칙, 공개된 구축 인터페이스, 이 저장소의 숫자와 개인정보).
186
+ - 자체 테스트: `python tools/test_mosaic.py`, 오프라인 테스트 56개(조회, 중국어 용어, 구축 결과의 형태와 거부 규칙, 공개된 구축 인터페이스, 이 저장소의 숫자와 개인정보).
187
187
  - evals: Mosaic 1.0.10~1.0.12 동작에 관한 16문항. skill 사용 시 16/16, 미사용 시 0/16. 결과: [evals/RESULTS.md](evals/RESULTS.md).
188
188
  - `SKILL.md`, 이 README들, 배지의 숫자는 `tools/check_numbers.py`가 데이터와 대조합니다. 자세한 내용: [verification-record.md](references/verification-record.md).
189
189
 
@@ -200,7 +200,7 @@ node type, node 속성, 스타일 속성, 스타일 상태는 플러그인 소
200
200
 
201
201
  ## 제한 사항
202
202
 
203
- - Mosaic Pro 1.0.13까지 측정했습니다. 1.0.13 에디터에만 있는 기능(새 스타일 변수 유형, List 클래스, pageLoad 지연 등)은 아직 측정하지 않았고 도구도 기록하지 않습니다.
203
+ - Mosaic Pro 1.0.14까지 측정했습니다. 1.0.13 에디터에만 있는 기능(새 스타일 변수 유형, List 클래스, pageLoad 지연 등)은 아직 측정하지 않았고 도구도 기록하지 않습니다.
204
204
  - 그리드 자식 배치 속성은 headless로 기록하면 출력되지 않습니다. 일부 인터랙션 형태는 아직 측정하지 않았습니다.
205
205
  - 브라우저 검증 도구에는 Playwright와 기록 가능한 사이트가 필요하며, 오프라인 자체 테스트에는 포함되지 않습니다.
206
206
  - 미해결 항목: [data/pending.csv](data/pending.csv). 상세 가이드(실패 모드, Elementor 변환기, 예제): [docs/guide.md](docs/guide.md)(영어).
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
  <img src="https://img.shields.io/badge/node_properties-120-success?style=flat-square" alt="120 node properties">
19
19
  <img src="https://img.shields.io/badge/style_properties-101-success?style=flat-square" alt="101 style properties">
20
20
  <img src="https://img.shields.io/badge/responsive_checks-733-blueviolet?style=flat-square" alt="733 responsive checks">
21
- <img src="https://img.shields.io/badge/self--tests-55-blueviolet?style=flat-square" alt="55 self-tests">
21
+ <img src="https://img.shields.io/badge/self--tests-56-blueviolet?style=flat-square" alt="56 self-tests">
22
22
  </p>
23
23
 
24
24
  <p align="center">
@@ -33,7 +33,7 @@
33
33
 
34
34
  ## What it does
35
35
 
36
- Mosaic keeps a page in its own database tables, one row per element, not in `post_content`. This skill is a measured map of that model plus the tools to write through it, extracted from Mosaic Pro 1.0.13 and swept on a live site.
36
+ Mosaic keeps a page in its own database tables, one row per element, not in `post_content`. This skill is a measured map of that model plus the tools to write through it, extracted from Mosaic Pro 1.0.14 and swept on a live site.
37
37
 
38
38
  | Area | What you get |
39
39
  |---|---|
@@ -183,7 +183,7 @@ Node types, node properties, style properties and style states are extracted fro
183
183
  | `data/theme-zip-verification.csv` | 22 | Mosaic's own theme ZIP round-tripped and compared |
184
184
  | `data/conversion-batch.csv` | 19 | every Elementor page of a site converted, built and checked |
185
185
 
186
- - Self-test: `python tools/test_mosaic.py`, 55 offline tests (lookups, Chinese terms, the build output's shape and refusals, the public build interface, this repository's numbers and privacy).
186
+ - Self-test: `python tools/test_mosaic.py`, 56 offline tests (lookups, Chinese terms, the build output's shape and refusals, the public build interface, this repository's numbers and privacy).
187
187
  - Evals: 16 questions about Mosaic 1.0.10 to 1.0.12 behaviour; with the skill 16/16, without it 0/16. Results: [evals/RESULTS.md](evals/RESULTS.md).
188
188
  - Every number in `SKILL.md`, these READMEs and their badges is checked against the data by `tools/check_numbers.py`. Detail: [verification-record.md](references/verification-record.md).
189
189
 
@@ -200,7 +200,7 @@ What a lookup costs, priced with tiktoken on the same six tasks (`data/token-ben
200
200
 
201
201
  ## Limits
202
202
 
203
- - Measured against Mosaic Pro up to 1.0.13. Features that live only in the 1.0.13 editor (new style-variable types, List classes, pageLoad delay and others) are not measured yet and are not written by the tools.
203
+ - Measured against Mosaic Pro up to 1.0.14. Features that live only in the 1.0.13 editor (new style-variable types, List classes, pageLoad delay and others) are not measured yet and are not written by the tools.
204
204
  - Grid child placement properties emit nothing when written headlessly; some interaction shapes are still unmeasured.
205
205
  - The browser verifiers need Playwright and a site you can write to; they are not part of the offline self-test.
206
206
  - Open questions: [data/pending.csv](data/pending.csv). The long guide (failure modes, the Elementor converter, the worked example): [docs/guide.md](docs/guide.md).
package/README.zh-TW.md CHANGED
@@ -18,7 +18,7 @@
18
18
  <img src="https://img.shields.io/badge/node_properties-120-success?style=flat-square" alt="120 個 node 屬性">
19
19
  <img src="https://img.shields.io/badge/style_properties-101-success?style=flat-square" alt="101 個樣式屬性">
20
20
  <img src="https://img.shields.io/badge/responsive_checks-733-blueviolet?style=flat-square" alt="733 條 RWD 檢查">
21
- <img src="https://img.shields.io/badge/self--tests-55-blueviolet?style=flat-square" alt="55 項自我測試">
21
+ <img src="https://img.shields.io/badge/self--tests-56-blueviolet?style=flat-square" alt="56 項自我測試">
22
22
  </p>
23
23
 
24
24
  <p align="center">
@@ -33,7 +33,7 @@
33
33
 
34
34
  ## 功能
35
35
 
36
- Mosaic 把頁面存在自己的資料表裡,一個元素一列,不在 `post_content`。這個 skill 是那套資料模型的實測地圖,加上透過它寫入的工具;資料從 Mosaic Pro 1.0.13 抽出,並在正式網站上逐一實測。
36
+ Mosaic 把頁面存在自己的資料表裡,一個元素一列,不在 `post_content`。這個 skill 是那套資料模型的實測地圖,加上透過它寫入的工具;資料從 Mosaic Pro 1.0.14 抽出,並在正式網站上逐一實測。
37
37
 
38
38
  | 類別 | 內容 |
39
39
  |---|---|
@@ -183,7 +183,7 @@ node type、node 屬性、樣式屬性、樣式狀態從外掛原始碼抽出(
183
183
  | `data/theme-zip-verification.csv` | 22 | Mosaic 自己的佈景 ZIP 匯出再匯入並比對 |
184
184
  | `data/conversion-batch.csv` | 19 | 一個網站的每個 Elementor 頁面都轉換、建置並檢查 |
185
185
 
186
- - 自我測試:`python tools/test_mosaic.py`,55 項離線測試(查詢、中文用語、建頁產出的結構與拒收規則、對外的建頁介面、本 repo 的數字與隱私)。
186
+ - 自我測試:`python tools/test_mosaic.py`,56 項離線測試(查詢、中文用語、建頁產出的結構與拒收規則、對外的建頁介面、本 repo 的數字與隱私)。
187
187
  - evals:16 題 Mosaic 1.0.10 到 1.0.12 的行為題;有 skill 16/16,沒有 skill 0/16。結果見 [evals/RESULTS.md](evals/RESULTS.md)。
188
188
  - `SKILL.md`、這幾份 README 和徽章上的數字,都由 `tools/check_numbers.py` 對照資料核對。細節見 [verification-record.md](references/verification-record.md)。
189
189
 
@@ -200,7 +200,7 @@ node type、node 屬性、樣式屬性、樣式狀態從外掛原始碼抽出(
200
200
 
201
201
  ## 限制
202
202
 
203
- - 實測到 Mosaic Pro 1.0.13。只存在於 1.0.13 編輯器裡的功能(新的樣式變數類型、List 的 class、pageLoad 延遲等)還沒實測,工具也不會寫。
203
+ - 實測到 Mosaic Pro 1.0.14。只存在於 1.0.13 編輯器裡的功能(新的樣式變數類型、List 的 class、pageLoad 延遲等)還沒實測,工具也不會寫。
204
204
  - 用 headless 方式寫入格線子項位置的屬性不會有輸出;部分互動形狀還沒實測。
205
205
  - 瀏覽器驗證器需要 Playwright 和一個可以寫入的網站,不在離線自我測試裡。
206
206
  - 待補問題:[data/pending.csv](data/pending.csv)。完整說明(失敗模式、Elementor 轉換器、示範範例):[docs/guide.md](docs/guide.md)(英文)。
package/SKILL.md CHANGED
@@ -6,7 +6,7 @@ license: "MIT"
6
6
  user-invocable: true
7
7
  metadata:
8
8
  author: "moksa (https://moksaweb.com)"
9
- version: "1.40.2"
9
+ version: "1.41.0"
10
10
  homepage: "https://github.com/Moksa1123/mosaic-headless"
11
11
  ---
12
12
 
@@ -22,7 +22,7 @@ health, not plugin audits.
22
22
 
23
23
  | | |
24
24
  |---|---|
25
- | Surface | Extracted from the Mosaic Pro plugin source, last re-extracted on **Mosaic Pro 1.0.13** (unlicensed: the licence gates the theme library, not the node factories). `tools/check_tables.py` re-extracts every source table and diffs it against `data/`. 1.0.13's editor-side features are not measured yet: [upgrading.md](references/upgrading.md) |
25
+ | Surface | Extracted from the Mosaic Pro plugin source, last re-extracted on **Mosaic Pro 1.0.14** (no table changed from 1.0.13) (unlicensed: the licence gates the theme library, not the node factories). `tools/check_tables.py` re-extracts every source table and diffs it against `data/`. The editor-side features of 1.0.13 and 1.0.14 are not measured yet: [upgrading.md](references/upgrading.md) |
26
26
  | Measured on | A live WordPress 7.1 + WooCommerce 11.1 install, upgraded in place from 1.0.7 to 1.0.12. Node sweep: 133 of 134 types on 1.0.11 / 1.0.12 (`document` excluded: its probe wrecks the master). Older rows say which version they ran on. Detail: [verification-record.md](references/verification-record.md) |
27
27
  | Size | 134 node types, 120 node property names declared in 201 rows (one row per owning data class), 191 node-property probe rows covering 118 of those names (`ariaLive` and `positioning` not yet probed), 101 style properties, 60 style states, 157 variants, 76 dynamic variables, 16 interaction triggers, 115 REST routes, 23 tables. Current counts: `python tools/mo.py stats` - do not quote numbers from memory |
28
28
  | Provenance | Each table says where it came from: **source** (read out of the plugin code), **live** (captured from the running site), **swept / probed / driven** (written to a page and asserted on the delivered HTML, CSS or browser). Per-file list: [data-files.md](references/data-files.md) |
@@ -21,7 +21,7 @@
21
21
  "license": "MIT",
22
22
  "metadata": {
23
23
  "author": "moksa (https://moksaweb.com)",
24
- "version": "1.40.2",
24
+ "version": "1.41.0",
25
25
  "homepage": "https://github.com/Moksa1123/mosaic-headless"
26
26
  }
27
27
  },
@@ -24,7 +24,7 @@
24
24
  "user-invocable": true,
25
25
  "metadata": {
26
26
  "author": "moksa (https://moksaweb.com)",
27
- "version": "1.40.2",
27
+ "version": "1.41.0",
28
28
  "homepage": "https://github.com/Moksa1123/mosaic-headless"
29
29
  }
30
30
  },
@@ -21,7 +21,7 @@
21
21
  "license": "MIT",
22
22
  "metadata": {
23
23
  "author": "moksa (https://moksaweb.com)",
24
- "version": "1.40.2",
24
+ "version": "1.41.0",
25
25
  "homepage": "https://github.com/Moksa1123/mosaic-headless"
26
26
  }
27
27
  },
@@ -21,7 +21,7 @@
21
21
  "license": "MIT",
22
22
  "metadata": {
23
23
  "author": "moksa (https://moksaweb.com)",
24
- "version": "1.40.2",
24
+ "version": "1.41.0",
25
25
  "homepage": "https://github.com/Moksa1123/mosaic-headless"
26
26
  }
27
27
  },
@@ -21,7 +21,7 @@
21
21
  "license": "MIT",
22
22
  "metadata": {
23
23
  "author": "moksa (https://moksaweb.com)",
24
- "version": "1.40.2",
24
+ "version": "1.41.0",
25
25
  "homepage": "https://github.com/Moksa1123/mosaic-headless"
26
26
  }
27
27
  },
package/data/pending.csv CHANGED
@@ -7,9 +7,11 @@ date,question,why_not_found,asked_by,status
7
7
  2026-11-16,Shared msgids that need a msgctxt from Mosaic: Fixed / Select / Snap / Toggle / Scale down,one English string serves a verb and a noun so one zh_TW string cannot fit both (選取 for the Select field),zh_TW review 2026-11-05,closed 2026-11-17: all five carry a msgctxt in Mosaic 1.0.13
8
8
  2026-11-16,Is a top-level user-invocable key accepted by the claude.ai skill upload,scripts/check-release.mjs notes the Agent Skills spec allows only six top-level keys; Claude Code reads user-invocable and the claude-code platform template now writes it; the other platform templates do not; the claude.ai upload path is untested,mosaic skill (SOP item 0),open
9
9
  2026-11-17,"Mosaic 1.0.13 editor features the skill cannot write yet: new collection-variable types (background/gradient, box/text shadow, nested; font size and line height as variables); List classes; pageLoad delay; scroll-direction offset; Hide/Show in Editor actions; accordion all-open; External Styles / Gutenberg Styles","they live in the editor JavaScript, not in the PHP the extractors read; each needs one editor-authored example read back from the row on a 1.0.13 site (references/upgrading.md)",user (Mosaic 1.0.13 release),open
10
- 2026-11-17,Demo verifiers and sweeps not yet re-run on Mosaic 1.0.13,"the demo site was upgraded on 2026-11-17 and passed the page health check (90/90, no duplicate roots); the browser verifiers were held back because the shared host was under heavy load",user (Mosaic 1.0.13 release),open
10
+ 2026-11-17,Demo verifiers and sweeps not yet re-run on Mosaic 1.0.13 / 1.0.14,"the demo site went to 1.0.13 on 2026-11-17 and 1.0.14 on 2026-11-24; both passed the page health check (90/90, no duplicate roots), 1.0.14 also theme export/import and sync_nodes; the browser verifiers and property sweeps were not re-run (1.0.14 changed no stored shape)",user (Mosaic 1.0.13 release),open
11
11
  2026-11-18,"Demo site: 7 component instances (case-card x3, service-row x4) in two unbound templates have all 70 override nodes emptied to originalID-only shells","not a gap in the data but a known state: written 2026-11-04 18:05 UTC after a component rebuild re-keyed the components; the templates serve no post so no visitor sees it. Left as is (read-only check); prune_unbound.php would remove the templates, or the instances can be re-filled from a spec. Whether to delete the two unbound templates is the user's decision",skill 總機 (em925 override incident follow-up),waiting (user decision)
12
12
  2026-11-18,"Install the front-end write block for wp_mosaic_nodes on the demo site (references/facts.md, empty-root prevention)","a decision, not a gap: the block is measured on another live site; installing it on the shared demo site waits for the user",skill 總機 (em925 empty-root root cause),waiting (user decision)
13
13
  2026-11-21,"Can a child of an accordion item (an icon in the title) be styled through the ___accordion-item--opened state, or only the item itself?","conflicting: a second site (1.0.13) reported the state applies only to the item and needed outside CSS for an icon turn; the 1.0.13 selector template also targets the item's direct children and anything inside .m-accordion-title. This skill's state sweep recorded NO_HOST for it, so neither is measured here. Needs one accordion with a styled title icon, opened in Chromium","skill 總機 (second-site findings 2026-11-21, item 14)","closed 2026-11-21: source-documented in references/facts.md (third site): the selector template reaches the item, its direct children and anything inside the title; deeper panel children need outside CSS. Still not browser-measured here"
14
14
  2026-11-21,Does a taxonomy loop's offset ever apply (a product-brand loop started from the first term whatever the offset)?,measured on a second site only; this skill's node-property sweep never probed loop offsets on a taxonomy source. Treated as NO_EFFECT in references/facts.md until a sweep measures it,"skill 總機 (batch 4, item 40)",open
15
15
  2026-11-21,"Should build_site.py look up a post's existing template before binding, instead of always creating a new master and template?","a design decision, not a gap: em925's deploy tool imports build_site, so its behaviour is left unchanged (its md5 is part of em925's agreement). sync_nodes.py + list_bindings.php now cover in-place updates; build_site.py's limits are documented in SKILL.md and references/tools.md","skill 總機 (batch 3 item 20, batch 4 item 32)",open
16
+ 2026-11-24,"Does Mosaic 1.0.14 really answer 503 (Retry-After 30, no-cache) and write no root when the database connection is lost mid-render?","read from the 1.0.14 source and WordPress 7.1.5's wpdb only; measuring it needs the database to go away under a front-end render, not done on the shared demo site",skill 總機 (Mosaic 1.0.14 re-verification),open
17
+ 2026-11-24,Mosaic's own ZIP import of a ~24k-node theme exhausts a 512M PHP memory limit in createTemplates,"measured once on the demo site (1.0.14; the import flow's PHP is unchanged since 1.0.12); how much memory a theme that size needs, or whether Mosaic splits the tick, is not known. theme_import.php handles it",skill 總機 (Mosaic 1.0.14 re-verification),open
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mosaic-headless",
3
- "version": "1.40.2",
3
+ "version": "1.41.0",
4
4
  "description": "AI-agent skill: build Mosaic Pro (Nextend) WordPress sites by writing the underlying data model directly - 23 custom tables, no visual editor, no DOM. Every node type, style property and node property swept against a live install and asserted on the delivered HTML and compiled CSS. Installs into Claude Code, Cursor, Codex CLI, Gemini CLI, Copilot, Continue, Windsurf and Claude.ai.",
5
5
  "keywords": [
6
6
  "wordpress",
@@ -50,6 +50,13 @@ expression as a plain string in `dynamicCode`:
50
50
  "children": [{"type": "wysiwyg-variable", "data": {"dynamicCode": "@VAR('post/title')"}}]}
51
51
  ```
52
52
 
53
+ The text's tag decides what block HTML survives (Mosaic 1.0.14, measured): a `p` or
54
+ `h1`-`h6` text - by `tagName` or by its Paragraph / Heading variant - strips `<p>`,
55
+ `<h2>` and the like out of the value and joins the runs with no space, so post content
56
+ reads as one run-on line; a `div` text, or one with no tag and no variant, keeps them.
57
+ Put `@VAR('post/content')` in a `div` text. Before 1.0.14 a variant-tagged `p` kept the
58
+ inner paragraphs and the browser split them into empty `<p>` (references/upgrading.md).
59
+
53
60
  `wysiwyg-variable` is one of the seven types that **kill the page** when placed under
54
61
  a plain container — it needs a wysiwyg parent, and the sweep recorded it as
55
62
  `NodeMResourceFilterFunctionInterface parent is missing`.
@@ -56,6 +56,24 @@ Platform and rendered-tag facts, each measured. Moved out of SKILL.md on 2026-11
56
56
  bot traffic a site gets, the likelier it is. A small site is less likely to hit it,
57
57
  not immune.
58
58
 
59
+ **Fixed in Mosaic 1.0.14, read from the source (2026-11-24).** The four readers in
60
+ `MosaicDB` (`get_results`, `get_row`, `get_col`, `get_var`) now also throw when
61
+ `$wpdb->dbh` is empty - which is what WordPress leaves after a failed reconnect
62
+ (`db_connect()` sets `dbh = null` on `connect_errno`, `class-wpdb.php` line 1997 on
63
+ 7.1.5) - so a lost connection is an error, not "no root", and heal never runs on it.
64
+ `FrontendRenderer` catches that `DatabaseException` and answers **503 with
65
+ `Retry-After: 30` and no-cache headers** instead of a page. `AbstractDocument`
66
+ (load + heal) is byte-identical to 1.0.13: heal still writes on the front end, it is
67
+ only no longer fed a false empty read. What the fix does NOT do:
68
+ - repair a site that already has extra roots or emptied overrides: run the health
69
+ SQL above and `tools/override_health.sql` after upgrading, and repair as before;
70
+ - help any site still on 1.0.13 or older;
71
+ - cover a failure the readers cannot see (a read that returns empty while the
72
+ connection is up). None is known, but the front-end write block below still costs
73
+ nothing and remains a valid second layer.
74
+ Not measured: the 503 itself (dropping the database of the shared demo site to watch
75
+ it was not worth the risk).
76
+
59
77
  **Prevention, measured on one live site (2026-11-18):** block front-end writes to
60
78
  `wp_mosaic_nodes`. A `query` filter refuses `INSERT` / `REPLACE` / `DELETE` on that
61
79
  table during an ordinary front-end request, while `UPDATE` passes and wp-admin,
@@ -129,6 +147,18 @@ Platform and rendered-tag facts, each measured. Moved out of SKILL.md on 2026-11
129
147
  whose spec set neither; between a masthead and the block below it that is a
130
148
  160px hole. Set `paddingTop`/`paddingBottom` explicitly when a section's rhythm
131
149
  is meant to come from its contents.
150
+ - **`button` arrives with `padding: 12px 24px`, so a round button is an ellipse until
151
+ all four paddings are 0.** `.m-button{…width:fit-content;padding:12px 24px;…}` in the
152
+ 1.0.14 stylesheet (the `:where(button.m-button)` reset to `padding:0` has no
153
+ specificity and loses). Measured on the demo site (1.0.14, Chromium, 1440px,
154
+ `getBoundingClientRect`, at rest and hovered): a button with no style is 48 x 24;
155
+ `width`/`height` 44px with `borderRadius` 999px - or 50% - renders **48 x 44**,
156
+ because 24 + 24 > 44; the same button with `paddingTop`, `paddingBottom`,
157
+ `paddingLeft` and `paddingRight` all `0px` renders 44 x 44. Reported first from a
158
+ client site (four 44px circles at 48 x 44, 44 x 44 after the fix). The fill that
159
+ shows the shape is often a `hover` background, so a screenshot at rest looks fine:
160
+ `verify_browser.py` reports it as `ROUND_NOT_ROUND`, measured hovered too
161
+ (`--round URL` runs that check alone on any public page).
132
162
  - **A `code` node's content is a template, and `@media(` is a function call.**
133
163
  Mosaic parses `code` content for `@VAR(...)`; a CSS at-rule glued to its
134
164
  parenthesis - the form every minifier emits - is parsed as a call with
@@ -11,7 +11,7 @@ Every tool in `tools/`, and where the REST session comes from. Moved out of SKIL
11
11
  | `build_page.py` | commit one page spec through the verified write path |
12
12
  | `build_site.py` | a whole site: one master with the shell, one document per page. It makes a NEW master and new templates on EVERY run and re-binds every page it builds, so a one-line change means a full rebuild, and building only some pages leaves the site split across masters (a header edit then reaches some pages and not others). For changes to a built site use `sync_nodes.py` |
13
13
  | `verify_rwd.py` | does every `_t`/`_m` declaration reach the served stylesheet? |
14
- | `verify_browser.py` | does the **browser** compute what the stylesheet promised - and does the result pass a design audit? |
14
+ | `verify_browser.py` | does the **browser** compute what the stylesheet promised - and does the result pass a design audit? The audit includes `ROUND_NOT_ROUND`: every element whose corners are all >= 999px or >= 50% is measured with `getBoundingClientRect` at rest and hovered, and an unequal width and height is an error (a pill longer than 1.5 : 1, or one showing more than 2 characters of text, is not). `--round URL ...` runs that check alone on any public page: no spec, no session, images and fonts not fetched, stops at the first 403 |
15
15
  | `verify_intro.py` | does the page-load animation play, and - the part that matters - does it END and hand the page back? |
16
16
  | `verify_menus.py` | build and drive every site-menu option: does hover hold, do the keyboard and a touch tablet work, does the phone drawer trap focus, close on Esc and stay above a sticky header? |
17
17
  | `verify_loop.py` | a decoration that runs forever: does it loop (paused-timeline scrub), does it bury text or controls anywhere a reader can rest, does it open by pointer and by keyboard, is it still under reduced motion? |
@@ -28,7 +28,7 @@ Every tool in `tools/`, and where the REST session comes from. Moved out of SKIL
28
28
  | `interactions.py` | a library, not a command: `tween`, `on`, `mode_switch`, `set_cookie`, `cookie_is`, `hide_at_end`, `suspend` / `resume`, `class_target` - every interaction shape in the form the editor stores |
29
29
  | `verify_recipes.py` | builds Mosaic's four docs tutorials on one page and drives each in Chromium |
30
30
  | `theme_export.php` / `theme_import.php` | move a whole theme across installs, ids intact |
31
- | `theme_zip.py` | drive Mosaic's OWN export/import - the ZIP the editor makes, attachments included, over the milestone protocol; import lands in test mode unless told `--activate` |
31
+ | `theme_zip.py` | drive Mosaic's OWN export/import - the ZIP the editor makes, attachments included, over the milestone protocol; import lands in test mode unless told `--activate`. Sends the `offset` / `chunkIndex` / `chunkSize` that 1.0.12+ requires (measured on 1.0.14; 1.0.8-1.0.11 do not read them, per their source); a theme of ~20k nodes can exhaust a 512M PHP limit on import - use `theme_export.php` / `theme_import.php` for those |
32
32
  | `theme_zip_compare.php` | hold an imported copy against its source, tree for tree - every scoped table, the (parentType, type) shape, which ids survive, and orphans named rather than counted |
33
33
  | `prune_unbound.php` | delete the templates no post is bound to, the masters no kept template uses, their nodes, then orphan nodes pass after pass - one theme, dry run unless given the bare word `apply` (WP-CLI eats `--apply`), `assign="auto"` templates kept |
34
34
  | `theme_delete.php` | remove a theme completely through the plugin's own routine; refuses the live one |
@@ -1,4 +1,4 @@
1
- # Upgrading the plugin: what 1.0.7 → 1.0.8 → 1.0.10 → 1.0.11 → 1.0.12 did to the data, measured
1
+ # Upgrading the plugin: what 1.0.7 → 1.0.8 → 1.0.10 → 1.0.11 → 1.0.12 → 1.0.13 → 1.0.14 did to the data, measured
2
2
 
3
3
  A Mosaic plugin update is two events, not one. The files change when WordPress
4
4
  installs the package; the DATA changes only when Mosaic's own upgrade flow has
@@ -451,3 +451,80 @@ Editor actions; the accordion "all open" option; Style Guides renamed External
451
451
  Styles, with Gutenberg Styles. The dynamic-data function "renames" (`@FIND_IMAGE`
452
452
  ...) change the docs, not the evaluator: the ids already had underscores in 1.0.12
453
453
  (`references/dynamic-content.md`).
454
+
455
+ ## 1.0.13 → 1.0.14
456
+
457
+ Released 2026-11-24. Read from the Pro package, diffed against 1.0.13, and run on the
458
+ live test site the same day.
459
+
460
+ **`wp plugin update mosaic` can report success and change nothing.** Mosaic's updater
461
+ stages the package in `plugins/mosaic-next/` and, when the data version is unchanged,
462
+ moves it over `plugins/mosaic/` with `move_dir()`
463
+ (`MosaicUpgradeLayer/Update/UpdateInteraction.php`, `filterUpgraderInstallPackageResult`)
464
+ - without checking the result. Run by a system user that cannot delete inside
465
+ `mosaic/` (on a managed host, the server's master user, where the folders belong to
466
+ the application's own user and give the group only `r-x`), that move fails silently:
467
+ WP-CLI prints "Updated", `mosaic/` stays the old version, the new one sits inactive in
468
+ `mosaic-next/`. The package itself was the real one; licensing and the download were
469
+ not the problem. Run the update as the user that owns `wp-content/plugins/mosaic/`
470
+ (1.0.13 went in that way), and never trust the CLI line: check `Version:` in
471
+ `mosaic/mosaic.php` afterwards. To finish a half-done update by hand, copy
472
+ `mosaic-next/` to a new folder as the owning user (dirs 775, files 664), move
473
+ `mosaic/` aside and the copy into its place; `wp plugin list` then shows 1.0.14 active.
474
+ A leftover `mosaic-next/` owned by the other user has to be removed by that user.
475
+
476
+ **No data migration.** `defines.php`: `version 1.0.14`, `dataVersion 1.0.12`. Minimums
477
+ unchanged (PHP 8.2, WordPress 6.9).
478
+
479
+ **Re-extracted: nothing changed.** Every extractor re-run against 1.0.14 rewrote its
480
+ table byte for byte, and `check_tables.py` passes. The unauthenticated REST index lists
481
+ the same 115 routes with the same methods and arguments. Only three PHP files changed:
482
+
483
+ | file | change |
484
+ |---|---|
485
+ | `Mosaic/Database/MosaicDB.php` | readers throw on a lost connection - the empty-root fix (`references/facts.md`) |
486
+ | `Mosaic/Builder/FrontendRenderer.php` | a `DatabaseException` on a front-end render answers 503, `Retry-After: 30`, no-cache |
487
+ | `Mosaic/NodeTypes/Text/TextElementMResource.php` | the text filter uses the tag the element renders with (below) |
488
+
489
+ The rest is the editor bundles (multi-select, bulk styling, the interaction-preview
490
+ fix) and translations; none of it changes what is stored.
491
+
492
+ **Dynamic text with block HTML** (measured on the live site, post content holding two
493
+ paragraphs and a heading): a `text` node whose tag comes from its Paragraph or Heading
494
+ variant, with no `tagName`, used to filter its dynamic content as if it had no tag -
495
+ block tags allowed - and printed them inside its `<p>` / `<h2>`, which the browser
496
+ splits into empty paragraphs. 1.0.14 filters with the rendered tag:
497
+
498
+ | text node | renders | dynamic `post/content` comes out |
499
+ |---|---|---|
500
+ | no `tagName`, no variant | `<div>` | the block HTML, intact |
501
+ | `tagName: "div"` | `<div>` | the block HTML, intact |
502
+ | `tagName: "p"` or `"h2"` | `<p>` / `<h2>` | text only, block tags stripped, runs joined with no space |
503
+ | Paragraph / Heading 2 variant, no `tagName` | `<p>` / `<h2>` | the same - this is the case 1.0.14 fixed |
504
+
505
+ No empty `<p>` on the page. To show post content with its paragraphs, use a `div` text
506
+ (or no tag). `VAR` and `VAR_RAW` behaved the same here.
507
+
508
+ **On the live site:** the same 90 pages answered as before (88 × 200, the front page's
509
+ own permalink 301, checkout 302), no page's size moved more than 1.28%, 238 roots and no
510
+ duplicates before and after. The WP-CLI JSON export of the live theme was identical
511
+ before and after the upgrade apart from its version stamp; `theme_import.php` +
512
+ `theme_zip_compare.php` passed 22 of 22. `sync_nodes.py` on a throwaway two-page site:
513
+ an unchanged spec gave 0 differences, a one-line edit 1, a structural change rebuilt the
514
+ template, and the re-check gave 0.
515
+
516
+ **Mosaic's own ZIP (`theme_zip.py`) needed two fixes - broken since 1.0.12, not by
517
+ 1.0.14.** 1.0.12 made the export's download and the import's upload "tick isolated":
518
+ the download serves the piece at the byte `offset` the client posts, and each upload
519
+ chunk carries `chunkIndex` and `chunkSize`; a chunk's tick never reports completion, the
520
+ call with `chunkIndex == totalChunks` does. Without them the export failed with
521
+ "Missing arguments [offset]" and the import with "Missing arguments". With the fix a
522
+ 480-node theme went through export and test-mode import; the copy lacked 11 nodes whose
523
+ parent was not in that theme (a second `template-external` per master, left over from
524
+ older tools) and one variant, which the export itself left out. A 23,848-node theme
525
+ exported fine but its import died in `createTemplates` on PHP's 512M memory limit
526
+ (`ValidatorFractionalIndex.php`, deep in heal) and created nothing; the import flow's
527
+ PHP is unchanged from 1.0.12, so this is the theme's size, not 1.0.14. For a theme that
528
+ large use `theme_export.php` / `theme_import.php`.
529
+
530
+ Not measured: the 503 (it needs the database to go away); the editor-only features.
@@ -97,8 +97,9 @@ RULES: list[tuple[str, str, str]] = [
97
97
  (r"Measured on Mosaic Pro 1\.0\.10", "fixed", "version the popover / modal / trigger features were measured on (verification-record.md)"),
98
98
  (r"1\.0\.7 -> 1\.0\.10 data upgrades", "fixed", "upgrade range driven over the milestone route (upgrading.md)"),
99
99
  (r"re-verified on 1\.0\.11 and 1\.0\.12", "fixed", "plugin versions of the latest re-extraction"),
100
- (r"\*\*Mosaic Pro 1\.0\.13\*\*", "fixed", "plugin version the source tables were last re-extracted from (upgrading.md)"),
101
- (r"1\.0\.13's editor-side features", "fixed", "same version; its editor features are not measured yet"),
100
+ (r"\*\*Mosaic Pro 1\.0\.14\*\*", "fixed", "plugin version the source tables were last re-extracted from (upgrading.md)"),
101
+ (r"changed from 1\.0\.13", "fixed", "the previous version, whose tables 1.0.14 left unchanged"),
102
+ (r"editor-side features of 1\.0\.13 and 1\.0\.14", "fixed", "versions whose editor features are not measured yet"),
102
103
  (r"WordPress 7\.1 \+ WooCommerce 11\.1", "fixed", "test site stack (verification-record.md)"),
103
104
  (r"from 1\.0\.7 to 1\.0\.12", "fixed", "upgrade history of the test site"),
104
105
  (r"Node sweep: 133 of 134 types on 1\.0\.11 / 1\.0\.12", "fixed", "document is the one type excluded from the sweep"),
@@ -188,7 +189,7 @@ README_RULES: list[tuple[str, str, str]] = [
188
189
  (r"(?:with the skill|(?<!沒)有 skill|skill ありで|skill 사용 시) \d+/(\d+)", "fact", "eval_n"),
189
190
  (r"(?:without it|沒有 skill|なしで|미사용 시) (\d+)/\d+", "fact", "eval_without"),
190
191
  (r"(?:without it|沒有 skill|なしで|미사용 시) \d+/(\d+)", "fact", "eval_n"),
191
- (r"Mosaic Pro (?:up to )?1\.0\.13|1\.0\.13 ?(?:editor|編輯器|のエディター|에디터)", "fixed", "plugin version the data was last extracted from / measured to (upgrading.md)"),
192
+ (r"Mosaic Pro (?:up to )?1\.0\.1[34]|1\.0\.13 ?(?:editor|編輯器|のエディター|에디터)", "fixed", "plugin version the data was last extracted from / measured to (upgrading.md)"),
192
193
  (r"Mosaic 1\.0\.10 ?(?:to|到|〜|~) ?1\.0\.12", "fixed", "version range the eval questions cover (evals/cases.json)"),
193
194
  (r"Python 3", "fixed", "runtime requirement"),
194
195
  (r"\bH1\b", "fixed", "an HTML heading level in an example prompt"),
@@ -407,6 +407,21 @@ class SkillDoc(unittest.TestCase):
407
407
  self.assertTrue(hits, name)
408
408
 
409
409
 
410
+ class RoundCheck(unittest.TestCase):
411
+ """verify_browser's ROUND_NOT_ROUND decision, without a browser."""
412
+
413
+ def test_round_and_oval(self):
414
+ import verify_browser as vb
415
+ self.assertTrue(vb._is_round(["999px"] * 4))
416
+ self.assertTrue(vb._is_round(["50%"] * 4))
417
+ self.assertFalse(vb._is_round(["999px", "999px", "0px", "999px"]))
418
+ self.assertFalse(vb._is_round(["8px"] * 4))
419
+ self.assertTrue(vb._oval(48, 44)) # the default-padding button
420
+ self.assertFalse(vb._oval(44, 44)) # all four paddings 0
421
+ self.assertFalse(vb._oval(140, 44)) # a pill
422
+ self.assertFalse(vb._oval(44.3, 44)) # sub-pixel rounding
423
+
424
+
410
425
  class SyncNodesPlan(unittest.TestCase):
411
426
  """sync_nodes.py's matching, offline: a live document is simulated as the same spec
412
427
  flattened again (fresh node ids, the way a commit stores it)."""
@@ -153,9 +153,17 @@ def export_theme(a, cfg):
153
153
  out.write(data)
154
154
  got["bytes"] += len(data)
155
155
 
156
+ def on_milestone(mid, fields, calls):
157
+ # Mosaic 1.0.12+ serves each piece of the archive from the byte offset the
158
+ # client posts ('Missing arguments [offset]' without it); 1.0.8-1.0.11 kept
159
+ # the cursor on the server and ignore the field.
160
+ if mid == "download":
161
+ fields["offset"] = got["bytes"]
162
+ return None
163
+
156
164
  print("export theme %s" % theme)
157
165
  Flow(cfg).run(url, {"themeID": theme, "simpleExport": "1" if a.simple else "0"},
158
- on_file=on_file)
166
+ on_milestone=on_milestone, on_file=on_file)
159
167
  out.close()
160
168
  if got["bytes"] < 4 or open(a.out, "rb").read(2) != b"PK":
161
169
  sys.exit("no archive came back (%d bytes)" % got["bytes"])
@@ -189,8 +197,19 @@ def import_theme(a, cfg):
189
197
  def on_milestone(mid, fields, calls):
190
198
  if mid != "upload":
191
199
  return None
200
+ if calls > len(chunks) + 3:
201
+ sys.exit(" upload never reported completion after %d calls" % calls)
202
+ index = min(calls, len(chunks) - 1)
192
203
  fields["totalChunks"] = str(len(chunks))
193
- return ("file", os.path.basename(a.zip), chunks[min(calls, len(chunks) - 1)])
204
+ # Mosaic 1.0.12+ writes each chunk at chunkIndex * chunkSize and refuses a
205
+ # tick without both ('Missing arguments'); 1.0.8-1.0.11 appended and ignore them.
206
+ # Every chunk's tick answers isCompleted:false (a chunked batch never advances
207
+ # the milestone); the call AFTER the last chunk, chunkIndex == totalChunks,
208
+ # starts past the last batch and is the one that reports completion. It still
209
+ # needs a file part; nothing is written from it.
210
+ fields["chunkIndex"] = str(calls)
211
+ fields["chunkSize"] = str(CHUNK)
212
+ return ("file", os.path.basename(a.zip), chunks[index])
194
213
 
195
214
  Flow(cfg).run(url, base, on_milestone=on_milestone)
196
215
  print("imported. mode=%s - %s" % (
@@ -557,6 +557,213 @@ PROBE = r"""
557
557
  """
558
558
 
559
559
 
560
+ # ── ROUND: a circle that is not one ──────────────────────────────────────────
561
+ #
562
+ # A button set to 44 x 44 with `borderRadius: 999px` is meant to be a circle. Mosaic's
563
+ # `.m-button` rule arrives with `padding: 12px 24px`, and 24 + 24 is more than 44, so
564
+ # the box is 48 x 44 - an ellipse - unless every side of the padding is written as 0
565
+ # (references/facts.md). The fill that shows the shape is often a hover colour, so a
566
+ # screenshot at rest sees nothing wrong; the reading has to be taken while hovered too.
567
+ #
568
+ # An element counts as "meant to be round" when every corner's computed radius is
569
+ # >= 999px or >= 50%. Width and height are read with getBoundingClientRect, at rest
570
+ # and again with the pointer on it. A pill - a wide button with a 999px radius - is
571
+ # round by the same test and is not a defect, so only a box whose long side is at
572
+ # most ROUND_PILL_RATIO times its short side is reported: 48 x 44 is 1.09, a
573
+ # "Contact us" pill is 3 or more. A circle that only gets its radius under `:hover`
574
+ # is found from the stylesheet's :hover rules (same-origin sheets only).
575
+ # A short pill exists too - a "Home" nav link at 55 x 40 on a client site - so an
576
+ # element showing more than ROUND_MAX_TEXT characters of text is a labelled pill and
577
+ # is skipped; a circle holds an icon, a number or one character.
578
+ ROUND_PILL_RATIO = 1.5
579
+ ROUND_MAX_TEXT = 2
580
+
581
+ ROUND_JS = r"""
582
+ () => {
583
+ const qual = v => {
584
+ v = (v || '').trim().split(/\s+/)[0];
585
+ if (v.endsWith('%')) return parseFloat(v) >= 50;
586
+ if (v.endsWith('px')) return parseFloat(v) >= 999;
587
+ return false;
588
+ };
589
+ const corners = cs => [cs.borderTopLeftRadius, cs.borderTopRightRadius,
590
+ cs.borderBottomRightRadius, cs.borderBottomLeftRadius];
591
+ const round = cs => corners(cs).every(qual);
592
+ const seen = new Set();
593
+ for (const el of document.body.querySelectorAll('*')) {
594
+ if (round(getComputedStyle(el))) seen.add(el);
595
+ }
596
+ // a radius that only exists under :hover
597
+ const walk = rules => {
598
+ for (const r of rules) {
599
+ if (r.cssRules && !r.selectorText) {
600
+ if (!r.media || matchMedia(r.media.mediaText).matches) walk(r.cssRules);
601
+ continue;
602
+ }
603
+ if (!r.selectorText || !r.selectorText.includes(':hover') || !r.style) continue;
604
+ const s = r.style;
605
+ if (![s.borderTopLeftRadius, s.borderTopRightRadius,
606
+ s.borderBottomRightRadius, s.borderBottomLeftRadius].every(qual)) continue;
607
+ try {
608
+ document.querySelectorAll(r.selectorText.replace(/:hover/g, ''))
609
+ .forEach(el => seen.add(el));
610
+ } catch (e) {}
611
+ }
612
+ };
613
+ for (const sh of document.styleSheets) {
614
+ try { walk(sh.cssRules); } catch (e) {} // cross-origin sheet
615
+ }
616
+ const out = [];
617
+ let i = 0;
618
+ for (const el of seen) {
619
+ const cs = getComputedStyle(el);
620
+ if (cs.display === 'none' || cs.visibility === 'hidden') continue;
621
+ const r = el.getBoundingClientRect();
622
+ if (r.width < 4 || r.height < 4) continue;
623
+ el.setAttribute('data-round-probe', String(i));
624
+ const cls = (el.getAttribute('class') || '').trim().split(/\s+/).filter(Boolean);
625
+ const label = (el.getAttribute('aria-label') || el.getAttribute('title') ||
626
+ (el.innerText || '').trim()).replace(/\s+/g, ' ').slice(0, 30);
627
+ out.push({i: i, node: el.id || (el.tagName.toLowerCase() +
628
+ (cls.length ? '.' + cls.slice(0, 2).join('.') : '')),
629
+ label: label, href: el.getAttribute('href') || '',
630
+ text: (el.innerText || '').replace(/\s+/g, ''),
631
+ w: r.width, h: r.height, round: round(cs),
632
+ radius: cs.borderTopLeftRadius, padding: cs.padding});
633
+ i++;
634
+ }
635
+ return out;
636
+ }
637
+ """
638
+
639
+ ROUND_READ_JS = r"""
640
+ el => {
641
+ const cs = getComputedStyle(el);
642
+ const r = el.getBoundingClientRect();
643
+ return {w: r.width, h: r.height, radius: cs.borderTopLeftRadius,
644
+ corners: [cs.borderTopLeftRadius, cs.borderTopRightRadius,
645
+ cs.borderBottomRightRadius, cs.borderBottomLeftRadius],
646
+ padding: cs.padding};
647
+ }
648
+ """
649
+
650
+
651
+ def _is_round(corners):
652
+ for v in corners:
653
+ v = (v or "").split()[0] if (v or "").strip() else ""
654
+ try:
655
+ if v.endswith("%"):
656
+ if float(v[:-1]) < 50:
657
+ return False
658
+ elif v.endswith("px"):
659
+ if float(v[:-2]) < 999:
660
+ return False
661
+ else:
662
+ return False
663
+ except ValueError:
664
+ return False
665
+ return True
666
+
667
+
668
+ def _oval(w, h):
669
+ """Unequal by half a pixel or more, and not long enough to be a pill."""
670
+ lo, hi = min(w, h), max(w, h)
671
+ return lo > 0 and hi - lo >= 0.5 and hi / lo <= ROUND_PILL_RATIO
672
+
673
+
674
+ def round_check(page, limit=80):
675
+ """ROUND_NOT_ROUND findings for the page as it stands: every element whose
676
+ corners are all >= 999px or >= 50%, measured at rest and hovered."""
677
+ found = []
678
+ for c in page.evaluate(ROUND_JS)[:limit]:
679
+ if len(c["text"]) > ROUND_MAX_TEXT:
680
+ continue # a labelled pill, not a circle
681
+ rest = c if c["round"] else None
682
+ hover = None
683
+ loc = page.locator('[data-round-probe="%d"]' % c["i"])
684
+ try:
685
+ loc.hover(timeout=1500, force=True)
686
+ page.wait_for_timeout(350) # most hover transitions are <= 300ms
687
+ got = loc.evaluate(ROUND_READ_JS)
688
+ if _is_round(got["corners"]):
689
+ hover = got
690
+ except Exception:
691
+ pass # off-screen, covered, or gone
692
+ try:
693
+ page.mouse.move(0, 0)
694
+ except Exception:
695
+ pass
696
+ bad = []
697
+ if rest and _oval(rest["w"], rest["h"]):
698
+ bad.append("%gx%g at rest" % (round(rest["w"], 1), round(rest["h"], 1)))
699
+ if hover and _oval(hover["w"], hover["h"]):
700
+ bad.append("%gx%g hovered" % (round(hover["w"], 1), round(hover["h"], 1)))
701
+ if not bad:
702
+ continue
703
+ seen = hover or rest
704
+ found.append({
705
+ "check": "ROUND_NOT_ROUND", "level": "error", "node": c["node"],
706
+ "detail": "radius %s but %s (padding %s)"
707
+ % (seen["radius"], ", ".join(bad), seen["padding"]),
708
+ "sample": (c["label"] or c["href"])[:30],
709
+ })
710
+ return found
711
+
712
+
713
+ def round_scan(urls, viewports, block_media=True, gap_ms=1500):
714
+ """The ROUND check alone, on public URLs, with no spec and no REST session.
715
+
716
+ Made for reading a front end that is not yours: no cache-buster (the cached copy
717
+ is what a visitor gets and costs the server nothing), images, video and fonts are
718
+ not fetched, one load per URL per viewport with a pause between loads, and the
719
+ run STOPS at the first 401/403/429/503 - the reason is returned, nothing is
720
+ retried."""
721
+ import time
722
+ try:
723
+ from playwright.sync_api import sync_playwright
724
+ except ImportError:
725
+ sys.exit("verify_browser.py needs Playwright:\n"
726
+ " pip install playwright && playwright install chromium")
727
+ findings, stopped, loads = [], None, 0
728
+
729
+ def no_media(route):
730
+ if route.request.resource_type in ("image", "media", "font"):
731
+ route.abort()
732
+ else:
733
+ route.continue_()
734
+
735
+ with sync_playwright() as pw:
736
+ browser = pw.chromium.launch()
737
+ for url in urls:
738
+ for bp, w, h in viewports:
739
+ page = browser.new_page(viewport={"width": w, "height": h},
740
+ device_scale_factor=1)
741
+ if block_media:
742
+ page.route("**/*", no_media)
743
+ try:
744
+ resp = page.goto(url, wait_until="load", timeout=45000)
745
+ loads += 1
746
+ status = resp.status if resp else 0
747
+ if status in (401, 403, 429, 503):
748
+ stopped = "%s answered HTTP %d (%s)" % (url, status, bp)
749
+ else:
750
+ page.wait_for_timeout(1200)
751
+ for f in round_check(page):
752
+ findings.append(dict(f, url=url, breakpoint=bp))
753
+ except Exception as e: # a timeout is reported, not retried
754
+ findings.append({"check": "LOAD", "level": "warn", "url": url,
755
+ "breakpoint": bp, "node": "", "sample": "",
756
+ "detail": str(e).splitlines()[0][:120]})
757
+ page.close()
758
+ if stopped:
759
+ break
760
+ time.sleep(gap_ms / 1000.0)
761
+ if stopped:
762
+ break
763
+ browser.close()
764
+ return findings, stopped, loads
765
+
766
+
560
767
  def run(url, ids, shots_dir):
561
768
  try:
562
769
  from playwright.sync_api import sync_playwright
@@ -585,6 +792,8 @@ def run(url, ids, shots_dir):
585
792
  page.screenshot(path=os.path.join(shots_dir, "browser-%s.png"
586
793
  % bp.strip("_") or "desktop"),
587
794
  full_page=False)
795
+ # after the screenshot, because this one hovers things
796
+ results[bp]["audit"].extend(round_check(page))
588
797
  page.close()
589
798
  browser.close()
590
799
  return results
@@ -608,7 +817,13 @@ def main():
608
817
  ap = argparse.ArgumentParser()
609
818
  ap.add_argument("--config",
610
819
  help="JSON with base/cookie/nonce; omit it and the MOSAIC_SITE_URL / MOSAIC_REST_COOKIE / MOSAIC_REST_NONCE environment variables supply them instead")
611
- ap.add_argument("--site", required=True)
820
+ ap.add_argument("--site", help="the site spec (required unless --round)")
821
+ ap.add_argument("--round", nargs="+", metavar="URL",
822
+ help="run ONLY the round-element check on these public URLs: "
823
+ "no spec, no REST session, images/fonts not fetched, "
824
+ "stops at the first 403")
825
+ ap.add_argument("--viewports", default="_,_m",
826
+ help="with --round: which of _,_t,_m to load (default _,_m)")
612
827
  ap.add_argument("--csv", help="a DIRECTORY: the computed-value table is "
613
828
  "written one file per page, <dir>/<slug>.csv")
614
829
  ap.add_argument("--audit", help="the design-audit findings")
@@ -620,6 +835,10 @@ def main():
620
835
  ap.add_argument("--page", help="only this slug")
621
836
  a = ap.parse_args()
622
837
 
838
+ if a.round:
839
+ sys.exit(main_round(a))
840
+ if not a.site:
841
+ ap.error("--site is required (or use --round URL ...)")
623
842
  cfg = mosaic_config.load(a.config)
624
843
  spec = json.load(open(a.site, encoding="utf-8"))
625
844
 
@@ -797,5 +1016,30 @@ def main():
797
1016
  sys.exit(1 if hard else 0)
798
1017
 
799
1018
 
1019
+ def main_round(a):
1020
+ want = [v.strip() for v in a.viewports.split(",") if v.strip()]
1021
+ vps = [v for v in VIEWPORTS if v[0] in want]
1022
+ findings, stopped, loads = round_scan(a.round, vps)
1023
+ errors = [f for f in findings if f["level"] == "error"]
1024
+ print("round check: %d URL(s), %d page loads, %d finding(s)"
1025
+ % (len(a.round), loads, len(errors)))
1026
+ for f in findings:
1027
+ print(" %-5s %-4s %-40s %-28s %s %s"
1028
+ % (f["level"], f["breakpoint"], f["url"][-40:], f["node"][:28],
1029
+ f["detail"], f.get("sample", "")))
1030
+ if a.audit:
1031
+ with open(a.audit, "w", newline="", encoding="utf-8") as fh:
1032
+ w = csv.writer(fh)
1033
+ w.writerow(["url", "breakpoint", "check", "level", "node", "detail",
1034
+ "sample"])
1035
+ for f in findings:
1036
+ w.writerow([f["url"], f["breakpoint"], f["check"], f["level"],
1037
+ f["node"], f["detail"], f.get("sample", "")])
1038
+ if stopped:
1039
+ print("STOPPED - " + stopped)
1040
+ return 2
1041
+ return 1 if errors else 0
1042
+
1043
+
800
1044
  if __name__ == "__main__":
801
1045
  main()