CI
Overview
Claustrum CI runs a release-gate job on every pull request and on every push to main.
The job uses:
pnpmworkspace install/cachedocker compose(localdb profile)scripts/release-gate.shwithRELEASE_GATE_RESET_DB=true
Workflow
File:
.github/workflows/ci.yml
Triggers:
pull_requestpushonmain
Job:
release-gate(ubuntu-latest,timeout-minutes: 20)
Main execution flow:
- Checkout
- Setup pnpm + Node 20
pnpm install --frozen-lockfile- Prepare
.envfor CI defaults pnpm lintpnpm test./scripts/release-gate.sh(RELEASE_GATE_RESET_DB=true)- Always run compose cleanup:
docker compose ... down -v --remove-orphans
Docs Pages Workflow
File:
.github/workflows/docs-pages.yml
Build guardrails:
- Generates
/apps/docs-site/public/openapi.jsonfrom memory-core routes before docs build. - Validates generated spec (
pathsand endpoint stats) before publishing to Pages. - Docs build then uses Scalar API Explorer at
/api-explorer.html(/docs/apiredirects for compatibility).
Requirements before first successful deploy:
- Repository Settings → Pages must be enabled.
- Build and deployment source should be GitHub Actions.
If this is not enabled, deploy step may fail with:
Error: Failed to create deployment (status: 404)
Eval Comment Workflow
File:
.github/workflows/eval-comment.yml
Highlights:
- Runs context bundle eval on PR head (and optional base run + diff).
- Adds/updates sticky PR comment with score, failures, budget warnings, and diff summary.
- Runs MCP schema snapshot guard (
tools-schema.snapshot.test.ts) and reports status in the comment. - Uploads eval artifacts even when snapshot guard fails, then fails the job at the end.
Local Reproduction
Run the same gate locally:
RELEASE_GATE_RESET_DB=true ./scripts/release-gate.sh
Environment Handling
CI writes a local .env file from .env.example, then appends non-secret CI defaults:
DATABASE_URLMEMORY_CORE_API_KEYMEMORY_CORE_SEED_ADMIN_KEYNEXT_PUBLIC_MEMORY_CORE_URLGITHUB_APP_WEBHOOK_SECRET
No production secrets are committed or printed.
scripts/release-gate.sh also masks sensitive values in QC logs.
Failure Artifacts
On failure, CI uploads:
release-gate-logsartifact- source: last 200 lines of
memory-corecompose logs - masked for bootstrap password / API key-like tokens
Troubleshooting
- If CI fails before QC starts:
- check
pnpm install --frozen-lockfileand lockfile drift
- check
- If unit tests fail with
ERR_MODULE_NOT_FOUNDfor@claustrum/shared/dist/index.js:- ensure shared is built before
memory-coretests:pnpm --filter @claustrum/shared build
- current
memory-coretest script already includes this prebuild step by default
- ensure shared is built before
- If CI fails in bootstrap QC:
- ensure compose profile is
localdb - ensure
POSTGRES_DB,POSTGRES_USER, andPOSTGRES_PASSWORDare set to real values (not placeholder strings like<db_user>) - ensure
MEMORY_CORE_RUN_SEED=false(release-gate default) is effective
- ensure compose profile is
- If CI fails in webhook QC:
- confirm
GITHUB_APP_WEBHOOK_SECRETis present in compose env
- confirm
- If cleanup fails:
- run manual cleanup:
docker compose -f docker-compose.dev.yml --profile localdb down -v --remove-orphans
- run manual cleanup: