Skip to content

chore(translations): drop the unused event.display.time_in_place atlas key - #1059

Merged
sydevs-bot merged 5 commits into
mainfrom
claude/chore-1057-drop-time-in-place
Nov 2, 2026
Merged

sydevs-bot merged 5 commits into
mainfrom
claude/chore-1057-drop-time-in-place

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Drops event.display.time_in_place from the atlas translations schema, all ten seeds and the generated types.
  • Adds the data migration that edit needs: a stored key refuses every later save of the global.
  • Joined: src/globals/AGENTS.md gains the key-retirement rule — the single home for it, which the migration and the spec now point at rather than restate — and its stale "Versions: max 3" becomes 10.

Change outline

The key itself, and everything that named it.

Contract — one key leaves event.display

 sy-atlas-translations › Event › Display      src/globals/SahajAtlasTranslations/translationsSchema.json
   hosted_from    "Hosted from %{city}"       # unchanged: the only host-city string left
-  time_in_place  "%{time} in %{city}"        # nothing has rendered it since SahajAtlasWeb#351
   distance_away  …

 SyAtlasTranslationsEventDisplayStrings       src/payload-types.ts  (generated)
-  time_in_place?: string

 seeds/sy-atlas-translations/data.<10 locales>.json
-  event.display.time_in_place

Flow — why the schema edit alone leaves the global unsaveable

The group declares additionalProperties: false, and removing a key from the schema does not remove it from the jsonb column that stored it.

 updateGlobal sy-atlas-translations { countries: { title } }   # a write that never mentions event.display
   merge the stored value into every field the write omits
   validate event_display against SyAtlasTranslationsEventDisplayStrings
-    → ValidationError: The following field is invalid: Event > Display
+    → ok, once the sweep has run
   # a write that REPLACES event.display validates only what it carries,
   # which is why the retired key's own tab is the one place that looks fine

 20261101_191500_atlas_drop_time_in_place.up                  src/migrations/
+  sy_atlas_translations_locales.event_display             - 'time_in_place'
+  _sy_atlas_translations_v_locales.version_event_display  - 'time_in_place'   # an update reads latest:true
+  both guarded by `? 'time_in_place'`                     # jsonb - text raises on a scalar

Preview

The global's field list renders from the config, not from stored content, so this link shows the change on an unseeded preview. previewUrl.seed is unset for this repo, so nothing was seeded.

Contract impact

src/payload-types.ts changed, so contractSync consumers re-sync after this merges: sydevs/WeMeditateWeb (server/payload-types.ts) and sydevs/SahajAtlasWeb (src/types/payload/payload-types.ts). The dispatcher opens that bot PR; no issue needed.

SahajAtlasWeb also carries this key's English copy in src/config/translations.en.json and a RETIRING_KEYS entry naming #1057 in src/config/translations.test.ts. That contractSync PR does not carry either — it regenerates types only. The real follow-up is sydevs/SahajAtlasWeb#354, filed in review here and blocked on #1057 until this deploys, since pnpm sync:translations reads the live global. #1057's own Notes say "the sync PR" and name the wrong one.

Migration

  • New migration: src/migrations/20261101_191500_atlas_drop_time_in_place.ts
  • Impact: strips one key from sy_atlas_translations_locales.event_display and _sy_atlas_translations_v_locales.version_event_display. Every other key in those columns is preserved; NULL and already-clean rows are skipped. Data only, no DDL, so the .json is the prior snapshot re-stamped per src/migrations/AGENTS.md.
  • Reversible: no — down is deliberately empty. Rolling the code back restores the key to the schema, where a locale that does not store it reads as untranslated, which is the state every other unfilled key is already in. Writing values back would mean carrying ten translations this deletes.

Test results

  • Lean gate: ✓ .claude/skills/pr-prep/check.sh — lint, format, typecheck, typecheck:tests, 2992 unit tests in 234 files
  • Targeted specs: 81 passed — atlas-drop-time-in-place.int (2, new), translations-globals.int, translations-field.int, globals-client-reads.int
  • Build: N/A — Railway builds the preview

Three existing assertions in tests/unit/atlas-translations-schema.spec.ts move with the key and each was watched to fail first: the widget-facing key count (259 → 258), and the German and Dutch English-value allowlists, where %{time} in %{city} was claimed as a real translation.

Manual verification

  1. Open the preview link above and confirm the Event tab's Display group lists Hosted From and no Time In Place.
  2. The refusal is not observable on the preview. A PR environment carries no translations rows, so no stored key is there to refuse a save, and step 2 as first written could not fail. tests/int/atlas-drop-time-in-place.int.spec.ts is where it is reproduced against a real Postgres: its first case asserts the refusal, its second the sweep. On a seeded database — a local checkout, or production — saving any other tab of the global (Countries will do) is the write the sweep exists for.
  3. Local checkouts seeded before this merges keep the key and will refuse those saves — re-seed rather than running pnpm db:migrate. Noted in src/globals/AGENTS.md.

Notes for reviewer

  • Scope widened past the ticket's Approach, deliberately. The ticket listed the schema, the seeds and the types. Removing the key from the schema while the column still holds it refuses every later save of the global, so the sweep is part of the same criterion ("offers no time_in_place field, in any locale") rather than a follow-up. The title is still the ticket's.
  • The sweep stays per-key rather than generic. The hazard is general — stringsSchema sets additionalProperties from the group, and every leaf group in all three translations globals declares it false — and collectLeafLookups already yields the declared key set a generic reconciler would need. It is not built here: a prune-on-save would silently delete copy an editor typed, which is exactly what feat(translations): rewrite the Sahaj Atlas schema by widget view, seed all ten locales, and gate availableLocales on them #706's migration went to length to avoid, and emails and event.title hold the only real editor copy in these globals. Each future retirement costs one .ts/.json pair, and the rule is now written down.
  • Relaxing the group instead was weighed and rejected in review. additionalProperties: true on event.display would make the stored key saveable, but a client read serves the column verbatim — mergeEnglish only fills gaps, it never strips — so the widget would keep receiving time_in_place in ten locales, which is the criterion chore(translations): drop the unused event.display.time_in_place atlas key #1057 names. It is also per-group, not per-key (translationsField.ts:305), and nothing pins stored content: atlas-translations-schema.spec.ts:221 pins the seeds. feat(translations): rewrite the Sahaj Atlas schema by widget view, seed all ten locales, and gate availableLocales on them #706's 20260909_161353_atlas_translations_by_view swept these same two tables for this same reason.
  • This is the repo's first spec to import a migration's up. The established shape is the opposite: region-breadcrumb-url-backfill and schedule-last-date-backfill exercise a routine kept in src/lib/. Two unqualified SQL statements have no such routine to extract. up runs verbatim inside one transaction with SET LOCAL search_path, because this lane gives each suite its own Postgres schema; the spec's header carries that reasoning.
  • _meta.schema_version in the ten seeds was left at post-#1023. Both facts it states — 13 tabs, 43 leaf groups — are still true, so bumping it across ten files would be churn for a label.
  • Dismissed: moving the spec's raw seed to payload.db.updateGlobal. Measured — it takes no locale and reads a localized JSON column's own keys as locale codes, inserting one row per key until the _locales enum rejects it.
  • Dismissed: returning schemaName from createTestEnvironment to retire the same payload.db cast in three other specs. A real cleanup, but it touches specs this ticket does not, and the cast turned out to be unnecessary here anyway — drizzle and schemaName are already on the augmented DatabaseAdapter.
Detail

How the defect was established, rather than inferred. src/globals/AGENTS.md says Payload validates a stored column on every save of its document, which suggested the hazard. It was then reproduced three ways: the emitted schema refuses {hosted_from, time_in_place} with data must NOT have additional properties; the two UPDATEs were run against a real Postgres with NULL, clean and affected rows, preserving hosted_from in all three; and the integration spec reproduces the end-to-end ValidationError on a real updateGlobal.

The first version of that spec asserted the wrong save. A write that replaces event.display validates only what it carries, so it passed with the key still stored. Saving another tab is the shape that fails, and the spec says so where a later reader will trip on it.

Emptying up was watched to fail, twice — once before and once after the spec was rewritten — each time with ValidationError: The following field is invalid: Event > Display > Display, the same error the first case asserts.

jsonb - text on a scalar raises cannot delete from scalar, confirmed against Postgres directly. That makes the ? '<key>' guard load-bearing rather than an optimization over twenty rows: without it, one locale holding a non-object event_display would abort the boot migration and crash-loop the deploy. The migration's header says so, because the obvious simplification is to delete the guard.

Row counts. 19 configured locales and versions.max: 10, so the sweep touches at most ~19 live rows and ~190 version rows. Two sequential scans, row locks only, no DDL.

Not reached, deliberately. A client read of this global is edge-cached for 600s and purged on write; raw SQL purges nothing, so a cached payload can carry the retired key for up to ten minutes after the deploy. Consumers ignore unknown keys, and #706 behaved identically.

Where the hazard's story lives, after review. One owner each: src/globals/AGENTS.md carries the rule a future retirement needs, the migration keeps only its load-bearing ? guard, and the spec keeps only its Postgres-schema isolation and why it imports up. The migration was 32 comment lines of 47, now 19 of 34.

Closes #1057


Generated by Claude Code

…s key

