docs(postgres): document the PostgreSQL backend and its upstream blockers - #139
Merged
Conversation
…kers jvspatial ships a complete PostgresDB backend and jvagent needs no code changes to use it, but `JVSPATIAL_DB_TYPE=postgres` fails at startup: DatabaseConfigurator.initialize_graph_context() rejects the type (jvspatial database_configurator.py:177), and PostgresDB._ensure_pool() has no event-loop affinity, which jvagent's bootstrap-then-uvicorn boot trips. Both reproduce on jvspatial 0.0.9, 0.0.12, and 0.0.15 (the pin). Nothing in the docs said so. .env.example listed four backends, and .planning/reference/jvspatial-integration.md §2.5 the same four, so the only way to learn Postgres was unavailable was to try it and read a traceback. Add docs/postgres.md: the full config surface (all four JVSPATIAL_POSTGRES_* keys, verified defaults), local docker setup, both blockers with file:line and exact errors, and what was verified working once patched. Documented as blocked rather than supported -- the fix belongs upstream (CLAUDE.md section 4), and TrueSelph/jvspatial#35 is open for it. Also flag two quieter traps: the DSN reaches the driver via env only (server_config.py:126-164 threads a connection string for mongodb but has no postgres field), and the log DB silently falls back to a json file log for any type jvspatial does not recognise, postgres included.
This was referenced Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents the PostgreSQL backend — and, more importantly, documents that it does not currently work.
jvspatial ships a complete
PostgresDBand jvagent needs no code changes to use it, butJVSPATIAL_DB_TYPE=postgresfails at startup. Nothing in our docs said so:.env.examplelisted four backends and.planning/reference/jvspatial-integration.md§2.5 listed the same four, so the only way to discover Postgres was unavailable was to try it and read a traceback.This is docs-only. No jvagent code changes — the fixes belong upstream (
CLAUDE.md§4, ADR-0006), and TrueSelph/jvspatial#35 is open with both of them.Related issues
None filed. Upstream fix: TrueSelph/jvspatial#35.
Type of change
Checklist
CONTRIBUTING.mdand (for subsystem work) the localCLAUDE.md.pre-commit run --all-filespasses.pytest tests/passes — 3218 passed, 0 failures. No tests added: docs-only, no behavior to cover.file:linein the description. (the upstream defects are cited by file:line indocs/postgres.md§3)CHANGELOG.mdupdated where relevant — see note below.Notes for reviewers
No CHANGELOG entry — deliberate, tell me if you disagree. Our changelog records changes to jvagent package behavior; this PR changes none. Happy to add an entry under
[Unreleased]if you'd rather every doc addition be listed.Why "blocked" rather than "supported". The doc leads with the failure and keeps the setup instructions after it. Writing it as a supported backend would have been false, and writing nothing leaves the next person to rediscover it via traceback. When jvspatial#35 merges and ships, §1 (config surface) and §2 (setup) stay as-is and §3 (blockers) becomes a version note.
The two upstream blockers, both reproduced on jvspatial 0.0.9, 0.0.12, and 0.0.15 (our current pin):
jvspatial/api/components/database_configurator.py:177—initialize_graph_context()dispatches through a hard-codedjson/mongodb/sqlite/dynamodbchain and raisesValueError: Unsupported database type: postgres. Only theServerpath is missing;create_database("postgres", ...)works today.jvspatial/db/postgres.py:353—_ensure_pool()memoizes the pool and its lock with no event-loop affinity. This one is ours specifically: our CLI bootstraps the graph insideasyncio.run()and then hands off to uvicorn's loop, so the first server-loop query dies withcannot perform operation: another operation is in progress.Two quieter traps also documented, since both cost real debugging time:
server_config.py:126-164threads a connection string intoDatabaseConfigfor mongodb and table/region for dynamodb, but has no Postgres field — so anapp.yamldatabase.uriis silently ignored.JVSPATIAL_LOG_DB_TYPEdefaults toJVSPATIAL_DB_TYPE, so this fires by default and never warns.Everything in §4 was verified, not inferred. Against jvspatial#35 with stock jvagent and no patches: bootstrap persists the full graph to Postgres,
/healthreportsPostgresDB, JWT login works off a Postgres-stored user, agent turns run end to end, and conversation state survives a full server restart. Row counts in the doc are measured. A repeatable smoke script exists if you want it in the repo — I left it out to keep this docs-only.Base branch note. Branched from
main, notfeat/skill-only-tools, since this is unrelated to that work.