Repository navigation
NU-001 Scaffold: compose stack, Postgres schema, env template #16
Description
Part of #30.
Stand up the six-container stack and the Postgres schema everything else depends on.
Dev runtime is OrbStack, not Docker Desktop. docker/docker compose CLI and the compose file
format are unaffected — OrbStack is a drop-in Docker-compatible engine, so nothing in this issue's
Build or Definition of Done changes. Noted so no one installs Docker Desktop or assumes its
file-sharing/networking quirks when something doesn't behave like it would there.
Build
docker-compose.yml: Postgres 18, Neo4j 5 community (5.13+ for native vector indexes), RustFS.schema.sql: two schemas (nuron_ai,nuron_api), two login roles, no cross-schema grants.
Enumspipeline_state(must includefailedas a terminal value, not just the happy-path
chain),author_source,entry_point. Tablesdocuments(needsclaimed_by,lease_until,
lease_token— monotonic, incremented on every claim, required on every subsequent write so
a worker whose lease was reclaimed can't overwrite newer work — plusattempt_count,
next_attempt_at),reviewed_sources,entity_aliases,node_provenance..env.examplecovering Postgres/Neo4j/RustFS creds,OPENAI_*, embedding model + dimensions,
LlamaParse (disabled), scan interval, mtime window, upload cap (default 25 MB),source_owner.
Why schema isolation is a role, not a convention
nuron-api must not be able to SELECT from nuron_ai tables. If it can, it eventually will —
it is right there and faster than an HTTP hop — and the one-way web → api → ai layering becomes
a comment rather than a constraint, with nuron-ai unable to migrate a table without breaking
nuron-api. Enforce with separate DB roles.
Role passwords come from env via psql \getenv so no secret is committed.
Definition of done
docker compose configvalidates.docker compose up -d postgres neo4j rustfsbrings all three healthy.- Schema applies cleanly on a fresh volume.
nuron_api_svccannot readnuron_ai.documents— verify explicitly, don't assume the grant.
Status
Not started. An earlier draft was written outside the tracker and has been deleted — the schema was never accepted by a live Postgres, so nothing was verified.
Activity
[-]Scaffold: compose stack, Postgres schema, env template[/-][+]NU-001 Scaffold: compose stack, Postgres schema, env template[/+]docs: record tracer bullet 01 design decisions