Repository navigation
feat(atlas): prepare the final Atlas cutover - #1137
Conversation
- DIGESTS_ENABLED pauses SendDigests, off by default, so no imported manager gets a digest before the migration email. Temporary. - The Atlas importer stamps followUpSentAt on registrations whose session has started, so no feedback email asks about a legacy class. - public/atlas-moving.html, the page /cms redirects to during the freeze. - scripts/send-atlas-migration-email.ts and AtlasMigrationEmail: the one-off announcement to active Atlas managers, with a local ledger. - scripts/lib/payloadBoot.ts: the schema-safe boot the audit and the new script share. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🚅 Deployed to the SahajCloud-pr-1137 environment in sahajcloud
1 service not affected by this PR
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🤖 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
Judged against its own body. All five pieces are named there and joined by one operation, and three carry a shortcut: naming their deletion trigger. Nothing is larger than the cutover it serves, and no contract surface moves.
The one piece that outlives the cutover is the boot extraction, and it is the one to settle: scripts/AGENTS.md now claims a production-safety property for "an operator script" while four of them, the break-glass one included, still boot unsafely. The other gap is the body: it says nothing about the second commit.
Findings
- should-fix
scripts/lib/payloadBoot.ts:20— the new shared boot leaves four operator scripts outside it. - should-fix
seeds/atlas/sync/cli.ts:93— the Heroku stderr fix is in the diff, not in## Changes. - consider
seeds/atlas/sync/cli.ts:98— a failure to spawn reportsnull, not the ENOENT. - consider
src/jobs/Digests/featureFlag.ts:4— the second identical one-line flag module.
What was checked
Read whole on the branch: both new scripts, payloadBoot.ts, AtlasMigrationEmail.tsx, atlas-moving.html, plus SendDigests.ts, SendPostEventFollowUps.ts, middleware.ts and payload.config.ts.
Ladder, named answers found: not_equals: 'finished' is the repo's own spelling (atlasOverview/openItems.ts:367); the hand-rolled plural matches EventImportSummaryEmail.tsx:19; the transport guard holds, since the adapter is name: 'resend' (resendAdapter.ts:104); the stamp lands where the job reads it (SendPostEventFollowUps.ts:49), and an explicit null is absent to exists: false, so a session still ahead keeps its follow-up.
middleware.ts:118 matches /atlas-moving.html, but previewGate returns null off a Railway preview, so production serves it. The body publishes no preview link, so none was opened.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
- Unschedule SendDigests instead of the DIGESTS_ENABLED flag: one line to restore about a week after the cutover. - Rewrite the migration email for volunteers: it lists what each manager looks after the way an invitation does (ResponsibilityRows, now shared with InviteEmail), says what is new, and ends on a button to the admin and one to the new map. - Rewrite the holding page the same way, with the new map's features and a link to it. - ADOPTED_CLIENT_LEGACY_IDS: a re-sync only re-links the region of Sahaja Yoga Canada and syuk.org, whose sites serve live users, and keeps what SahajCloud gave them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`spawnSync` sets `status`, `stdout` and `stderr` to null when the CLI never ran, so a missing `heroku` binary reported `failed:\nnull\nnull` and buried the reason in `error`. Prefer `error.message` when it is set. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW4FCn952dMT17i5h3
`lib/payloadBoot.ts` makes its two callers safe to point at production, not
every operator script. The other five still boot through `getPayload({ config
})`, where `prodMigrations` applies pending migrations — `signin-link.ts`, run
in a production shell by design, among them.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjW4FCn952dMT17i5h3
Two jobs now carry a byte-identical one-line flag module, which reads as duplication. It is the deliberate shape: `vi.mock` is keyed by path and `src/jobs/index.ts` loads every job, so one shared module would make each job's integration spec restate every other job's flag. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW4FCn952dMT17i5h3
|
Addressed all four review findings. Adopted
Rebutted
Lean gate and 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
…s role Co-Authored-By: Claude Opus 5.5 <[email protected]>
…page; no admins Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s once The prose link hardcoded `cloud.sydevelopers.com` while the buttons came off `signInUrl`, so the email would name one host and link another as soon as either moved. The link now reads the host out of `signInUrl`. The `mailto:` had the same shape and takes `CONTACT_EMAIL`, which `docs/rules/email.md` names as the one address shown to a human. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW1mNU41VgYcGTZFh7
`import/order` refuses a blank line inside an import group, and the gate runs eslint at `--max-warnings 0`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW1mNU41VgYcGTZFh7
|
Addressed all four findings from the second review. No merge: already level with Adopted
Lean gate and 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
…change signin-link.ts, create-manager.ts and audit-region-slugs.ts booted with a plain getPayload, which under NODE_ENV=production applies every pending migration: break-glass run from a feature branch migrated production on the way to a link. All three now use loadPayloadWithoutSchemaChanges. The two preview-email scripts keep the dev push on purpose, and say so. Closes #1138 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@sydevs-bot review |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Third look, on 63bcfbd, asked for by hand. Judged against its own body, which names all eight pieces.
New since the last review is #1138 folded in: signin-link.ts, create-manager.ts and audit-region-slugs.ts now share loadPayloadWithoutSchemaChanges. Right call — break-glass was the script that most needed it, and scripts/AGENTS.md no longer claims a production-safety property four scripts lacked. Nothing here is larger than the cutover it serves, and no contract surface moves.
Three findings, all consider: a comment or a type promising more than the code delivers. Ladder: no named answer for anything new.
Findings
- consider
seeds/atlas/sync/merges.ts:128— aMapwhose values nothing reads; aSetplus the note says the same. - consider
seeds/atlas/helpers/registrations.ts:44—followUpSentAtgains a second writer; the sweep's docblock still says it has one. - consider
scripts/send-atlas-migration-email.ts:145— the role highlights and the listed rows count a manager's events differently.
What was checked
Read whole on the branch: payloadBoot.ts, send-atlas-migration-email.ts, atlas-migration-recipients.ts, merges.ts, registrations.ts, import.ts's clients loop, plus grantSummary.ts, SendPostEventFollowUps.ts, logField.ts and UserSubmissions/fields.ts.
Verified: no script outside the two preview ones still boots plainly (git grep getPayload scripts/), so the AGENTS.md claim now holds; 9c6aa71's reorder reads nothing from the manager it now precedes; summarizeGrants does cover clients, so a service manager's email is not empty (grantSummary.ts:209); an imported stamp misleads nobody, since the field is admin: { hidden: true }.
The body publishes no ## Preview link, so none was opened; Railway's own was still building.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
#1135's lifecycle work and #1121's class brief both landed while this branch moved ResponsibilityRows out of InviteEmail.tsx. Two conflicts, both kept whole: - src/emails/InviteEmail.tsx — main grew an EventBrief under each class item of the rows this branch moved to EmailLayout.tsx. The component, its two styles and the item.event call site move with the rows, so the invitation still carries the brief and the shared rows still live in the layout. Nothing else renders one: only invite.ts asks summarizeGrants for describeEvents. - docs/rules/email.md — both sides rewrote the template table. Took main's rows and put ResponsibilityRows back among EmailLayout's exports. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVJuj3U8ZvhK2zChe8
A Map<number, string> claimed the labels were data a reader could use. Nothing read a value: the importer calls .has(), the spec iterated keys. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVJuj3U8ZvhK2zChe8
The sweep's docblock claimed the stamp was written only after a successful send. The Atlas import writes it too, so a reader debugging an unsent follow-up would never look at the importer. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVJuj3U8ZvhK2zChe8
compose()'s docblock claimed the listed rows and the role highlights could not describe one manager differently. They can: holds counts only unfinished events, summarizeGrants walks the join and counts the rest. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVJuj3U8ZvhK2zChe8
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVJuj3U8ZvhK2zChe8
|
All three findings adopted. Merged Adopted
Merge (
Lean gate and 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Prep for the final legacy Atlas → SahajCloud sync and the
atlas.sydevelopers.com/cmscutover.Changes
SendDigestshasschedule: []and ashortcut:comment, so no imported manager gets a digest before the migration email. A follow-up PR puts back[{ cron: '0 7 * * *', queue: 'nightly' }]about a week after the cutover. The job and its tests are otherwise unchanged.followUpSentAtset (importedFollowUpSentAt), soSendPostEventFollowUpsnever asks about a legacy class, even after a reset wipes an earlier run's stamps.ADOPTED_CLIENT_LEGACY_IDS(sync/merges.ts): Sahaja Yoga Canada (Ticket #1: Sentry Integration and Production Environment Setup #1) and syuk.org (feat: implement Narrator collection (Issue #2) #12). Their sites serve live users. A re-sync only re-links their region, whichatlas-resetnulls, and keeps the label, managers, contact, roles, language and colour SahajCloud gave them. The re-link runs ahead of the manager lookup it reads nothing from, so a service whose Atlas manager the prune took still gets its region back.public/atlas-moving.html. The holding page/cms*redirects to during the freeze. Plain language, with the new map's headline features and a link to it. Deleted after the cutover.scripts/send-atlas-migration-email.ts+src/emails/AtlasMigrationEmail.tsx), the one-off "Welcome to the new Sahaj Atlas".ResponsibilityRows— now inEmailLayout.tsx, shared withInviteEmailso both describe a manager the same way. The "what's new" lines depend on the manager's role (cmsHighlights), followed by the map's highlights. It ends on two buttons, one to the admin and one to the map. The admin host is spelled once, insignInUrl, and the support address comes fromCONTACT_EMAIL.--preview <addr>or--send --force, and refuses a bulk send unless the transport is Resend. A local ledger makes a re-run send only the rest. It writes nothing to the database. Deleted after it goes out.scripts/lib/payloadBoot.ts: every script you may point at production boots without a schema change (fix(scripts): an operator script pointed at production migrates it #1138). A plaingetPayloadunderNODE_ENV=productionapplies every pending migration, so break-glass run from a feature branch would migrate production on the way to a link.signin-link.ts,create-manager.ts,audit-region-slugs.ts,audit-challenge-parents.tsand the email script all use the shared boot: no push, noprodMigrations, noonInit.preview-event-emails.tsandpreview-registration-emails.tskeep a plain boot on purpose. They only run locally, and the dev push keeps that database current; each says so in its docblock and inscripts/AGENTS.md.src/AGENTS.md. ThefeatureFlag.tsparagraph goes: with digests paused byschedule: [],ExpireEvents/holds the only flag module in the tree, and its reason now sits in that file.atlas:sync fetchfix. It now reads the captured backup id from the Heroku CLI's stderr as well as stdout. The CLI prints the id on stderr, so the fresh-capture path always threw.Testing
atlas-migration-recipients(selection and role-tailored highlights),atlas-registrations-data(importedFollowUpSentAt),atlas-sync(adopted clients),job-schedules,doc-citations.typecheck,typecheck:tests: all green.create-manager.tscreated a manager,signin-link.tsprinted its link, andaudit-region-slugs.tsreported. Then, underNODE_ENV=productionwith all 132 migrations pending,signin-link.tsandaudit-region-slugs.tsbooted andpayload_migrationsstayed unchanged.create-manager.tsstopped at its usage check before booting, but it shares the same boot.grep -n "getPayload({" scripts/*.tslists only the two preview scripts.ics-builder's LAST-MODIFIED case fails onmainlocally too (machine timezone).Closes #1138
🤖 Generated with Claude Code