Skip to content

chore(seeds): retire the one-off wm-web-locales seed - #1220

Merged
Ardnived merged 3 commits into
mainfrom
claude/chore-retire-wm-web-locales-seed
Nov 19, 2026
Merged

Ardnived merged 3 commits into
mainfrom
claude/chore-retire-wm-web-locales-seed

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Change outline

Files — one script retired, and the base it shared

The deletion is the change. seeds/lib/ keeps only what more than one importer reaches.

 seeds/
-├── wm-web-locales/import.ts             # the one-off: nine locales, read and published
 ├── wm-web-translations/
-│   ├── data.<nine locales>.json         # the drafts it read; nothing else does
 │   └── data.en.json                     # still read by `translations`
 ├── lib/
-│   ├── TranslationGlobalsImporter.ts    # seedLocaleFiles + writeGlobal, for two callers
 │   └── index.ts                         # barrel loses that export
 └── translations/import.ts               # now owns both, for the atlas global's ten locales

Contract — what pnpm seed and the seed route accept

VALID_SCRIPTS is derived from EXPECTED_COUNTS (route.ts:47), so dropping the entry is what closes the route. There is no second list to keep in step.

 type ScriptName =
   | 'file-transcripts'
   | 'translations'
-  | 'wm-web-locales'

 EXPECTED_COUNTS, COLLECTION_METADATA, SCRIPT_DATA_FILES, SCRIPT_DESCRIPTIONS, VALID_SCRIPTS
-  each lose their 'wm-web-locales' row

 GET|POST /api/seed/wm-web-locales
-  → WmWebLocalesImporter
+  → 400 { error: "Invalid script: wm-web-locales", validScripts: [...] }

Behaviour — the per-locale loop is unchanged

It moved file; nothing about it changed. Both failures it tells apart are still asserted, now from tests/unit/translations-seed-locale-files.spec.ts.

 TranslationsImporter.seedLocaleFiles({ slug, locales, dataFile, prepare })
   per locale: load data.<locale>.json
     _meta.locale ≠ the slot → addError, next locale
     prepare(data, locale)                   # the atlas seed's two live groups
     writeGlobal(…, publish: true)
       updateGlobal throw → already reported, next locale
       no Payload instance → re-throw        # fails every locale, reported nowhere else

Preview

The diff touches no collection or admin view, so no fixture record shows it. The seed route is the surface that changed:

  • /api/seed/wm-web-locales — 400 Invalid script, listing the two scripts that remain. The name check runs before auth, so this needs no sign-in.
  • /api/seed/translations — still answers its metadata, so the derived allowed set is intact. Sign in at /admin/login first; it is admin-only.

Test results

  • Lean gate: ✓ lint, format, both typechecks, unit lane (282 files, 3827 tests).
  • Targeted specs: 16 passed — seeds/tests/atlas-translations-import.test.ts (9) and tests/int/wm-web-translations-seed.int.spec.ts (7), the two that drive the moved loop against a database.
  • Build: N/A — CI runs the integration lane and the smoke tests.

Notes for reviewer

  • seedLocaleFiles and writeGlobal are kept whole, as methods of TranslationsImporter: the atlas global's ten locales still run through them, _meta.locale check included. seeds/wm-web-translations/data.en.json is kept too, since translations still seeds it.
  • Removing the wm-web-locales case from src/app/(payload)/api/seed/[script]/route.ts touches a security-review path. It only takes a script name out of the allowed set; the route's auth is unchanged.
  • chore(translations): drop WeMeditate Web's unused video tab #1217 (dropping the video tab) touches only data.en.json among the seed files, so the two PRs do not overlap.
  • seeds/AGENTS.md keeps the nine locales' story as a ⚠ paragraph in the translations section, beside the wm-app-translations retirement (chore(seeds): retire the one-shot importers and the atlas sync #1169), rather than a ### heading for a script that is gone.
Detail

The production run: 117 sections, 0 errors, and each of the nine locales read back afterwards as published with its own wording.

Why the base class went rather than staying for a future caller: its header claimed testability as the reason to keep it apart, and the spec's ProbeImporter gets that by extending TranslationsImporter instead — still no Payload bootstrap, which is what makes the missing-instance case reachable at all. No open ticket plans a fourth translation global or a second script that writes one.

🤖 Generated with Claude Code

The website's nine non-English locales of wm-web-translations were loaded
into production on 2026-11-19 and are edited in the admin from now on. A
re-run of the script would overwrite an editor's wording, so the script, its
nine data files, its registrations (CLI, seed route, counts, data-file
registry) and its two specs go.

TranslationGlobalsImporter stays: `translations` still runs the atlas
global's ten locales through it, and its unit spec now probes atlas files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app

railway-app Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-1220 environment in sahajcloud

Service Status Web Updated
SahajCloud 😴 Sleeping (View Logs) Web Nov 19, 2026 at 5:31 pm UTC
1 service not affected by this PR
  • mailpit

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1220 November 19, 2026 16:23 Destroyed
@Ardnived
Ardnived enabled auto-merge November 19, 2026 16:27
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 19, 2026
@sydevs-bot

sydevs-bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 16:53Z address-review · attempt 1 · session · done
  • 16:53Z address-review · attempt 1 · session
  • 16:39Z review-pr · attempt 1 · session · done
  • 16:39Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 19, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The retirement itself is complete. Nothing on the branch still names the script, its symbols or its nine data files, and the route closes without a second list: VALID_SCRIPTS is derived from EXPECTED_COUNTS (route.ts:47), so dropping the entry is what refuses the request. Nothing depends on those locales staying seeded — no seed writes wm-web-config.availableLocales, so a fresh database is English-only by design, which the docs now say. The diff carries nothing the retirement does not force.

One shape question is left behind: the deletion makes TranslationGlobalsImporter a 161-line abstract base with a single subclass, and rewrites away the comment that said why it was separate.

Findings

  • should-fix — one subclass left for a shared base → seeds/lib/TranslationGlobalsImporter.ts:5
  • should-fix — the body skips ## Change outline and ## Preview. The diff touches src/app/(payload)/, a fixture.surfacePaths entry, so No preview surface is not open to it either. (No thread: the body has no line to anchor.)
  • consider — a ### section for a script that is gone → seeds/AGENTS.md:159

What was checked

  • Read whole on the branch: TranslationGlobalsImporter.ts, dataFiles.ts, run.ts, the seed route, seeds/translations/import.ts, both AGENTS.md, the four touched specs.
  • git grep for wm-web-locales|WmWebLocales|WM_WEB_TRANSLATION_LOCALES|wmWebTranslationsDataFile|WmWebTranslationLocale: one hit, the deliberate #1213 breadcrumb.
  • Ladder: the diff adds no file, type, constant or dependency.
  • Coverage: tests/COVERAGE.md listed neither deleted spec, so no row goes stale. The publish-before-widening order the deleted integration spec asserted stays covered by available-locales (COVERAGE.md:55).

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread seeds/lib/TranslationGlobalsImporter.ts Resolved
Comment thread seeds/AGENTS.md Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 19, 2026
#1213 split `seedLocaleFiles` and `writeGlobal` out because two scripts
shared the loop. Retiring `wm-web-locales` leaves one caller, so the
abstract class, its barrel export and its own file served `translations`
alone.

Testability was the base's other claim. It does not need a class of its
own for that: the spec's `ProbeImporter` extends `TranslationsImporter`
instead and still boots no Payload, which is what makes the
missing-instance case reachable.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjY9rbp8raZqKHwTkGp
A `###` heading inside "Available scripts" reads as a script, and
`wm-web-locales` is gone. The `wm-app-translations` retirement (#1169)
is a `⚠` paragraph in the `translations` section; this one now matches.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjY9rbp8raZqKHwTkGp
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1220 November 19, 2026 17:04 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor

All three critic findings adopted. The branch was already level with main, so no merge.

  • One subclass left for a shared base — TranslationGlobalsImporter folded into seeds/translations/import.ts and deleted, barrel export with it. db0c79d
  • A ### section for a script that is gone — now a ⚠ paragraph in the translations section. 856a795
  • "the body skips ## Change outline and ## Preview" — both written, from the full branch diff. Preview links the seed route, the one surface the diff touches; no fixture record shows it. The body now follows pr-template.md's headings throughout.

Lean gate green. atlas-translations-import (9) and wm-web-translations-seed.int (7) pass against a database — the two that drive the moved loop end to end.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 19, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 19, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@Ardnived
Ardnived added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 28a667b Nov 19, 2026
43 of 45 checks passed
@Ardnived
Ardnived deleted the claude/chore-retire-wm-web-locales-seed branch November 19, 2026 17:31
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 19, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 19, 2026
The merge queue failed on b3299ff while this PR's own CI was green:
`tests/unit/wm-web-translations-locales-seed.spec.ts` required each of the
nine non-English wm-web seed files to hold every English key, and this
branch adds `common.a11y.menu` to English alone.

#1220 retired that seed, its nine data files and that spec, so the queue's
base no longer carries the assertion. Nothing here changes to satisfy it —
the branch only needed the base it lands on.

The merge itself is clean. #1220 also folded the importer base class into
`TranslationsImporter`; nothing this branch touches calls it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjY74fyRCakbkCvN2uS
sydevs-bot pushed a commit that referenced this pull request Nov 19, 2026
#1220 retired the `wm-web-locales` seed on main: its script, its nine
non-English data files and its two specs are gone, because the locales were
loaded into production on 2026-11-19 and are edited in the admin from now on.
This branch had added the five finder keys to all nine of those files, so the
merge takes main's deletion. Restoring them would resurrect a seed whose
re-run overwrites an editor's wording — the thing #1220 removed. English keeps
the five keys, and `clientEnglishFallback` is what the other locales read until
an editor types their own.

`data.en.json`'s `_meta` keeps both sides: main's `common.a11y.menu` sentence
and this branch's mood-finder one, and `schema_version` becomes
post-#1223 (14 tabs, 25 leaf groups, 202 declared keys) — 197 on main plus the
five here, as `translations-seed-meta.spec.ts` derives it.

`src/migrations/index.ts` keeps both migrations, in timestamp order. They write
disjoint jsonb columns — `common_a11y` against `meditation_general` and
`meditation_a11y` — so neither sees the other. Both snapshots are byte-identical
to the one they re-stamp, so the chain's newest-by-timestamp is still this
branch's and drifts from nothing.

The migration's `down` comment no longer cites the Russian, Ukrainian and Czech
seeds for `_few`/`_many`: those files are gone, and the admin's grouped plural
row is what writes them now.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjX4YpovnqWe4qFsoXk

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1220 — 856a795a Deployed Nov 19, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants