Repository navigation
feat(translations): rewrite the WeMeditate Web schema by page, seed and publish English - #755
Conversation
Replaces the 16 placeholder keys drafted in #528 — none of which the site ever read — with the 140 UI strings WeMeditateWeb actually renders, laid out as 12 tabs in reading order rather than by data type. Every tab carrying screen-reader-only copy declares explicit `general` + `a11y` sub-groups, which #705 renders as collapsibles with `a11y` closed. `navigation` and `footer` stay flat. Every key carries a translator-facing description naming its placeholders; `%{count}` is reserved for the number that selects a plural form. The English seed is the copy extracted from the site's own source, one value per Appendix A row, shaped like the global's API response so it is the `updateGlobal` payload verbatim. One deviation from the ticket, deliberate: `media.duration_minutes` and `duration_seconds` take `maxLength` 18, not 10. The limit measures the RAW stored string, and English is already `%{count} min` — 12 characters. At 10 the ticket's own acceptance criteria contradict each other, since seeding Appendix A's English would be refused by the strict gate it also asks for. 18 keeps the gate blocking while leaving nine characters for the translated unit. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCdVPp5bCT3neC7hWcDbNZ
…sh it `seedFromSchema` invented values from key names, which is fine for a placeholder schema and useless for a real one. wm-web now reads `seeds/wm-web-translations/data.en.json` the way wm-app already reads its own file, `inlineData` entry included so a remote seed can upload it. It also PUBLISHES the English locale. `wm-web-config.availableLocales` refuses a locale whose translations are unpublished (#705), so without this step nobody could offer English at all. Publishing is per-locale, so every other locale stays a draft. `wm-app-translations` deliberately keeps the plain update: one `_status` covers all its locales there, so publishing would claim 19 translated languages the file does not contain. `sy-atlas-translations` keeps the generated example data until #706 replaces it — that PR deletes `generateExampleData` as its last caller. Types regenerated: 22 named `WmWebTranslations…Strings` interfaces, one per leaf group, with each key's description as JSDoc. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCdVPp5bCT3neC7hWcDbNZ
Two migrations, not one, and the split is mechanical rather than stylistic: a drop and an add of jsonb columns in the same diff reads to drizzle-kit as a rename, and its rename-vs-create prompt hangs forever on non-TTY stdin (src/migrations/AGENTS.md). Generated by reducing the schema to the two surviving tabs, generating the drops, restoring it, then generating the adds — so each file is pure, and neither run saw a prompt. `drop_wm_web_placeholder_tabs` drops `common`, `errors`, `page_tags` and their `version_` twins. `wm_web_translations_tabs` adds the 20 new `<tab>_<sub-group>` columns and their twins. `navigation` and `footer` keep their names, so nothing touches them. Every dropped column held only seed placeholders — no locale of this global carries live copy (#705 established that) — so the drops lose nothing. Both validated with the migration-validator skill: reversible, compiling, no unrelated DDL. The DROP COLUMN warning is the point of the first file. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCdVPp5bCT3neC7hWcDbNZ
…b tabs
`toWords('a11y')` renders "A11y" — a shorthand the translator is left to
decode, on ten of the twelve new tabs. A group may now carry a `title`,
which the tab and collapsible labels prefer over the slug. It is
presentational only: the field name, data path and column all still come
from the slug, so naming a group migrates nothing. The wm-web schema uses
it once, for "Accessibility".
Test changes track the rewrite: the twelve tabs in reading order, and the
leaf groups as `<tab>.<sub-group>` PAIRS rather than bare names — `general`
and `a11y` now repeat across ten tabs, so a bare name identifies nothing
and a dropped sub-group would have gone unnoticed.
New: plural keys expand for storage and stay collapsed for the admin. The
two sides read a plural key differently, so a builder that expanded in both
places, or in neither, would still look plausible from one side. Also that
a `strict` limit survives the expansion onto every stored form, and that an
advisory one stays out of the emitted schema where it cannot block a save.
The new unit spec pins the English seed to the schema: every declared key
covered, no undeclared key present, no blank value, every `%{placeholder}`
named in its own description, and every `strict` value inside its limit.
Each new assertion was watched failing against the defect it exists to
catch, at the site that would cause it — five in the field builder and the
schema, seven in the seed.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MCdVPp5bCT3neC7hWcDbNZ
`pnpm seed translations` has failed outright since #705 merged. The generator writes one property per DECLARED key, but a `plural: true` key is stored as its CLDR family, and #705 gave every leaf column a JSON Schema naming those expanded keys and nothing else. So the atlas write was rejected — "The following field is invalid: Emails > Emails" — and `writeGlobal` rethrows, taking the whole command down after the app and web globals had already been written. `sy-atlas-translations.emails.sessions_count` is the only such key today, which is why nothing caught it: the failure is in the one global that still uses generated data, and the generator has no test. Found while writing the seed integration spec in this PR, which runs the real importer and so fails on this before it can assert anything. #706 deletes this generator when it gives the atlas real copy — until then the command has to work. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCdVPp5bCT3neC7hWcDbNZ
The unit spec proves the seed FILE agrees with the schema. It cannot prove Payload accepts it: the shape only satisfies the per-column JSON Schema if the importer hands it over untransformed, and the publish only lands if `localizeStatus` treats `_status` as a per-locale column. Both are database facts, and the first defect this spec found was in neither the file nor the schema but in a sibling global's generator. It asserts the publish itself, not only its effect. English is exempt from the `availableLocales` publish gate, so a publish that silently did nothing would still let `['en']` through — and would surface only when someone tried to add a second language, long after the deploy. `fallbackLocale: false` on the French read is load-bearing: without it French resolves `_status` through the English fallback and reports itself published. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCdVPp5bCT3neC7hWcDbNZ
…s, and the publish
Three things a future contributor cannot infer from the code:
- The twelve Web tabs are in the site's reading order, not grouped by data
type, and every tab carrying screen-reader copy splits into `general` +
`a11y`. So does the pair of conventions the schema depends on — the
"Not shown on screen" description prefix, and `%{count}` being reserved
for the number that selects the plural form.
- A group may name itself with `title`, and why the default is wrong for
`a11y` in particular.
- `pnpm seed translations` publishes the WEB global and must never publish
the app one, plus the reason each way round.
Also corrects an overclaim in the importer's own comment: Payload ignores
an unknown TOP-LEVEL key on a global, so stripping `_meta` is for the
reader, not the database. A mutation run proved it — leaving `_meta` in the
write changed nothing. The refusal that does bite is inside a leaf group.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MCdVPp5bCT3neC7hWcDbNZ
Three review lenses ran over the branch. The substantive findings: **The publish rationale was wrong, in four places.** Every comment said the English publish is what lets `wm-web-config.availableLocales` offer `en`. It is not: `availableLocalesField.ts` exempts English from that gate by design, because gating the one locale nobody can deselect would deadlock the save. A probe against a real database settled the other half — a global read returns the same document whether `draft` is true, false, or unset. So the publish sets state and nothing else, which is exactly why the spec has to assert `_status` directly rather than infer it from an effect. Corrected in the importer, `seeds/AGENTS.md`, and the spec's own header. **`title` on `GroupSchema` was one level too shallow.** It introduced a general schema extension to carry one value repeated ten times, while three lines from its call site the builder already special-cased the same slug a different way (`initCollapsed: subSlug === 'a11y'`). Two mechanisms for one group, and ten duplicated literals with nothing pinning them equal. Replaced by `SUBGROUP_PRESENTATION`, one table where a slug's label and collapse rule sit together. The schema JSON goes back to declaring no presentation at all. Simplification, no behaviour change: the seed spec's four copies of the plural expansion collapse into `DeclaredKey`, which resolves each key once into the paths English must fill and the paths the schema permits — making the English-vs-full-family distinction visible in one place instead of four. Three same-shaped tests become filters over it, and the per-key `it.each` becomes one collected assertion that names every missing path at once rather than the first of 140. In the config spec, two walkers over the same tab structure become one, and a hand-maintained `toBe(20)` is derived. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCdVPp5bCT3neC7hWcDbNZ
`title` on a group schema is gone — `SUBGROUP_PRESENTATION` carries the label and the collapse rule together instead. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCdVPp5bCT3neC7hWcDbNZ
|
🚅 Deployed to the SahajCloud-pr-755 environment in sahajcloud
1 service not affected by this PR
|
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
`translations-field.int.spec.ts` still asserted `toWords('a11y')`'s "A11y"
for the accessibility collapsible. This PR's `SUBGROUP_PRESENTATION` renames
it to "Accessibility", which the ticket's acceptance criterion asks for, so
the pre-existing expectation went stale and CI went red on it.
The lean gate is Tier 2 (unit only), so the int lane first ran in CI — the
sibling assertion added here, `translations-globals.int.spec.ts:263`, covers
the new label and passed.
The assertion's real property is the collapse rule, and it is unchanged.
Confirmed still load-bearing: setting the table's label back to 'A11y' turns
this case red and nothing else.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012oRh6doD5BV4ebFpqDW8ra
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Scope matches the ticket. All 140 keys agree with Appendix A key for key — order, plurals, limits, English. The hand-written surface is small; the 59k lines are generated. Both migrations are pure drop then pure add, reversible column for column. Two things want your ratification.
Findings
should-fix— fivetag_*keys restatePAGE_TAGS, nothing pins them (schema:218).consider—SUBGROUP_PRESENTATIONlabels tabs too, though name and docs say sub-group (translationsField.ts:165).consider— strictmaxLength18 against Appendix A's 10 (schema:510).
What was checked
- All 140 leaf paths of the schema and
data.en.jsonagainst Appendix A: no extras, no gaps. translationsField.tswhole —stringsJsonSchemaputsmaxLengthon each plural form, so the gate bites.- Both migrations: 6 drops, 40 adds;
navigation,footeruntouched. - WeMeditateWeb names this global in two TODOs only, and no removed interface.
PAGE_TAGS(src/lib/pageTags/index.ts:9) and importers; both new specs.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
| "duration_minutes": { | ||
| "type": "string", | ||
| "plural": true, | ||
| "maxLength": 18, |
There was a problem hiding this comment.
18 here, 10 in Appendix A. The PR body's reasoning holds — the limit measures the raw string, and %{count} min is 12, so 10 would refuse the English the ticket specifies.
Flagging it inline because it changes a number you wrote. 18 leaves nine characters for a translated unit: confirm that is the budget you want, or correct the appendix.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
There was a problem hiding this comment.
Left at 18 — the one thread with nothing to change until you rule.
18 is %{count} min (12) plus six for a longer unit. 10 refuses the English Appendix A itself specifies, so the ticket cannot pass its own criterion. Say which side moves and I will change the schema or the appendix.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`article.general.tag_*` names one filter chip per `PAGE_TAGS` entry, which `Pages` and `ContentIndexBlock` both read. Nothing joined the two lists, so a sixth tag would give pages a facet with no translatable label and no failure anywhere — here or in WeMeditateWeb. Pinned in the spec that already loads the schema. Watched red with a sixth entry added to `PAGE_TAGS`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015Q7E9s5cCBUvcaNn8GGZEE
`groupLabel` served both the sub-group collapsibles and the top-level tabs, so the table decided a tab's label too — while its name, its comment, and `src/globals/AGENTS.md` all said sub-group. Split into `slugLabel` (every tab) and `subGroupLabel` (the table, else `slugLabel`), so the name and the behaviour agree. No real schema declares a tab named `a11y`, so the emitted config is unchanged today. The spec states the rule directly instead, and was watched red with the tab site reading the table again. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015Q7E9s5cCBUvcaNn8GGZEE
|
Two of three review threads adopted and pushed. One waits on you.
Both new assertions were watched red at the defect site. Lean gate green, plus 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
I could not mark ready here — the dispatch token is not allowed to. Everything else on this item is done, so this is the one step left for you. 🤖 sydevs dispatcher |
|
This draft has had no CI activity for hours and no session holds it. Comment or push to wake me. 🤖 sydevs dispatcher |
|
@sydevs-bot Resolve the merge conflicts in this PR. They were created by merging #750 into main |
Resolves the conflicts #750 (the Sahaj Atlas schema rewrite, #706) created. Both branches rewrote a translations global, so the overlap is the one importer, the migration index, and the specs that read both schemas. Four conflicts, each resolved to keep both behaviours: - `src/migrations/index.ts` — all three migrations, in timestamp order: #750's atlas reshape first, then this branch's drop and add. - `seeds/translations/import.ts` — `seedWmWeb` (real English copy, published) beside `seedAtlas` (ten locales, each published). `writeGlobal` takes main's `locale` parameter, so wm-web passes `DEFAULT_LOCALE` explicitly. - `tests/int/translations-globals.int.spec.ts` — main's atlas field set, this branch's wm-web set, one merged docblock. - `seeds/AGENTS.md` — one section covering both globals' real copy and both publishes. `generateExampleData` is deleted, not merged. Each side replaced one of its two callers with real copy, and this branch's own comment said to delete it once #706 took the last one. The plural-expansion fix this branch made to that generator goes with it — `pnpm seed translations` no longer generates data for any global, so the break it repaired cannot recur here. Also repairs the out-of-order snapshot trap (`src/migrations/AGENTS.md`). The two migration snapshots on this branch were generated before #750 merged, so the newest-by-timestamp snapshot described the pre-#750 atlas columns. The next `migrate:create` would have re-emitted #750's DDL and crash-looped the boot migration (#566). Both snapshots now carry #750's atlas tables, and `pnpm db:migrations:create --skip-empty` emits nothing. Verified: lean gate green (lint, typecheck, typecheck:tests, 1778 unit tests); `translations-globals` (23), `wm-web-translations-seed` (7) and `translations-field` (22) integration specs green; `pnpm generate:types` leaves `src/payload-types.ts` byte-identical, so the merged types already match the merged config. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01T8bW17CGRLHDEzMz9pTk4m
|
Merge conflicts resolved. Four files conflicted. Both sides survive in each: the seed importer (wm-web's English copy beside the atlas's ten locales), Two sessions were dispatched for your one comment. Both produced the same resolution; the one that pushed won. This run verified that result instead of re-pushing: lean gate green (1778 unit tests), and GitHub still lists the PR as conflicting. That field lags the push. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
Conflicts resolved and pushed — #750 and this branch each rewrote a translations global, so the four conflicts were the shared importer, the migration index, and two specs. Each kept both behaviours: the atlas seeds ten published locales, wm-web seeds real English and publishes it.
One thing the conflict hid. Both migration snapshots here predate #750, so the newest snapshot still described the old atlas columns. The next Lean gate green (1778 unit tests), the three translations integration specs green, The 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
`main` moved again with #747 — `wm-app-translations` gains per-locale `_status` and `wm-app-config` gains `availableLocales`. Both sides' behaviour is kept. - `src/globals/AGENTS.md`: kept this branch's #707 Web-tabs section and its two key conventions, and took `main`'s framing sentence. All three translations globals now carry per-locale status, so "three things distinguish the two web globals from wm-app" is no longer true. - `tests/COVERAGE.md`: took `main`'s two rewritten rows and kept this branch's two wm-web rows, which `main` has no counterpart for. - `src/migrations/index.ts`, `src/payload-types.ts` and the four `main`-only specs merged cleanly, in timestamp order. **Both snapshots repaired a second time.** #747's migration is `20260909_161243`, older by timestamp than this branch's `161848` and `162104`, so after the merge the newest-by-timestamp snapshot still described the pre-#747 `wm_app` schema — the out-of-order snapshot trap in `src/migrations/AGENTS.md`. Verified before the repair: `db:migrations:create --skip-empty` re-emitted #747's DDL byte for byte, and replaying it aborts the boot migration on deploy (#566). Both snapshots now carry #747's `wm_app` schema, and the same command emits nothing. **Two comments the merge falsified, corrected without changing behaviour.** `seeds/translations/import.ts` and `tests/int/wm-web-translations-seed.int.spec.ts` both said `wm-app-translations` holds one `_status` for every locale. It has per-locale status since #709. The seed still leaves it unpublished — an operator republishes each locale after the deploy — and the assertion, read at `locale: 'en'`, still holds. Gate: lint, both typechecks, 1778 unit tests, and the three integration specs covering the conflicted files (49 tests) all pass. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_0146WwB8svzTLxZMfRraYati
|
Merged Both migration snapshots were repaired a second time. #747's migration is Two comments the merge falsified. Only Gate: lint, both typechecks, 1778 unit tests, plus 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Resolves #755's WeMeditate Web schema rewrite against this branch's atlas `seo` group. Three conflicts, all kept from both sides: - `src/migrations/index.ts` — both branches added imports. #755's two entries are ordered before this branch's, matching the array the merge already produced and the migrations' timestamps. - `src/globals/AGENTS.md` — #755 documented the Web tabs' reading order and the `a11y` conventions; this branch documented `Seo`/`Emails` as the two server-read exceptions to the one-tab-per-widget-view rule. Both paragraphs stand, Atlas first. - `tests/int/translations-globals.int.spec.ts` — took #755's docblock, which restates the leaf/nested split for all three globals, and added `Seo` back to the sy-atlas leaf-tab list. Refreshes `20260912_031449_atlas_translations_seo_group.json`. That snapshot is the newest by timestamp, so `migrate:create` diffs the next migration against it — and it predated #755, so it still carried the old `wm_web` columns. Regenerated post-merge; the `.ts` DDL comes out byte-identical, so the file and its timestamp are unchanged and the preview's applied migration row still matches (src/migrations/AGENTS.md, the out-of-order snapshot trap). `pnpm generate:types` reproduces the merged `src/payload-types.ts` exactly. Gate: lint, `tsc` over src and tests, 1812 unit tests. Targeted specs: translations-globals, translations-field, wm-web-translations-seed (52) and atlas-seo (53). Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRMePM8fqqySLhNpbUgxX6
Summary
wm-web-translations— none of which WeMeditateWeb ever read — with the 140 UI strings the site actually renders, laid out as 12 tabs in the site's reading order. Every tab carrying screen-reader-only copy splits intogeneral+a11y, which feat(translations): typed JSON groups, per-locale publish status, and an availableLocales field gated on published translations #705 renders as collapsibles witha11yclosed.mainbelow,pnpm seed translationsseeds no global from generated strings. feat(translations): rewrite the Sahaj Atlas schema by widget view, seed all ten locales, and gate availableLocales on them #706 (merged as feat(translations): rewrite the Sahaj Atlas schema by widget view, seed all ten locales, and gate availableLocales on them #750) replaced the atlas global's placeholders and this PR replaces wm-web's, sogenerateExampleDatalost its last caller and is deleted.Closes #707. Unblocks sydevs/WeMeditateWeb#80.
Changes
src/globals/WeMeditateWebTranslations/translationsSchema.json— the 12 tabs, 22 leaf groups, 140 keys of Appendix A, each with a translator-facing description naming its placeholders.seeds/wm-web-translations/data.en.json(new) — the English copy, shaped like the global's API response so the importer hands it over untransformed.seeds/translations/import.ts—seedWmWebreads that file instead of inventing values from key names, and publishes English.generateExampleDataandseedFromSchemaare gone.src/fields/translationsField.ts—SUBGROUP_PRESENTATION, one table holding a sub-group slug's label and collapse rule together.toWords('a11y')is "A11y". Only a sub-group reads that table:slugLabellabels every tab,subGroupLabelconsults it.src/migrations/— two migrations, drop then add.Preview
The route worth opening is
/admin/globals/wm-web-translations, for the twelve tabs and the collapsibles.Migration
20260909_161848_drop_wm_web_placeholder_tabs.ts, then20260909_162104_wm_web_translations_tabs.ts. Both now run aftermain's20260909_161353_atlas_translations_by_view.ts, which is timestamp order.wm_web_translations_localesand_wm_web_translations_v_locales, dropscommon,errors,page_tags(+version_twins) and adds the 20<tab>_<sub-group>columns (+ twins).navigationandfooterkeep their names and are untouched. Every dropped column held seed placeholders only — feat(translations): typed JSON groups, per-locale publish status, and an availableLocales field gated on published translations #705 established that no locale of this global carries live copy — so nothing is preserved because there is nothing to preserve. The atlas global's own tables are feat(translations): rewrite the Sahaj Atlas schema by widget view, seed all ten locales, and gate availableLocales on them #750's, untouched here.downfunctions restore the exact prior column set, verified by applying the chain and rolling it back (below).Why two migrations and not one. A drop and an add of jsonb columns in one diff reads to drizzle-kit as a rename, and its rename-vs-create prompt hangs forever on non-TTY stdin (
src/migrations/AGENTS.md). Generated by reducing the schema to the two surviving tabs, generating the drops, restoring it, then generating the adds — so each file is pure and neither run saw a prompt.Both snapshots were repaired in the merge. See the merge section below — left alone they would have crash-looped the next deploy's boot migration.
Contract impact
src/payload-types.ts: 22 namedWmWebTranslations…Stringsinterfaces, one per leaf group, up from 5 — each key's description carried through as JSDoc.…CommonStrings,…PageTagsStringsand…ErrorsStringsare gone;…NavigationStringsand…FooterStringskeep their names with new members.sydevs/WeMeditateWeb#80 consumes this global for every string. It must run
pnpm types:cmsonly after production has deployed and an operator has runpnpm seed:prod translations— the sequence is in Manual verification below.Test results
pnpm lint && pnpm typecheck && pnpm typecheck:tests && pnpm test:unit(1778 unit tests, post-merge)translations-globals(23),wm-web-translations-seed(7),translations-field(22)main's table shapepnpm db:migrations:create --skip-emptyemits nothing against the merged configpnpm generate:typesleavessrc/payload-types.tsbyte-identical after the mergeManual verification
Media → General → duration_minutesand save — it must be refused (strictlimit).Meditation → General → labelover 20 must still save (advisory).pnpm seed:prod translations, confirmsenshows as published, then selects English inwm-web-config.availableLocales. Only then may feat(i18n): source every UI string and the locale set from SahajCloud WeMeditateWeb#80 runpnpm types:cms.Notes for reviewer
One deliberate deviation from the ticket, and it is a number — this is the open thread. Appendix A puts
strictmaxLength10 onmedia.duration_minutes/duration_seconds. The limit measures the raw stored string, and Appendix A's own English for those keys is%{count} min— 12 characters. At 10 the ticket contradicts itself: seeding the English it specifies would be refused by the strict gate it also specifies, sopnpm seed translationscould never pass its own acceptance criterion. They are 18 here, which keeps the gate blocking while leaving nine characters for the translated unit. The new unit spec asserts this class of mistake directly, and I watched it go red at 10 before changing it. Nothing changes here until you rule on which side moves — the schema or the appendix.140 keys, not the 135 the ticket's prose estimates. Appendix A is the contract ("Appendix A is the schema, key for key"), and several of its rows declare two keys (
a11y.previous/a11y.next). The 140 is what the appendix lists.A second scope note.
SUBGROUP_PRESENTATIONin the field builder is not in the ticket. It exists because the acceptance criterion asks for a collapsible labelled "Accessibility" while the builder derives "A11y" from the slug, and the ticket pins the slug (a11yis Appendix A's name for the sub-group, and sydevs/WeMeditateWeb#80's key paths are written against it). It also absorbs theinitCollapsed: subSlug === 'a11y'rule that was already there, so one table now holds everything a sub-group slug decides about its presentation.A third defect found on the way, filed rather than fixed: #753. The same generator wrote a nested tab's placeholder data to a top-level key Payload does not have, so it was discarded silently. That generator is now deleted, so #753's cause is gone with it — close it against this PR rather than fixing it separately.
Known follow-up, not addressed here.
localesErrorOrNullin the new int spec is a fourth copy of the same helper (available-locales,client-canonical,eventshave the others). A sharedfieldErrorOrNull(write, path)intests/utils/testHelpers.tswould absorb all four; doing it here would have meant editing three specs this PR has no other business in.Merge with
main(2026-09-12)9c83125mergesorigin/mainin and resolves the conflicts #750 created. Both branches rewrote a translations global, so the overlap is the one importer, the migration index, and the two specs that read both schemas. Every conflict kept both behaviours.src/migrations/index.tsseeds/translations/import.tsseedWmWebbesideseedAtlas.writeGlobaltakesmain'slocaleparameter, so wm-web passesDEFAULT_LOCALEexplicitly.tests/int/translations-globals.int.spec.tsmain's atlas field set, this branch's wm-web set, one merged docblock.seeds/AGENTS.mdgenerateExampleDatais deleted, not merged. Each side replaced one of its two callers with real copy, and this branch's own comment said to delete it once #706 took the last one. The plural-expansion fix this branch made to that generator goes with it: no global is seeded from generated data, so the break it repaired cannot recur here. That is the one behaviour the merge removed, and it is deliberate.The conflict hid a second, quieter problem. Both migration snapshots on this branch were generated before #750 merged, so after the merge the newest-by-timestamp snapshot still described the pre-#750 atlas columns — the out-of-order snapshot trap in
src/migrations/AGENTS.md. The nextmigrate:createwould have re-emitted #750's atlas DDL, and replaying it aborts the boot migration on deploy (#566). Both snapshots now carry #750's atlas tables, andpnpm db:migrations:create --skip-emptyagainst the merged config emits nothing — which is the check that proves it.Review round (2026-09-09)
Two findings adopted, one commit each, both watched red at the site that would cause them.
9b39b00—article.general.tag_*restatedPAGE_TAGS(src/lib/pageTags/index.ts) with nothing joining them, so a sixth tag would have given pages a filter facet with no translatable label and no failure anywhere. The seed spec now asserts the two sets are equal.fb185d3—groupLabelserved both the sub-group collapsibles and the top-level tabs, soSUBGROUP_PRESENTATIONdecided a tab's label too, while its name andsrc/globals/AGENTS.mdboth said sub-group. Split intoslugLabel(every tab) andsubGroupLabel(the table, elseslugLabel). No real schema declares a tab nameda11y, so the emitted config is unchanged today — the spec states the rule instead.Detail
The seed publishes, and only for We Meditate
wm-app-translationskeeps its plain update. One_statuscovers every locale there, so publishing would claim 19 translated languages from an English-only file.wm-web-translationshas per-locale_status(#705), so publishing English leaves every other locale a draft.sy-atlas-translationspublishes each of its ten locales on its own (#750).My first three commits gave the wrong reason for the publish, and the review pass caught it. They said it is what lets
availableLocalesofferen. It is not:availableLocalesField.tsexempts English from that gate by design, because gating the one locale nobody can deselect would deadlock the save. A probe against a real database settled the other half — a global read returns the same document whetherdraftis true, false, or unset.So the publish sets state and nothing else. That is precisely why the spec has to read
_statusdirectly: a publish that silently did nothing would leave every downstream behaviour looking correct and show up only as wrong state in the admin. The reasoning is in the importer,seeds/AGENTS.md, and the spec header.The pre-existing break, and why it is no longer reachable
generateExampleDatawrote one property per declared key. Aplural: truekey is stored as its CLDR family, and #705 gave every leaf column a JSON Schema naming those expanded keys and nothing else. So the atlas write was rejected — "The following field is invalid: Emails > Emails" — andwriteGlobalrethrows, taking the whole command down after the app and web globals had already been written.sy-atlas-translations.emails.sessions_countwas the only such key, which is why nothing caught it: the failure was in the one global still using generated data, and the generator had no test.This branch fixed that generator. The merge deletes it instead, because #750 gave the atlas global real copy. Both are the same repair by different means, and the second one is permanent.
Every new assertion was watched failing
Per
tests/AGENTS.md, a new assertion is not finished until it has failed. Sixteen defects were reintroduced at the site that would cause each one, and each turned exactly the intended case red:%{placeholder}, an over-strict value.a11yunable to be renamed,a11ystarting open, plural keys stored unexpanded, astrictlimit dropped from the emitted schema, a sub-group deleted from the schema.The review round added two more: a sixth
PAGE_TAGSentry, and the tab site readingSUBGROUP_PRESENTATIONagain. The last of the four integration mutations concerned the generator and went out with it; the other seventeen survive the merge and were re-run green.One mutation came back green and is worth recording rather than hiding: leaving the
_metaheader in theupdateGlobalpayload changes nothing, because Payload ignores an unknown top-level key on a global. The refusal that does bite is inside a leaf group. The importer's comment says so, instead of implying the strip is protective.The migration chain, checked against a real database
The integration lane uses drizzle
push, so it never runs the migration files. Bothupfunctions were applied in order to a Postgres schema rebuilt to matchmain's snapshot (with a placeholder row in it), then bothdownfunctions in reverse:common,errors,page_tagsgone;_status,footer,navigationkeptFixture pre-mortem
The seed file assumes the key paths the field builder produces. Rather than re-derive them, the unit spec walks the schema with
collectLeafLookups(src/lib/translations/schemaWalker.ts) — the same walkerclientEnglishFallbackuses to decide which keys to fill from English. English strings were spot-checked against the real WeMeditateWeb source:components/atoms/Spinner/Spinner.tsx:60,components/molecules/MasonryGrid/MasonryGrid.tsx:86,88,pages/+config.ts:22-23,server/error-utils.ts:113-119,components/molecules/ErrorFallback/ErrorFallback.tsx:49-52,pages/map/_components/AtlasContent.tsx:127,132.English plural forms
The seed populates
_oneand_otheronly.fewandmanyexist in the storage family for Russian, Ukrainian and Czech, andpluralize()falls back tootherwhere a locale does not use them — so seeding them in English would invent a form the language has no rule for. The unit spec states that explicitly rather than expanding viaPLURAL_CATEGORIESand quietly demanding four.🤖 Generated with Claude Code
https://claude.ai/code/session_01T8bW17CGRLHDEzMz9pTk4m