Skip to content

fix(dev): fill sync.* config placeholders in backend bootstrap - #2757

Open
tyler-dane wants to merge 1 commit into
mainfrom
cursor/setup-dev-environment-c8fa
Open

fix(dev): fill sync.* config placeholders in backend bootstrap#2757
tyler-dane wants to merge 1 commit into
mainfrom
cursor/setup-dev-environment-c8fa

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

Summary

While setting up the development environment I found that .cursor/bootstrap-backend.sh was stale relative to the current compass.example.yaml. The example config now ships a required sync: block with REPLACE_WITH_SYNC_MONGO_PASSWORD and REPLACE_WITH_SYNC_INTERNAL_AUTH_TOKEN placeholders, but the bootstrap script only filled the older backend, supertokens, and mongo.uri values. The config validator (packages/core/src/config/compass.config.ts) rejects any remaining REPLACE_WITH_ value, so both bun run dev:web and bun run dev:backend aborted at startup with:

Compass config file /workspace/compass.yaml contains unfilled placeholder values.
Replace the following fields with real values:
  - sync.mongoUri
  - sync.internalAuthToken

This PR:

  • Fills sync.mongoUri (an isolated compass_sync database on the same local single-node replica set) and sync.internalAuthToken in bootstrap-backend.sh, reading optional SYNC_MONGO_URI / SYNC_INTERNAL_AUTH_TOKEN env overrides with safe local defaults.
  • Documents the new env vars, the sync.mongoUri replica-set requirement, and the expected/harmless sync-change-feed ... unavailable warnings (logged when the optional dev:sync service isn't running) under ## Cursor Cloud specific instructions in AGENTS.md.

No application code changed; compass.yaml remains gitignored.

Simplicity

Minimal: two additional sed substitutions plus one default variable, mirroring the existing pattern in the script. Documentation updates only in AGENTS.md.

Automated validation

  • bun lint — passes (12 pre-existing warnings, exit 0).
  • bun test:core — 549 pass.
  • bun test:web — 2173 pass.
  • bun test:backend — 300 pass, 1 skip (in-memory Mongo auto-started).
  • bun run dev:backendGET /api/health returns 200 {"status":"ok"} with Mongo connected.
  • bun run dev:web — serves http://localhost:9080 (HTTP 200).
  • Manual: created a calendar event "Hello World Compass" in the web UI (anonymous/IndexedDB mode); it persists on the grid.

compass_create_event_hello_world.mp4

Hello World Compass event on the calendar

Independent review

Verified fresh-path bootstrap fills all sync.* placeholders (only commented google/email/posthog placeholders remain, which the validator ignores) and that re-running the script is idempotent (leaves an existing compass.yaml untouched).

Test plan

bun install
bun lint
bun test:core
bun test:web
bun test:backend
bash .cursor/bootstrap-backend.sh
bun run dev:backend   # curl -s localhost:3000/api/health -> {"status":"ok"}
bun run dev:web       # http://localhost:9080 -> 200
Open in Web Open in Cursor 

The backend bootstrap script did not fill the sync.mongoUri and sync.internalAuthToken placeholders that compass.example.yaml now ships, so dev:web and dev:backend aborted with a config validation error. Fill them with local defaults (sync uses an isolated compass_sync database on the same local replica set) and document the sync-change-feed warnings in AGENTS.md.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@tyler-dane
tyler-dane marked this pull request as ready for review August 11, 2026 22:49
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