The widget no longer renders it: its faded host-clock line sits directly
under "Hosted from %{city}", so the `in %{city}` clause repeated the city
above it, and sydevs/SahajAtlasWeb#351 renders the bare clock instead. The
key was copy in ten locales nothing displayed, and translators were asked
to keep it filled for nothing.

`event.display.hosted_from` stays — it is the only place the widget names
the host city now.

Three assertions in atlas-translations-schema.spec.ts move with the key,
and each fails without this edit: the widget-facing key count, and the
German and Dutch English-value allowlists, where `%{time} in %{city}` was
claimed as a real translation.

Refs #1057

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

Removing the key from the schema does not remove it from the `event_display`
JSON column that held it, and `event.display` declares
`additionalProperties: false`. Payload merges a stored value into a field the
write never mentions and validates it, so the schema edit alone leaves every
save of `sy-atlas-translations` that does not itself replace `event.display`
refused — with "The following field is invalid: Event > Display", reported
against a tab the editor was not touching. Production stores the key in all
ten locales, so the first editor to save any other tab after this deploys
would have hit it.

The versions table is swept with the main one: a global's update loads the
document it is about to change from the `latest: true` version row, so a key
left there returns on the next save.

Data only, so the `.json` is the prior snapshot re-stamped. `down` restores
nothing: rolling the code back puts the key back in the schema, where a locale
that does not store it reads as untranslated, and writing values back would
mean carrying ten translations this deliberately deleted.

`tests/int/atlas-drop-time-in-place.int.spec.ts` asserts the defect first and
the sweep second. Emptying `up` was watched to fail the second case with the
first's error.

Refs #1057

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

The review pass found three things worth acting on.

The `? 'time_in_place'` guard reads as an optimization over twenty rows, and is
not one: `jsonb - text` raises `cannot delete from scalar` on a column holding
a non-object, which would abort the boot migration. Confirmed against Postgres,
and now stated, as 20260909_161353 states the same hazard for its own guard.

The spec hand-wrote a structural type for `payload.db`. `drizzle` and
`schemaName` are both declared on the augmented `DatabaseAdapter`
(@payloadcms/db-postgres types.d.ts), so the cast bought nothing and discarded
`transaction`'s real signature. Dropping it also retires the mutable suite-scope
`inSchema`, the re-cast of its callback argument, and the hand-quoted schema
identifier, which is `sql.identifier`. `up` is called with a named type rather
than `as never`, so a future read of `req` fails typecheck instead of at
runtime.

The seed interpolated its value into a SQL string literal, which an apostrophe
in the retired string would have broken inside `beforeAll`. Two statements
instead of one carry it as a bound parameter.

Rejected: moving the raw seed to `payload.db.updateGlobal`, which takes no
locale and reads a localized JSON column's own keys as locale codes — measured,
it inserts one row per key and fails on the `_locales` enum.

Refs #1057

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZSh9ZSyni4Spnp6Lc
The guide gave the mirror-image rule for ADDING a key — a `required` one
strands a locale that predates it — and said nothing about removing one, so
this ticket followed a rule that did not exist. Deleting a key leaves every
stored value holding it against an `additionalProperties: false` group, and the
global then refuses every save that does not replace that group. Recorded only
in the sweep migration's own header, that hazard would have sat in a folder
`src/migrations/AGENTS.md` says gets squashed, under a filename naming one key.

It is general: `stringsSchema` takes `additionalProperties` from the group, and
every leaf group in all three translations globals declares it false. So the
rule names both tables to sweep, the guard the delete needs, and the local
recovery — a re-seed, since `push: !isProduction` means no local database ever
replays the chain and `pnpm db:migrate` on an empty `payload_migrations`
replays the whole of it.

Also corrects "Versions: max 3" to 10, which is what all three globals have
declared since #705. Anyone sizing the versions table reasoned from the wrong
number.

Refs #1057

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

railway-app Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Nov 1, 2026 at 8:22 pm UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot

sydevs-bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 20:09Z address-review · attempt 1 · session · done
  • 20:09Z address-review · attempt 1 · session
  • 20:00Z review-pr · attempt 1 · session · done
  • 20:00Z review-pr · attempt 1 · session

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

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

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🧐 Adversarial review

The diff matches #1057 and is honest about widening past it — the sweep serves the same acceptance criterion, not a second change. Within this approach it is the smallest correct version: two guarded UPDATEs folded into their one caller, nothing bespoke extracted.

What the Notes never ask is whether the approach is needed. additionalProperties: false on a jsonb column that holds history makes every future key retirement a migration, across three globals — and this repo already rejected that trade once, in writing. That is the finding worth an answer.

