Skip to content

feat(meditations): a transcript collection, word list and normaliser - #957

Merged
sydevs-bot merged 13 commits into
mainfrom
claude/feat-952-meditation-transcripts
Oct 15, 2026
Merged

sydevs-bot merged 13 commits into
mainfrom
claude/feat-952-meditation-transcripts

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Transcripts get a place to live: one meditation-transcripts row per meditation, holding timed phrases in the same cue shape subtitles uses, readable by nobody but an admin.
  • One word list, glossary.json, decides Sahaja Yoga spellings, applied by a collection hook so no writer can store an uncorrected one. An entry names the base languages it holds for — en covers en-AU.

Nothing transcribes, imports or displays anything yet — children 2, 3 and 4 build on what this defines.

Change outline

Contract — the stored column

New collection, slug meditation-transcripts, hidden from the admin sidebar. Generated as MeditationTranscript and TranscriptSegments in src/payload-types.ts.

meditation-transcripts                   src/collections/MeditationTranscripts/MeditationTranscripts.ts
  meditation      relationship → meditations, unique, NOT required
  status          select, required, default queued   # queued · processing · completed · failed
  audioFilename   text                               # the meditations.filename it was requested for
  provider        select                             # lemonfox, and nothing else
  language        select over LOCALES, required      # closed union; the glossary keys on its base language
  outdated        checkbox, default false            # stored, written when the audio is replaced
  segments        jsonField TranscriptSegments, nullable
                    the subtitle cue, closed         # { content, startTimeMs, endTimeMs, durationMs? }
  error           textarea
  hooks.beforeChange → applyGlossaryToSegments

meditation is unique but not required on purpose: Payload makes a required relationship NOT NULL, and the FK is ON DELETE SET NULL, so hard-deleting a meditation would leave the row unsaveable. language is the opposite case — nothing nulls it, and a meditation's own locale is required: true, so every writer has one to pass.

Contract — one cue shape, not two

Subtitles and TranscriptSegments described the same thing in two shapes, which review round three settled on one. The cue literal lives in src/lib/utilities/subtitles.ts and is read in two modes:

subtitleCue = { content, startTimeMs, endTimeMs, durationMs? }
  z.looseObject  →  subtitles on Lessons ×2 and Videos   # a row written under an earlier shape stays saveable
  z.strictObject →  meditation-transcripts.segments      # one internal writer, so nothing is stranded

Closed here is what keeps word timings out. The cost: the cue takes any number where the old schema took nonnegative(), so the Lemonfox normaliser's clamp is the only guard left on a negative offset, and a case pins it.

Contract — four corrections against the reference branch

