mosaic-headless 1.36.2 → 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 (39) hide show
  1. package/SKILL.md +179 -1119
  2. package/assets/templates/platforms/claude-ai.json +6 -3
  3. package/assets/templates/platforms/claude-code.json +10 -4
  4. package/assets/templates/platforms/codex-cli.json +6 -3
  5. package/assets/templates/platforms/continue.json +1 -1
  6. package/assets/templates/platforms/copilot.json +6 -3
  7. package/assets/templates/platforms/cursor.json +1 -1
  8. package/assets/templates/platforms/gemini-cli.json +6 -3
  9. package/data/pending.csv +8 -0
  10. package/data/terms-zh.csv +97 -0
  11. package/evals/RESULTS.md +41 -0
  12. package/evals/cases.json +329 -0
  13. package/evals/grade.py +121 -0
  14. package/evals/runs/2026-11-16-final-with-skill.json +29 -0
  15. package/evals/runs/2026-11-16-final-without-skill.json +30 -0
  16. package/evals/runs/2026-11-16-r1-with-skill.json +19 -0
  17. package/evals/runs/2026-11-16-r1-without-skill.json +19 -0
  18. package/evals/runs/2026-11-16-r2-with-skill.json +9 -0
  19. package/evals/runs/2026-11-16-r2-without-skill.json +9 -0
  20. package/evals/runs/2026-11-16-r3-without-skill.json +1 -0
  21. package/package.json +1 -1
  22. package/references/building.md +93 -0
  23. package/references/core-rules.md +143 -0
  24. package/references/data-files.md +102 -0
  25. package/references/design-system.md +1 -1
  26. package/references/facts.md +261 -0
  27. package/references/failure-modes.md +1 -1
  28. package/references/maintenance.md +70 -0
  29. package/references/tools.md +84 -0
  30. package/references/tutorials.md +1 -1
  31. package/references/upgrading.md +2 -2
  32. package/references/verification-record.md +395 -0
  33. package/scripts/check-release.mjs +15 -7
  34. package/scripts/install.mjs +35 -14
  35. package/scripts/sync-version.mjs +5 -3
  36. package/tools/check_numbers.py +196 -0
  37. package/tools/mo.py +132 -7
  38. package/tools/test_mosaic.py +373 -0
  39. package/tools/verify_menus.py +1 -1
