mosaic-headless 1.36.3 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/SKILL.md +179 -1119
  2. package/assets/templates/platforms/claude-ai.json +1 -1
  3. package/assets/templates/platforms/claude-code.json +5 -2
  4. package/assets/templates/platforms/codex-cli.json +1 -1
  5. package/assets/templates/platforms/copilot.json +1 -1
  6. package/assets/templates/platforms/gemini-cli.json +1 -1
  7. package/data/pending.csv +8 -0
  8. package/data/terms-zh.csv +97 -0
  9. package/evals/RESULTS.md +41 -0
  10. package/evals/cases.json +329 -0
  11. package/evals/grade.py +121 -0
  12. package/evals/runs/2026-11-16-final-with-skill.json +29 -0
  13. package/evals/runs/2026-11-16-final-without-skill.json +30 -0
  14. package/evals/runs/2026-11-16-r1-with-skill.json +19 -0
  15. package/evals/runs/2026-11-16-r1-without-skill.json +19 -0
  16. package/evals/runs/2026-11-16-r2-with-skill.json +9 -0
  17. package/evals/runs/2026-11-16-r2-without-skill.json +9 -0
  18. package/evals/runs/2026-11-16-r3-without-skill.json +1 -0
  19. package/package.json +1 -1
  20. package/references/building.md +93 -0
  21. package/references/core-rules.md +143 -0
  22. package/references/data-files.md +102 -0
  23. package/references/design-system.md +1 -1
  24. package/references/facts.md +261 -0
  25. package/references/failure-modes.md +1 -1
  26. package/references/maintenance.md +70 -0
  27. package/references/tools.md +84 -0
  28. package/references/tutorials.md +1 -1
  29. package/references/upgrading.md +2 -2
  30. package/references/verification-record.md +395 -0
  31. package/scripts/check-release.mjs +10 -5
  32. package/scripts/install.mjs +7 -5
  33. package/tools/check_numbers.py +196 -0
  34. package/tools/mo.py +132 -7
  35. package/tools/test_mosaic.py +373 -0
  36. package/tools/verify_menus.py +1 -1
package/SKILL.md CHANGED
@@ -1,11 +1,12 @@
1
1
  ---
2
2
  name: "mosaic-headless"
3
3
  description: |
4
- Build and modify Mosaic Pro (Nextend) WordPress sites by writing the data model directly - no visual editor, no DOM. Query the real surface with `mo.py` (134 node types, 201 node properties, 101 style properties, 60 style states, 157 variants, 75 dynamic variables, 16 interaction triggers, 115 REST routes) where every lookup leads with the measured verdict, not the declaration: each node type placed on a live site one at a time, each style and node property swept against compiled CSS and markup, the delivered pages re-read in Chromium at three viewports. Measured on Mosaic Pro 1.0.10: the popover (anchored or screen-placed, the flip state, afterClose-chained tours), the modal on the Popover API, OpenStreetMap, exit-intent and scroll-depth triggers, run rules and memory. Drives theme export/import and the 1.0.7 -> 1.0.10 data upgrades from outside wp-admin; re-extracted and re-verified on 1.0.11 and 1.0.12 (the buildable Select).
4
+ Build and modify Mosaic Pro (Nextend) WordPress sites by writing the data model directly - no visual editor, no DOM. Query the real surface with `mo.py` (134 node types, 120 node properties, 101 style properties, 60 style states, 157 variants, 75 dynamic variables, 16 interaction triggers, 115 REST routes) where every lookup leads with the measured verdict, not the declaration: each node type placed on a live site one at a time, each style and node property swept against compiled CSS and markup, the delivered pages re-read in Chromium at three viewports. Measured on Mosaic Pro 1.0.10: the popover (anchored or screen-placed, the flip state, afterClose-chained tours), the modal on the Popover API, OpenStreetMap, exit-intent and scroll-depth triggers, run rules and memory. Drives theme export/import and the 1.0.7 -> 1.0.10 data upgrades from outside wp-admin; re-extracted and re-verified on 1.0.11 and 1.0.12 (the buildable Select). 中文觸發:Mosaic、Nextend、不開編輯器做頁面、做一頁、整站、母版、範本、元件、變體、內距、外距、圓角、懸停、斷點、RWD、手機版、彈出視窗、浮動框、彈窗、摺疊面板、頁籤、輪播、表單、互動、動畫、深色模式、搬佈景、匯出匯入佈景、Mosaic 升級、Elementor 轉 Mosaic、自訂欄位。
5
5
  license: "MIT"
6
+ user-invocable: true
6
7
  metadata:
7
8
  author: "moksa (https://moksaweb.com)"
8
- version: "1.36.3"
9
+ version: "1.37.0"
9
10
  homepage: "https://github.com/Moksa1123/mosaic-headless"
10
11
  ---
11
12
 
@@ -15,1130 +16,189 @@ Build Mosaic pages by writing the data model directly. The visual builder is one
15
16
  client of that model; it is not the format, and you do not need it.
16
17
 
17
18
  **Scope: page and template construction on a Mosaic site.** Not WordPress site
18
- health, not plugin audits. If the site is not running Mosaic, this skill does not
19
- apply — `references/vs-elementor-gutenberg.md` says which skill does.
19
+ health, not plugin audits.
20
20
 
21
- ## The one rule that overrides everything
21
+ ## Sources
22
22
 