claude/feat-881-meditation-transcripts (PR #882, closed unmerged) is where the storage came from. Paraphrased, one rule per line:

-segments[].words: TranscriptWord[]        # 85% of the bytes, no consumer
+segments[] is the subtitle cue alone      # z.strictObject — unrepresentable, not merely unused
-TRANSCRIPT_PROVIDERS = ['lemonfox','sample']
+TRANSCRIPT_PROVIDERS = ['lemonfox']       # a failure is a `failed` row with an `error`
-outdated computed at render from a filename comparison
+outdated is a stored column               # a preview key prefixes filenames; the compare lied
-language: text
+language: required select over LOCALES    # free text, or none at all, would skip the pass

Behaviour — the glossary pass

applyGlossary(text, language)             src/collections/MeditationTranscripts/glossary.ts
  PASSES.get(baseLanguage(language))      # built once at module load from glossary.json
    absent → return text unchanged        # ru, uk, bg, el, hy, fa — no entry claims them
  one alternation, longest `heard` first  # no replacement's output feeds another's input
  (?<!\p{L}) … (?!\p{L}), flags giu       # `\b` is ASCII-only and would never anchor Cyrillic
  replace → written.get(match.toLowerCase())
    match starts \p{Lu} → capitalise it   # a lower-case `written` cannot strip a sentence opening

An entry's language is a list of base languages, seeded with the 12 written in Latin script: these are Sanskrit words, so French and Dutch want the spelling English wants. A region is unrepresentable — BaseLanguage is derived from LOCALES — so en serves en-AU and pt serves pt-BR rather than one variant being corrected while its sibling takes no pass at all. The six languages written in another script name none, which leaves room for a Cyrillic entry beside the Latin one rather than against it.

Six properties, each with a spec that goes red when it is removed: entries are filtered to the languages they name, a regional locale is corrected through its base, a Latin-script transcript is corrected like English, matching is whole-word, the single pass is order-independent, and a capital the heard word already carries survives.

Flow — how a phrase gets corrected

 payload.create / update  meditation-transcripts
+  applyGlossaryToSegments(data, originalDoc)   src/collections/MeditationTranscripts/hooks/applyGlossaryToSegments.ts
+    language = data.language ?? originalDoc.language   # a partial update carries none of its own
+    segments.map → applyGlossary(segment.content, language)
+      unchanged → the same object, and `data` returned untouched
   Ajv validates `segments` against TranscriptSegments
   row written

On the hook rather than at each writer, so children 2 and 3 both get corrected spellings without either remembering the call.

Files — where each module lives, and why

src/lib/meditations/transcript.ts            the shared model: statuses, providers, the zod shape, TranscriptView
src/lib/utilities/subtitles.ts               the one cue literal, read open and closed
src/lib/locales/index.ts                     baseLanguage + BaseLanguage — the one reduction, already needed for ISO labels
src/collections/MeditationTranscripts/
  MeditationTranscripts.ts                   the collection
  glossary.json                              the word list — plain data, 23 entries
  glossary.ts                                applyGlossary, pure and synchronous
  hooks/applyGlossaryToSegments.ts           the one hook
  lemonfox.ts                                normalizeLemonfoxResponse — no fetch in the module

The split is #952 §7's: transcript.ts has two consumers under src/ so it clears lib-boundary's one-consumer gate, while the glossary's single consumer means src/lib/ is not available to it. Nothing lives under seeds/, which the production build does not trace.

Preview

The collection is hidden and this PR ships no writer, so there is nothing to open on data — these two links are what a reviewer can confirm.

Data: not seeded. previewUrl.seed is unset for this repo, and no writer exists until child 2 — the empty list is the expected state, not a failed seed.

Migration

Two, applied in order. Neither the cue-shape change nor the base-language one adds a third: segments is a jsonb column, so its shape lives in the Ajv schema and the generated type rather than in the DDL, and glossary.json is a committed file the database never sees.

  • src/migrations/20261015_061054_meditation_transcripts.ts — creates meditation_transcripts and three enums, adds payload_locked_documents_rels.meditation_transcripts_id. No existing table is touched and no data is transformed. Reversible: down drops the table, the column and the three enums.
  • src/migrations/20261015_070852_require_transcript_language.ts — ALTER COLUMN "language" SET NOT NULL, from the first review round. Reversible: down drops the constraint.

Why the second one is stacked rather than folded into the first. A migration is applied the moment its branch is pushed, because Railway boots prodMigrations on every preview — and this branch has deployed. Regenerating the first migration would leave the preview holding its columns with no payload_migrations row naming the replacement, which crash-loops the boot (src/migrations/AGENTS.md, #633). The add-then-change churn is what that file prescribes instead.

One line was deleted from the first migration's generated down: DROP CONSTRAINT "payload_locked_documents_rels_meditation_transcripts_fk", which the DROP TABLE … CASCADE two statements above has already removed. tests/unit/migration-down-cascade.spec.ts rejects that generator shape, because it aborts the whole batch rollback (#682). Nothing else is hand-edited in either file.

Contract impact

src/payload-types.ts gains MeditationTranscript and TranscriptSegments, the latter as { content, startTimeMs, endTimeMs, durationMs? }[] | null — the same cue the three subtitles columns carry, so a consumer reading both reads one shape. MeditationTranscript['language'] is a required closed union rather than an optional one; this push regenerates that, which the round that made the field required did not. The base-language round changes no generated type: language is still the full LOCALES union on the column, and BaseLanguage is internal. contractSync re-syncs the file to WeMeditateWeb and SahajAtlasWeb in a bot PR after this merges — no consumer work here, and no re-sync child.

Test results

  • Lean gate: ✓ pnpm lint, pnpm typecheck, pnpm typecheck:tests, pnpm test:unit (183 files, 2402 cases)
  • Targeted spec: meditation-transcripts.int.spec.ts 7 passed
  • Contract step: ✓ pnpm generate:types run and committed; no migration owed (see above)
  • /security-review: run on the round that touched the collection's hooks/ path. No finding — the alternation is still built from a committed file through escapeRegExp, and the replacement is a function, so a $1 in a written value stays inert. The base-language round touches glossary.{ts,json}, src/lib/locales/, two specs and one doc, none of them a securityReview.triggerPattern path, so none was owed.
  • Build: N/A — Railway builds the preview

Every new assertion was watched failing before it was kept. This round: the two reduction cases (applyGlossary keyed on the raw locale again, both red) and the file's refusal of a region (en-AU put back in one entry, red).

Manual verification

  1. Sign in to the preview admin and confirm no "Meditation Transcripts" entry appears in the sidebar.

Notes for reviewer

  • The three question threads are answered and built. A: the separate collection stands unchanged. A: transcripts take the subtitle cue. A: a glossary entry names a list of languages. Each is one commit, and each thread carries the SHA.
  • A glossary entry names a language, never a locale. en covers every en-* and pt covers pt-BR, so no entry spells a region and applyGlossary reduces the transcript's locale before it looks up. Without that reduction an en-AU transcript took no pass at all — the silent skip a required language exists to prevent, by another route.
  • Adapting the stored shape to Lemonfox's {text,start,end} is answered on its thread, not built. It would re-split the one cue shape you settled on, and pin the column to a body Lemonfox publishes no schema for. That thread is open for your call.
  • glossary.json is the part worth a content owner's eye, especially fentanyl → fontanelle, which rewrites a real English word. It is in feat(meditations): a transcript collection, word list and normaliser #952's measured-facts table (1 occurrence against 10 correct spellings), and a meditation transcript is an unlikely place for the drug — but it is the one entry whose cost is not obvious. It applies in the 12 Latin-script base languages rather than one.
  • chakra, nadi, bandhan, puja and vibrations are in the list as the vocabulary record, not as corrections. They are inert passes today, and the capital-preserving rule is what makes a lower-case written safe to carry at all. void is still out: that rule answers an entry that strips a capital, never one that adds one, and void is the one subtle-system node label that is also an ordinary English word.
  • RESTRICTED_COLLECTIONS now holds an entry that is neither personal data nor credentials, and this PR widens its docblock's opening sentence to say so. The rest of that docblock stands: the set still fails open the day a sixth collection in no project is added, and it still records the real fix (invert step 4a) as deferred, not blocked. Not widened here.
  • The adversarial pass was /simplify (four lenses) plus /security-review, not pr-review-toolkit — no routine has that plugin.
  • Dismissed review findings, with reasons, are in the refactor: commit body. The four: deleting the unconsumed TranscriptView cluster (feat(meditations): a transcript collection, word list and normaliser #952 ## Interfaces names it as children 2–4's contract), moving transcript.ts into the collection folder (feat(meditations): a transcript collection, word list and normaliser #952 §7 decides it and counts the consumers), parsing glossary.json with zod at import (a malformed list would crash the CMS at boot; CI refuses the bad edit first), and dropping the integration validator case as duplicating the unit one (feat(meditations): a transcript collection, word list and normaliser #952 §8 asks for both).
  • One review finding is routed rather than built: escapeRegExp reaching this glossary from an event-quality module is refactor(utilities): move escapeRegExp out of the event-quality module #958, because the move touches five files across two unrelated areas.
  • feat(meditations): a transcript collection, word list and normaliser #952's ## Interfaces is now out of date in two places — the segment shape, and the glossary entry's language, which is a list of base languages. Children 2–4 read it, so it wants both edits before the next one starts.
Detail

Why the normaliser ships in this PR at all. #952 §6 assigns it here, and it is also what gives src/lib/meditations/transcript.ts its second consumer under src/. With only the collection importing it, tests/unit/lib-boundary.spec.ts fails — the check is consumers.length !== 1, so zero consumers passes and two pass, and exactly one does not.

Both word layouts reduce to the same answer. Lemonfox's verbose_json carries word timings either on each segment (WhisperX) or in one top-level list (OpenAI). Nothing stores them now, so the normaliser reads neither and both layouts produce identical cues. The spec asserts that equality rather than assuming it.

baseLanguage lives in src/lib/locales/, not beside the glossary. buildPayloadLocales already split a code to get its ISO 639-1 label, so putting the reduction there leaves one spelling of "the language a locale is a variant of" rather than two. BaseLanguage is a distributive conditional type over LocaleCode, so the set is exactly what LOCALES reduces to and cannot drift from it.

Fixture pre-mortem. The Lemonfox fixtures claim to be that verbose_json body; verified against the shape the normaliser declares in src/collections/MeditationTranscripts/lemonfox.ts, whose input is still seconds. The glossary spec assumes glossary.json is a flat array whose language lists are base languages — en, never en-AU — that every entry names en, and that none names ru; verified against src/lib/locales/index.ts, and the spec's last block asserts the shape rather than trusting it, in both directions.

The access case was rewritten mid-review. It first built its callers as object literals with invented ids. A caller the access layer cannot interpret is refused for the wrong reason, which is indistinguishable from a working restriction — the same vacuity the select/idOnlySelect() note guards against, one level up. It now uses testData.createManager and testData.createClient, and the removal of the RESTRICTED_COLLECTIONS entry was re-confirmed to turn it red afterwards.

Making language required rewrote three existing cases, and two of them needed it. They created a row carrying no language. The duplicate-meditation case and the segment-validator case would then have been refused for the missing language instead of the constraint under test — a pass for the wrong reason, which is the same vacuity as above. Each now passes language: 'en', and the refusal itself has its own case.

The word boundary is (?<!\p{L})…(?!\p{L}), not \b. JavaScript's \b is ASCII-only, so an entry in a Cyrillic or Greek language would silently never match — the failure containsPhrase documents in src/lib/eventQuality/heuristics.ts. It is load-bearing the day such an entry is filed, which the entry's language list is what makes possible.

The capital rule changes two existing entries' output, and that is the point. Fontanel now gives Fontanelle rather than fontanelle, and Bandhanas gives Bandhans. A sentence opening on a corrected word kept its capital by luck before only where written already carried one.

Closes #952

🤖 Generated with Claude Code

https://claude.ai/code/session_01PZGPtEhcE71EjUFhoxMhnB

A `meditation-transcripts` collection, one row per meditation, holding
timed phrases. Lifted from the unmerged `claude/feat-881-meditation-transcripts`
branch (PR #882, closed) with the four corrections #952 requires:

- `words` is gone from the stored schema. Word timings were 85% of the
  proposal's bytes and have no consumer — the player reports whole
  seconds. `z.strictObject` makes them unrepresentable rather than
  merely unused.
- `TRANSCRIPT_PROVIDERS` loses `sample`. A transcript that cannot be
  produced is a `failed` row with an `error`, never placeholder text
  wearing a provider's name (#897, success line 13).
- `outdated` is a stored column. The mark belongs to the moment the
  recording is replaced, and the render-time filename comparison it
  replaces is meaningless across environments, where a preview key
  prefixes them.
- `language` is a `select` over `LOCALES`. The glossary pass keys on it,
  and free text could hold a code no entry matches — disabling the pass
  silently.

`meditation` stays `unique` and not `required`: a required relationship
is NOT NULL, and hard-deleting a meditation nulls this column through its
foreign key, which would leave the row unsaveable.

The slug is named in `RESTRICTED_COLLECTIONS`. "In no project" means
shared, so without the entry the Atlas widget's browser key reads every
transcript — what happened to `managers` (#821) and `clients` (#822).
The integration case asserts it by reading back through
`overrideAccess: false`, with `idOnlySelect()` so a client read is
refused by access control rather than by the query-validation gate.

The Lemonfox normaliser ships beside the collection, so a live
transcription and the import of the existing library can share one. The
HTTP client stays with child 2.

One line is deleted from the generated migration's `down`:
`DROP CONSTRAINT "payload_locked_documents_rels_meditation_transcripts_fk"`,
which `DROP TABLE "meditation_transcripts" CASCADE` has already removed
two statements earlier. `tests/unit/migration-down-cascade.spec.ts`
rejects that generator shape — it aborts the whole batch rollback (#682).

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XC1CTQ5ZA82KL7FsUJHsAV
`glossary.json` is the list — plain data beside the collection, so a
change needs a GitHub account and no code review of logic (#897's
2026-10-13 Decision replaced the CMS global #883 proposed). `applyGlossary`
is the pure pass, and a collection `beforeChange` hook applies it to every
`segments[].text` on write, so the live transcription and the library
import both get corrected spellings without either calling it.

Three properties make the pass checkable, and each has a spec that goes
red when it is removed:

- Entries are filtered to the segment's own language first, so one
  language's spellings never reach another's transcript (success line 8).
  A language with no entries returns the text byte-identical.
- Matching is whole-word, which is what keeps `fontanel` from rewriting
  inside `fontanelle` — and that is what makes the pass idempotent.
- One alternation, longest `heard` first, so no replacement's output
  feeds another's input and the answer does not depend on row order.

The list is seeded from the repo's own `SUBTLE_SYSTEM_NODE_OPTIONS` and
the goal's measured-facts table. Two deliberate omissions, both because
the match is case-insensitive and a lower-case `written` would rewrite a
sentence-initial capital away:

- No entry for a word already written lower-case — `chakra`, `nadi`,
  `bandhan`, `puja`, `vibrations` need no correction, and an entry for
  each would lowercase every sentence opening with one.
- No entry for `void`, the one node label that is also an ordinary
  English word.

Capitalisation and endings only, never transliteration: `Anahat` and
`Anahata` are both accepted and both appear, so the list fixes each one's
capital rather than choosing between them.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XC1CTQ5ZA82KL7FsUJHsAV
Findings from /simplify's four lenses and /security-review. Behaviour is
unchanged except where noted.

- The int spec's access case built its callers as object literals with
  invented ids. A caller the access layer cannot interpret is refused for
  the wrong reason, which reads exactly like a working restriction — the
  same trap the `select` note already guards. It now uses
  `testData.createManager` and `testData.createClient`, and the case was
  re-confirmed red with the `RESTRICTED_COLLECTIONS` entry removed.
- `escapeRegExp` was a byte-identical copy of the exported one in
  `@/lib/eventQuality/heuristics`, which two specs already import for
  unrelated regexes. Import it.
- The word boundary is now `(?<!\p{L})…(?!\p{L})`, not `\b`. JavaScript's
  `\b` is ASCII-only, so an entry in a Cyrillic or Greek language would
  silently never match — the failure `containsPhrase` documents next door.
  The list is English-only today, so nothing changes yet.
- The glossary's per-language pass is built once at module load instead of
  memoised lazily. The static import means every language is known then,
  which removes the three-state map and the `passFor` indirection.
- The hook returns `data` untouched when no phrase changed, which is every
  write in the 18 locales the list has no entry for. It also moves to
  `hooks/applyGlossaryToSegments.ts`, matching the ten other collections
  that split hooks into a folder.
- `getLocaleOptions()` replaces a third hand-rolled spelling of the same
  locale mapping.
- A spread before `.filter().sort()` guarded against a mutation `filter`
  already prevents.
- Comments: cut a consumer list that was a moving target, a sentence that
  contradicted the schema below it, and four that narrated their own code.

Dismissed, with reasons:

- Delete `TranscriptView`, `TranscriptStatus`, `TranscriptProvider` and
  `TRANSCRIPTION_STALL_MS` as unconsumed. #952's `## Interfaces` block
  defines them as the contract children 2, 3 and 4 build against, and says
  none of it may change without updating them.
- Move `src/lib/meditations/transcript.ts` into the collection folder.
  #952 §7 decides this explicitly, counts the consumers, and says to move
  it only if the implementation collapses to one importer. It has two.
- Parse `glossary.json` with zod at import instead of casting. A malformed
  list would then crash the CMS at boot, and the file is meant to take
  edits from non-technical contributors. CI's unit lane refuses a bad edit
  before it can merge, which is the cheaper place for that failure.
- Drop the integration validator case as duplicating the unit one. #952 §8
  asks for both.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XC1CTQ5ZA82KL7FsUJHsAV
`docs/architecture.md`'s collection list and `tests/COVERAGE.md`'s
behaviour map are both read as complete, so a collection absent from
either reads as one that does not exist.

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

railway-app Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Oct 15, 2026 at 9:44 pm UTC
1 service not affected by this PR
  • mailpit

@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.

1 question for the reviewer, one per thread.

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


Generated by Claude Code

@sydevs-bot

sydevs-bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 21:32Z address-review · attempt 1 · session · done
  • 21:32Z address-review · attempt 1 · session
  • 18:22Z address-review · attempt 1 · session · done
  • 18:22Z address-review · attempt 1 · session
  • 17:37Z address-review · attempt 1 · session · done

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

@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

Holistic assessment

This PR is the size of its ticket. Six modules, each placement #952 §7 decides, nothing the ticket did not ask for.

One thing is worth seeing, and it is the ticket's call rather than this PR's: src/lib/meditations/transcript.ts sits in src/lib/ partly because lib-boundary refuses a one-consumer module, two of its three consumers import it for one type alias, and TranscriptView and TRANSCRIPTION_STALL_MS have no consumer until child 4. Children 2–4 earn it. Today it is structure a test rule chose.

The contracts hold. src/payload-types.ts gains two interfaces and one collections key, all additive, and no consumer enumerates collections exhaustively. The restriction is asserted by reading rows back through overrideAccess: false, the only shape that proves anything here.

Findings

  • should-fix — language is optional, so the glossary pass can be skipped silently (MeditationTranscripts.ts:63).
  • consider — escapeRegExp reaches a transcripts glossary from an event-quality module (glossary.ts:18).
  • consider — the RESTRICTED_COLLECTIONS docblock still opens on "personal data or credentials" (projects.ts:186).

What was checked

Read whole: the collection, glossary.{ts,json}, the hook, lemonfox.ts, transcript.ts, projects.ts, all three new specs. The glossary carries all 12 node labels but void, and every row of §5's table. Meditations.locale is required: true, unlike language. On the access case: createManager and createClient both tag collection, so no caller is refused for the wrong reason, and the manager is the one that goes red without the entry. WeMeditateWeb's getDocumentById narrows on its own union; SahajAtlasWeb enumerates nothing. Both preview links answer 200.

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


Generated by Claude Code

Comment thread src/plugins/access/config/projects.ts 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 Oct 15, 2026
An absent `language` disabled the glossary pass as silently as the
unmatchable free-text value correction (d) removed: the hook returns `data`
untouched and nothing marks the row. A meditation's own `locale` is
required, so every writer has one to pass.

Stacked rather than folded into the table's own migration: the branch has
already deployed to its Railway preview, where regenerating leaves the
columns without a `payload_migrations` row and crash-loops the boot
(src/migrations/AGENTS.md).

Three existing cases created a row with no language. Left alone, two of them
would have been refused for that reason instead of the one under test.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UDgXhmw8WvWNsN3RFehsqD
`meditation-transcripts` is neither personal data nor credentials, so the
opening sentence no longer described its own list.

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

Copy link
Copy Markdown
Contributor Author

Review round addressed: three threads closed, the glossary question still waits on you.

Gate green: lint, both typechecks, test:unit (2388), meditation-transcripts.int.spec.ts (7, up one). The new refusal was watched red first. /security-review re-run over both commits — nothing.

🤖 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 Oct 15, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review October 15, 2026 07:26
@sydevs-bot
sydevs-bot requested a review from Ardnived October 15, 2026 07:26
@sydevs-bot
sydevs-bot enabled auto-merge October 15, 2026 07:26
@antontcymbal

Copy link
Copy Markdown
Contributor

@Ardnived could you review this one when you have a moment? CI is green and the bot's review has been addressed. Only an approval is missing.

It's the first piece of #897 (meditation transcripts). The next piece, #953, builds the shared Lemonfox connection and can't start until this merges. #941 (intro subtitles for Path Steps, in the International App Admins milestone) plans to reuse that connection, so this PR unblocks both goals.

Comment thread src/lib/meditations/transcript.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Oct 15, 2026
sydevs-bot and others added 2 commits October 15, 2026 21:40
`en` covers every `en-*` and `pt` covers `pt-BR`, so a regional entry held
for one variant and left its siblings uncorrected. Entries now name 12 base
languages, and `applyGlossary` reduces the transcript's locale before it
looks up — an `en-AU` transcript takes English's pass rather than none.

`BaseLanguage` makes the regional code unrepresentable rather than merely
discouraged, derived from `LOCALES` so it cannot drift from it. The
reduction is `baseLanguage`, which `buildPayloadLocales` already needed for
its ISO label, so there is one spelling of it.

Two cases pin the new behaviour and one pins the file: `en-AU` and `pt-BR`
correct through their base, and no entry may spell a region. Each was
watched red first.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PZGPtEhcE71EjUFhoxMhnB
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-957 October 15, 2026 21:40 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Round four: one adopted, one pushed back. Pushed 273deb0.

  • Adopted — base languages only. An entry names en, never en-AU, and applyGlossary reduces the transcript's locale before it looks up. BaseLanguage is derived from LOCALES, so a region is unrepresentable. Without the reduction an en-AU row took no pass at all. Resolved.
  • Pushed back — adopting Lemonfox's shape. It re-splits the one cue shape you answered A on, and pins the column to a body Lemonfox publishes no schema for. Left open for your call.

Three assertions, each watched red first: the two reduction cases, and the file's refusal of a region.

Lean gate green, 2402 cases. meditation-transcripts.int.spec.ts 7 passed. No securityReview path touched this round.

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


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 15, 2026
@sydevs-bot sydevs-bot moved this from Revising to Approved in SYDevelopers Technical Roadmap Oct 15, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit ab219aa Oct 15, 2026
46 checks passed
@sydevs-bot
sydevs-bot deleted the claude/feat-952-meditation-transcripts branch October 15, 2026 22:05
@sydevs-bot sydevs-bot moved this from Approved to Done in SYDevelopers Technical Roadmap Oct 15, 2026
sydevs-bot added a commit to sydevs/WeMeditateWeb that referenced this pull request Oct 15, 2026
sydevs-bot pushed a commit that referenced this pull request Oct 15, 2026
Three conflicts, each one both sides adding an entry of their own, so
each keeps both.

`RESTRICTED_COLLECTIONS` now names six collections: this branch's
`event-imports` and main's `meditation-transcripts` (#957). Both reasons
stay in the docblock, and the count prose that said "exactly five" and
"a sixth" moves to six and a seventh — in `config/projects.ts` and in
`docs/rules/access.md`, which states the same set.

`src/lib/locales/index.ts` had no textual conflict at the real problem
and git merged a file that could not compile: both sides added a
`baseLanguage`, with different contracts. Main's is total over
`LocaleCode` and typed to `BaseLanguage`, which the glossary needs to key
a word list by language. This branch's accepts request-supplied input,
where `?locale=all` must not reach a language field. Main's keeps the
name and its two callers; the lenient one is `baseLanguageOrDefault` and
delegates to it, so there is one split and one validation. Its only
caller is the `defaultLanguages` default on `event-imports`.

`pnpm generate:types` leaves the merged `src/payload-types.ts` unchanged,
so the two generated halves composed correctly.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GChzoT89sR8wGLVoTNoUi7
Ardnived added a commit that referenced this pull request Oct 23, 2026
#957 added a glossary.ts importer of the old heuristics export after this
branch was cut, so the merge queue failed typecheck on every attempt.

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

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-957 — 273deb0f Deployed Oct 15, 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.

feat(meditations): a transcript collection, word list and normaliser

4 participants