@@ -0,0 +1,102 @@
1
+ # Reading order and the data files
2
+
3
+ Moved out of SKILL.md on 2026-11-16 (skill SOP pass). `scripts/check-release.mjs` checks the row counts in the table below against the CSVs.
4
+
5
+ ## Orient yourself in this order
6
+
7
+ 1. `references/data-model.md` — where a page actually lives. Read this first even if
8
+ you know Elementor; the answer is not `postmeta` and not `post_content`.
9
+ 2. `references/write-protocol.md` — the checkout/check/commit sequence and envelopes.
10
+ 3. `references/failure-modes.md` — how Mosaic fails, measured. Read before writing.
11
+ 4. `references/placement.md` — what may go inside what, and what that table cannot
12
+ tell you.
13
+ 5. `references/styling.md` — how a style value becomes CSS, and the shapes that are
14
+ silently inert if you write a string.
15
+ 6. `references/responsive.md` - the state/breakpoint/property axis, the two
16
+ breakpoint rows, and the override that can change a property but never remove
17
+ one. **Read before writing any `_t` or `_m` value.**
18
+ 7. `references/design-system.md` — variants (element classes) and design tokens. **Read this
19
+ before styling anything beyond a one-off page**; per-node style is the wrong layer
20
+ for a real site.
21
+ 8. `references/dynamic-content.md` — the `@VAR()` language. The syntax is not
22
+ guessable, and a wrong guess renders as literal text rather than an error.
23
+ 9. `references/templates-and-conditions.md` — how Mosaic picks a template, and the
24
+ condition grammar shared by templates, elements, interactions and form actions.
25
+ 10. `references/interactions.md` — the JavaScript animation system in the shape the
26
+ editor stores, values included, and the measured tutorial recipes.
27
+ `references/tutorials.md` — all 24 official tutorials mapped to headless builds:
28
+ which are measured, which are built from measured parts, which are still open.
29
+ 11. `references/vs-elementor-gutenberg.md` — which builder habits transfer.
30
+ 12. `references/slider.md` — the slider nested as its factories require, and the
31
+ two things about it the markup does not announce.
32
+ 13. `references/custom-fields.md` — ACF and Meta Box fields as `@VAR` / `@LOOP`:
33
+ the names, what each field type resolves to, and the loop element that walks
34
+ a multi-value field. Measured, 62 rows.
35
+ 14. `references/dialog-and-triggers.md` — the modal (and what 1.0.10's Popover API
36
+ move changed), the 1.0.10 popover, OpenStreetMap, the exit-intent / scroll-depth
37
+ triggers, run rules, memory and the shorthand.
38
+ 15. `references/upgrading.md` — what a plugin update does to the data and to the
39
+ delivered page, measured on 1.0.7 -> 1.0.8; how to drive the migration and what
40
+ to re-verify afterwards.
41
+ 16. `references/server-thumbnails.md` — Mosaic's headless-Chrome thumbnails on a host
42
+ without root: where Mosaic looks for the binary, a no-root install, and the two
43
+ things (PHP-FPM's disabled functions, a setting decided once) that make a working
44
+ install look broken.
45
+
46
+ ## The data files
47
+
48
+ | file | rows | source |
49
+ |---|---|---|
50
+ | `data/node-verification.csv` | 134 | **swept live** — outcome, rendered tag and classes, page bytes, failure detail |
51
+ | `data/node-types.csv` | 134 | source — slug, label, edition, aliases, data class |
52
+ | `data/node-properties.csv` | 201 | source — property, validator chain, **accepted enum values**, `supportsInherit` |
53
+ | `data/placement-rules.csv` | 134 | source — which children each type accepts |
54
+ | `data/default-children.csv` | 27 | source — what a composite type needs **inside** it |
55
+ | `data/style-properties.csv` | 101 | source — every settable CSS property and its value shape |
56
+ | `data/style-value-shapes.csv` | 25 | **probed live** — the exact JSON shape for each structured value, and what it compiled to |
57
+ | `data/style-states.csv` | 60 | source — state IDs with their exact CSS selector templates |
58
+ | `data/property-verification.csv` | 170 | **probed live** — per-property effect on markup vs CSS, with unprovable enums marked INCONCLUSIVE |
59
+ | `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 |
60
+ | `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 |
61
+ | `data/rwd-verification.csv` | 733 | **checked live** - every `_t`/`_m` declaration vs the served stylesheet, with status per row |
62
+ | `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 |
63
+ | `data/design-audit-acknowledged.csv` | 4 | 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 |
64
+ | `data/design-audit.csv` | 26 | **computed in Chromium** - contrast, font fallback, CJK tracking, overflow, measure. Empty means it ran and found nothing |
65
+ | `data/data-class-hierarchy.csv` | 131 | source - every data class and its parent, so a type's inherited properties can be resolved |
66
+ | `data/style-state-verification.csv` | 59 | **swept live** - each state written on a host of its own type and matched against its promised selector |
67
+ | `data/component-verification.csv` | 8 | **driven live** - the component lifecycle, each step asserted against the row or the delivered HTML |
68
+ | `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 |
69
+ | `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 |
70
+ | `data/conversion-verification.csv` | 9 | **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 |
71
+ | `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 |
72
+ | `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 |
73
+ | `data/slider-verification.csv` | 30 | **driven live** - two sliders, one autoplaying and one a carousel: advance, arrows, bullets, keyboard, reduced motion |
74
+ | `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 |
75
+ | `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 |
76
+ | `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 |
77
+ | `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 |
78
+ | `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 |
79
+ | `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 |
80
+ | `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 |
81
+ | `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 |
82
+ | `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 |
83
+ | `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 |
84
+ | `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 |
85
+ | `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 |
86
+ | `data/interaction-rules-verification.csv` | 17 | **driven live** - interaction run rules (`pickOne`, remember scopes) over repeated fresh loads; see references/interactions.md |
87
+ | `data/value-coercion-verification.csv` | 12 | **probed live** - what each validator does to a value of the wrong shape (`"12abc"` -> 12 since 1.0.9); see references/write-protocol.md |
88
+ | `data/node-type-notes.csv` | 10 | where a sweep outcome is true but misleading on its own, why. Surfaced by `mo.py type` |
89
+ | `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 |
90
+ | `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 |
91
+ | `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 |
92
+ | `data/intro-verification.csv` | 8 + 15 | **sampled live** - the entrance sequence over fifteen timestamps on a monotonic clock, plus the eight assertions about it |
93
+ | `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 |
94
+ | `data/dynamic-variables.csv` | 75 | source — every `@VAR('ns/name')` expression, by namespace |
95
+ | `data/evaluator-functions.csv` | 19 | source — the `@` functions with their arity |
96
+ | `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) |
97
+ | `data/animatable-properties.csv` | 22 | source — what a keyframe can drive (**not** the same set as the style properties) |
98
+ | `data/condition-subjects.csv` | 59 | **live** — condition subjects per context |
99
+ | `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 |
100
+ | `data/pluggables.csv` | 285 | source — every `setID()` by registry |
101
+ | `data/rest-routes.csv` | 115 | **live** — method, path, args |
102
+ | `data/db-columns.csv` | 210 | **live** — every column of all 23 tables |
@@ -95,7 +95,7 @@ adds the root's names and data first, then each level). A sub class's emitted na
95
95
  joins every level with `--` (`card--wide--dark`), so only a root class renders under
96
96
  exactly the name you gave it.
97
97
  The emitted class is the `name` (sanitized, any `m-` prefix dropped - the
98
- class-name grammar is in SKILL.md), and its CSS is printed only
98
+ class-name grammar is in references/facts.md), and its CSS is printed only
99
99
  on a page where some node uses it. `status: "delete"` removes one - unlike a variant,
100
100
  a universal class is not catalog-backed.
101
101
 
@@ -0,0 +1,261 @@
1
+ # Facts worth knowing before you look anything up
2
+
3
+ Platform and rendered-tag facts, each measured. Moved out of SKILL.md on 2026-11-16 (skill SOP pass); `mo.py` answers lookups, this file answers "why did that happen".
4
+
5
+ ## Facts worth knowing before you look anything up
6
+
7
+ - **The REST namespace contains the plugin version** (`/wp-json/mosaic/v1.0.11`). Read
8
+ it from `mosaicOptions.rest_api_url`, never hardcode. After a plugin update the
9
+ editor namespace is GONE until the data upgrade has run; only
10
+ `mosaic/<dataVersion>/<version>/upgrade` answers. `tools/data_upgrade.py`.
11
+ - **`ordering` is a fractional-index string**, not a number.
12
+ - **The tree is a `parentID` column**, not nesting. There is no page-level JSON blob.
13
+ - **Everything is scoped to a `themeID`**, breakpoints included.
14
+ - **A post is a target, not a container.** Templates bind to posts through
15
+ `mosaic_template_assigns`; one template serves many posts.
16
+ - **Only `wp_mosaic_locks` existing** means a half-installed Mosaic. The other 22
17
+ tables appear when an admin loads `/wp-admin/admin.php?page=mosaic`.
18
+ - **Commit has side effects.** `heal()` runs inside it and creates breakpoints,
19
+ collections and child nodes you never sent. Take every revision in the response.
20
+ - **One root per document, or the document renders empty.** A second, empty
21
+ `component-internal` (or master/template root) ordered first makes Mosaic render
22
+ from it: every instance of that component prints nothing, and within a day the
23
+ overrides that point into the real tree were gone with no master commit in
24
+ between (90 on a live 1.0.11 site; restoring them alone changed nothing until the
25
+ empty roots were deleted). Heal syncs an instance's overrides by walking the
26
+ component from that first root (`keepOverrideNodesInSync`), and heal runs on
27
+ front-end renders too. Health check, which must return no rows (group by `themeID` too: the
28
+ same component ID in two themes is not a duplicate):
29
+ `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`.
30
+ A node's `revision` is a time-based UUID (v1), so it dates when that root was
31
+ written. Match that time against the access log. `build_site.py` stops and the
32
+ fix tools skip a document with more than one root; `scan_inline_tags.py` warns.
33
+ Reading every document over REST does not create roots (135 before and after a
34
+ full scan on the demo site). Both creations traced so far came from the
35
+ database failing under load: a MySQL restart on one site, a crawler driving a
36
+ burst of fast HTTP 500s on another. Each time a front-end render's heal read the
37
+ failed query as "no root" and wrote a new empty one, with no REST write in the
38
+ log. A site that sees this needs the load handled (bot rate limits, MySQL
39
+ capacity) as much as the roots repaired.
40
+ - **`modified_gmt` is server-assigned.**
41
+ - **Styling hangs on the generated `._<token>` class, not your `attrID`**, and the
42
+ token (`_a`, `_b`, ... `_ba`: a base-38 per-document counter) is not stable. The
43
+ sibling `m-<type>` class is (`m-div`, `m-text m-wysiwyg`, `m-menu-link`), and a
44
+ variant that renders its name adds it (`m-heading-2`). Before 1.0.8 the same
45
+ three were `M_EL4`, `M_EL_Div` and `M_EL_Text__Heading2`; state classes moved
46
+ with them (`m-accordion-item--opened`, `m-menu-link--current`, `m-tab--active`).
47
+ Any CSS you write against an emitted class is coupled to the plugin version.
48
+ - **`body{opacity:0}`** — the theme reveals itself from JavaScript. Screenshot tooling
49
+ must let scripts run or it captures a blank page. The reveal waits for
50
+ `DOMContentLoaded`, i.e. for every `defer` script, so deferring scripts blanks the
51
+ page longer; `html body{opacity:1!important}` is safe and was worth 72 → 86 mobile
52
+ (`references/styling.md`).
53
+ - **Two themes can carry the same name, and only the ACTIVE one is bound to
54
+ anything.** Every write to `theme/<themeID>/...` succeeds against an inactive
55
+ theme - master, nodes, components, tokens, all of it - and then
56
+ `createManualTemplate` answers `Master not found`, because it resolves the theme
57
+ from the request, not from your URL. Read the active theme's id off
58
+ `wp theme list --status=active` (`mosaic-1-1-<themeID>`) before building.
59
+ - **Page caches stack.** The demo host ran Varnish AND Breeze; purging Varnish
60
+ changed nothing because Breeze still had the old document. `build_site.py`
61
+ fetches the plain URL and a cache-busted one at the same moment and reports
62
+ STALE CACHE when they differ by more than a percent - believe it, then find
63
+ every layer. `wp breeze purge --cache=all` was the one that mattered.
64
+ - **A `code` node is a wrapper, not a splice.** `insertLocation:"inPlace"` puts your
65
+ markup INSIDE `<div class="m-code _x">`, one level down - so a sibling combinator
66
+ from injected HTML to a Mosaic node never matches, and a control you inject has
67
+ to be styled through its own ancestors or through `:has()`. The native accordion
68
+ avoided the question entirely.
69
+ - **`section` arrives with 80px of top and bottom padding.** Measured on a node
70
+ whose spec set neither; between a masthead and the block below it that is a
71
+ 160px hole. Set `paddingTop`/`paddingBottom` explicitly when a section's rhythm
72
+ is meant to come from its contents.
73
+ - **A `code` node's content is a template, and `@media(` is a function call.**
74
+ Mosaic parses `code` content for `@VAR(...)`; a CSS at-rule glued to its
75
+ parenthesis - the form every minifier emits - is parsed as a call with
76
+ unparseable arguments and the page renders as HTTP 500, after a clean commit.
77
+ Write `@media (`. Text nodes are not parsed and are safe; measured both.
78
+ - **The front page 301s.** When a post is `page_on_front`, its own permalink
79
+ (`/moksa/`) redirects to `/`; a fetch that does not follow redirects reads 0
80
+ bytes and looks like an outage.
81
+ - **Every `build_site.py` run leaves a master behind, and they add up.** After a
82
+ season of probing the test theme held 223 masters and 98,261 nodes with 25
83
+ masters actually bound; Mosaic's ZIP import then spent 230s on masters and died
84
+ in templates when nginx closed the upstream at five minutes. Pruned to the bound
85
+ set (masters not reached from a bound template, their templates, their nodes)
86
+ the same import took under two minutes and compared 22 of 22. Prune before you
87
+ export - `wp eval-file tools/prune_unbound.php <themeID>` counts, `--apply` deletes; `wp_mosaic_template_assigns.parentID` -> template -> `masterID` is the
88
+ bound set, plus any `assign="auto"` template. Then sweep ORPHANS: a probe run
89
+ that half-failed, or a prune that removed a parent, leaves nodes whose parent id
90
+ points at nothing. The export skips them, so the copy is short by exactly those
91
+ rows and `theme_zip_compare.php` reports a tree that does not match - delete
92
+ nodes with a missing parent REPEATEDLY until none are left, because each pass
93
+ orphans the next level down.
94
+ - **`width` / `height` and their min/max take the keyword `stretch` since 1.0.9**,
95
+ and Mosaic emits `-webkit-fill-available` before it so an older engine still gets
96
+ something. They are still token-referencable - `CSSSizePropertyFactory` extends
97
+ the collection-variable one, which is why `data/style-properties.csv` resolves a
98
+ factory's ancestry rather than testing its name. 39 properties take a token, not
99
+ the 34 counted before that fix.
100
+ - **A width copied out of Elementor needs `maxWidth: "100%"` beside it.**
101
+ Elementor caps every widget with `max-width:100%`, so a px width there is a
102
+ desktop intent its own CSS already constrains; carried across bare it keeps the
103
+ full 600px and the page scrolls sideways on a phone. `verify_rwd` cannot see it
104
+ - the declaration did reach the stylesheet - and nineteen converted pages were
105
+ green on every per-page check while all nineteen overflowed at 390px.
106
+ - **Only three interaction types can be an `interactionShorthand`**: `pageLoad`,
107
+ `exitIntent`, `scrollDepth` (`InteractionTypesManager::getShorthandInteractionTypes`).
108
+ Any other is dropped in silence - the modal renders with its aria and its
109
+ `closedby`, the page carries no interaction, and nothing ever opens it. The
110
+ three that remain are exactly the ones that do not need the element to be
111
+ visible first, which a modal never is.
112
+ - **A `slider-navigation-bullet` is a template, not a list item.** One authored
113
+ bullet is repeated once per slide, every copy carrying the SAME id - writing
114
+ three gets three templates and a document full of duplicate ids. The
115
+ `aria-label` is Mosaic's, taken from each slide's own `title`. An arrow hides
116
+ itself at the end it cannot pass unless the slider is a carousel, so a test
117
+ that clicks `next` after autoplay has parked the slider finds nothing there.
118
+ - **An interaction that targets another element stores that element's NODE id**,
119
+ not its attrID, so both have to be written in one pass (`nodeID` on a spec node
120
+ pins it). The pin means "these two halves must agree", never "this uuid must be
121
+ the one in the database" - `wp_mosaic_nodes`' key is `(ID, themeID)`, so a fixed
122
+ id makes the spec single-use and the SECOND build dies on a duplicate key with
123
+ the page half written. `build_page.refresh_node_ids()` now rewrites every pin and
124
+ every reference to it at build time, so a spec with pins rebuilds as many times
125
+ as you like.
126
+ - **Since 1.0.9 the three per-breakpoint stylesheets are one.**
127
+ `mosaic-theme-document-styles-inline-css` carries the base rules and the
128
+ `@media` blocks together; the old `mosaic-theme-block-editor-styles_<bp>-inline-css`
129
+ ids are gone. And an element whose styles compile to nothing is emitted with
130
+ no generated class at all, so "no `_token`" no longer means "did not render".
131
+ - **Since 1.0.10 the modal is a Popover-API host in the top layer.** `<dialog
132
+ popover="manual">`; `dialog.open` is always false (read `:popover-open` or
133
+ `data-mosaic-dialog-state`), the controller has `requestClose()` and no `close()`,
134
+ and the closed state is `display:none !important` - so `display` on a modal host,
135
+ a pin-it-open bug on 1.0.9, is safe now. z-index cannot put anything above it.
136
+ - **`popover` is the non-blocking dialog (1.0.10)**: no overlay, no children
137
+ required, `closedby` defaults to `nothing`, `positioning` is `screen` (nine cells)
138
+ or `element` (side / align / keepInView / anchor - no anchor = its trigger).
139
+ Actions `popoverOpen` / `popoverClose` / `popoverToggle`; trigger `popover` with
140
+ slots `show` / `beforeClose` / `afterClose`; style state `___popover--flipped`.
141
+ **A dialog opened from inside another dialog is its child and closes with it, and
142
+ closing a popover suspends the interactions inside it** - so a sequence advances
143
+ on the step's own `afterClose`, never on a button that opens the next step.
144
+ references/dialog-and-triggers.md
145
+ - **`scrollDepth`'s action slot is `reached` since 1.0.10** (plus `returned`). An
146
+ action stored under the old slot name `scrollDepth` is kept and never runs.
147
+ - **A local-context loop's `loopSource` is `@VAR('post/<loop>')`, never `@LOOP()`.**
148
+ Both render on the front end; `@LOOP` there throws in the editor
149
+ (`_loopEvaluatorFunction is not a function`) and the canvas never finishes.
150
+ `build_page.py` refuses it. `@LOOP(…)` inside text is fine.
151
+ - **A custom field is `@VAR('post/meta_<key>')`, and a multi-value one is a LOOP.**
152
+ ACF and Meta Box both, plus bare post meta. Derived properties hang off the
153
+ name with two underscores (`meta_k__label`, `__url`, `__id`); an ACF group is
154
+ `loop-k` (hyphen) with `item/value_<sub>` rows; ACF puts the ID in a
155
+ reference's primary slot where Meta Box puts the title. Run
156
+ `tools/list_fields.php` on the post rather than guessing - a name it does not
157
+ print does not exist. references/custom-fields.md
158
+ - **A variant row cannot be deleted, only emptied.** `status:"delete"` on a
159
+ variant is accepted and ignored - the row is catalog-backed. Commit it back with
160
+ `{"states": {"&": {"_": {}}}}` and the rule disappears; measured on Heading 2.
161
+ - **User class names have a grammar.** Variant sub classes and universal classes
162
+ emit `[a-z0-9_-]` segments joined by `--` (`m-button--primary--sm`), each segment
163
+ at most 60 characters, never starting with `_`, a digit or the reserved `m-`;
164
+ names that do not sanitize fall back to `class`, and collisions get `-2`, `-3`.
165
+ The emitted name is UNIQUE per theme (an `emittedName` column with a unique
166
+ index on four tables), so two classes cannot share a spelling.
167
+
168
+ ## Rendered-tag facts you would otherwise guess wrong
169
+
170
+ - **`button` renders three tags since 1.0.8, by two properties.** With a `url` it is
171
+ `<a href>`; without one it is `<button type="button">` (1.0.7 emitted `<span>`);
172
+ with `inactive:"1"` - the new integer-as-string property, the Badge variant's
173
+ default - it is a `<span>`, a label rather than a control. Measured all three.
174
+ `menu-link` and `wysiwyg-link` still render `<span>` without a `url`.
175
+ - **A button's words go in a `text` node, not straight under it.** The editor builds
176
+ `button > text (Inherited text variant, 6381b2f3…) > wysiwyg-text`, and the same
177
+ for menu-link, dropdown-toggle, tabs and submit labels. A `wysiwyg-text` placed
178
+ directly under a button renders identically but cannot be edited in the editor:
179
+ the navigator shows no child, and a double-click opens only the link settings.
180
+ Only `text`, `label`, `choice-label`, `choice-legend`, `fieldset-legend` and the
181
+ inline `wysiwyg-span` / `wysiwyg-link` hold runs directly. `build_page.py` wraps
182
+ runs under any other type itself (`wrap_text_runs`), so the `"text"` shorthand is
183
+ safe on a button, and a component's `text` override on a button follows the run
184
+ down into that wrapper (`build_site.py`). Output: `<a class="m-button"><div class="m-inherited-text
185
+ m-wysiwyg">…</div></a>` - the editor's own button carries the same `<div>`.
186
+ A site built before v1.34.1 is fixed in place by `tools/fix_text_runs.py`
187
+ (dry run, then `--apply`): measured on the test theme, 428 runs wrapped
188
+ across its masters and templates, every page unchanged in text, a component instance's
189
+ override still shown, and a second run finding nothing.
190
+ - **`text` renders as `<div>` by default** — set `tagName` for `<h1>`, `<p>` and so on.
191
+ - **A `wysiwyg-text` run prints no markup since 1.0.11.** Its `<` and `>` are escaped
192
+ on output, so `A<strong>B</strong>C<br>D` reaches the page as those literal
193
+ characters (measured: `A&lt;strong&gt;B&lt;/strong&gt;C&lt;br&gt;D`). Inline
194
+ formatting is a node: `wysiwyg-span` → `<span class="m-span">` (style it),
195
+ `wysiwyg-linebreak` → `<br>`, `wysiwyg-link` with `url` →
196
+ `<a class="m-inline-link">`, each holding its own `wysiwyg-text` child. Entities
197
+ still print as their character (`&lt;dialog&gt;` → `<dialog>`, `&amp;` → `&`).
198
+ Bold and italic are NOT nodes but a property of the run: `wysiwyg-text` (and
199
+ `wysiwyg-variable`) take `format: ["bold"]`, `["italic"]` or both, printed as
200
+ `<strong>` / `<em>`. Both at once comes out misnested on 1.0.11 -
201
+ `<strong><em> BI</strong></em>` (measured); browsers repair it, validators do not.
202
+ `inline_html.py` maps `<strong>`/`<em>` to styled `wysiwyg-span`s instead.
203
+ Through 1.0.10 the run was raw HTML instead, where a tag name in prose swallowed
204
+ the rest of the paragraph; `build_page.py` refuses any tag in a run either way.
205
+ **So a site built on 1.0.10 or earlier can start showing tags overnight**: the
206
+ plugin updates itself, the data does not change, and every `<p>`, `<br>` or
207
+ `<span>` written into a run now prints. Run `tools/scan_inline_tags.py` (read only)
208
+ before or after the update, on any site not built by `build_page.py` (another
209
+ converter, hand edits, an older helper). On the test theme it listed 179 runs on
210
+ the Elementor-converted `el-*` pages, and each listed page printed `&lt;p&gt;` while
211
+ the rest printed none. `tools/fix_inline_tags.py` then rewrites them in place
212
+ (dry run, then `--apply`): 179 fixed, 0 skipped, a second run found nothing, no
213
+ page printed a tag afterwards, and every page's visible text was identical.
214
+ One layout change to expect: a run that was `<p>…</p>` used to put a real `<p>`
215
+ inside the text node, and that `<p>` picked up the WordPress theme's own `p` rule
216
+ (here `margin:24px 0 0; font-size:16px; line-height:24px`), overriding the node's
217
+ own font size and line height. After the fix the node's own style applies, so
218
+ each such block lost 8-49px of height. Giving the node `tagName: p` does not
219
+ bring it back: Mosaic zeroes the margin on its own `p.m-text`.
220
+ - **`menu-link` is `width: fit-content` by default** (`.m-menu-link{display:flex;gap:4px;
221
+ padding:4px 8px;width:fit-content;…}`). Used as a cell of a button row or a grid -
222
+ a phone contact bar on `2fr 1fr 1fr` - its background hugs the text and the cell
223
+ stays empty around it, whatever `display` or `justify-content` you give it. Set
224
+ `width: 100%` on it (reported from a client build; the rule read from 1.0.10's
225
+ `style.css`). The same rule's `align-items:center` matters when a `menu-link`
226
+ wraps a whole card: set `alignItems: stretch` and `textAlign: left` on it.
227
+ - **`customDeclarations` is all or nothing, and its unit list is short.** The
228
+ validator parses every declaration and drops the WHOLE block if one value fails.
229
+ `!important` fails, and so does any unit outside `ValidatorCustomDeclarations`'s
230
+ list - `dvh`, `svh`, `lvh`, `dvw`, container units: `height: 100dvh` takes every
231
+ other line in the block with it, silently. The structured `height` / `maxHeight`
232
+ fields do accept `dvh`.
233
+ - **`youtube` renders `<mosaic-youtube>` carrying `data-video-id`, `data-params`,
234
+ `data-host`**, with the server's iframe inside `<noscript>`; the custom element
235
+ builds the real iframe once it has a size. The iframe has no `title`, so an
236
+ accessible name has to be added some other way. `youtubeUrl` is
237
+ `{"v": "https://www.youtube.com/watch?v=…"}`; `lazyLoad` defers it and there is
238
+ no click-to-load facade (same for `vimeo`). Sized by `width`/`height: 100%` inside
239
+ an `aspect-ratio: 16/9` box. `privacy:"1"` switches the host to
240
+ `www.youtube-nocookie.com` - measured on 1.0.11; the old NO_OUTPUT row was a probe
241
+ artefact. `suggestedVideos` maps to `rel`. `vimeo`'s `privacy` is `dnt=1`.
242
+ - **Eight types emit custom elements**: `<mosaic-dropdown>`, `<mosaic-navbar>`,
243
+ `<mosaic-tabs>`, `<mosaic-accordion>`, `<mosaic-vimeo>`, `<mosaic-youtube>` and
244
+ friends. A selector written against `div`/`nav` misses all of them.
245
+ - **`icon` renders inline `<svg>`.**
246
+ - **Only four types take a `url`**: `button`, `menu-link`, `wysiwyg-link`,
247
+ `dropdown-toggle`. Put one on a `text` or an `image` and it is accepted, stored,
248
+ and emits no anchor whatsoever. To make anything else clickable, WRAP it in a
249
+ `button` whose `style.variant` is the Link variant (`f671bc01-…`, `m-link`) - that
250
+ is what the editor's "Wrap in link" writes, `button` takes children, and with a
251
+ `url` it renders `<a class="m-link" href>` around them (measured on 1.0.11). A
252
+ `menu-link` wrapper works the same way (`target="_blank"` included; probed) but
253
+ carries menu styling. A `button` with `inactive` on keeps its `url`/`target`/`rel`
254
+ stored and emits none of them.
255
+ - **An image's attachment-protocol path is relative to the UPLOADS directory.**
256
+ `wp-attachment://image/<id>/<size>/2026/09/pic.png` resolves, and carries the
257
+ attachment's `width`/`height` onto the tag. Give it the full
258
+ `wp-content/uploads/2026/09/pic.png` - the obvious guess - and Mosaic prefixes
259
+ the uploads base a second time, serving a broken `src` with no error and no
260
+ dimensions. A plain `https://` URL also works, and is the right fallback for an
261
+ image that is not an attachment on this site.
@@ -240,7 +240,7 @@ silently in favour of whichever happens to be last.
240
240
 
241
241
  ## A declaration can be present, correct, and still wrong
242
242
 
243
- The fourth failure mode in SKILL.md - "wrong value SHAPE, HTTP 200, and the CSS rule
243
+ The fourth failure mode in references/core-rules.md - "wrong value SHAPE, HTTP 200, and the CSS rule
244
244
  is simply absent" - has a quieter sibling: the rule is *present*, the value is what
245
245
  you asked for, and what the browser does with it is not what you meant.
246
246
 
@@ -0,0 +1,70 @@
1
+ # Maintenance: regenerating everything
2
+
3
+ Moved out of SKILL.md on 2026-11-16 (skill SOP pass).
4
+
5
+ ## Regenerating everything
6
+
7
+ ```bash
8
+ python tools/extract_node_types.py <plugin-root> data/
9
+ python tools/extract_pluggables.py <plugin-root> data/
10
+ python tools/extract_placement.py <plugin-root> data/
11
+ python tools/extract_default_children.py <plugin-root> data/ # now also records heal-inserted children
12
+ python tools/extract_style_properties.py <plugin-root> data/
13
+ python tools/extract_interactions.py <plugin-root> data/
14
+ python tools/extract_dynamic_variables.py <plugin-root> data/
15
+
16
+ # and then, always: a table extracted BEFORE its extractor was repaired keeps
17
+ # describing the old source and ships silently. Row counts cannot see it and the
18
+ # release gate never sees the plugin. Run this after ANY change to an extractor,
19
+ # not only after a plugin upgrade.
20
+ python tools/check_tables.py <plugin-root>
21
+ python tools/capture_live.py data/ # from data/raw/*.json + db-columns.txt
22
+ # (raw dumps are gitignored;
23
+ # re-capture from a live site)
24
+
25
+ # against a scratch site - DESTRUCTIVE, never point at production
26
+ python tools/sweep_node_types.py --config sweep.json --setup
27
+ python tools/sweep_node_types.py --config sweep.json --sweep --edition all
28
+ python tools/sweep_properties.py --config sweep.json
29
+ # `sites/moksa.json` is GENERATED - the package ships the readable modules it
30
+ # comes from, not 2MB of built output. Regenerate it before anything reads it:
31
+ python sites/_moksa.py
32
+
33
+ python tools/verify_rwd.py --config sweep.json --site sites/moksa.json --csv data/rwd-verification.csv
34
+ python tools/verify_browser.py --config sweep.json --site sites/moksa.json \
35
+ --csv data/browser-verification/ --audit data/design-audit.csv
36
+ python tools/verify_intro.py --config sweep.json --site sites/moksa.json \
37
+ --csv data/intro-verification.csv --frames shots/intro/
38
+ python tools/sweep_style_properties.py --config sweep.json --page moksa --csv data/style-verification.csv
39
+ python tools/sweep_node_properties.py --config sweep.json --page moksa --csv data/node-property-verification.csv
40
+ python tools/sweep_style_states.py --config sweep.json --post 20 --slug probe-lab --csv data/style-state-verification.csv
41
+ python tools/sweep_interactions.py --config sweep.json --post 20 --slug probe-lab --csv data/interaction-verification.csv
42
+ python tools/verify_recipes.py --config sweep.json --post <ID of the probe-recipes page> --slug probe-recipes \
43
+ --csv data/tutorial-recipes-verification.csv # --post REBINDS that post's template: check the ID first
44
+ python tools/verify_menus.py --config sweep.json --post <ID of the menu-lab page> --slug menu-lab --csv data/menu-verification.csv
45
+ python tools/verify_loop.py --url https://site/ --window mk-loop --toggle mk-plate-title --panel mk-plate-item \
46
+ --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 \
47
+ --period 14000 --csv data/loop-verification.csv
48
+ python tools/probe_accordion.py --config sweep.json --post 20 --slug probe-lab --csv data/accordion-verification.csv
49
+ 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
50
+ python tools/verify_rwd.py --config c.json --site spec.json --csv rwd.csv
51
+ python tools/verify_browser.py --config c.json --site spec.json --csv browser.csv --audit audit.csv
52
+ 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
53
+ wp eval-file tools/theme_export.php active > theme.json
54
+ wp eval-file tools/theme_import.php theme.json "Copy" rebind activate
55
+ python tools/theme_zip.py export --config c.json --out theme.zip
56
+ python tools/theme_zip.py import --config c.json --zip theme.zip # test mode
57
+ python tools/theme_zip.py import --config c.json --zip theme.zip --activate # goes live
58
+ wp eval-file tools/theme_zip_compare.php <source> <copy> theme-zip-verification.csv
59
+ wp eval-file tools/theme_delete.php <copy>
60
+ python tools/probe.py --config lab.json --cases cases.json # ad-hoc measurement
61
+ python tools/check_placement_predicts.py
62
+ claude plugin eval . --runs 3 -j 3 --no-publish # the skill vs no skill, 5 cases; Bash is
63
+ # not granted (no sandbox on Windows), the
64
+ # agent reads data/ instead of running mo.py
65
+ ```
66
+
67
+ `bootstrap_probe_theme.php` exists because Mosaic's own new-theme flow calls
68
+ `account.mosaicbuilder.com` and needs a licence. `EditorInstanceWithNewTheme->heal()`
69
+ does not — which is what made a licence-free fixture, and therefore this whole
70
+ verification, possible.
@@ -0,0 +1,84 @@
1
+ # Tools and the session
2
+
3
+ Every tool in `tools/`, and where the REST session comes from. Moved out of SKILL.md on 2026-11-16 (skill SOP pass).
4
+
5
+ ## Tools
6
+
7
+ | tool | does |
8
+ |---|---|
9
+ | `mo.py` | query the measured surface - **the front door** |
10
+ | `benchmark_tokens.py` | reproduce the token figures: source vs tables vs query, six tasks |
11
+ | `build_page.py` | commit one page spec through the verified write path |
12
+ | `build_site.py` | a whole site: one master with the shell, one document per page |
13
+ | `verify_rwd.py` | does every `_t`/`_m` declaration reach the served stylesheet? |
14
+ | `verify_browser.py` | does the **browser** compute what the stylesheet promised - and does the result pass a design audit? |
15
+ | `verify_intro.py` | does the page-load animation play, and - the part that matters - does it END and hand the page back? |
16
+ | `verify_menus.py` | build and drive every site-menu option: does hover hold, do the keyboard and a touch tablet work, does the phone drawer trap focus, close on Esc and stay above a sticky header? |
17
+ | `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? |
18
+ | `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 |
19
+ | `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) |
20
+ | `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 |
21
+ | `verify_conversion.py` | did the conversion carry the page? every source string, image, link and heading level looked for on the delivered Mosaic page |
22
+ | `sweep_node_types.py` | commit every node type one per document and assert the delivered HTML |
23
+ | `sweep_style_properties.py` | write every style property and check the compiled CSS |
24
+ | `sweep_node_properties.py` | probe every node property with a value from its own validator chain |
25
+ | `sweep_style_states.py` | write every style state and check the selector it compiled to |
26
+ | `sweep_components.py` | build a component, instance it twice, and prove one definition served both |
27
+ | `sweep_interactions.py` | which interaction animation shapes survive to the frontend payload |
28
+ | `interactions.py` | a library, not a command: `tween`, `on`, `mode_switch`, `set_cookie`, `cookie_is`, `hide_at_end`, `suspend` / `resume`, `class_target` - every interaction shape in the form the editor stores |
29
+ | `verify_recipes.py` | builds Mosaic's four docs tutorials on one page and drives each in Chromium |
30
+ | `theme_export.php` / `theme_import.php` | move a whole theme across installs, ids intact |
31
+ | `theme_zip.py` | drive Mosaic's OWN export/import - the ZIP the editor makes, attachments included, over the milestone protocol; import lands in test mode unless told `--activate` |
32
+ | `theme_zip_compare.php` | hold an imported copy against its source, tree for tree - every scoped table, the (parentType, type) shape, which ids survive, and orphans named rather than counted |
33
+ | `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 |
34
+ | `theme_delete.php` | remove a theme completely through the plugin's own routine; refuses the live one |
35
+ | `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 |
36
+ | `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 |
37
+ | `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 |
38
+ | `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 |
39
+ | `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 |
40
+ | `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 |
41
+ | `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 |
42
+ | `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 |
43
+ | `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 |
44
+ | `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 |
45
+ | `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` |
46
+ | `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`) |
47
+ | `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 |
48
+ | `copy_styles.py` | push one node's style onto others, by attrID or prefix |
49
+ | `bootstrap_probe_theme.php` | a licence-free scratch theme |
50
+ | `mint_session.php` | a matching cookie + `wp_rest` nonce from WP-CLI |
51
+ | `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 |
52
+ | `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 |
53
+
54
+ ## The session, and where it comes from
55
+
56
+ Every tool that writes needs a site URL, a logged-in cookie and a matching
57
+ `wp_rest` nonce. **Never go looking for them on the user's machine** - not in a
58
+ browser profile, not in `wp-config.php`, not in a dotfile. Ask, or have the user
59
+ mint them:
60
+
61
+ ```bash
62
+ wp eval-file tools/mint_session.php # on the server, prints COOKIE= and NONCE=
63
+ ```
64
+
65
+ Then either export them, which keeps the credential off disk entirely:
66
+
67
+ ```bash
68
+ export MOSAIC_SITE_URL=https://example.com
69
+ export MOSAIC_REST_COOKIE='wordpress_logged_in_…=…'
70
+ export MOSAIC_REST_NONCE=0a0326da96
71
+ python tools/build_site.py --site sites/moksa.json
72
+ ```
73
+
74
+ or pass a JSON file the user wrote:
75
+
76
+ ```bash
77
+ python tools/build_site.py --config sweep.json --site sites/moksa.json
78
+ ```
79
+
80
+ `tools/mosaic_config.py` is the single place that resolves this, and the
81
+ environment wins over the file. Installed as a plugin, the three values are
82
+ `userConfig` options - the cookie and the nonce `sensitive: true`, so Claude Code
83
+ masks them and stores them in the platform credential store rather than in
84
+ `settings.json`.
@@ -6,7 +6,7 @@ integrations - all of them listed in the site's `tutorial-sitemap.xml`; the inde
6
6
  pages load the list with JavaScript, so a plain fetch of them finds only four).
7
7
  **None of the 24 uses custom code.** Several say so outright ("without writing any
8
8
  JavaScript", "no code required"). That is the bar for this skill too - see "Native
9
- first" in SKILL.md.
9
+ first" in references/core-rules.md (and the Tasks table in SKILL.md).
10
10
 
11
11
  Status, per tutorial:
12
12
 
@@ -167,7 +167,7 @@ upgrade the migration had rewritten every row it owns, the page served with HTTP
167
167
  enlarge, because the class the selector named no longer exists. Nothing in the
168
168
  plugin reports that; `verify_loop.py` OPENS (186x161 → 1920x900) is what saw it.
169
169
  The selector now reads `m-accordion-item--opened`, and the lesson is in
170
- `SKILL.md`: any CSS that names an emitted class is coupled to the plugin version.
170
+ `references/facts.md`: any CSS that names an emitted class is coupled to the plugin version.
171
171
 
172
172
  ## What did not change
173
173
 
@@ -350,7 +350,7 @@ the background** (`MosaicUpgradeLayer/BackgroundUpgrade`); nothing had to be dri
350
350
  `wp plugin list` printed `1.0.11` once, straight after the update, before the
351
351
  header read back as 1.0.12 - check `Version:` in `mosaic.php`, not the first list.
352
352
  Backups: `wp db export ~/private_html/pre-1012.sql` and a copy of the old folder.
353
- No duplicate roots afterwards (the health SQL in SKILL.md: 0 groups, 155 roots).
353
+ No duplicate roots afterwards (the health SQL in references/facts.md: 0 groups, 155 roots).
354
354
 
355
355
  **What the migration rewrote: the Select split** (`Upgrade-1.0.12.php`, NEXT-4757,
356
356
  written for 1.0.8 and carried forward). The native `select-input` / `select-option`