Repository navigation
Description
Context
Polylogue currently has a JSON config layer that is responsible for a mix of durable settings and values that are not really configuration at all. polylogue/config.py resolves XDG paths, chooses archive roots, defines source structures, and feeds those values into the CLI and container. Commands then thread config_path around even when the only meaningful outcome is "use the default archive path and look in the known provider directories."
The duplication is structural. Claude, Codex, and other provider exports already live in well-known places. The archive root already has a clear XDG default. Environment variables already exist and are often the preferred override mechanism in local shells, CI, and service definitions. The config file is mostly repeating default logic, while adding a second override mechanism that has to be reconciled with env vars and command-line flags.
There is a related ownership problem in storage and health. storage/db.py and storage/backends/sqlite.py both claim pieces of SQLite lifecycle and schema handling. verify.py and health.py both perform integrity-style checks. None of those splits are helping the public model of the system.
The async story is also incomplete. The storage layer is synchronous end-to-end, so any async caller either blocks the loop or wraps archive calls in executors. MCP support is similarly partial: the server can expose tools and resources, but not prompts.
Motivation
This matters now because the existing setup makes the runtime model harder to understand than it needs to be. A new contributor looking at the CLI has to infer whether the config file, the environment, or the XDG default wins, and then trace that through container wiring. That is needless complexity for a tool whose most common setup should be "point it at the default archive root and auto-discover the exports."
The config layer also gets in the way of honest testing. Path resolution is cached at import time, some tests need subprocess isolation to validate env-sensitive behavior, and the persistence of a notional config file obscures what the actual runtime rules are.
On the capability side, async consumers and MCP clients are now important enough that the synchronous-only backend and prompt-less MCP server are real gaps, not future nice-to-haves.
Scope
In scope:
- make runtime defaults and source discovery work without any config file
- centralize XDG/env/path logic in code rather than serialized config
- consolidate SQLite lifecycle into one backend module
- merge integrity/verification reporting into one health surface
- add an async SQLite backend plus a small public async facade
- add MCP prompt methods
- simplify packaging and service wiring around the zero-config model
Out of scope:
- redesigning provider parsers
- changing user-visible archive formats
- building a full async write pipeline for every archive operation
Acceptance criteria
polyloguestarts and resolves sources/archive paths correctly with no config file present- the CLI no longer requires
--config, and there is no separate config command to keep in sync storage/db.pyandverify.pyare no longer peer ownership centers for SQLite and health behavior- an async caller can read one or many conversations through a supported async facade
- the MCP server responds to
prompts/listandprompts/get - tests exist for async backend behavior and for env/XDG-sensitive CLI startup via subprocess isolation
Activity