You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`pnpm --filter @atlas/db db:generate` with `DATABASE_URL` already set
38
+
-`pnpm --filter @atlas/db db:check` with `DATABASE_URL` already set
39
+
-`pnpm --filter @atlas/db db:migrate` with `DATABASE_URL` already set
40
+
35
41
## Prompt Improvement Loop
36
42
37
43
Atlas treats prompt changes as product behavior changes. Use the live eval harness to iterate on prompts deliberately instead of editing blind.
@@ -79,7 +85,7 @@ Notes:
79
85
## Environment
80
86
81
87
Copy `.env.example` into `apps/web/.env.local` for local development and provide real values through your deployment environment for hosted runs.
82
-
For local-only test credentials, prefer `apps/web/.env.test.local`, which is gitignored and loaded by the Next app, Drizzle config, and integration test runner.
88
+
For local-only test credentials, prefer `apps/web/.env.test.local`, which is gitignored and loaded by the Next app and integration test runner.
83
89
84
90
-`DATABASE_URL`: Postgres connection string
85
91
-`APP_BASE_URL`: canonical deployed app origin used when generating Google Calendar connect links
@@ -98,6 +104,8 @@ To register the production Telegram webhook once those values are set, also expo
98
104
99
105
For hosted rollout steps, use [`docs/workflows/production-deploy-checklist.md`](docs/workflows/production-deploy-checklist.md) as the main production deploy runbook and [`docs/workflows/vercel-telegram-webhook.md`](docs/workflows/vercel-telegram-webhook.md) for the narrower webhook-only setup flow.
100
106
107
+
Production schema changes are not applied from local laptops. Merge to `main`, let the GitHub Actions migration workflow apply `packages/db/drizzle/` against the production database, and only release after that workflow succeeds.
108
+
101
109
Atlas no longer exposes public planner/debug mutation routes. The intended externally reachable surfaces are:
Copy file name to clipboardExpand all lines: docs/current-work.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,8 @@
5
5
Atlas is a schedule-forward, Google-calendar-gated product with a working mutation pipeline.
6
6
Current implementation focus: replace transcript-heavy conversation memory with an explicit conversation-state layer. Atlas now persists a user-scoped conversation snapshot with transcript, summary, entity registry, and discourse state so reference resolution can anchor on known objects instead of reconstructing intent from recent turns alone. Recent work still includes the prompt-asset cleanup, expanded live eval coverage around ambiguous routing and confirmed-mutation recovery, a consolidated `pnpm eval:all` loop plus suite-specific eval reports and prompt-improvement briefs for prompt iteration, chat-first prompt/docs framing, and consistent `referenceTime` threading through scheduling.
7
7
8
+
DB rollout hardening is now part of the active release path: `packages/db` owns all Drizzle commands and config, root-level DB command aliases are removed, and production migrations are expected to run from GitHub Actions before Vercel production release.
Copy file name to clipboardExpand all lines: docs/workflows/production-deploy-checklist.md
+27-8Lines changed: 27 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,16 @@ Set these in the Vercel project for the target environment before deploying:
43
43
-`GOOGLE_LINK_TOKEN_SECRET`, `GOOGLE_CALENDAR_TOKEN_ENCRYPTION_KEY`, and `CRON_SECRET` should be unique per environment.
44
44
-`GOOGLE_CALENDAR_TOKEN_ENCRYPTION_KEY` must be a base64-encoded 32-byte key.
45
45
-`TELEGRAM_ALLOWED_USER_IDS` is required in all environments. The app should not boot without it.
46
+
- Vercel Preview and Vercel Production must use different `DATABASE_URL` values. Preview must not point at the production database.
47
+
48
+
## GitHub Actions migration secret
49
+
50
+
Set the production database connection string in GitHub Actions secrets as `DATABASE_URL_PRODUCTION`.
51
+
52
+
- This secret is for the hosted migration workflow, not for Vercel runtime configuration.
53
+
- The migration workflow maps `DATABASE_URL_PRODUCTION` to `DATABASE_URL` only inside the job that runs `pnpm --filter @atlas/db db:check` and `pnpm --filter @atlas/db db:migrate`.
54
+
- Keep the production secret scoped to the repo or environment that owns production releases.
55
+
- In GitHub branch protection or rulesets, mark `Apply DB Migrations / apply-db-migrations` as a required status check for the production release path.
46
56
47
57
## Pre-deploy checks
48
58
@@ -55,18 +65,25 @@ Set these in the Vercel project for the target environment before deploying:
55
65
56
66
1. Review the pending migration files under `packages/db/drizzle/`.
57
67
2. Confirm the migration set matches the code being deployed.
58
-
3. Apply migrations to the target database before or alongside the app deploy, but do not leave the database halfway between expected schema versions.
59
-
4. If the environment has known partial-state risk, verify the release migration is safe to rerun or has an explicit recovery plan.
60
-
61
-
Atlas does not yet have a fully documented hosted migration runner. For now, production releases must include an explicit operator-applied migration step.
68
+
3. Confirm the database commands are run only through `packages/db`:
- or the equivalent `pnpm --filter @atlas/db ...` form with `DATABASE_URL` already set
73
+
4. Merge the release to `main` and let [`.github/workflows/apply-db-migrations.yml`](/Users/maxlin/Code/Atlas/.github/workflows/apply-db-migrations.yml) run against `DATABASE_URL_PRODUCTION`.
74
+
5. Do not apply production migrations from a local shell. The GitHub Actions migration workflow is the only supported production migration runner.
75
+
6. Confirm the migration workflow succeeds before starting or approving the production Vercel release.
76
+
7. If the environment has known partial-state risk, verify the release migration is safe to rerun or has an explicit recovery plan.
62
77
63
78
## Deploy
64
79
65
80
1. Push the release branch and confirm the intended commit SHA.
66
-
2. Verify the Vercel project uses `apps/web` as the Root Directory and can access workspace files outside that directory.
67
-
3. Confirm the target Vercel environment has all required env vars.
68
-
4. Deploy the intended commit to Vercel.
69
-
5. Confirm the deployment is healthy before switching any production traffic assumptions to it.
81
+
2. Merge the intended commit to `main`.
82
+
3. Verify [`.github/workflows/apply-db-migrations.yml`](/Users/maxlin/Code/Atlas/.github/workflows/apply-db-migrations.yml) passed on that `main` commit before promoting any production deploy.
83
+
4. Verify the Vercel project uses `apps/web` as the Root Directory and can access workspace files outside that directory.
84
+
5. Confirm the target Vercel environment has all required env vars, including separate Preview and Production `DATABASE_URL` values.
85
+
6. Deploy the intended `main` commit to Vercel Production.
86
+
7. Confirm the deployment is healthy before switching any production traffic assumptions to it.
1. Confirm removed public planner/debug routes are still unavailable.
123
140
2. Confirm linked-account reads do not expose raw Google access or refresh tokens.
124
141
3. Confirm Vercel logs do not expose webhook secrets, cron secrets, link tokens, or decrypted Google credentials.
142
+
4. Confirm the production deploy commit has a successful `apply-db-migrations` GitHub Actions run attached to it.
125
143
126
144
## Rollback notes
127
145
128
146
- If the app deploy is bad but the schema is still compatible, roll traffic back to the last known good deployment.
129
147
- If a migration is not backward-compatible, do not assume app rollback alone is sufficient.
148
+
- If the migration workflow fails, do not continue with production deploy until the workflow is fixed or the migration issue is explicitly recovered.
130
149
- If Google OAuth is failing after deploy, first verify `APP_BASE_URL`, `GOOGLE_OAUTH_REDIRECT_URI`, and the Google Cloud OAuth client configuration all match exactly.
131
150
- If Telegram delivery fails after deploy, verify webhook registration, secret-token alignment, and Vercel route health before changing app code.
- Vercel only hosts the protected cron endpoints. Scheduled follow-up dispatch and Google Calendar reconciliation now come from GitHub Actions via [`.github/workflows/send-followups.yml`](/Users/maxlin/Code/Atlas/.github/workflows/send-followups.yml) and [`.github/workflows/reconcile-google-calendar.yml`](/Users/maxlin/Code/Atlas/.github/workflows/reconcile-google-calendar.yml), not from Vercel Cron Jobs.
78
+
- Production database migrations are owned by `packages/db` and are applied by [`.github/workflows/apply-db-migrations.yml`](/Users/maxlin/Code/Atlas/.github/workflows/apply-db-migrations.yml), not by ad hoc local commands or Vercel deploy hooks.
76
79
- Do not log the webhook secret in Vercel function logs or error output.
77
80
- Keep the route handler thin and continue moving persistence and planning behavior into workspace packages.
78
81
- After the first Vercel smoke test, the next backend milestone is replacing the `processInboxItem` stub with planner-owned persistence that reads canonical `inbox_items`, creates validated `tasks`, and records `planner_runs` as operational audit state.
79
-
- End-to-end deployability is not fully hardened yet. Follow-up work should add a hosted migration-apply workflow, rename or replace any misleading generate-only migration commands, and document a repeatable production deploy checklist that covers schema application, deployment, webhook registration, and post-deploy verification.
"packages/db/drizzle.config.ts requires DATABASE_URL in the environment. Run Drizzle commands from packages/db or via `pnpm --filter @atlas/db ...` with DATABASE_URL already set."
0 commit comments