23
- **Never write a node type, property name, enum value, style key or Free/Pro claim
24
- from memory. Look it up in `data/`.**
25
-
26
- And look it up with `mo.py`, not with grep. Grep answers the question you typed;
27
- it does not answer the question you have. Ask grep about `accordion-content` and it
28
- confirms the type exists. The sweep table says BROKE_PAGE: place one and the entire
29
- public page becomes a 54-byte error string. Both are true, and both are the wrong
30
- answer - the note beside the row says the string is `AccordionItemElementMResource
31
- instance required`, that this is a type committed without the parent its factory
32
- needs, and that nested under `accordion > accordion-item` it commits, renders and
33
- gives you a keyboard-operable disclosure for free. `mo.py type` shows all three in
34
- one answer. Grep shows one, the CSV shows two, and the skill was itself wrong about
35
- this type for a week.
36
-
37
- ```bash
38
- python tools/mo.py stats # the surface, and what is unsafe
39
- python tools/mo.py type accordion-content # ONE type, joined to every sweep
40
- python tools/mo.py params text # EVERYTHING settable on a type:
41
- # data properties, the states that
42
- # reach it, the style surface, placement
43
- python tools/mo.py types --edition pro --safe
44
- python tools/mo.py check div text button # exits 1 on an unsafe or unknown type
45
- python tools/mo.py placement accordion-item # what goes inside what, both directions
46
- python tools/mo.py prop tagName # one node property + how it was probed
47
- python tools/mo.py props --shared # the ones every element carries
48
- python tools/mo.py style --grouped # the 20 that are inert set on their own
49
- python tools/mo.py css border-radius # which Mosaic key drives this CSS
50
- python tools/mo.py states --grep hover # state IDs and their selector templates
51
- python tools/mo.py states --verified # only the ones measured to compile
52
- python tools/mo.py vars --namespace post # the @VAR() surface
53
- python tools/mo.py classes --grep Heading # variants: the theme-global element classes
54
- python tools/mo.py routes --grep template
55
- python tools/mo.py tables wp_mosaic_nodes
56
- python tools/mo.py skeleton # a minimal valid page spec
57
- ```
58
-
59
- `--json` on any of them for machine-readable output. Every answer leads with the
60
- measured verdict rather than the declaration, because on this platform the two
61
- disagree for 52 of the 122 types they were first counted on.
62
-
63
- Then check the page. Mosaic has eight failure modes and **only three of them change the
64
- HTTP status code**:
65
-
66
- ```
67
- clean validator rejection HTTP 200 + an `exceptions` array in the body
68
- PHP fatal during commit HTTP 500 (15 of 129 types do this from a plain div)
69
- structurally invalid node HTTP 200, committed, row in the DB, and the whole
70
- public page becomes a 54-byte error string
71
- wrong value SHAPE HTTP 200, stored, and the CSS rule is simply absent -
72
- or worse, compiles to `transform:none`
73
- right rule, wrong result HTTP 200, in the stylesheet, correct, and the BROWSER
74
- computes something else: a unit that resolves against
75
- something you forgot, a font that cannot render the
76
- text, a property the layout mode overrides
77
- no template for the URL HTTP 406 with an EMPTY BODY for anyone not logged in
78
- render-time fatal from HTTP 500 - the commit went through and the page dies
79
- CONTENT when Mosaic parses it. A `code` node's content is a
80
- template: `@media(` (as every minifier writes it) is
81
- read as a function call and kills the whole page.
82
- `@media (` renders. build_page refuses the former.
83
- plugin upgrade renamed HTTP 200, page intact, rows migrated - and a selector
84
- what the page emits you wrote against an emitted class matches nothing.
85
- 1.0.8: `M_EL4 M_EL_Div` -> `m-div _e`, the state
86
- classes with them, `customStyles` -> `customDeclarations`.
87
- The worked example's tap-to-enlarge stopped opening
88
- and only `verify_loop.py` OPENS said so.
89
- ```
90
-
91
- That last one also fooled every checker here for a day: WordPress answers a fatal
92
- with a 2,697-byte error document, which is larger than the 2,000-byte "healthy"
93
- floor, and `Client.page()` returned that body as if it were the page - so
94
- `build_site` printed `OK 2645 bytes` over an HTTP 500. A 5xx now reads as an
95
- empty page, which is what it is.
96
-
97
- **406 is Mosaic's "no template matched".** `FrontendRenderer` answers
98
- `TemplateNotFoundException` with `status_header(406)` and prints the explanation
99
- only for an admin, so a logged-out visitor gets a blank page and a status code
100
- that looks like a server problem. Two things make it easy to hit:
101
-
102
- - **There are TWO ways to bind a template, and `createManualTemplate` is only one
103
- of them.** That endpoint takes `resourceQuery=post/<id>` and `post` is the only
104
- resource type it registers (`setResourceType('post')`, three call sites), so
105
- through it there is no catch-all. But `assign` and `path` are first-class columns
106
- on `wp_mosaic_templates`, and a template row committed with `assign:"auto"` and
107
- `path:"index.php"` binds to a template PATH instead of a post. Measured A/B on a
108
- URL with no template of its own: 406 with no such row, handled with it, 406 again
109
- after deleting it. `X-Mosaic-Paths` on any 406 names the paths Mosaic looked for,
110
- and `index.php` is in every list.
23
+ | | |
24
+ |---|---|
25
+ | Surface | Extracted from the Mosaic Pro plugin source and re-extracted on **Mosaic Pro 1.0.12** (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/` |
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
+ | 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, 75 dynamic variables, 16 interaction triggers, 115 REST routes, 23 tables. Current counts: `python tools/mo.py stats` - do not quote numbers from memory |
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) |
29
+ | Chinese terms | `data/terms-zh.csv`: every row has `source` + `trust` |
30
+ | Trust levels | `measured` (swept, probed, driven) > `documented` (plugin source, Mosaic's shipped zh_TW strings, Mosaic's docs) > `inferred` / `house-style` (the 2026-11-05 designer glossary, colloquial words). Never present the last two as Mosaic's own |
31
+ | Last checked | 2026-11-16: offline self-test and SKILL.md number check pass; open gaps in `data/pending.csv` |
111
32
 
112
- This `index.php` row is the editor's **Fallback → Empty** template: priority
113
- `PHP_INT_MAX`, matching every request (`Plugins/Paths/PathIndex.php`). Since 1.0.10
114
- an auto template is an ordinary writable one - it is listed by
115
- `adminTemplateEditorInstance` and its document carries a `template-internal`
116
- root, so content goes in like any page's (the commit shape is in
117
- `references/templates-and-conditions.md`). Before 1.0.10 both were missing and a
118
- direct commit answered HTTP 500.
33
+ ## Usage
119
34
 
120
- For `/` specifically the WordPress-side fix is the sound one: point the front page
121
- at a post that has a template (`show_on_front=page`, `page_on_front=<id>`).
122
- - **Activating a theme is not the same as populating it.** A fresh theme has no
123
- templates, so between `wp theme activate` and a successful build the whole site
124
- is 406 - and if the build fails, it stays that way. Never activate a new theme
125
- as a step that can be separated from the commit that fills it.
35
+ **Use it for:** building or changing a Mosaic page, site, master, template,
36
+ component, variant or design token; popups, menus, sliders, forms, interactions;
37
+ moving a theme between installs; driving a Mosaic plugin upgrade; converting an
38
+ Elementor page to Mosaic; answering "what is it called / what shape is the value /
39
+ is it safe / does it render".
126
40
 
127
- A successful commit is not evidence of a working page, and neither is a correct
128
- stylesheet. Fetch the page and check its size; then run `verify_browser.py` and let
129
- the element say what it actually got. `references/failure-modes.md` has all of them,
130
- measured.
41
+ **Do not use it for:**
131
42
 
132
- ## Native first: what the client can open in the editor
43
+ | Request | Go to |
44
+ |---|---|
45
+ | Elementor pages | `elementor-headless` |
46
+ | WordPress block editor (Gutenberg) pages | `gutenberg-headless` |
47
+ | SEO articles, Rank Math scores | `rankmath-seo-wp` |
48
+ | Translating Mosaic's own .po files | `tw-translate` |
49
+ | Site security, plugin updates, health checks | out of scope - say so |
50
+ | The site is not running Mosaic | [vs-elementor-gutenberg.md](references/vs-elementor-gutenberg.md) says which skill does |
133
51
 
134
- The second rule, and the one an agent breaks most often: **build with Mosaic's own
135
- features, not with code.** A `code` node, a `script` action, or a pile of
136
- `customDeclarations` renders fine and is a dead end for the client - the editor
137
- shows a box of text they cannot change, the Navigator shows nothing of its
138
- structure, and the next agent has to reverse-engineer it. Mosaic's tutorials build
139
- every one of the effects below with no custom code; this skill can now write all of
140
- them headlessly, measured.
52
+ **The front door is `tools/mo.py`.** Every answer starts with a lookup there.
141
53
 
142
- | the job | the native way | how, headlessly |
54
+ | User-run tools | Does | Dependency |
143
55
  |---|---|---|
144
- | dark / light mode, themed sections | a second mode on the colour collection; `collectionModesData` on a band, or the Variable modes action on `document` for the whole site | references/design-system.md (modes), the switcher recipe in references/interactions.md |
145
- | any animation: reveal, fade, slide, loop, parallax | an interaction (`pageLoad`, `click`, `hover`, `elementScrollIntoView`, `scrollIntoView`...) | `tools/interactions.py`; never `@keyframes` in a code node |
146
- | the same animation on many elements | a universal class as the interaction's trigger, empty target | `trigger=class_target(...)`, recipe in references/interactions.md |
147
- | a hover / focus look with no motion sequence | a style state (`hover`, `focus`...) with a `transition` | references/styling.md |
148
- | a loading screen, a cookie bar | a fixed div + `pageLoad` + `hide_at_end`, `data.hidden: true` so it does not block editing | recipe in references/interactions.md |
149
- | a block repeated on several pages | a component, one definition, overrides per instance | references/design-system.md (components) |
150
- | a popup, a drawer, a tour | the `modal` / `popover` nodes and their actions | references/dialog-and-triggers.md |
151
- | a site menu: desktop hover dropdown + phone drawer | `dropdown` / `dropdown-wide` with `openOn: hover`; a `modal` drawer opened by `modalOpen` (there is no off-canvas node) | references/design-system.md (site menus), `tools/verify_menus.py` |
152
- | a typeface, site-wide | a `fontFamily` collection variable, `{"var": id}` in styles; Settings: `saveGoogleFontsLocally` on and `fontDisplay: swap` (unset is `block`) | references/styling.md (fonts) - saving Google fonts locally took a CJK page from 68 to 96 on mobile |
153
- | remembering a visitor's choice | `setCookie`, `remember` / `forget`, cookie conditions | references/interactions.md |
154
- | text that comes from the post, the user, a field | a dynamic `{"v": "@VAR(...)"}` value | references/dynamic-content.md |
155
- | a colour, a size used twice | a collection variable | references/design-system.md |
156
-
157
- Reach for custom code only when no row above fits and `mo.py` finds no node,
158
- property or action for the job - and then say in the spec, next to the code, which
159
- native path was checked and why it falls short.
160
-
161
- ## What was verified, and how
162
-
163
- Everything ran against a live install: WordPress 7.1, WooCommerce 11.1,
164
- Mosaic Pro 1.0.12, **unlicensed** — the licence gates the theme library and updates,
165
- not the node factories, so the Pro types register and render regardless. The
166
- site was built on 1.0.7 and upgraded in place five times: every data migration
167
- ran over the real theme (1.0.11 has none; 1.0.12's Select split ran by itself in
168
- the background), the source tables were re-extracted from 1.0.12, every demo
169
- verifier was re-run on the result, and the node sweep covers 133 of 134 types
170
- (`document` excluded because its probe wrecks the master; the seven Select and
171
- List box types swept on 1.0.12, the rest on 1.0.11), so the tables describe 1.0.12
172
- as delivered, not as declared. Where a row is still an older measurement - the property sweeps - the
173
- section says so. 1.0.11 swapped the Free/Pro split and 1.0.12 replaced the native
174
- select (`references/upgrading.md`).
175
-
176
- ```
177
- WRITE PATH verified end to end over REST
178
- theme -> master -> healed node tree -> template -> nodes -> public HTML
179
-
180
- NODE SWEEP 134 of 134 node types, ONE PER DOCUMENT, committed then rendered then
181
- deleted, asserting each type's attrID against the delivered HTML:
182
- RENDERED 82 id found; tag and classes recorded
183
- COMMITTED 25 row exists, nothing reached the page
184
- COMMIT_5xx 15 PHP fatal on commit
185
- BROKE_PAGE 12 committed, then the whole page died
186
- data/node-verification.csv. 1.0.9's four new types - modal,
187
- modal-window, modal-overlay, openstreetmap - all render, and so
188
- does 1.0.10's one, popover (<div popover=manual>, swept on 1.0.10;
189
- the other rows are the 1.0.9 sweep).
190
- Re-swept on 1.0.8: five types that used to commit and render
191
- nothing (accordion-title, loop-pagination and its two buttons,
192
- multi-steps-form-step) now kill the page instead - the render
193
- guard on their required parent throws. Same advice, louder
194
- failure: nest them. `button` now renders `<button>`, not `<span>`.
195
- Three of the non-rendering outcomes are artefacts of the sweep's own
196
- method - one type per document, under a plain div - and not of the
197
- type: `component-instance` (needs `component-instance/<id>`),
198
- `accordion-item` and `accordion-content` (need their parent). Each is
199
- proven to work as built, and `data/node-type-notes.csv` says so
200
- beside the row. The sweep verdict stands; the note is what to read.
201
-
202
- STYLE the states[state][breakpoint][property] shape confirmed by writing it
203
- and reading back the compiled CSS; 20 of 22 structured value shapes
204
- pinned down the same way. data/style-value-shapes.csv
205
-
206
- DESIGN SYS variants and collection variables both verified against compiled
207
- CSS: a variant on the Heading 2 catalog entry emitted a site-wide
208
- h2,.m-heading-2{...} rule (1.0.7: h2,.M_EL_Text__Heading2), and a
209
- collection variable emitted
210
- :root{--brand: rgb(9, 99, 199)} with background-color:var(--brand).
211
- references/design-system.md
212
-
213
- SLIDER the slider family nested as its factories require, driven in a
214
- browser, 19 of 19 across two configurations: it advances unaided on
215
- its declared delay, the arrows and bullets move it, Enter on a
216
- focused bullet moves it, and under prefers-reduced-motion it holds
217
- still on its own. The sweep calls the whole family COMMIT_500 /
218
- BROKE_PAGE, which is what a bare `slider` does under a plain div and
219
- nothing about the component - the same kind of row the accordion
220
- probe corrected. Two facts no markup announces: a
221
- slider-navigation-bullet is a TEMPLATE, repeated once per slide with
222
- the SAME id on every copy and an aria-label taken from each slide's
223
- own title; and an arrow hides ITSELF at the end it cannot pass.
224
- data/slider-verification.csv
225
-
226
- SITE the nineteen converted Elementor pages assembled into one real site:
227
- a shared shell, a menu of `menu-link` nodes that render real
228
- <a href>, a WordPress page each, and a modal on every page - six
229
- distinct configurations across pageLoad / exitIntent / scrollDepth,
230
- cap / cooldown / firstRunWindow, page / session / forever memory and
231
- four closedby policies. 46 of 46 navigation checks (including no page scrolling sideways at three widths), 19 of 19 pages
232
- carrying a working modal. data/navigation-verification.csv,
233
- data/page-modal-verification.csv
234
-
235
- DIALOG 1.0.9's features built on a live page and read back out of the
236
- browser, 19 of 19: the modal renders a real <dialog> (aria-modal
237
- appears only with an overlay child), a modalOpen action opens it and
238
- modalClose closes it, closedby=everything is answered by Esc,
239
- remember/forget write and clear mos:v1:r:<name> in local AND session
240
- storage, scrollDepth fires, and an exitIntent modal opened by the
241
- interaction SHORTHAND alone - nothing in the page points at it -
242
- runs once a session and again in a new one, which is the cap rule
243
- holding. The OpenStreetMap element carries the coordinates only in
244
- the {"v": ...} object form. data/dialog-verification.csv,
245
- references/dialog-and-triggers.md. Re-run on 1.0.10, 19 of 19, with
246
- one row changed: the open modal is now in the top layer (1.0.10
247
- moved it onto the Popover API - `dialog.open` is always false, read
248
- `:popover-open`; close from script with `mosaicDialog.requestClose()`)
249
-
250
- POPOVER 1.0.10's non-blocking surface on a lab page, 37 of 37 in Chromium:
251
- a page-load notice leaves the page scrollable and clickable;
252
- closedby nothing / clickOutside / everything each honoured; an
253
- unanchored menu on its trigger to the pixel, an anchored card on
254
- the element it names, the nine screen cells where they say;
255
- keepInView flips and ___popover--flipped styles the flipped one -
256
- and without it the popover does not overflow but slides back over
257
- its own trigger. A three-step tour taught the two rules that decide
258
- how any sequence is built: a dialog opened from inside another is
259
- its child and closes with it, and closing a popover suspends the
260
- interactions inside it - so steps advance on afterClose, never on a
261
- button that opens the next one. data/popover-verification.csv
262
-
263
- FIELDS ACF 6.8 and Meta Box 5.15, forty fields registered in code on a page,
264
- read back off the delivered HTML: 59 of 62 expressions resolve to the
265
- value expected, the 3 empties explained (select label needs ACF's
266
- array format; oEmbed dies in a text node, lives in a code node).
267
- Loops over relationship / checkbox / taxonomy / gallery / clone /
268
- group fields rendered exactly the rows the field holds. The names
269
- are not guessable (meta_k, meta_k__label, loopk, loop-k for a
270
- group, item/value_sub) - tools/list_fields.php prints them.
271
- data/custom-fields-verification.csv, references/custom-fields.md
272
-
273
- DYNAMIC the @VAR('namespace/name') language verified against rendered output -
274
- @VAR('post/title') produced the real post title, @concat/@substr/
275
- @fallback all compose over it. 74 variables in
276
- data/dynamic-variables.csv. references/dynamic-content.md
277
-
278
- PROPERTIES 170 probes over the declared property surface, each value asserted
279
- against the delivered markup and the compiled CSS separately.
280
- data/property-verification.csv
281
-
282
- STATES 59 of the 60 style states written to a live page on 1.0.12 and
283
- matched against the selector `data/style-states.csv` promises:
284
- 39 COMPILED exactly, 15 NO_HOST (their node type cannot be committed
285
- safely), 4 SKIPPED, 1 ABSENT (`___select--opened`: a `select` only
286
- renders inside a `field`, and the probe host is a bare div). The new
287
- Select's option states (--active, --selected, --in-toggle) and
288
- ___listbox-option compiled. All seven globally usable states verified
289
- - and the pseudo-classes are emitted UPPERCASE (`._j:HOVER`), so
290
- grepping a stylesheet for `:hover` finds nothing.
291
- data/style-state-verification.csv
292
-
293
- COMPONENTS used on the example page: the service row is committed ONCE to the
294
- theme and the page places four instances of it, each carrying only the
295
- words that differ. A spec declares `"components": {...}` and a node
296
- says `"component": "<name>"` with `"overrides"`; build_site creates or
297
- refills the definition, resolves the name to an id, and writes the
298
- overrides in a second pass - they cannot exist before the instance
299
- does. Plus the system driven end to end, 8 of 8 checks: a component
300
- created under a category, its document healed, its tree filled through
301
- the WRITABLE instance, the read-only one refused the same write as a
302
- negative control, and two instances placed on a page rendering the one
303
- definition twice. data/component-verification.csv
304
-
305
- INTERACTION the JS animation path, values included, since v1.35: one tween
306
- authored in the editor and read back showed the shape - values keyed
307
- by the property META's uuid, written as CSS strings with units, and
308
- `duration` on the keyframe for timed triggers. Written headlessly it
309
- binds on the first commit; bare numbers and name keys, one field
310
- apart, store nothing. data/interaction-verification.csv
311
-
312
- TUTORIALS Mosaic's four docs tutorials built from tools/interactions.py and
313
- driven in Chromium, 16 of 16: a dark/light switcher (variable-mode
314
- action on `document`, session cookie, cookie-gated page load), a
315
- loading overlay that ends display:none and stops catching clicks, a
316
- class-triggered scroll reveal that fires per element, and a loop a
317
- hover suspends and resumes by Interaction ID.
318
- data/tutorial-recipes-verification.csv
319
-
320
- INTRO the page-load sequence - an ukiyo-e sheet printing itself eleven
321
- carved blocks at a time, each impression landing out of register and
322
- easing true against the kento marks - sampled at fifteen timestamps
323
- on a monotonic clock (the first version scheduled against the previous
324
- sample and drifted fourteen seconds) and asserted on eight counts: it
325
- plays, the animated `@property` counter reaches 100, the veil leaves
326
- hit-testing, no in-viewport content is stranded at opacity 0 (elements
327
- waiting on a scroll timeline are exempt, and a `position:fixed` one
328
- was the case that showed the exemption had to be by timeline and not
329
- by position), a real click reaches the document, under
330
- `prefers-reduced-motion` the veil never exists and nothing is
331
- invisible at 120ms, plus AMBIENT, which counts how many elements still
332
- move with no input once everything has settled. Every other motion
333
- check here fires on an EVENT; a page can pass all of them and be
334
- completely static the moment you stop scrolling. Also measured, with
335
- CPU-time counters rather than frame timing, which proved unusable:
336
- the sequence costs one late frame over a page with no animation in it,
337
- because it no longer starts until the document's own first layout is
338
- done. All pass. data/intro-verification.csv
339
-
340
- LOOP 28 assertions about the one animation nothing else here can see: the
341
- ukiyo-e plate that keeps printing itself in the corner of the page,
342
- forever, with no input, and that opens to full size when tapped. Its
343
- eleven moving parts are SVG groups inside a raw-HTML `code` node, so no
344
- checker that walks the spec tree knows they exist. RUNS reads them on the clock across a full period; each part is
345
- then proved periodic by PAUSING its animation and scrubbing
346
- `currentTime` to T and T + one period (14s), past the stagger, which
347
- is the only way to compare a compositor-driven transform exactly.
348
- CLEAR is the one that found a real defect: a fixed decoration is
349
- opaque, and on a full-bleed page no rectangle anywhere along the right
350
- edge misses text at every scroll offset - so the test is not "never
351
- overlaps" but "never makes anything unreadable", per element, at five
352
- widths and twenty-five scroll stops.
353
- It caught three footer links buried at the position a reader cannot
354
- scroll past. Once the plate became a control, REACHABLE holds links and
355
- buttons to the same rule - swallowing a click is worse than covering a
356
- word - and OPENS/CLOSES/KEYBOARD check the enlarged view on the
357
- delivered page, including that Enter works on it. Five widths from 390
358
- up. data/loop-verification.csv
359
-
360
- CONVERSION an Elementor page turned into a Mosaic spec and built, then checked
361
- against its own source: every text string, every image, every link
362
- target, every h1-h6 level. 5 of 5 on a page with 16 images and 21
363
- links. Scope was decided by counting a real site rather than by
364
- taste - across 19 Elementor pages and 3,292 element instances,
365
- container/heading/text-editor/button/html/icon-list/divider/image
366
- are 99.6% of everything present, and the long tail (loop-grid, form,
367
- posts, countdown, third-party addons) is dynamic: a query and a
368
- server-side action have no node to become. Those are reported per
369
- element with a reason, never dropped, and `--strict` refuses to
370
- write a spec while any remain. The verifier earned its place twice
371
- over: it caught the converter writing `url` onto `text` and `image`
372
- nodes, which only `button`, `menu-link`, `wysiwyg-link` and
373
- `dropdown-toggle` declare - 19 of 21 link targets accepted, stored
374
- and silently emitting no anchor, this platform's signature failure -
375
- and it caught two bugs in ITSELF that had blamed the converter.
376
- Then the converted page went through the skill's own suites like any
377
- other: 96 responsive declarations verified, 5,595 computed values
378
- with 0 overridden, and a design audit of 49 CONTRAST findings -
379
- every one traced back to a colour the Elementor source declared,
380
- none introduced by the conversion. That split is a check of its own,
381
- FIDELITY, and the inherited defects are recorded beside it as still
382
- real: a 3.19:1 label is 3.19:1 whoever wrote it. 8 of 8.
383
- Then all 19 pages of the site, each re-converted, built onto one
384
- post, cache purged and content-checked in turn: 19 of 19, 3,281
385
- elements carried and 11 declared. The one that did not pass the
386
- first time was the HTTP 500 above - an "open source" page whose
387
- `<style>` blocks wrote `@media(`. data/conversion-verification.csv,
388
- data/conversion-batch.csv
389
-
390
- ACCORDION 7 checks that resolve a wrong entry in this skill's own tables.
391
- `accordion-item` and `accordion-content` are recorded BROKE_PAGE, which
392
- is true and misleading in exactly the way `component-instance` was:
393
- the failure is `AccordionItemElementMResource instance required`, i.e.
394
- committed without the parent the factory needs. Nested properly they
395
- commit, render, and emit `<dl><div class=AccordionItem><dt tabindex=0
396
- aria-expanded><dd>` - which is why the worked example's enlargeable
397
- plate is built on it instead of on a checkbox, and gets keyboard
398
- operation and a screen-reader state for nothing. The negative control
399
- asks the placement guard rather than committing, because the first
400
- version of the probe destroyed the positive result it had just
401
- produced. data/accordion-verification.csv
402
-
403
- BROWSER 4,132 computed-style readings on the delivered pages in Chromium, at
404
- three viewports: every declared property vs `getComputedStyle` on the
405
- node it targets. 2,929 compared and agreed, 912 not-comparable and
406
- labelled as such, 0 overridden. Plus a design audit that only a browser
407
- can run - font fallback, tracking against script, text contrast,
408
- horizontal overflow, clipped text, line measure - 26 findings, every
409
- one ruled on in writing. Two pages: the homepage, and a WooCommerce
410
- My Account page whose UI arrives through one `code` node running a
411
- shortcode - which is also the measurement that shows the property
412
- sweep's NO_EFFECT on `processShortcodes` was the sweep, not the flag.
413
- data/browser-verification/ (one CSV per page), data/design-audit.csv
414
-
415
- RWD 733 responsive declarations across two sites asserted against the
416
- stylesheet the site actually served - each `_t`/`_m` property matched
417
- to its element's generated class inside that breakpoint's own media
418
- query. All verified; the checker is itself checked against a poisoned
419
- spec so a pass means something. data/rwd-verification.csv
420
-
421
- BUILD nine complete designed pages built through the tables alone and checked
422
- in a real browser, hover states included - the ninth uses only design
423
- tokens, element-class typography and dynamic content, no hard-coded
424
- colour anywhere, plus a real studio homepage rebuilt from the
425
- live moksaweb.com. sites/_moksa.py is the one that ships.
426
-
427
- EVAL the skill itself, put in front of the model with and without it loaded
428
- (`claude plugin eval .`, 5 cases x 3 runs x 2 arms, three LLM judges
429
- per run). Every case is a question a user of this skill would ask
430
- where the measured facts decide the answer: an invented `heading`
431
- type, a `code` node that 500s on `@media(`, whether the accordion is
432
- usable, moving a theme without going live by accident, placing a grid
433
- child on tablet only. With the skill: 1.00 on all five. Without it:
434
- 0.00 on all five - and the baseline's best answer was to refuse ("I
435
- don't have reliable knowledge of Mosaic Pro's spec format"), which is
436
- the right thing for a model with no data to do. evals/
437
-
438
- MEASURED 115 REST routes, 157 variants, 59 condition subjects,
439
- 23 tables / 210 columns - read off the running site.
440
-
441
- UPGRADE 1.0.7 -> 1.0.8 driven over the plugin's own milestone route from
442
- outside wp-admin (6 milestones, 17 calls): four class tables renamed,
443
- every emitted class name changed (M_EL4 M_EL_Div -> m-div _e),
444
- customStyles -> customDeclarations in every stored row - and the
445
- one selector on the worked example that named an emitted class
446
- stopped matching until it was rewritten. references/upgrading.md
447
-
448
- FROM SOURCE 134 node types, 201 properties (68 with enums), 285 pluggable IDs,
449
- 134 placement rules, 27 composite default structures (10 declared,
450
- 17 healed in), 101 style properties, 60 style states, 16 interaction
451
- triggers - re-extracted from the 1.0.12 tree.
452
- ```
453
-
454
- **Coverage, stated as a fraction rather than as a headline.** The verification
455
- counts above are real, but they are not the same as "the surface is verified", and
456
- the difference is worth being exact about:
457
-
458
- ```
459
- node types 134 / 134 swept live, one per document
460
- node properties 191 / 196 re-probed with a value shaped by each property's
461
- own validator chain: 39 APPLIED, 45 NO_EFFECT,
462
- 2 EDITOR_ONLY, 55 NO_HOST (no rendering type
463
- declares them), 2 INSTRUMENT, 48 SKIPPED
464
- (the five missing are 1.0.10's popover -
465
- role, ariaLive, accessibleLabel, closedby,
466
- positioning - measured on the popover lab
467
- instead: data/popover-verification.csv)
468
- style properties 101 / 101 swept live; 61 COMPILED, 18 ABSENT, 1 NO_ELEMENT,
469
- 21 SKIPPED (no test value could be synthesised, and
470
- SKIPPED is never counted as a pass)
471
- ```
472
-
473
- **A same-value probe measures the probe, not the surface.** The first property run
474
- sent the string `MPROP0000X` to all 181 properties (191 by 1.0.9) regardless of what each wanted,
475
- and reported 91 NO_EFFECT. The tell was that `tagName` was in that list while the
476
- entire demo site is built on it. Re-probed with a value derived from the declared
477
- validator chain - array for `ValidatorArray`, boolean for `ValidatorBoolean`, a legal
478
- enum member for `ValidatorAcceptedValues` - six of those NO_EFFECTs turn out to work:
479
- `tagName`, `target`, `rel`, `height`, `size`, `insertLocation`.
480
-
481
- **A sweep cannot be its own subject.** `attrID` and `style` came back SKIPPED
482
- because the property sweep finds each probe node BY its `attrID` and reads its
483
- `style` back out of the compiled CSS - asking it to probe those is asking a ruler to
484
- measure itself. But SKIPPED reads as "nobody checked", and they are in fact the two
485
- most heavily asserted properties here: every row of `style-verification.csv` is a
486
- `style` assertion and every row of `rwd-verification.csv` is a `style` assertion
487
- located by `attrID`. They are labelled **INSTRUMENT**, which is not a pass either,
488
- and the label carries the file and row count that does cover them.
489
-
490
- **Some properties are gated by a companion.** `target` and `rel` did nothing until
491
- the node also carried a `url`: `menu-link` renders a `<span>` without one (and so did
492
- `button` before 1.0.8; it is a `<button>` now)
493
- and an `<a href>` with it, so an anchor-only attribute has nothing to attach to. A
494
- NO_EFFECT is only meaningful once the property has been given the context it needs.
495
-
496
- Twelve remain NO_EFFECT with a correctly shaped value, `cssClasses` and `attributes`
497
- among them - recorded as measured-inert-with-this-shape rather than as dead, because
498
- a third shape may yet be the right one.
499
-
500
- **A property that belongs to a `group` is inert when you set it on its own.** This is
501
- the sweep's one big result and it is exact:
502
-
503
- ```
504
- ungrouped 78 properties 58 COMPILED 0 ABSENT (20 SKIPPED)
505
- grouped 20 properties 0 COMPILED 18 ABSENT (1 NO_ELEMENT, 1 SKIPPED)
506
- ```
507
-
508
- Zero exceptions in either direction. The 20 are the `borderStyle` per-side longhands
509
- (12), `outlineStyle` (4) and `gridChildPosition` (4) — so `borderLeftWidth`,
510
- `outlineColor` and `gridColumnStart` are all instances of one rule rather than three
511
- oddities. Set the grouped shape instead (`border` takes `{width, style, color}`), or
512
- use `customDeclarations`. `data/style-verification.csv` carries the group beside the result
513
- so the pattern is in the data, not just in this paragraph.
514
-
515
- **Known gaps, stated rather than papered over.**
516
-
517
- - `backgroundStyle` is the one style property whose shape resisted every attempt — it
518
- accepts what you send and emits `background-image:none`. Use `customDeclarations` for
519
- gradients, as the glass and darkglow pages do.
520
- - **`gridColumnStart` / `gridColumnEnd` / `gridRowStart` / `gridRowEnd` emit nothing.**
521
- All four are real entries in `data/style-properties.csv`, under `gridChildPosition`.
522
- Measured: 16 `gridColumnStart` declarations committed, zero occurrences of
523
- `grid-column` in the delivered CSS. Change the template; you cannot place a child.
524
- - **Interaction values bind in the editor's shape - build them with
525
- `tools/interactions.py`.** `initial` and each keyframe's `properties` are keyed by
526
- the property META's `uuid`, values are CSS strings with units (`"0%"`, `"40px"`),
527
- and a timed trigger's keyframe carries `duration`/`delay` in ms (only
528
- `scrollIntoView`/`pointerMove` use `progressData`). A simple action's fields go
529
- under `<type>Options.settings` - under the opt-group's name they are dropped, and a
530
- suspend without its ID suspends everything on the element, itself included. The
531
- full table of stored shapes is in references/interactions.md.
532
- - An element **condition** puts its comparator INSIDE the subject's options
533
- (`subject.<type>Options.comparator`). One level up is a PHP fatal that blanks the
534
- whole page; so is `{"v": …}` as a `variable` subject's `dynamicCode` (a plain
535
- string there). A server-condition `regexp` needs delimiters (`/./`) - `.` never
536
- matches and the element silently disappears. Driven end to end on a client build;
537
- references/templates-and-conditions.md
538
-
539
- **Cross-checked against the official docs.** All 72 pages of Mosaic's own
540
- documentation (Oct 2026) were compared with this skill, and every disagreement was
541
- settled in the 1.0.11 source or on the live site. Where the docs are wrong for
542
- 1.0.11, the skill follows the source and says so at the spot: the system
543
- requirement is WordPress 6.9, not 6.5; evaluator functions are `find_image` /
544
- `remove_html`, and `@FINDIMAGE` prints nothing; a slider's `duration` is the
545
- transition, not the dwell; the Google Maps Language and Region settings do not
546
- exist; the optimizer opt-out attributes are the four the source adds, not the
547
- docs' longer list. Where the docs corrected the skill, re-measured on 1.0.11:
548
- `gridChildPosition` compiles as a group, `scale` / `perspective` /
549
- `collectionModesData` exist and compile, `youtube` `privacy` renders on
550
- youtube-nocookie.com, "Wrap in link" is a `button` with the Link variant, and a
551
- variable's `customProperty` is optional.
552
-
553
- ## Orient yourself in this order
554
-
555
- 1. `references/data-model.md` — where a page actually lives. Read this first even if
556
- you know Elementor; the answer is not `postmeta` and not `post_content`.
557
- 2. `references/write-protocol.md` — the checkout/check/commit sequence and envelopes.
558
- 3. `references/failure-modes.md` — how Mosaic fails, measured. Read before writing.
559
- 4. `references/placement.md` — what may go inside what, and what that table cannot
560
- tell you.
561
- 5. `references/styling.md` — how a style value becomes CSS, and the shapes that are
562
- silently inert if you write a string.
563
- 6. `references/responsive.md` - the state/breakpoint/property axis, the two
564
- breakpoint rows, and the override that can change a property but never remove
565
- one. **Read before writing any `_t` or `_m` value.**
566
- 7. `references/design-system.md` — variants (element classes) and design tokens. **Read this
567
- before styling anything beyond a one-off page**; per-node style is the wrong layer
568
- for a real site.
569
- 8. `references/dynamic-content.md` — the `@VAR()` language. The syntax is not
570
- guessable, and a wrong guess renders as literal text rather than an error.
571
- 9. `references/templates-and-conditions.md` — how Mosaic picks a template, and the
572
- condition grammar shared by templates, elements, interactions and form actions.
573
- 10. `references/interactions.md` — the JavaScript animation system in the shape the
574
- editor stores, values included, and the measured tutorial recipes.
575
- `references/tutorials.md` — all 24 official tutorials mapped to headless builds:
576
- which are measured, which are built from measured parts, which are still open.
577
- 11. `references/vs-elementor-gutenberg.md` — which builder habits transfer.
578
- 12. `references/slider.md` — the slider nested as its factories require, and the
579
- two things about it the markup does not announce.
580
- 13. `references/custom-fields.md` — ACF and Meta Box fields as `@VAR` / `@LOOP`:
581
- the names, what each field type resolves to, and the loop element that walks
582
- a multi-value field. Measured, 62 rows.
583
- 14. `references/dialog-and-triggers.md` — the modal (and what 1.0.10's Popover API
584
- move changed), the 1.0.10 popover, OpenStreetMap, the exit-intent / scroll-depth
585
- triggers, run rules, memory and the shorthand.
586
- 15. `references/upgrading.md` — what a plugin update does to the data and to the
587
- delivered page, measured on 1.0.7 -> 1.0.8; how to drive the migration and what
588
- to re-verify afterwards.
589
- 16. `references/server-thumbnails.md` — Mosaic's headless-Chrome thumbnails on a host
590
- without root: where Mosaic looks for the binary, a no-root install, and the two
591
- things (PHP-FPM's disabled functions, a setting decided once) that make a working
592
- install look broken.
593
-
594
- ## The data files
595
-
596
- | file | rows | source |
56
+ | `tools/mo.py` | query the measured surface - **the front door**; reads `data/*.csv` only | stdlib |
57
+ | `tools/build_page.py` | commit one page spec through the verified write path; refuses unsafe types, bad placement, out-of-enum values | stdlib |
58
+ | `tools/build_site.py` | a whole site: one master with the shell, one document per page, components | stdlib |
59
+ | `tools/interactions.py` | library: every interaction shape the editor stores (`tween`, `on`, `mode_switch`...) | stdlib |
60
+ | `tools/from_elementor.py` | Elementor `_elementor_data` -> Mosaic spec, unconverted elements named | stdlib |
61
+ | `tools/theme_zip.py`, `theme_export.php` / `theme_import.php` | move a whole theme | stdlib / WP-CLI |
62
+ | `tools/verify_*.py`, `audit_mobile.py` | check the delivered page in Chromium | `playwright` |
63
+ | `tools/test_mosaic.py` | self-test (offline) | stdlib |
64
+
65
+ | Maintainer tools | Does | Dependency |
597
66
  |---|---|---|
598
- | `data/node-verification.csv` | 134 | **swept live** — outcome, rendered tag and classes, page bytes, failure detail |
599
- | `data/node-types.csv` | 134 | source — slug, label, edition, aliases, data class |
600
- | `data/node-properties.csv` | 201 | source — property, validator chain, **accepted enum values**, `supportsInherit` |
601
- | `data/placement-rules.csv` | 134 | source — which children each type accepts |
602
- | `data/default-children.csv` | 25 | source — what a composite type needs **inside** it |
603
- | `data/style-properties.csv` | 98 | source — every settable CSS property and its value shape |
604
- | `data/style-value-shapes.csv` | 22 | **probed live** — the exact JSON shape for each structured value, and what it compiled to |
605
- | `data/style-states.csv` | 60 | source — state IDs with their exact CSS selector templates |
606
- | `data/property-verification.csv` | 170 | **probed live** — per-property effect on markup vs CSS, with unprovable enums marked INCONCLUSIVE |
607
- | `data/node-property-verification.csv` | 191 | **swept live** — each property probed with a value shaped by its own validator chain, on a type that declares it |
608
- | `data/style-verification.csv` | 101 | **swept live** — every style property written to a page and checked against the compiled CSS, with its group beside the result |
609
- | `data/rwd-verification.csv` | 733 | **checked live** - every `_t`/`_m` declaration vs the served stylesheet, with status per row |
610
- | `data/browser-verification/` | 4132 | **computed in Chromium** - declared vs `getComputedStyle` at three viewports, `not-comparable` labelled per row. One CSV per page, named by its slug |
611
- | `data/design-audit-acknowledged.csv` | 3 | reviewed findings that will not be fixed, each with a written reason. An acknowledgement without a reason is a suppression wearing a better name, and the release gate refuses one |
612
- | `data/design-audit.csv` | 26 | **computed in Chromium** - contrast, font fallback, CJK tracking, overflow, measure. Empty means it ran and found nothing |
613
- | `data/data-class-hierarchy.csv` | 131 | source - every data class and its parent, so a type's inherited properties can be resolved |
614
- | `data/style-state-verification.csv` | 59 | **swept live** - each state written on a host of its own type and matched against its promised selector |
615
- | `data/component-verification.csv` | 8 | **driven live** - the component lifecycle, each step asserted against the row or the delivered HTML |
616
- | `data/loop-verification.csv` | 28 | **measured live** - a perpetual animation: periodicity by scrubbing a paused timeline, per-element occlusion of both text and controls at five widths, and the enlarged view opened by pointer and by keyboard |
617
- | `data/accordion-verification.csv` | 7 | **driven live** - the accordion family nested the way its factory requires, against the guard that refuses it unparented. Resolves two BROKE_PAGE rows |
618
- | `data/conversion-verification.csv` | 8 | **converted then checked live** - an Elementor page rebuilt as Mosaic and held against its source (text, images, links, heading levels), then put through rwd, browser and the design audit with every finding classified inherited-or-introduced |
619
- | `data/conversion-batch.csv` | 19 | **converted, built and checked live, one page after another** - every Elementor page of a production site through the converter, with per-page element and content counts |
620
- | `data/token-benchmark.csv` | 6 | **measured with tiktoken** - the same six lookups priced three ways: reading the plugin source, loading every table, querying `mo.py`. 71-99.5% fewer tokens than the source and 99.6%+ fewer than the tables, which total 259,539 - never load them, query them |
621
- | `data/slider-verification.csv` | 30 | **driven live** - two sliders, one autoplaying and one a carousel: advance, arrows, bullets, keyboard, reduced motion |
622
- | `data/navigation-verification.csv` | 39 | **fetched and opened live** - every menu item is a real `<a href>`, each of the demo's twelve pages answers 200, every in-page anchor it links to exists, and no page scrolls sideways at 390 / 768 / 1280 |
623
- | `data/page-modal-verification.csv` | 19 | **read live** - one modal per page, and what each one's trigger, run rule, memory scope and dismissal policy actually came out as |
624
- | `data/dialog-verification.csv` | 19 | **driven live** - the modal (re-run on 1.0.10), its triggers, its run rules and the memory actions, each exercised in a real browser |
625
- | `data/dialog-form-verification.csv` | 49 | **driven live** - the same three nodes made into five FORMS (sheet, drawer, corner, takeover, gate), each re-opened at 390px and 768px; also where `pickOne` on a click turned out to be a latch rather than a lottery |
626
- | `data/popover-verification.csv` | 37 | **driven live** - 1.0.10's popover: every host a `<div popover=manual>`, a pageLoad notice that leaves the page scrollable and clickable, closedby honoured per policy, anchored placement against the trigger and against another element, the nine screen cells, keepInView flipping and the `___popover--flipped` state applying, a three-step tour advanced by afterClose and ended by interactionSuspend, and a modal whose host sets `display:flex` and still hides when closed |
627
- | `data/token-verification.csv` | 15 | **driven live** - every `:root` custom property declared once, non-empty, and resolved by something on the page; a token nothing points at is a token that is not working |
628
- | `data/mobile-audit.csv` | 68 | **driven live** - what a sideways-scroll check cannot see: type under the legible floor, controls too small to hit, a grid that never collapsed, content escaping its box |
629
- | `data/component-wall-verification.csv` | 27 | **driven live** - tabs switched, an accordion opened, a form's fields and Mosaic's own honeypot, and an OpenStreetMap asserted on the coordinates it was GIVEN rather than the default it falls back to |
630
- | `data/form-surface-verification.csv` | 23 | **driven live** - every field type Mosaic ships in one form: 1.0.12's buildable select opened, picked by click and by keyboard, its hidden input's value and its required state, radio and checkbox groups, file upload, and the browser's own validation refusing an empty submit |
631
- | `data/content-loop-verification.csv` | 15 | **driven live** - a slider, a tab bar, a list and a paginated archive whose children all come from one authored template repeated per post; the pagination is clicked and the rows asserted to CHANGE |
632
- | `data/custom-fields-verification.csv` | 62 | **rendered live** - ACF and Meta Box fields of every common type read back through `@VAR` / `@LOOP` off the delivered page, loops included |
633
- | `data/theme-zip-verification.csv` | 22 | **round-tripped live** - Mosaic's own ZIP export imported in test mode and compared to its source, table by table and tree by tree |
634
- | `data/node-type-notes.csv` | 8 | where a sweep outcome is true but misleading on its own, why. Surfaced by `mo.py type` |
635
- | `data/interaction-verification.csv` | 11 | **probed live** - interaction animation shapes, with negative controls and the stored row beside the payload; the editor's shape binds, the six older candidates and two one-field-apart controls do not |
636
- | `data/tutorial-recipes-verification.csv` | 16 | **driven live** - Mosaic's four docs tutorials (dark/light switcher, loading overlay, class-driven reveal, loop with hover pause) plus the off-canvas toggle and the reading progress bar, built from `tools/interactions.py` and checked in Chromium |
637
- | `data/menu-verification.csv` | 34 | **driven live** - every way to build a site menu on one page: hover dropdown and mega panel (mouse, keyboard, touch tablet), and three phone menus (modal drawer, navbar, the tutorial's click panel) on a 390px touch phone - Esc, focus trap and return, aria, scroll lock, a sticky header over the close button |
638
- | `data/intro-verification.csv` | 8 + 15 | **sampled live** - the entrance sequence over fifteen timestamps on a monotonic clock, plus the eight assertions about it |
639
- | `data/variants.csv` | 157 | **live** — the variant catalog (Mosaic's built-in element classes); their IDs are what a `variant` record must use, and `class_name` is what the element emits |
640
- | `data/dynamic-variables.csv` | 75 | source — every `@VAR('ns/name')` expression, by namespace |
641
- | `data/evaluator-functions.csv` | 19 | source — the `@` functions with their arity |
642
- | `data/interaction-types.csv` | 16 | source — trigger types, `timed` vs `progress`; 1.0.9 added exitIntent, scrollDepth and modal, 1.0.10 adds popover (Popover visibility change: show / beforeClose / afterClose) |
643
- | `data/animatable-properties.csv` | 22 | source — what a keyframe can drive (**not** the same set as the style properties) |
644
- | `data/condition-subjects.csv` | 59 | **live** — condition subjects per context |
645
- | `data/condition-comparators.csv` | 12 | **live** — comparators and their operator sets, captured on 1.0.9; the two date rows carry 1.0.10's four operators (after, after-or-equal, before, before-or-equal) from its source |
646
- | `data/pluggables.csv` | 285 | source — every `setID()` by registry |
647
- | `data/rest-routes.csv` | 115 | **live** — method, path, args |
648
- | `data/db-columns.csv` | 210 | **live** — every column of all 23 tables |
649
-
650
- ## Building a page
651
-
652
- `tools/build_page.py` consumes a declarative spec and commits it through the verified
653
- write path, refusing anything the tables say is unsafe. `tools/build_site.py` does the
654
- same for a whole site: one master carrying the header and footer, one template document
655
- per page.
656
-
657
- The example page is deliberately varied rather than uniform: seven numbered clauses
658
- in one rhythm, and then the things a document has that are NOT clauses - an
659
- unnumbered plate, a capability table read as a grid, a figure drawn in hairline
660
- boxes, a type specimen inverted onto the ink ground. The page changes ground five
661
- times. A builder that can only produce one section shape has not been exercised.
662
-
663
- **`sites/_moksa.py` is the worked example** - a real studio homepage (hero, statistics,
664
- services, a nine-item work list, products, testimonials, CTA, footer) generated as a
665
- spec and committed entirely through the tables. Read it for the shape of a real build:
666
- the `bp()` breakpoint helper, the `code` node that carries the keyframes, the glass
667
- header, and `apply_type()`.
668
-
669
- A spec can carry a `theme` block, which is how a real site should be styled — design
670
- tokens and element-class typography rather than per-node values:
671
-
672
- ```jsonc
673
- "theme": {
674
- "variables": {"--brand": {"type": "color", "value": "rgb(13,108,102)"}},
675
- "variants": {"Heading 1": {"&": {"_": {"color": {"token": "--brand"}}}}}
676
- }
677
- ```
678
-
679
- `{"token": "--brand"}` anywhere in a style resolves to the `{"var": "<uuid>"}`
680
- reference the compiler wants.
681
-
682
- **Two brands in one theme need namespaced tokens and no variants at all.**
683
- Collection variables and variants are both theme-global: two specs that each
684
- declare `--ink` produce one `:root` with duplicate declarations, and two specs that
685
- each style `Heading 1` produce one set of rules. Whichever committed last wins, for
686
- every page. `sites/_moksa.py` namespaces its tokens (`--mk-*`) and bakes the type
687
- system onto the nodes with `apply_type()` instead of using variants, which is
688
- what lets it share an install with a completely different design.
689
-
690
- Whole themes move between installs with `theme_export.php` / `theme_import.php`.
691
- A theme is a themeID scattered across nineteen tables, and every one of them has a
692
- COMPOSITE primary key of `(themeID, ID)` — so an import can keep every internal id
693
- and rewrite nothing but the theme, which means no id remapping and nothing left
694
- dangling. Round-tripped and verified: a full theme exported, re-imported as a copy,
695
- and the copy served byte-identical pages.
696
-
697
- Mosaic also has its own: `POST /theme/<id>/export` and `POST /theme/import/upload`
698
- (or `/import/download` from a URL), plus `/duplicate` on themes, masters, templates,
699
- components and style guides. The native export is a ZIP with the theme's
700
- attachments inside, produced by a chunked, lock-protected milestone flow — you POST
701
- repeatedly with `milestoneID` to step it through collect → compress → download — and
702
- it is gated on admin capability only, not on a licence. It moves a whole theme, never
703
- a single page. `tools/theme_zip.py` drives both directions from outside the editor.
704
- Two things about the import that the route list does not tell you: with no
705
- `themeActivateMode` it defaults to `live` and switches every visitor to the imported
706
- theme (the tool sends `test` unless `--activate`). Test mode is per USER, not per
707
- admin role: it is user meta `mosaic_<blogID>_test_mode_theme`, so the account whose
708
- cookie made the import sees the imported theme on every later fetch while visitors
709
- keep the live one - read a page logged out to see what visitors see; and a
710
- milestone must be called until it answers `isCompleted:true` - stop one call early,
711
- as the first version of the tool did after its last upload chunk, and that
712
- milestone's batch bookkeeping is left in the lock for the NEXT milestone to read as
713
- its own, which is how `extract` came to skip creating its directories and fail on
714
- the first nested file with "Could not copy file".
715
-
716
- Round-tripped and measured (`data/theme-zip-verification.csv`, 22 checks): export,
717
- import in test mode, compare. Every scoped table equal; 68,337 of 68,337 nodes
718
- outside overrides keep their ids; the 1,024 override nodes are re-keyed, with their
719
- `originalID` re-pointed at the re-keyed component internals; the live theme
720
- untouched. The node table came back one row short, and that row is the difference
721
- between the two tools in one line: an orphan `div` with no parent, left by an
722
- interrupted build, which a tree-walking import correctly does not carry and a
723
- row-copying one (`theme_import.php`) would. `theme_export.php` exists because a
724
- 2 MB JSON of rows is easier to diff, version and reason about than a ZIP, and
725
- because it needs nothing but WP-CLI; the ZIP is what the editor's buttons speak.
726
-
727
- `copy_styles.py` pushes one node's style onto others by attrID or prefix, optionally
728
- only certain `state.breakpoint` slices, and shows the diff before writing.
729
-
730
- ```bash
731
- wp eval-file tools/bootstrap_probe_theme.php # licence-free scratch theme
732
- python tools/build_all.py --config sweep.json # reset + build every design
733
- ```
734
-
735
- Rebuilding a single page without a reset leaves an orphan template bound to the same
736
- post — `build_all.py` resets first for that reason. `build_site.py` re-binds the post
737
- to a fresh master and template and leaves the old pair bound to nothing; clear them
738
- with `tools/prune_unbound.php` (dry run by default) after a batch of rebuilds.
739
-
740
- ## Facts worth knowing before you look anything up
741
-
742
- - **The REST namespace contains the plugin version** (`/wp-json/mosaic/v1.0.11`). Read
743
- it from `mosaicOptions.rest_api_url`, never hardcode. After a plugin update the
744
- editor namespace is GONE until the data upgrade has run; only
745
- `mosaic/<dataVersion>/<version>/upgrade` answers. `tools/data_upgrade.py`.
746
- - **`ordering` is a fractional-index string**, not a number.
747
- - **The tree is a `parentID` column**, not nesting. There is no page-level JSON blob.
748
- - **Everything is scoped to a `themeID`**, breakpoints included.
749
- - **A post is a target, not a container.** Templates bind to posts through
750
- `mosaic_template_assigns`; one template serves many posts.
751
- - **Only `wp_mosaic_locks` existing** means a half-installed Mosaic. The other 22
752
- tables appear when an admin loads `/wp-admin/admin.php?page=mosaic`.
753
- - **Commit has side effects.** `heal()` runs inside it and creates breakpoints,
754
- collections and child nodes you never sent. Take every revision in the response.
755
- - **One root per document, or the document renders empty.** A second, empty
756
- `component-internal` (or master/template root) ordered first makes Mosaic render
757
- from it: every instance of that component prints nothing, and within a day the
758
- overrides that point into the real tree were gone with no master commit in
759
- between (90 on a live 1.0.11 site; restoring them alone changed nothing until the
760
- empty roots were deleted). Heal syncs an instance's overrides by walking the
761
- component from that first root (`keepOverrideNodesInSync`), and heal runs on
762
- front-end renders too. Health check, which must return no rows (group by `themeID` too: the
763
- same component ID in two themes is not a duplicate):
764
- `SELECT themeID, documentType, documentID, parentType, COUNT(*) n FROM wp_mosaic_nodes WHERE parentType IN ('master','template','component','componentDocument') GROUP BY themeID, documentType, documentID, parentType HAVING n > 1`.
765
- A node's `revision` is a time-based UUID (v1), so it dates when that root was
766
- written. Match that time against the access log. `build_site.py` stops and the
767
- fix tools skip a document with more than one root; `scan_inline_tags.py` warns.
768
- Reading every document over REST does not create roots (135 before and after a
769
- full scan on the demo site). Both creations traced so far came from the
770
- database failing under load: a MySQL restart on one site, a crawler driving a
771
- burst of fast HTTP 500s on another. Each time a front-end render's heal read the
772
- failed query as "no root" and wrote a new empty one, with no REST write in the
773
- log. A site that sees this needs the load handled (bot rate limits, MySQL
774
- capacity) as much as the roots repaired.
775
- - **`modified_gmt` is server-assigned.**
776
- - **Styling hangs on the generated `._<token>` class, not your `attrID`**, and the
777
- token (`_a`, `_b`, ... `_ba`: a base-38 per-document counter) is not stable. The
778
- sibling `m-<type>` class is (`m-div`, `m-text m-wysiwyg`, `m-menu-link`), and a
779
- variant that renders its name adds it (`m-heading-2`). Before 1.0.8 the same
780
- three were `M_EL4`, `M_EL_Div` and `M_EL_Text__Heading2`; state classes moved
781
- with them (`m-accordion-item--opened`, `m-menu-link--current`, `m-tab--active`).
782
- Any CSS you write against an emitted class is coupled to the plugin version.
783
- - **`body{opacity:0}`** — the theme reveals itself from JavaScript. Screenshot tooling
784
- must let scripts run or it captures a blank page. The reveal waits for
785
- `DOMContentLoaded`, i.e. for every `defer` script, so deferring scripts blanks the
786
- page longer; `html body{opacity:1!important}` is safe and was worth 72 → 86 mobile
787
- (`references/styling.md`).
788
- - **Two themes can carry the same name, and only the ACTIVE one is bound to
789
- anything.** Every write to `theme/<themeID>/...` succeeds against an inactive
790
- theme - master, nodes, components, tokens, all of it - and then
791
- `createManualTemplate` answers `Master not found`, because it resolves the theme
792
- from the request, not from your URL. Read the active theme's id off
793
- `wp theme list --status=active` (`mosaic-1-1-<themeID>`) before building.
794
- - **Page caches stack.** The demo host ran Varnish AND Breeze; purging Varnish
795
- changed nothing because Breeze still had the old document. `build_site.py`
796
- fetches the plain URL and a cache-busted one at the same moment and reports
797
- STALE CACHE when they differ by more than a percent - believe it, then find
798
- every layer. `wp breeze purge --cache=all` was the one that mattered.
799
- - **A `code` node is a wrapper, not a splice.** `insertLocation:"inPlace"` puts your
800
- markup INSIDE `<div class="m-code _x">`, one level down - so a sibling combinator
801
- from injected HTML to a Mosaic node never matches, and a control you inject has
802
- to be styled through its own ancestors or through `:has()`. The native accordion
803
- avoided the question entirely.
804
- - **`section` arrives with 80px of top and bottom padding.** Measured on a node
805
- whose spec set neither; between a masthead and the block below it that is a
806
- 160px hole. Set `paddingTop`/`paddingBottom` explicitly when a section's rhythm
807
- is meant to come from its contents.
808
- - **A `code` node's content is a template, and `@media(` is a function call.**
809
- Mosaic parses `code` content for `@VAR(...)`; a CSS at-rule glued to its
810
- parenthesis - the form every minifier emits - is parsed as a call with
811
- unparseable arguments and the page renders as HTTP 500, after a clean commit.
812
- Write `@media (`. Text nodes are not parsed and are safe; measured both.
813
- - **The front page 301s.** When a post is `page_on_front`, its own permalink
814
- (`/moksa/`) redirects to `/`; a fetch that does not follow redirects reads 0
815
- bytes and looks like an outage.
816
- - **Every `build_site.py` run leaves a master behind, and they add up.** After a
817
- season of probing the test theme held 223 masters and 98,261 nodes with 25
818
- masters actually bound; Mosaic's ZIP import then spent 230s on masters and died
819
- in templates when nginx closed the upstream at five minutes. Pruned to the bound
820
- set (masters not reached from a bound template, their templates, their nodes)
821
- the same import took under two minutes and compared 22 of 22. Prune before you
822
- export - `wp eval-file tools/prune_unbound.php <themeID>` counts, `--apply` deletes; `wp_mosaic_template_assigns.parentID` -> template -> `masterID` is the
823
- bound set, plus any `assign="auto"` template. Then sweep ORPHANS: a probe run
824
- that half-failed, or a prune that removed a parent, leaves nodes whose parent id
825
- points at nothing. The export skips them, so the copy is short by exactly those
826
- rows and `theme_zip_compare.php` reports a tree that does not match - delete
827
- nodes with a missing parent REPEATEDLY until none are left, because each pass
828
- orphans the next level down.
829
- - **`width` / `height` and their min/max take the keyword `stretch` since 1.0.9**,
830
- and Mosaic emits `-webkit-fill-available` before it so an older engine still gets
831
- something. They are still token-referencable - `CSSSizePropertyFactory` extends
832
- the collection-variable one, which is why `data/style-properties.csv` resolves a
833
- factory's ancestry rather than testing its name. 39 properties take a token, not
834
- the 34 counted before that fix.
835
- - **A width copied out of Elementor needs `maxWidth: "100%"` beside it.**
836
- Elementor caps every widget with `max-width:100%`, so a px width there is a
837
- desktop intent its own CSS already constrains; carried across bare it keeps the
838
- full 600px and the page scrolls sideways on a phone. `verify_rwd` cannot see it
839
- - the declaration did reach the stylesheet - and nineteen converted pages were
840
- green on every per-page check while all nineteen overflowed at 390px.
841
- - **Only three interaction types can be an `interactionShorthand`**: `pageLoad`,
842
- `exitIntent`, `scrollDepth` (`InteractionTypesManager::getShorthandInteractionTypes`).
843
- Any other is dropped in silence - the modal renders with its aria and its
844
- `closedby`, the page carries no interaction, and nothing ever opens it. The
845
- three that remain are exactly the ones that do not need the element to be
846
- visible first, which a modal never is.
847
- - **A `slider-navigation-bullet` is a template, not a list item.** One authored
848
- bullet is repeated once per slide, every copy carrying the SAME id - writing
849
- three gets three templates and a document full of duplicate ids. The
850
- `aria-label` is Mosaic's, taken from each slide's own `title`. An arrow hides
851
- itself at the end it cannot pass unless the slider is a carousel, so a test
852
- that clicks `next` after autoplay has parked the slider finds nothing there.
853
- - **An interaction that targets another element stores that element's NODE id**,
854
- not its attrID, so both have to be written in one pass (`nodeID` on a spec node
855
- pins it). The pin means "these two halves must agree", never "this uuid must be
856
- the one in the database" - `wp_mosaic_nodes`' key is `(ID, themeID)`, so a fixed
857
- id makes the spec single-use and the SECOND build dies on a duplicate key with
858
- the page half written. `build_page.refresh_node_ids()` now rewrites every pin and
859
- every reference to it at build time, so a spec with pins rebuilds as many times
860
- as you like.
861
- - **Since 1.0.9 the three per-breakpoint stylesheets are one.**
862
- `mosaic-theme-document-styles-inline-css` carries the base rules and the
863
- `@media` blocks together; the old `mosaic-theme-block-editor-styles_<bp>-inline-css`
864
- ids are gone. And an element whose styles compile to nothing is emitted with
865
- no generated class at all, so "no `_token`" no longer means "did not render".
866
- - **Since 1.0.10 the modal is a Popover-API host in the top layer.** `<dialog
867
- popover="manual">`; `dialog.open` is always false (read `:popover-open` or
868
- `data-mosaic-dialog-state`), the controller has `requestClose()` and no `close()`,
869
- and the closed state is `display:none !important` - so `display` on a modal host,
870
- a pin-it-open bug on 1.0.9, is safe now. z-index cannot put anything above it.
871
- - **`popover` is the non-blocking dialog (1.0.10)**: no overlay, no children
872
- required, `closedby` defaults to `nothing`, `positioning` is `screen` (nine cells)
873
- or `element` (side / align / keepInView / anchor - no anchor = its trigger).
874
- Actions `popoverOpen` / `popoverClose` / `popoverToggle`; trigger `popover` with
875
- slots `show` / `beforeClose` / `afterClose`; style state `___popover--flipped`.
876
- **A dialog opened from inside another dialog is its child and closes with it, and
877
- closing a popover suspends the interactions inside it** - so a sequence advances
878
- on the step's own `afterClose`, never on a button that opens the next step.
879
- references/dialog-and-triggers.md
880
- - **`scrollDepth`'s action slot is `reached` since 1.0.10** (plus `returned`). An
881
- action stored under the old slot name `scrollDepth` is kept and never runs.
882
- - **A local-context loop's `loopSource` is `@VAR('post/<loop>')`, never `@LOOP()`.**
883
- Both render on the front end; `@LOOP` there throws in the editor
884
- (`_loopEvaluatorFunction is not a function`) and the canvas never finishes.
885
- `build_page.py` refuses it. `@LOOP(…)` inside text is fine.
886
- - **A custom field is `@VAR('post/meta_<key>')`, and a multi-value one is a LOOP.**
887
- ACF and Meta Box both, plus bare post meta. Derived properties hang off the
888
- name with two underscores (`meta_k__label`, `__url`, `__id`); an ACF group is
889
- `loop-k` (hyphen) with `item/value_<sub>` rows; ACF puts the ID in a
890
- reference's primary slot where Meta Box puts the title. Run
891
- `tools/list_fields.php` on the post rather than guessing - a name it does not
892
- print does not exist. references/custom-fields.md
893
- - **A variant row cannot be deleted, only emptied.** `status:"delete"` on a
894
- variant is accepted and ignored - the row is catalog-backed. Commit it back with
895
- `{"states": {"&": {"_": {}}}}` and the rule disappears; measured on Heading 2.
896
- - **User class names have a grammar.** Variant sub classes and universal classes
897
- emit `[a-z0-9_-]` segments joined by `--` (`m-button--primary--sm`), each segment
898
- at most 60 characters, never starting with `_`, a digit or the reserved `m-`;
899
- names that do not sanitize fall back to `class`, and collisions get `-2`, `-3`.
900
- The emitted name is UNIQUE per theme (an `emittedName` column with a unique
901
- index on four tables), so two classes cannot share a spelling.
902
-
903
- ## Rendered-tag facts you would otherwise guess wrong
904
-
905
- - **`button` renders three tags since 1.0.8, by two properties.** With a `url` it is
906
- `<a href>`; without one it is `<button type="button">` (1.0.7 emitted `<span>`);
907
- with `inactive:"1"` - the new integer-as-string property, the Badge variant's
908
- default - it is a `<span>`, a label rather than a control. Measured all three.
909
- `menu-link` and `wysiwyg-link` still render `<span>` without a `url`.
910
- - **A button's words go in a `text` node, not straight under it.** The editor builds
911
- `button > text (Inherited text variant, 6381b2f3…) > wysiwyg-text`, and the same
912
- for menu-link, dropdown-toggle, tabs and submit labels. A `wysiwyg-text` placed
913
- directly under a button renders identically but cannot be edited in the editor:
914
- the navigator shows no child, and a double-click opens only the link settings.
915
- Only `text`, `label`, `choice-label`, `choice-legend`, `fieldset-legend` and the
916
- inline `wysiwyg-span` / `wysiwyg-link` hold runs directly. `build_page.py` wraps
917
- runs under any other type itself (`wrap_text_runs`), so the `"text"` shorthand is
918
- safe on a button, and a component's `text` override on a button follows the run
919
- down into that wrapper (`build_site.py`). Output: `<a class="m-button"><div class="m-inherited-text
920
- m-wysiwyg">…</div></a>` - the editor's own button carries the same `<div>`.
921
- A site built before v1.34.1 is fixed in place by `tools/fix_text_runs.py`
922
- (dry run, then `--apply`): measured on the test theme, 428 runs wrapped
923
- across its masters and templates, every page unchanged in text, a component instance's
924
- override still shown, and a second run finding nothing.
925
- - **`text` renders as `<div>` by default** — set `tagName` for `<h1>`, `<p>` and so on.
926
- - **A `wysiwyg-text` run prints no markup since 1.0.11.** Its `<` and `>` are escaped
927
- on output, so `A<strong>B</strong>C<br>D` reaches the page as those literal
928
- characters (measured: `A&lt;strong&gt;B&lt;/strong&gt;C&lt;br&gt;D`). Inline
929
- formatting is a node: `wysiwyg-span` → `<span class="m-span">` (style it),
930
- `wysiwyg-linebreak` → `<br>`, `wysiwyg-link` with `url` →
931
- `<a class="m-inline-link">`, each holding its own `wysiwyg-text` child. Entities
932
- still print as their character (`&lt;dialog&gt;` → `<dialog>`, `&amp;` → `&`).
933
- Bold and italic are NOT nodes but a property of the run: `wysiwyg-text` (and
934
- `wysiwyg-variable`) take `format: ["bold"]`, `["italic"]` or both, printed as
935
- `<strong>` / `<em>`. Both at once comes out misnested on 1.0.11 -
936
- `<strong><em> BI</strong></em>` (measured); browsers repair it, validators do not.
937
- `inline_html.py` maps `<strong>`/`<em>` to styled `wysiwyg-span`s instead.
938
- Through 1.0.10 the run was raw HTML instead, where a tag name in prose swallowed
939
- the rest of the paragraph; `build_page.py` refuses any tag in a run either way.
940
- **So a site built on 1.0.10 or earlier can start showing tags overnight**: the
941
- plugin updates itself, the data does not change, and every `<p>`, `<br>` or
942
- `<span>` written into a run now prints. Run `tools/scan_inline_tags.py` (read only)
943
- before or after the update, on any site not built by `build_page.py` (another
944
- converter, hand edits, an older helper). On the test theme it listed 179 runs on
945
- the Elementor-converted `el-*` pages, and each listed page printed `&lt;p&gt;` while
946
- the rest printed none. `tools/fix_inline_tags.py` then rewrites them in place
947
- (dry run, then `--apply`): 179 fixed, 0 skipped, a second run found nothing, no
948
- page printed a tag afterwards, and every page's visible text was identical.
949
- One layout change to expect: a run that was `<p>…</p>` used to put a real `<p>`
950
- inside the text node, and that `<p>` picked up the WordPress theme's own `p` rule
951
- (here `margin:24px 0 0; font-size:16px; line-height:24px`), overriding the node's
952
- own font size and line height. After the fix the node's own style applies, so
953
- each such block lost 8-49px of height. Giving the node `tagName: p` does not
954
- bring it back: Mosaic zeroes the margin on its own `p.m-text`.
955
- - **`menu-link` is `width: fit-content` by default** (`.m-menu-link{display:flex;gap:4px;
956
- padding:4px 8px;width:fit-content;…}`). Used as a cell of a button row or a grid -
957
- a phone contact bar on `2fr 1fr 1fr` - its background hugs the text and the cell
958
- stays empty around it, whatever `display` or `justify-content` you give it. Set
959
- `width: 100%` on it (reported from a client build; the rule read from 1.0.10's
960
- `style.css`). The same rule's `align-items:center` matters when a `menu-link`
961
- wraps a whole card: set `alignItems: stretch` and `textAlign: left` on it.
962
- - **`customDeclarations` is all or nothing, and its unit list is short.** The
963
- validator parses every declaration and drops the WHOLE block if one value fails.
964
- `!important` fails, and so does any unit outside `ValidatorCustomDeclarations`'s
965
- list - `dvh`, `svh`, `lvh`, `dvw`, container units: `height: 100dvh` takes every
966
- other line in the block with it, silently. The structured `height` / `maxHeight`
967
- fields do accept `dvh`.
968
- - **`youtube` renders `<mosaic-youtube>` carrying `data-video-id`, `data-params`,
969
- `data-host`**, with the server's iframe inside `<noscript>`; the custom element
970
- builds the real iframe once it has a size. The iframe has no `title`, so an
971
- accessible name has to be added some other way. `youtubeUrl` is
972
- `{"v": "https://www.youtube.com/watch?v=…"}`; `lazyLoad` defers it and there is
973
- no click-to-load facade (same for `vimeo`). Sized by `width`/`height: 100%` inside
974
- an `aspect-ratio: 16/9` box. `privacy:"1"` switches the host to
975
- `www.youtube-nocookie.com` - measured on 1.0.11; the old NO_OUTPUT row was a probe
976
- artefact. `suggestedVideos` maps to `rel`. `vimeo`'s `privacy` is `dnt=1`.
977
- - **Eight types emit custom elements**: `<mosaic-dropdown>`, `<mosaic-navbar>`,
978
- `<mosaic-tabs>`, `<mosaic-accordion>`, `<mosaic-vimeo>`, `<mosaic-youtube>` and
979
- friends. A selector written against `div`/`nav` misses all of them.
980
- - **`icon` renders inline `<svg>`.**
981
- - **Only four types take a `url`**: `button`, `menu-link`, `wysiwyg-link`,
982
- `dropdown-toggle`. Put one on a `text` or an `image` and it is accepted, stored,
983
- and emits no anchor whatsoever. To make anything else clickable, WRAP it in a
984
- `button` whose `style.variant` is the Link variant (`f671bc01-…`, `m-link`) - that
985
- is what the editor's "Wrap in link" writes, `button` takes children, and with a
986
- `url` it renders `<a class="m-link" href>` around them (measured on 1.0.11). A
987
- `menu-link` wrapper works the same way (`target="_blank"` included; probed) but
988
- carries menu styling. A `button` with `inactive` on keeps its `url`/`target`/`rel`
989
- stored and emits none of them.
990
- - **An image's attachment-protocol path is relative to the UPLOADS directory.**
991
- `wp-attachment://image/<id>/<size>/2026/09/pic.png` resolves, and carries the
992
- attachment's `width`/`height` onto the tag. Give it the full
993
- `wp-content/uploads/2026/09/pic.png` - the obvious guess - and Mosaic prefixes
994
- the uploads base a second time, serving a broken `src` with no error and no
995
- dimensions. A plain `https://` URL also works, and is the right fallback for an
996
- image that is not an attachment on this site.
997
-
998
- ## Tools
999
-
1000
- | tool | does |
1001
- |---|---|
1002
- | `mo.py` | query the measured surface - **the front door** |
1003
- | `benchmark_tokens.py` | reproduce the token figures: source vs tables vs query, six tasks |
1004
- | `build_page.py` | commit one page spec through the verified write path |
1005
- | `build_site.py` | a whole site: one master with the shell, one document per page |
1006
- | `verify_rwd.py` | does every `_t`/`_m` declaration reach the served stylesheet? |
1007
- | `verify_browser.py` | does the **browser** compute what the stylesheet promised - and does the result pass a design audit? |
1008
- | `verify_intro.py` | does the page-load animation play, and - the part that matters - does it END and hand the page back? |
1009
- | `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? |
1010
- | `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? |
1011
- | `probe_accordion.py` | the accordion family nested as its factory requires, plus the guard's refusal of the bare node - the probe that corrected two rows of this skill's own tables |
1012
- | `from_elementor.py` | an Elementor `_elementor_data` tree -> a Mosaic page spec, with every element it cannot convert reported by name and reason (`--strict` to refuse a lossy spec) |
1013
- | `inline_html.py` | an HTML fragment -> `text` / `list` nodes with `wysiwyg-span` / `-link` / `-linebreak` inside, for content that arrives as HTML (a 1.0.11 text run prints tags literally); `from_elementor.py` uses it |
1014
- | `verify_conversion.py` | did the conversion carry the page? every source string, image, link and heading level looked for on the delivered Mosaic page |
1015
- | `sweep_node_types.py` | commit every node type one per document and assert the delivered HTML |
1016
- | `sweep_style_properties.py` | write every style property and check the compiled CSS |
1017
- | `sweep_node_properties.py` | probe every node property with a value from its own validator chain |
1018
- | `sweep_style_states.py` | write every style state and check the selector it compiled to |
1019
- | `sweep_components.py` | build a component, instance it twice, and prove one definition served both |
1020
- | `sweep_interactions.py` | which interaction animation shapes survive to the frontend payload |
1021
- | `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 |
1022
- | `verify_recipes.py` | builds Mosaic's four docs tutorials on one page and drives each in Chromium |
1023
- | `theme_export.php` / `theme_import.php` | move a whole theme across installs, ids intact |
1024
- | `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` |
1025
- | `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 |
1026
- | `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 `--apply`, `assign="auto"` templates kept |
1027
- | `theme_delete.php` | remove a theme completely through the plugin's own routine; refuses the live one |
1028
- | `fix_text_runs.py` | wrap text runs that sit directly under a button, menu-link or other non-text element (built before v1.34.1) in an Inherited text `text` node, so the editor can edit them - every master, template and component, through each document's own commit; dry run unless `--apply`, idempotent, component overrides kept |
1029
- | `scan_inline_tags.py` | read only: list every `wysiwyg-text` run whose text holds HTML tags (printed literally on 1.0.11+), with the nearest attrID above it, across every master, template and component - run it before or after a site updates from 1.0.10; also warns on a document with more than one root |
1030
- | `fix_inline_tags.py` | rewrite those runs in place as `wysiwyg-span` / `-link` / `-linebreak` nodes (inline_html.py's mapping); a run that is one `<p>`/`<hN>` gives its tag to a text node that has none; lists, tables, images and mixed block/inline runs are skipped and listed; dry run unless `--apply`, idempotent |
1031
- | `verify_slider.py` | the slider in a real browser: does it advance, do the arrows and bullets drive it, does the keyboard, does it stop when motion is not wanted - `--label`/`--append` put several sliders in one table, which is where a carousel and a plain slider can be held against each other |
1032
- | `verify_navigation.py` | a multi-page site: is every menu item a real `<a href>`, does every page answer 200 (a template that was never bound answers 406 with an empty body, which only a logged-out visitor sees), and with `--viewports` does any page scroll SIDEWAYS - the one question no per-page checker asks - and whether every in-page `#fragment` resolves ON THE PAGE THAT CARRIES IT, which an HTTP check cannot see: a bare `#services` in a SHARED header fetches the current page, answers 200 everywhere, and does nothing on every page but the one that has that section |
1033
- | `verify_dialog.py` | the modal in a real browser (1.0.9 and 1.0.10 alike: open is read as `:popover-open` or `dialog.open`): does it open, close, answer Esc, remember, cap - and does an OpenStreetMap carry the coordinates it was given |
1034
- | `verify_popovers.py` | 1.0.10's popover in a real browser: opens, lands where its positioning says, blocks nothing, closes the way closedby says, flips, chains, and ends - every check reads `:popover-open`, never an attribute |
1035
- | `verify_dialog_lab.py` | the question after "does the modal work": can three nodes be made into a bottom sheet, a side drawer, a corner notice, a full takeover and a gate with no way out - and does each one still fit at phone width, which the page's own width check cannot see |
1036
- | `verify_tokens.py` | the design tokens as the BROWSER resolved them: every `:root` property declared once (a changed value does not retire the old one), non-empty, and actually pointed at by something - a wrong `skinsData` shape still emits the declaration and serves white |
1037
- | `verify_components.py` | presses the interactive components on a page and asserts the RESULT - a pane actually swapped, an accordion item actually opened, the map carries the coordinates it was given - because "these all work" is worth what the last press proved |
1038
- | `audit_mobile.py` | the RWD defects a sideways-scroll check cannot see - type under the legible floor, controls too small to hit, a grid that never collapsed, content escaping a box that is not clipping it - re-opened at every `--widths` |
1039
- | `list_fields.php` | every `@VAR` / `@LOOP` name Mosaic registers for one post - custom fields, their derived `__label` / `__url` / `__id` properties, the row variables of each loop - with the value each resolves to (`wp eval-file`) |
1040
- | `data_upgrade.py` | after a plugin update, run Mosaic's data migration over its own milestone route - the step wp-admin does from a screen - and set the config's version when the editor API is back |
1041
- | `copy_styles.py` | push one node's style onto others, by attrID or prefix |
1042
- | `bootstrap_probe_theme.php` | a licence-free scratch theme |
1043
- | `mint_session.php` | a matching cookie + `wp_rest` nonce from WP-CLI |
1044
- | `mosaic_config.py` | the one place a tool resolves the site URL and session - environment (`MOSAIC_SITE_URL` / `MOSAIC_REST_COOKIE` / `MOSAIC_REST_NONCE`) over `--config` file, so a credential never has to be written to disk |
1045
- | `check_tables.py` | re-extract all eleven source-derived tables and diff them against the shipped ones - the check for a table that is not wrong but STALE, which nothing else can see |
1046
-
1047
- ## The session, and where it comes from
1048
-
1049
- Every tool that writes needs a site URL, a logged-in cookie and a matching
1050
- `wp_rest` nonce. **Never go looking for them on the user's machine** - not in a
1051
- browser profile, not in `wp-config.php`, not in a dotfile. Ask, or have the user
1052
- mint them:
1053
-
1054
- ```bash
1055
- wp eval-file tools/mint_session.php # on the server, prints COOKIE= and NONCE=
1056
- ```
1057
-
1058
- Then either export them, which keeps the credential off disk entirely:
1059
-
1060
- ```bash
1061
- export MOSAIC_SITE_URL=https://example.com
1062
- export MOSAIC_REST_COOKIE='wordpress_logged_in_…=…'
1063
- export MOSAIC_REST_NONCE=0a0326da96
1064
- python tools/build_site.py --site sites/moksa.json
1065
- ```
1066
-
1067
- or pass a JSON file the user wrote:
1068
-
1069
- ```bash
1070
- python tools/build_site.py --config sweep.json --site sites/moksa.json
1071
- ```
1072
-
1073
- `tools/mosaic_config.py` is the single place that resolves this, and the
1074
- environment wins over the file. Installed as a plugin, the three values are
1075
- `userConfig` options - the cookie and the nonce `sensitive: true`, so Claude Code
1076
- masks them and stores them in the platform credential store rather than in
1077
- `settings.json`.
1078
-
1079
- ## Regenerating everything
1080
-
1081
- ```bash
1082
- python tools/extract_node_types.py <plugin-root> data/
1083
- python tools/extract_pluggables.py <plugin-root> data/
1084
- python tools/extract_placement.py <plugin-root> data/
1085
- python tools/extract_default_children.py <plugin-root> data/ # now also records heal-inserted children
1086
- python tools/extract_style_properties.py <plugin-root> data/
1087
- python tools/extract_interactions.py <plugin-root> data/
1088
- python tools/extract_dynamic_variables.py <plugin-root> data/
1089
-
1090
- # and then, always: a table extracted BEFORE its extractor was repaired keeps
1091
- # describing the old source and ships silently. Row counts cannot see it and the
1092
- # release gate never sees the plugin. Run this after ANY change to an extractor,
1093
- # not only after a plugin upgrade.
1094
- python tools/check_tables.py <plugin-root>
1095
- python tools/capture_live.py data/ # from data/raw/*.json + db-columns.txt
1096
- # (raw dumps are gitignored;
1097
- # re-capture from a live site)
1098
-
1099
- # against a scratch site - DESTRUCTIVE, never point at production
1100
- python tools/sweep_node_types.py --config sweep.json --setup
1101
- python tools/sweep_node_types.py --config sweep.json --sweep --edition all
1102
- python tools/sweep_properties.py --config sweep.json
1103
- # `sites/moksa.json` is GENERATED - the package ships the readable modules it
1104
- # comes from, not 2MB of built output. Regenerate it before anything reads it:
1105
- python sites/_moksa.py
1106
-
1107
- python tools/verify_rwd.py --config sweep.json --site sites/moksa.json --csv data/rwd-verification.csv
1108
- python tools/verify_browser.py --config sweep.json --site sites/moksa.json \
1109
- --csv data/browser-verification/ --audit data/design-audit.csv
1110
- python tools/verify_intro.py --config sweep.json --site sites/moksa.json \
1111
- --csv data/intro-verification.csv --frames shots/intro/
1112
- python tools/sweep_style_properties.py --config sweep.json --page moksa --csv data/style-verification.csv
1113
- python tools/sweep_node_properties.py --config sweep.json --page moksa --csv data/node-property-verification.csv
1114
- python tools/sweep_style_states.py --config sweep.json --post 20 --slug probe-lab --csv data/style-state-verification.csv
1115
- python tools/sweep_interactions.py --config sweep.json --post 20 --slug probe-lab --csv data/interaction-verification.csv
1116
- python tools/verify_recipes.py --config sweep.json --post <ID of the probe-recipes page> --slug probe-recipes \
1117
- --csv data/tutorial-recipes-verification.csv # --post REBINDS that post's template: check the ID first
1118
- python tools/verify_menus.py --config sweep.json --post <ID of the menu-lab page> --slug menu-lab --csv data/menu-verification.csv
1119
- python tools/verify_loop.py --url https://site/ --window mk-loop --toggle mk-plate-title --panel mk-plate-item \
1120
- --parts ukw-sky,ukw-sun,ukw-fuji,ukw-mist,ukw-sea,ukw-crest,ukw-boat,ukw-wave,ukw-claw,ukw-swell,ukw-key,mk-loop-seal \
1121
- --period 14000 --csv data/loop-verification.csv
1122
- python tools/probe_accordion.py --config sweep.json --post 20 --slug probe-lab --csv data/accordion-verification.csv
1123
- python tools/from_elementor.py --data _elementor_data.json --out spec.json --report conv.csv --uploads-base https://site/wp-content/uploads --slug converted --post 208
1124
- python tools/verify_rwd.py --config c.json --site spec.json --csv rwd.csv
1125
- python tools/verify_browser.py --config c.json --site spec.json --csv browser.csv --audit audit.csv
1126
- python tools/verify_conversion.py --data _elementor_data.json --url https://site/converted/ --report conv.csv --prefix p2360 --rwd rwd.csv --browser browser.csv --audit audit.csv --csv data/conversion-verification.csv
1127
- wp eval-file tools/theme_export.php active > theme.json
1128
- wp eval-file tools/theme_import.php theme.json "Copy" rebind activate
1129
- python tools/theme_zip.py export --config c.json --out theme.zip
1130
- python tools/theme_zip.py import --config c.json --zip theme.zip # test mode
1131
- python tools/theme_zip.py import --config c.json --zip theme.zip --activate # goes live
1132
- wp eval-file tools/theme_zip_compare.php <source> <copy> theme-zip-verification.csv
1133
- wp eval-file tools/theme_delete.php <copy>
1134
- python tools/probe.py --config lab.json --cases cases.json # ad-hoc measurement
1135
- python tools/check_placement_predicts.py
1136
- claude plugin eval . --runs 3 -j 3 --no-publish # the skill vs no skill, 5 cases; Bash is
1137
- # not granted (no sandbox on Windows), the
1138
- # agent reads data/ instead of running mo.py
1139
- ```
1140
-
1141
- `bootstrap_probe_theme.php` exists because Mosaic's own new-theme flow calls
1142
- `account.mosaicbuilder.com` and needs a licence. `EditorInstanceWithNewTheme->heal()`
1143
- does not — which is what made a licence-free fixture, and therefore this whole
1144
- verification, possible.
67
+ | `extract_*.py`, `check_tables.py`, `capture_live.py` | plugin source / live site -> `data/` | plugin source |
68
+ | `sweep_*.py`, `probe*.py` | write every type / property / state to a scratch site and assert | a scratch site |
69
+ | `check_numbers.py` | every number in this file vs the data | stdlib |
70
+ | `benchmark_tokens.py` | the token figures | `tiktoken` |
71
+ | `scripts/check-release.mjs`, `install.mjs` | release gate, installer | Node |
72
+
73
+ All tools: [tools.md](references/tools.md). The user path (query, build, self-test)
74
+ is standard library only; `playwright` and `tiktoken` are in `requirements.txt`.
75
+ Every tool that writes needs a site URL, cookie and `wp_rest` nonce from
76
+ `tools/mint_session.php` or the user - **never go looking for credentials on the
77
+ machine** ([tools.md](references/tools.md), "The session").
78
+
79
+ ## Routing
80
+
81
+ **Iron rule: look it up first, never answer from memory. Not in the data → say so, mark it 待補 (pending), record it in `data/pending.csv`, and do not guess.**
82
+ Never write a node type, property name, enum value, style key or Free/Pro claim
83
+ from memory. Mosaic accepts most wrong writes with HTTP 200 and then renders
84
+ nothing, drops a CSS rule, or replaces the whole public page with an error
85
+ string. Look it up with `mo.py`, not grep: grep confirms `accordion-content`
86
+ exists; `mo.py type` says placing one bare kills the page and where it must go
87
+ instead. Why, with the eight failure modes: [core-rules.md](references/core-rules.md).
88
+
89
+ Chinese and colloquial terms work directly: `data/terms-zh.csv` maps them to
90
+ Mosaic's names (`內距` → padding, `懸停` → hover, `摺疊面板` → accordion,
91
+ `彈窗` → modal | popover). `mo.py terms <詞>` shows the mapping; an unmapped word
92
+ exits 1 and says to record it.
93
+
94
+ | The user says | Data | Command |
95
+ |---|---|---|
96
+ | 「做一頁」「給我一個起手架構」 | page spec | `mo.py skeleton` → look up every type → `build_page.py --spec` |
97
+ | 「有哪些元件可以用」「有沒有表單/輪播」 | node types + sweep verdict | `mo.py types --safe` · `mo.py type 輪播` |
98
+ | 「哪些不能用」「哪些會讓頁面壞掉」 | sweep verdict | `mo.py types --unsafe` · `mo.py check <types>` |
99
+ | 「免費版能用嗎」「哪些要 Pro」 | edition | `mo.py types --edition pro` |
100
+ | 「這個節點能設什麼」 | everything settable on one type | `mo.py params text` |
101
+ | 「什麼可以放在什麼裡面」 | placement + default children | `mo.py placement accordion-item` |
102
+ | 「內距/外距/圓角/字級怎麼設」 | CSS → style key | `mo.py css 內距` · `mo.py style --grep radius` |
103
+ | 「懸停/聚焦的樣式」 | style states | `mo.py states --grep 懸停` · `--verified` |
104
+ | 「平板/手機版分開設」「RWD」「斷點」 | `_t` / `_m` style keys | [responsive.md](references/responsive.md) · `mo.py terms 斷點` |
105
+ | 「彈窗」「彈出視窗」「浮動框」「導覽」 | modal / popover + triggers | `mo.py type modal` · `mo.py type popover` · [dialog-and-triggers.md](references/dialog-and-triggers.md) |
106
+ | 「動畫」「互動」「捲動到這裡淡入」 | interaction triggers | `mo.py interactions` · `tools/interactions.py` · [interactions.md](references/interactions.md) |
107
+ | 「全站顏色/字型」「深色模式」 | variables, modes, variants | `mo.py classes --grep Heading` · [design-system.md](references/design-system.md) |
108
+ | 「同一塊放好幾頁」 | components | [design-system.md](references/design-system.md) (components) |
109
+ | 「class 命名規則」「刪掉一個變體」 | class grammar, variant rows | `mo.py facts class names` · `mo.py facts variant deleted` · [design-system.md](references/design-system.md) |
110
+ | 「顯示文章標題/自訂欄位」 | `@VAR()` | `mo.py vars --namespace post` · `tools/list_fields.php` |
111
+ | 「只在某些頁顯示」「範本套用規則」 | conditions | `mo.py conditions --grep` · [templates-and-conditions.md](references/templates-and-conditions.md) |
112
+ | 「搬佈景」「匯出匯入」 | theme export / import | [building.md](references/building.md) · `theme_zip.py` |
113
+ | 「Mosaic 升級了」 | data upgrade + re-verify | [upgrading.md](references/upgrading.md) · `data_upgrade.py` |
114
+ | 「REST 端點」「資料表欄位」 | routes, columns | `mo.py routes --grep template` · `mo.py tables wp_mosaic_nodes` |
115
+ | 「為什麼會這樣」「前台實際會怎樣」 | measured facts | `mo.py facts section padding` (all words must match) · [failure-modes.md](references/failure-modes.md) |
116
+ | a word that matches nothing | - | retry in English; still nothing → `data/pending.csv` |
117
+
118
+ `--json` goes before the subcommand (`mo.py --json type text`). `--grep` is a
119
+ substring match. `mo.py facts` matches English words in the measured-facts
120
+ text; turn a Chinese word into one with `mo.py terms` first, and try a second
121
+ wording (`visitor`, `status`, `reserved`) before concluding nothing was measured. **Never load `data/*.csv` into context** - query them.
122
+
123
+ ## Tasks
124
+
125
+ **Build native, not code.** A `code` node, a `script` action or a pile of
126
+ `customDeclarations` renders and is a dead end: the client cannot edit it.
127
+ Mosaic's own tutorials build every common effect with no custom code. Use code
128
+ only when no row of the native table in [core-rules.md](references/core-rules.md)
129
+ fits, and say in the spec which native path was checked.
130
+
131
+ | Task | Steps | Done when |
132
+ |---|---|---|
133
+ | **Build a page** | `mo.py skeleton`; `mo.py check <every type>`; `mo.py params` / `css` for every key; `build_page.py --spec page.json` | build exits 0, then the Verify rows for a page pass |
134
+ | **Build a whole site** | `build_site.py --site site.json`; rebuild pages that share components **in the same run** | every page `OK`, no `STALE CACHE` line; `verify_navigation.py` exit 0 |
135
+ | **Change a style** | `mo.py css <property>` → style key; `mo.py states` for a state; tokens via `{"token": "--x"}` in a `theme` block, not per-node values | `verify_rwd.py` and `verify_browser.py` exit 0 |
136
+ | **Responsive** | `_t` / `_m` keys only ([responsive.md](references/responsive.md)); a width copied from Elementor needs `maxWidth: "100%"` | `verify_rwd.py`, `audit_mobile.py --widths 390,768` exit 0 |
137
+ | **Popup / drawer / tour** | `modal` (blocking) or `popover` (non-blocking); shorthand triggers only `pageLoad` / `exitIntent` / `scrollDepth`; a tour advances on `afterClose` | `verify_dialog.py` / `verify_popovers.py` exit 0 |
138
+ | **Site menu** | `dropdown` with `openOn: hover`; phone drawer = `modal` opened by `modalOpen` | `verify_menus.py` exit 0 |
139
+ | **Animation / interaction** | `tools/interactions.py` (meta-uuid keys, CSS-string values); never `@keyframes` in a code node | `verify_recipes.py` exit 0 (or `verify_intro.py` / `verify_loop.py` for that shape) |
140
+ | **Form with a Select** | 1.0.12: `select > select-toggle + select-options > select-option`; `select-input` no longer exists | `verify_components.py` exit 0 |
141
+ | **Move a theme** | `theme_zip.py export` / `import` (test mode unless `--activate`), or `theme_export.php` / `theme_import.php`; prune unbound masters first | `theme_zip_compare.php` all PASS |
142
+ | **Plugin upgrade** | `data_upgrade.py`; re-extract (`extract_*.py`, `check_tables.py`); re-run the verifiers | [upgrading.md](references/upgrading.md) checklist; `scan_inline_tags.py` finds nothing |
143
+ | **Elementor → Mosaic** | `from_elementor.py --strict`; build; check | `verify_conversion.py` exit 0 |
144
+ | **Old site shows literal tags** (1.0.11+) | `scan_inline_tags.py` (read only) → `fix_inline_tags.py`, dry run then `--apply` | a second scan finds nothing |
145
+
146
+ Before writing anything, read [data-model.md](references/data-model.md) (where a
147
+ page lives: tables, not postmeta) and [write-protocol.md](references/write-protocol.md)
148
+ (checkout / check / commit). Spec format, themes, two brands in one install,
149
+ cleanup: [building.md](references/building.md). Full reading order:
150
+ [data-files.md](references/data-files.md).
151
+
152
+ Five facts that cause most broken pages (the rest: [facts.md](references/facts.md)):
153
+
154
+ - A `button`'s words go in a `text` node (`build_page.py` wraps them); only four types take a `url`.
155
+ - A `wysiwyg-text` run prints tags literally since 1.0.11: inline formatting is `wysiwyg-span` / `-link` / `-linebreak`.
156
+ - One root per document, or every instance renders empty; `build_site.py` stops on a duplicate root.
157
+ - `@media(` in a `code` node is a function call and returns HTTP 500 after a clean commit; write `@media (`.
158
+ - `scrollDepth`'s action slot is `reached` since 1.0.10; the old slot name is stored and never runs.
159
+
160
+ ## Verify
161
+
162
+ A successful commit is not a working page, and a correct stylesheet is not a
163
+ correct render. Run the gate for the output; do not report success without it.
164
+ Every validator below exits 1 on any FAIL.
165
+
166
+ | Output | Validator | Pass when |
167
+ |---|---|---|
168
+ | a page spec, before commit | `python tools/mo.py check <types>`; `build_page.py` (refuses on its own) | `mo.py check` exit 0; build prints `master=… nodes=…` with no `refusing to build` |
169
+ | a built page / site | `build_site.py` output | every page `OK <bytes>` (a 5xx reads as empty), no `STALE CACHE` line |
170
+ | styles and breakpoints | `verify_rwd.py --site spec.json` | exit 0: every `_t` / `_m` declaration in the served stylesheet |
171
+ | what the browser computes | `verify_browser.py --site spec.json --audit audit.csv` | exit 0: no OVERRIDDEN, no design-audit `error` |
172
+ | phone layout | `audit_mobile.py --base <url>/ --paths <slugs> --widths 390,768` | exit 0 |
173
+ | design tokens | `verify_tokens.py` | exit 0: every `:root` property declared once and used |
174
+ | modal / popover | `verify_dialog.py`, `verify_popovers.py`, `verify_dialog_lab.py` | exit 0 |
175
+ | menus, navigation | `verify_menus.py`, `verify_navigation.py --site spec.json --base <url> --viewports 390,768,1280` | exit 0: every page 200, real `<a href>`, no sideways scroll |
176
+ | interactions, intro, loop | `verify_recipes.py`, `verify_intro.py`, `verify_loop.py` | exit 0 (the intro must END and hand the page back) |
177
+ | slider, tabs, accordion, forms, map | `verify_slider.py`, `verify_components.py` | exit 0 |
178
+ | Elementor conversion | `verify_conversion.py` | exit 0: every string, image, link and heading level found |
179
+ | theme move | `wp eval-file tools/theme_zip_compare.php <src> <copy> out.csv` | no FAIL row |
180
+ | this skill | `python tools/test_mosaic.py` | all pass (offline) |
181
+
182
+ Read the page **logged out** (an admin sees a test-mode theme and 406
183
+ explanations a visitor never gets), and purge every cache layer before
184
+ believing a fetch. If a verifier fails on a page that looks right, read
185
+ [failure-modes.md](references/failure-modes.md) before trusting either side.
186
+
187
+ ## Maintenance
188
+
189
+ For maintainers. Full commands: [maintenance.md](references/maintenance.md).
190
+
191
+ - **After a plugin upgrade**: run the data upgrade (`data_upgrade.py`), re-extract
192
+ (`extract_*.py`), `check_tables.py <plugin-root>` (exit 0), re-capture live tables,
193
+ re-sweep on a scratch site, re-run every verifier on the demo pages, then
194
+ `python tools/check_numbers.py --fix`, `python tools/test_mosaic.py`, and the
195
+ evals (`evals/grade.py`, results in `evals/RESULTS.md`).
196
+ - **Release gate**: `node scripts/check-release.mjs` (versions agree, shipped files
197
+ exist, verification tables match the counts in [data-files.md](references/data-files.md)).
198
+ - **Installed copy**: em925's deploy tool imports `build_page` / `build_site` from
199
+ the global install. Never change their interface, and never refresh the global
200
+ install without asking the user and em925 first.
201
+ - **The shared demo site** is used by other work too: purge and warm the cache
202
+ after every write; never `wp plugin update --all`.
203
+ - **Pending gaps** live in `data/pending.csv`; close a row only with a measured or
204
+ documented source.