Findings

  • should-fix — a per-key migration where relaxing the group would do. 20261101_191500_atlas_drop_time_in_place.ts:32
  • should-fix — "deleted in its sync PR" names a PR that will not carry it. contractSync for SahajAtlasWeb syncs payload-types.ts only, so src/config/translations.en.json:127 and RETIRING_KEYS at translations.test.ts:234 are nobody's. Name the real follow-up.
  • consider — comment volume: one story told three times. 20261101_191500_atlas_drop_time_in_place.ts:3
  • Manual verification step 2 cannot fail: the body says the preview is unseeded, so no stored key is there to refuse that save.

What was checked

Read whole: the migration, the new spec, translationsField.ts, the schema spec, both AGENTS.md. Ladder: no existing helper for the sweep, and withSchema is justified — region-canonical-url and meditation-duration qualify the table name, which up's unqualified SQL cannot.

Queried: those two tables are the only ones with the column; max: 10 is right; the .json matches its predecessor apart from id/prevId, as two prior data-only pairs do; no time_in_place survives on the branch. Consumer side read in SahajAtlasWeb. Preview answers 200, not signed into — no PREVIEW_ADMIN_EMAIL here.

🤖 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 1, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 1, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 1, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 1, 2026
The hazard behind the time_in_place sweep was told three times: the
migration header, the spec header and the src/globals/AGENTS.md block all
carried why additionalProperties: false refuses a later save, why the
versions table is swept, and which save escapes it.

AGENTS.md is the durable home — the next retirement is found there, not in
this migration. So the migration keeps only the load-bearing `?` guard and
points at the rule, and the spec keeps only what nothing else owns: its
schema isolation, and why it imports a migration's `up`.

Comment lines: 32 of 47 in the migration, now 19 of 34. No behaviour
change; both cases of atlas-drop-time-in-place.int still pass.

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

Copy link
Copy Markdown
Contributor Author

Pushed 8eb44e5. Both threads answered; the review's two threadless findings are fixed in the body.

Adopted — comment volume. One owner each: src/globals/AGENTS.md the rule, the migration its ? guard, the spec its schema isolation. 32 comment lines of 47, now 19 of 34.

Rebutted — a per-key migration where relaxing the group would do. A client read returns event_display verbatim, so relaxing would keep sending time_in_place to the widget in ten locales — the criterion #1057 names. Evidence in the thread.

Body fixed — "'deleted in its sync PR' names a PR that will not carry it": correct. contractSync regenerates types only. Filed sydevs/SahajAtlasWeb#354, blocked on #1057.

Body fixed — "Manual verification step 2 cannot fail": correct. Step 2 now points at the int spec that reproduces the refusal.

Green: lean gate and atlas-drop-time-in-place.int.

🤖 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 1, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 1, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review November 1, 2026 20:33
@sydevs-bot
sydevs-bot requested a review from Ardnived November 1, 2026 20:33
@sydevs-bot
sydevs-bot enabled auto-merge November 1, 2026 20:33
@sydevs-bot sydevs-bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 1, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Nov 2, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 2, 2026
Merged via the queue into main with commit 9d5ce2c Nov 2, 2026
49 of 51 checks passed
@sydevs-bot
sydevs-bot deleted the claude/chore-1057-drop-time-in-place branch November 2, 2026 00:34
@sydevs-bot sydevs-bot moved this from Pending to Done in SYDevelopers Technical Roadmap Nov 2, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 2, 2026
One conflict: `src/migrations/index.ts`, where #1059 and this branch each
added an import. Both kept, in timestamp order.

The merge leaves this branch's `20261030_203909_registration_refusals`
behind #1059's newer `20261101_191500_atlas_drop_time_in_place`, so the
newest snapshot no longer carries the collection and `migrate:create`
re-emits every statement of it. `20261102_012821_merge_1052_main_snapshot`
keeps that snapshot with no DDL, which heals the chain: replaying the two
`task_slug` enum values would abort the boot migration.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXjBYEEvGDHNLg5Zan
Ardnived pushed a commit to sydevs/SahajAtlasWeb that referenced this pull request Nov 2, 2026
Ardnived pushed a commit that referenced this pull request Nov 5, 2026
One conflict: `src/migrations/index.ts`, where #1059 and this branch each
added an import. Both kept, in timestamp order.

The merge leaves this branch's `20261030_203909_registration_refusals`
behind #1059's newer `20261101_191500_atlas_drop_time_in_place`, so the
newest snapshot no longer carries the collection and `migrate:create`
re-emits every statement of it. `20261102_012821_merge_1052_main_snapshot`
keeps that snapshot with no DDL, which heals the chain: replaying the two
`task_slug` enum values would abort the boot migration.

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

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1059 — 8eb44e5d Deployed Nov 1, 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.

chore(translations): drop the unused event.display.time_in_place atlas key

3 participants