Skip to content

feat(app): Spike 1 — embedded Postgres subprocess (no Docker), all migrations + tests still green #177

Description

@Dewinator

Parent

Sub-task of #176 (native standalone app). Highest priority — Reed wants this validated as soon as possible to know whether Path A is feasible at all.

Acceptance

  • New scripts/native-pg.mjs (or mcp-server/src/native/pg.ts) starts a Postgres process without Docker, using one of:
    • @embedded-postgres-binaries/linux-x64 / darwin-x64 / darwin-arm64 / windows-x64 (npm) — handles binary download per platform.
    • Or embedded-postgres npm wrapper if it covers pgvector.
  • Lifecycle: start({ dataDir, port }), stop(), isReady() poll. Idempotent — re-runs reuse the data dir.
  • pgvector extension installed (binary-bundled or fetched). Verify with CREATE EXTENSION IF NOT EXISTS vector;.
  • scripts/migrate.sh (or a Node equivalent) runs all migrations under supabase/migrations/ against the embedded PG and reaches "All migrations applied successfully".
  • Full npm test in mcp-server passes (920+/920+) against the embedded PG. Some service code paths today assume PostgREST at 127.0.0.1:54321 — for this spike, either spin up a tiny PostgREST subprocess too, or stub the proxy with a thin Node equivalent. Pick whichever has lower ceremony for the spike.
  • Document the chosen npm package + version in docs/native-pg-spike.md plus a brief "what we learned" note (cold-start time, binary size, CPU at idle).

Out of scope

  • Windows/Linux verification — focus on macOS-arm64 to validate feasibility. Cross-platform belongs to a follow-up sub-task of epic: native standalone app (no Docker) — macOS / Windows / Linux #176.
  • Tauri shell, llama.cpp, Auto-Update — separate spikes/sub-tasks.
  • PostgREST-replacement design — if you replace it, fine; if you spawn it, fine; document the choice.
  • Supabase auth / realtime — not needed for the embedded use case, the dashboard-server already speaks raw PostgREST.

How to start

The npm packages I'd evaluate first:

  • @embedded-postgres-binaries/darwin-arm64 — distributes the Postgres binary tarball.
  • embedded-postgres (top-level wrapper) — convenient API but check pgvector support.

Read scripts/dashboard-server.mjs for how the upstream URL is read (POSTGREST_URL) so the spike can plug in cleanly.

Pillar check

Pillar 1 (no cloud dependency) — strengthened. Pillar 6 — data dir under user control, no daemon socket.

🤖 Generated by Claude Opus during interactive session — Reed-priorisiert für Tonight's tick.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-eligibleAutonomous agent loop is allowed to pick thisarchitectureCross-cutting design decisions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions