Skip to content

Add a cloud session startup hook and fix a stale SQL test - #20

Merged
EmotiveImpact merged 3 commits into
mainfrom
claude/project-thread-0k29pd
Oct 12, 2026
Merged

EmotiveImpact merged 3 commits into
mainfrom
claude/project-thread-0k29pd

Conversation

@EmotiveImpact

Copy link
Copy Markdown
Owner

Requested by Edem · project thread

Before: every Claude Code cloud session began with no dependencies and PostgreSQL stopped, so tests needed a manual install and database setup first. infra/neon/tests/atomic_commune_details.sql also failed on its own.

After: cloud sessions start with the web app, local API and reminder worker dependencies installed, PostgreSQL running, and a disposable commune_dev database built from all migrations. The SQL test passes.

The hook only runs when CLAUDE_CODE_REMOTE=true, so local machines are unaffected.

How:

  • .claude/hooks/session-start.sh, registered in .claude/settings.json, runs a filtered pnpm install --frozen-lockfile. It then starts the container's cluster and creates a loopback-only commune superuser. On first run it applies bootstrap.sql, migrations 0001 to 0023 and after-core.sql to commune_dev, following infra/local/README.md. It also exports PG* and COMMUNE_DEV_DATABASE_URL for the session. An existing commune_dev is left alone.
  • The test expected SQLSTATE 28000 for anonymous commune creation, but create_commune has raised 42501 since 0001_commune_core.sql:157.

Verification in a cloud container:

  • The hook passed twice in a row, which shows it is safe to re-run.
  • The local API smoke suite passed against commune_dev on port 3005.
  • All 251 web tests passed.
  • atomic_commune_details.sql fails before this change and passes after it, run on a stub plus migrations 0001 to 0007.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TsrwEAZzSRz3fzyxfP8zso


Generated by Claude Code

The SessionStart hook installs the web, local API and reminder worker
dependencies, starts the container's PostgreSQL and builds a disposable
commune_dev database from bootstrap.sql, migrations 0001 to 0023 and
after-core.sql. It runs only in Claude Code cloud sessions.

atomic_commune_details.sql expected SQLSTATE 28000 for an anonymous commune
creation, but create_commune has raised 42501 since migration 0001.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TsrwEAZzSRz3fzyxfP8zso
@EmotiveImpact EmotiveImpact self-assigned this Oct 6, 2026
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
commune-web Error Error Oct 12, 2026 2:02am UTC

Copy link
Copy Markdown
Owner Author

The Vercel preview for commune-web reports Error on d25572b. I don't think this PR caused it, but that is my inference, not something I could confirm:

  • The diff only touches .claude/ and one SQL test file. None of that is part of the apps/web build.
  • vite build in apps/web passes on this exact commit in a clean checkout, and so does tsc --noEmit.
  • The deployment errored about 3 seconds after the push, which is too quickly for a build to have run.
  • PR Task handovers, skip reasons and announcements #19 has the same commit author and deployed fine.

The build logs need a Vercel login, which I don't have, so I can't see the actual error. Please open the deployment or redeploy it from Vercel. I'll fix it here if the logs show something in this diff.


Generated by Claude Code

Since migration 0011 an empty identity raises 28000 before create_commune
is reached, so main's expectation is the right one and this branch's older
change to 42501 is dropped.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ztcMYgKXTHtHy5mLuVbKK
@EmotiveImpact
EmotiveImpact marked this pull request as ready for review October 12, 2026 02:02
@EmotiveImpact
EmotiveImpact merged commit d11acb7 into main Oct 12, 2026
2 of 6 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T02:04:11.010890Z 57c1822 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch had an error being deployed

1 failed deployment
Preview — 57c1822d Deployed Oct 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants