Repository navigation
feat(pages): adopt versions.drafts.localizeStatus on Pages and AppCards, so a client can read per-locale publish state - #765
Conversation
Opt both collections into `versions.drafts.localizeStatus`, so `_status` lives in their `_locales` tables and `?locale=all&select[_status]=true` answers which languages a document is published in, in one query. WeMeditateWeb#81 needs that to emit an `hreflang` cluster that names only the locales it really has. The object form of `drafts` is required — `drafts: true` sanitises the flag back to false. The root `experimental.localizeStatus` key is already on main from #731, and is deliberately not written again here. The migration's DDL is drizzle-generated, matching #731's worked example: same enum types, same indexes moved onto `(_status, _locale)`, snapshot chain intact. The backfill between its two DDL blocks is hand-written, and the migration is wrong without it. As generated, the locale column is added with DEFAULT 'draft' and the base column is then dropped — so every already-published page lands draft in all 19 locales, and `pages` is read published-only by `wemeditate-web-client`. That deploy would unpublish the entire We Meditate site. #731 accepted the same outcome for the translations globals, where the blast radius was one config gate; it is not acceptable here. Copying the base value to every locale preserves exactly what is observable today, since a published page renders in all 19 locales through the English fallback. `down()` needs the mirror of it for the same reason. Proven on a scratch database built from origin/main's schema, seeded with published and draft rows, in its own migration batch: up() keeps the published page published in both locales and the draft page draft, and down() restores the base column with the published page still published. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
A field `afterRead` hook sees `_status` in whichever shape its collection stores it: a plain string without `localizeStatus`, a per-locale map with it. The bare `data?._status !== 'published'` check reads the map as "not published" and nulled `webUrl` / `appUrl` on every page the moment the flag went on — five cases in `pages.int.spec.ts` caught it. The map reaches this hook unresolved because Payload hoists a localized value down to the requested locale in the same afterRead field pass that runs this hook, so whether `_status` is already a string here depends on field order. Handling both shapes is the fix, not reordering fields. At `locale: 'all'` any published locale counts — the alternative nulls the field for every document on a `locale=all` read. The access `Where` in accessConfigs needs no change: it constrains `_status`, that column moved, and Drizzle scopes the same clause to the requested locale for free. Comment only, recording that it is now per-locale and load-bearing — with it removed, a read at `?locale=de` returns the German text of a locale the editor unpublished. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
Nine cases over the status map, the published-only gate, the consumer contract, the query count, and live preview's draft unlock. Checked against criterion 11 by removing `localizeStatus` from both collection configs and re-running: six of the nine go red, including every status-map case and the access leak. The three that stay green are genuinely flag-independent — an unpublished page is served in no locale either way, the query count is a property of the adapter, and live preview reads through `draft: true`. The two Czech `webUrl` cases in `pages.int.spec.ts` now publish the locale they read. They are about the path shape for a non-English locale, and creating a page `published` publishes the default locale alone — so without it they were asserting the publish gate by accident. A new case covers the gate itself, paired with an English assertion, because it would otherwise pass against the old bug that nulled the URL in every locale. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
The host-facing half of #718: what `?locale=all&select[_status]=true` returns, and the one rule for reading it — a locale is published only when it says so, and a never-translated locale is absent from the map rather than `draft`. Also records why there is no `publishedLocales` field, that `payload-types.ts` still types `_status` as a single string so a consumer casts, and that the published-only filter is now per locale. The OpenAPI `locale` parameter accepts `all` alongside the concrete codes, which it enumerated exclusively before. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
The Pages guide still described `publishSpecificLocale` as tracking `published_locale` in the versions table, which was the pre-flag behaviour. Replaces it with what a contributor now has to know, each item being something this branch tripped over: a field afterRead hook sees `_status` in two shapes and the map arrives unresolved, publishing a locale validates that locale's required fields so a missing title refuses the write, and the published-only filter is per locale. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
The published-only client filter is `{ _status: { equals: 'published' } }`,
and making `_status` localized scopes it per locale — but only for a
request naming one locale. At `?locale=all` the clause filters
*documents*, matching any document published in any locale, while the
response still carries every locale's value for every localized field.
Measured on this branch, not inferred: a page published in English,
published in German, then unpublished in German, read by a published-only
client at `?locale=all`, returned
`title: { en: 'Leak EN', de: 'Leck DE' }`. The German text is the last
thing published there, and the editor has since taken it down. Unpublishing
one locale leaves its text in the main table with `_status = 'draft'`,
which is exactly what makes it reachable.
This is new with the flag — before it, a locale could not be unpublished
on its own, so every locale of a published document was published.
A cross-locale read by such a client now answers which locales are
published and nothing else: `_status` and `id`. That is the documented
contract (`?locale=all&select[_status]=true`) and the one cross-locale
fact the client is entitled to. Content stays available one locale at a
time, where the clause gates it properly. Managers, the admin panel, and
live preview are untouched — the hook uses the same three conditions as
the access branch, so the two cannot disagree about who is restricted.
Redacting per field instead would mean walking each document against its
field tree — groups, named tabs, arrays, blocks — to find which values are
locale maps, and every gap in that walk is a leak. Keeping two keys cannot
leak.
Attached by `accessPlugin` off the collection's own config rather than a
slug list, so a third collection opting into `localizeStatus` is covered
the day it does.
BREAKING CHANGE: an API client reading a drafts-enabled collection at
`?locale=all` receives only `_status` and `id`. No current consumer does
this — the read was introduced by this branch.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MC6QJKbQazsJfVCZ6RcyUb
|
🚅 Deployed to the SahajCloud-pr-765 environment in sahajcloud
1 service not affected by this PR
|
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Shape is right, no bigger than the ticket: two config keys, a migration, and the two reads the moved column broke. The redaction is outside the ticket but earns its place — the leak is real and this branch introduces it.
The blocker is rollout. The backfill preserves status only for locale rows that exist, so a page never translated into a locale is unreachable there on deploy. The PR body and api-clients.md:202 say otherwise.
Findings
- blocker — untranslated locales 404 on deploy (migration).
- should-fix —
alldocumented on the geojson endpoint, not/api/pages. - consider — blunt redaction vs
fieldAccess.ts's field walk. - consider — comment volume in
publicUrlFields.
What was checked
#718's criteria; the diff minus the snapshot; accessConfigs.ts (collectionHasDrafts is true for both, so the redaction matches it); fieldAccess.ts; specFilter.ts (injects no locale); consumer cms-client.ts:316, sitemap-routes.ts:70 (reads en); the new spec reads no untranslated locale as a client
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The `isPublished` doc comment ran 19 lines for a 6-line function, most of it narrating the regression that caused it. A caller needs the rule — `_status` is a string or a per-locale map, handle both — and the reason the map can arrive unresolved, because that is what stops the next reader simplifying the check away. The history stays in PR #765, where it reads better than in the file. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QcPzYuzr3bfjA1n7mxL8LQ
`hasLocalizedStatus` has one caller, `withPublishedLocaleRedaction`, in the same file. Exported it read as a shared helper the rest of the access plugin could ask about a collection, which it never does. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QcPzYuzr3bfjA1n7mxL8LQ
Criterion 10 was met on `eventGeoJsonParameters`, which only `GET /api/events/geojson` uses — and `events` has no localized field, so `all` does nothing there. The collection reads a consumer actually calls documented no `locale` parameter at all: `injectClientReadParameters` injects select, populate, depth, limit and page, and nothing else. So `locale` joins that injected set, carrying the `_status` map contract, and the geojson parameter goes back to naming concrete locales. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QcPzYuzr3bfjA1n7mxL8LQ
The contract said "on existing data nothing changes: the migration carried every document's old status into all 19 locales". It carries it into every locale row that exists, and an untranslated locale has none — so the published-only filter, which is SQL and sees rows rather than the English fallback, drops that locale on existing data. Payload's own localizeStatus template behaves the same way: it UPDATEs locale rows, never inserts one. Also records `locale` joining the injected client read parameters. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QcPzYuzr3bfjA1n7mxL8LQ
The criterion-8 block covered a locale an editor unpublished, and the fallback case read with overrideAccess, so nothing exercised the published- only clause against a locale that has no row at all. That is the case with the rollout consequence: measured here, a client read at `?locale=de` of an English-only page returns 0 docs while `?locale=en` returns the page. Goes red with `localizeStatus` removed from Pages, as criterion 11 requires — checked by removing the key, not assumed. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QcPzYuzr3bfjA1n7mxL8LQ
|
3 adopted, 1 asked, 1 half open. Head Asked — untranslated locales 404 on deploy. Measured: an English-only page returns 0 docs at Adopted
Open — the field walk there. A spec now pins what a never-translated locale serves (e6e27f6). 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Resolves the only conflict, `src/migrations/index.ts`: both branches appended a migration. Kept both, in timestamp order — main's 20260909_161353_atlas_translations_by_view (#750) before this branch's 20260911_235823_pages_app_cards_localize_status. Their DDL is independent: one rewrites the Sahaj Atlas translations schema, the other moves `_status` into the pages / app_cards locale tables. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PBHRDEQqp6sryryeHTMXN4
…ize-status One conflict, src/migrations/index.ts, additive on both sides. Main added 20260912_031449_atlas_translations_seo_group (#769); this branch adds 20260911_235823_pages_app_cards_localize_status. Both register, in timestamp order, so both apply. src/plugins/openapi/customEndpoints.ts merged without conflict: main rewrote the /api/atlas/seo docs, this branch annotated eventGeoJsonParameters. The regions do not overlap and both survive. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ybi5nRF2U6i7rsRafMCRfa
|
Merged ⚠ Correction to my two earlier notes: the newest-by-timestamp snapshot is no longer this branch's file. It is main's
Gate green: lint, typecheck, typecheck:tests, 1812 unit tests. Integration: 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Ardnived's review on #765: read access to content across locales is not sensitive here — write, edit and delete are what the roles guard — and the filtering is a complication that would cost more going forward. So `withPublishedLocaleRedaction` is gone, and with it the accessPlugin wiring. A `?locale=all` client read now carries every locale's value again, including a locale the editor has unpublished. The per-locale published-only filter still gates an ordinary single-locale read, which is the gate a consumer actually goes through. The spec case that pinned the redaction is inverted rather than deleted, so the next reader meets the decision instead of re-deriving the gap and re-plugging it. The manager cross-locale case goes with it: it read with `overrideAccess: true` and only ever asserted the redaction spared managers. `docs/rules/api-clients.md` states the new contract. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_0191944fWtwUR1ZgnYhiCPPd
|
Review addressed, pushed Adopted — the cross-locale redaction is removed: Closed as moot — the blunt-vs-field-walk thread. Neither ships. Still open, and yours — Notes 1: an untranslated locale stops serving on deploy. Three ways out, none free, none pushed. Gate green on this head: lint, typecheck, typecheck:tests, 1812 unit tests, and 97 integration cases across 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Ardnived's review on #765 settled the open blocker: a 404 is the right answer when a locale is not published, and an English-only page must not fall back to German. So the migration stays as written — no backfill inserts the 19 missing locale rows, and no consumer restores the fallback. Only the framing changes. `docs/rules/api-clients.md` and the spec comment called the untranslated-locale case a rollout hazard a consumer had to adapt to first. Both now state the decision, so the next reader meets it instead of reading an open question and re-plugging the gap — the same treatment the cross-locale read got in 17f9df0. The assertions are untouched: a never-translated locale is absent from the status map and serves nobody, measured rather than argued. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HY8U5JaE2s2qNefv2a4mFx
|
Review addressed, pushed Settled, no code change — the untranslated-locale blocker. A 404 for an unpublished locale is the answer you want, so none of the three options ships: no 19-row backfill, no wait on WeMeditateWeb#81, no access change that would let an absent locale fall back. What did change is the framing. Gate green on this head: lint, typecheck, typecheck:tests, 1812 unit tests. The commit touches a doc rule and a comment only, so no integration file was re-run; CI covers the suite. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Ardnived asked for the 41 new keys to sit in their own section rather than inside `media`, with the WeMeditateWeb map updated to match. They now live in a `video` tab between Media and Location, and the `video_` prefix goes with them — the tab is what disambiguates `Off`, `Auto` and `Color` now, so the prefix would only repeat the tab name in every key. `media` goes back to describing the music player, cards, images and the embed popover. `media.a11y.volume` stays reused: it names the volume slider for both players, and duplicating it would ask 18 locales to translate one word twice. A new tab is two new columns, so this needs the migration the in-`media` version did not. The generated delta also re-emitted #765's `pages` / `app-cards` localizeStatus DDL, which the stale `20260912_031449` snapshot makes drizzle re-derive on every migration since — trimmed, since replaying it on production fails on a column that already exists. The committed snapshot carries that state, so the next migration stops re-deriving it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SxXsSwv1xCqgGFpy2DG3Ca
…#775) * feat(translations): CMS-owned labels for the We Meditate video player WeMeditateWeb renders Vidstack's `DefaultVideoLayout`, which ships its control labels in English and overrides them through `DefaultLayoutProps.translations`. Nothing upstream can be imported: `@vidstack/[email protected]` carries no locale data at all, and its resolver is `translations?.[word] ?? word`, so the English phrase is both the key and the fallback. The 35 labels this adds are the ones the site's player can actually render and the bank does not already carry. The keys are ours, not Vidstack's. Its keys ARE the English phrases — `Captions look like this` cannot be a CMS field name — so WeMeditateWeb owns a typed phrase-to-key map and this side owns the copy, extending the existing `media` tab rather than adding a video tab of its own. What is left out, measured against the package rather than assumed: - Seven labels the bank already renders (`media.a11y.play`, `pause`, `mute`, `unmute`, `volume`, `blocks.a11y.enter_fullscreen`, `exit_fullscreen`). The map points at those, so no locale translates the same word twice. - Nine of the 56 the player cannot reach without a loader, a prop or a live stream it does not configure: AirPlay, Google Cast, Connected, Connecting, Disconnected, Download, LIVE, Skip To Live, Chapters. - Five the DEFAULT layout never renders in any configuration, which the ticket had counted as reachable. `Loop` and `Playback` appear nowhere in `vidstack-default-components.js`; `Disabled` appears only in the Plyr layout; `Replay` and `Continue` only in `DefaultAudioTitle`, part of `DefaultAudioLayout`, and the site mounts the video layout (`VideoPlayer.tsx:219`). `translations` is `Partial<>`, so anything left out keeps Vidstack's English and enabling one of those features later adds its key then. The split follows the tab's own rule rather than the buttons: a word goes in `a11y` only where the layout uses it as an `aria-label` and never shows it. Three do — `Fullscreen`, `PiP` and `Seek` name the fullscreen button, the picture-in-picture button and the progress bar, while their tooltips show different words. The rest are menu rows, section headings or tooltip text, all of which a viewer reads. No migration. Each leaf group is one localized JSON column, and these are keys inside `media_general` and `media_a11y`, so only the column's JSON Schema changes. Confirmed rather than reasoned: `db:migrations:create` against a scratch database generated no statement naming `wm_web_translations` (what it did generate was unrelated drift from #765, and was discarded). Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QwYeXRpYvR37oWay2CMaCX * fix(translations): six visible video tooltips leave the a11y bank The PR reused seven bank keys for words Vidstack renders. Measured against @vidstack/[email protected], six of those are visible tooltip text, not screen-reader-only copy: - DefaultPlayButton: tooltip content is Play/Pause - DefaultMuteButton: tooltip content is Mute/Unmute - DefaultFullscreenButton: tooltip content is Enter/Exit Fullscreen Every media.a11y description opens "Not shown on screen; read by screen readers", so reusing those keys tells a translator the opposite of the truth. blocks.a11y.enter_fullscreen is worse still: it names the subtle-system diagram's button, and its English is lowercase. So six video_ keys move into media.general, phrased like their siblings. Only media.a11y.volume stays reused, and it is genuinely aria-only — DefaultVolumeSlider passes it as aria-label and renders no tooltip. Fullscreen, PiP and Seek stay in a11y for the same measured reason. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01To5QDnbhw3RcvrxXe1fK7W * fix(translations): the video player's strings get their own tab Ardnived asked for the 41 new keys to sit in their own section rather than inside `media`, with the WeMeditateWeb map updated to match. They now live in a `video` tab between Media and Location, and the `video_` prefix goes with them — the tab is what disambiguates `Off`, `Auto` and `Color` now, so the prefix would only repeat the tab name in every key. `media` goes back to describing the music player, cards, images and the embed popover. `media.a11y.volume` stays reused: it names the volume slider for both players, and duplicating it would ask 18 locales to translate one word twice. A new tab is two new columns, so this needs the migration the in-`media` version did not. The generated delta also re-emitted #765's `pages` / `app-cards` localizeStatus DDL, which the stale `20260912_031449` snapshot makes drizzle re-derive on every migration since — trimmed, since replaying it on production fails on a column that already exists. The committed snapshot carries that state, so the next migration stops re-deriving it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SxXsSwv1xCqgGFpy2DG3Ca * docs(globals): name the Video tab in the Web tab list Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SxXsSwv1xCqgGFpy2DG3Ca --------- Co-authored-by: Claude <[email protected]>
Summary
pagesandapp-cardsnow store_statusper locale, so one read answers which languages a document is published in.GET /api/pages?locale=all&select[_status]=truereturns{ "en": "published", "de": "draft" }— thehreflangcontract WeMeditateWeb#81 is blocked on.Changes
src/collections/{Pages,AppCards}—versions.drafts.localizeStatus: true, object form (drafts: truesanitises the flag back to false).src/fields/publicUrlFields.ts— the publish gate reads a per-locale map as well as a string. Without this,webUrl/appUrlreadnullon every page.src/plugins/openapi/clientReadParametersDocs.ts—localejoins the injected client read parameters, documentingalland the status map on every collection list and findByID GET.docs/rules/api-clients.md— the contract a consumer reads, including whatlocale=alldoes and does not gate, and that an unpublished locale is meant to serve nothing.Preview
Migration
src/migrations/20260911_235823_pages_app_cards_localize_status.ts_statusmoves frompages/app_cardsinto their_localestables, andversion__statuslikewise for both_vtwins. Indexes move onto(_status, _locale). Data is preserved by a hand-written backfill, for every locale row that exists — see Notes 1 for the locales that have none.down()restores the base column and backfills it from the locale rows (published in any locale ⇒ published). Run on a scratch database, not just written.Test results
30ed58b: ✓pnpm lint,typecheck,typecheck:tests,test:unit(1812 unit tests). That commit changes a doc rule and a spec comment only, so no integration file was re-run.17f9df0: ✓pnpm lint,typecheck,typecheck:tests,test:unit(1812 unit tests)17f9df0:pages-localize-status(11 cases),pagesandrole-based-access(86) — 97 integration cases green08bd6c1—app-status-readiness,app-cards-for-audience,api,collections-smoke,available-locales,client-query-validation,atlas-seoamong themManual verification
curl "$URL/api/pages?locale=all&select[_status]=true"with awemeditate-web-clientkey — confirm the map, and that a locale you just unpublished readsdraft.curl "$URL/api/pages?locale=de&select[title]=true"for a page whose German you just unpublished — confirm it returns nothing. That single-locale read is the publish gate;?locale=allis not.app-cardsin the WeMeditate App group.Notes for reviewer
1. Settled: an untranslated locale stops serving on deploy, and that is intended (30ed58b). The backfill copies each document's old
_statusinto every locale row that exists. A locale nobody has translated has no row, so nothing lands there, and the published-only clause is SQL — it matches rows, not the English fallback. Measured on this branch: an English-only published page returns 0 docs to awemeditate-web-clientat?locale=de, and the page at?locale=en. WeMeditateWeb'sgetPageBySlug(server/cms-client.ts:316) reads at the visitor's locale and 404s on an empty result, so a German visitor to an English-only page gets a 404 the day this deploys. This fires on existing data, not on a deliberate unpublish.Ardnived's review settled it: that 404 is correct, and an English-only page should not fall back to German. So no code changed, and none of the three options I had raised ships — no 19-row backfill, no wait on WeMeditateWeb#81, no
accessConfigs.tschange that would let an absent locale fall back. What changed is the framing:docs/rules/api-clients.mdand thepages-localize-status.int.spec.tscomment stated it as an open hazard a consumer must adapt to, and now state the decision, so the next reader meets it instead of re-plugging the gap. The assertions are untouched — a never-translated locale is absent from the map and serves nobody, measured rather than argued.2. The migration is not purely drizzle-generated.
src/migrations/AGENTS.mdsays to default against augmenting a generated migration and to surface a backfill rather than decide it. As generated, the locale column is addedDEFAULT 'draft'and the base column is then dropped, so every already-published page landsdraftin all 19 locales — andpagesis read published-only bywemeditate-web-client, so that deploy takes the live We Meditate site dark until an editor re-publishes every page by hand. #731 accepted exactly this for the translations globals, where the blast radius was one config gate; it is not transferable here. The backfill sits between the two generated DDL blocks (the base column must still exist) and copies its value to every locale. Tell me to strip it if you disagree.3. Settled: the cross-locale redaction is gone (17f9df0). An earlier revision narrowed a published-only client's
?locale=allread to_statusandid. Ardnived's review removed it — read access to this content is not sensitive, only write, and the filtering would cost more going forward. So a cross-locale read now carries every locale's value, including a locale the editor has taken down. The per-locale published-only filter still gates an ordinary single-locale read, which is the read a consumer makes.pages-localize-status.int.spec.tspins the accepted behaviour rather than dropping the case, so the next reader meets the decision instead of re-deriving the gap and re-plugging it.Criterion 5 needs one correction to the ticket's wording: a never-translated locale is absent from the map, not
'draft'.docs/rules/api-clients.mdstates the rule consumers must use — a locale is published only when it says so.Detail
Why
?locale=allcarries every locale, and why that is now deliberate. The access clause filters documents — it matches a document published in any locale — while the response still carries every locale's values. A probe confirmed it: a published-only client read returnedtitle: { en: 'Leak EN', de: 'Leck DE' }where the German title had been published and then withdrawn./security-reviewreached the same finding independently, tracing@payloadcms/drizzle'sgetTableColumnFromPath, which omits the_localeconstraint whenlocale === 'all'. The finding is real; the review's answer is that it does not matter for this data, and the redaction that closed it has been removed. Recorded here rather than deleted, because the next person to readaccessConfigs.tswill find the same gap.The untranslated-locale case was missed by a spec that passed. The criterion-8 block covered a locale an editor unpublished, and the fallback case read with
overrideAccess: true, so nothing exercised the published-only clause against a locale with no row at all. That is the case carrying the rollout consequence, and it went unasserted while every neighbouring case was green. It now goes red whenlocalizeStatusis removed from Pages — checked by removing the key, not assumed.Criterion 11, checked rather than assumed. Removing
localizeStatusfrom both collection configs and re-running turns 6 of the 9 original cases red, including every status-map case. The 3 that stay green are genuinely flag-independent: an unpublished page is served in no locale either way, the query count is a property of the Postgres adapter, and live preview reads throughdraft: true. Those are controls, not coverage.Criterion 10 was met on the wrong parameter. The first revision widened
eventGeoJsonParameters, which onlyGET /api/events/geojsonuses — andeventshas no localized field, soallis inert there. MeanwhileinjectClientReadParametersinjectedselect,populate,depth,limitandpageonto every collection read and nolocaleat all, so the endpoints a consumer actually calls documented nothing.localenow joins that injected set and the geojson parameter is back to concrete codes.Criterion 7, no fan-out. A 25-row list at
locale=allis one SELECT plus Payload's pagination COUNT, counted at the pg pool. This is why there is nopublishedLocalesfield: a collectionafterReadcomputing one cannot see the other locales (the field afterRead pass hoists them away first) and would have to re-read each row atlocale: 'all'.Criterion 3, proven on main's schema with data. A scratch database was built from
origin/main's migration chain in its own batch, seeded with a published page and a draft page each havingenanddelocale rows, then this migration applied as a second batch.up(): the published page ispublishedin both locales, the draft pagedraftin both.down()(after unpublishingdeby hand): the base column returns with the published page stillpublished. Notepnpm payload migrate:downrolls back a whole batch, which is why the two-batch setup was necessary to test this migration alone.publicUrlFieldswas a live regression, not a speculative one — five existing cases inpages.int.spec.tswent red. A fieldafterReadhook sees_statusin either shape, and the map arrives unresolved because Payload hoists a localized value down to the requested locale in the same pass that runs the hook, so field order decides. The two CzechwebUrlcases now publish the locale they read, because they are about path shape, not publish state; a new case covers the gate itself, paired with an English assertion, because it would otherwise pass against the old bug that nulled the URL in every locale.payload-types.tsis unchanged, and that is expected — Payload generates the resolved single-locale shape for_status, not thelocale=allmap. Consumers cast. Recorded indocs/rules/api-clients.md.Rejected: Payload's own
localizeStatusmigration helper (payload/migrations). It reconstructs per-locale truth from_pages_vhistory instead of copying the base column. Two reasons against it: it creates the columns asVARCHARrather than the enum types drizzle's snapshot declares, which drifts the snapshot chain the nextmigrate:creatediffs against; andpublished_localeis NULL for every row written before this flag, which its own algorithm reads as "published in all locales" — the same answer the simple backfill gives, for this data. Note it shares the property in Note 1:migrateMainCollectionStatusonlyUPDATEs<table>_localesrows, so an untranslated locale is left without a status there too.Dismissed review finding.
/security-reviewflagged thatWeMeditateAppStatus/sections/{pages,shared}.tscompare_status === 'published'as a string and would now compare against an object. They read at a concrete locale, never'all', so_statusstill resolves to a string — andapp-status-readiness.int.spec.tspasses. The check's own description ("published for this locale") becomes more accurate, not less. No change made.Collection counts confirmed against
src/collections/*rather than trusted from the ticket table:pages2 localized fields,app-cards9, andmeditations/clients/events/regions0 — so two collections opt in, as the ticket says.Review coverage.
/pr-review-toolkit:review-pris not available in this environment, so the six-lens pass did not run./security-reviewdid run and was required at the time (src/plugins/access/matchessecurityReview.triggerPattern); its one HIGH finding was fixed in08bd6c1and then reversed by review in17f9df0— Notes 3./simplifydid not run.Closes #718
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code