Repository navigation
Description
Context
Polylogue can already render, import, and sync conversation archives, but repeated execution still lacks a shared definition of when output is current, when a rerun should skip work, and how user-edited Markdown on disk should be treated.
The project is also missing a coherent automation layer. There are watch-style needs for local session stores, there is interest in scheduled syncs, and there is enough runtime state now that status output should be able to aggregate manual and automated runs together. Today those concerns are scattered: state is JSON-based, write decisions are local to each caller, and there is no standard way to generate systemd or cron commands from the CLI’s own defaults.
Searchability is another gap. Once Polylogue is running repeatedly, there should be a default searchable index of persisted conversations rather than requiring downstream tooling to reparse Markdown on every query.
Motivation
This is worth doing now because repeated execution changes the correctness bar. A manual import can tolerate redundant rewrites; a watch loop or a timer cannot. Unchanged conversations should be skipped, user edits should not be overwritten silently, and the archive should expose enough metadata to explain why a rerun wrote or skipped a file.
Automation also needs a shared source of truth. If we support CLI-generated scheduler snippets, watch commands, and a NixOS module, they should all describe the same targets and default arguments. Otherwise the docs, CLI, and module will drift.
Finally, full-text indexing becomes much more valuable once the archive is persistent and skip-aware. At that point we have enough stable metadata to maintain a conversation index incrementally rather than by re-scanning the filesystem.
Scope
In scope:
- introduce a shared document persistence layer that owns skip/dirty/write behavior
- record per-conversation metadata such as slug, provider, hashes, and attachment policy in front matter and state
- make render/sync/import callers consume the shared persistence result instead of writing files directly
- add watch commands, scheduler snippet generation, and a target registry for automation
- add a searchable index backend with SQLite FTS as the default and optional alternative backends
- package the CLI cleanly enough to support NixOS module integration and generated systemd services/timers
- extend status output to summarize automated and manual runs from the same telemetry
Out of scope:
- a full database migration for all runtime state beyond what is needed for indexing and persistence bookkeeping
- replacing the CLI with a daemon process
- deep search UX beyond backend maintenance and status visibility
Acceptance criteria
- Re-running an import/render/sync on unchanged content can skip the write and explain why in the returned result/state.
- If an on-disk Markdown body diverges from the stored hash, Polylogue preserves the local file and marks it dirty instead of overwriting it silently.
- The CLI can describe automation targets and generate usable
systemdandcronsnippets from shared target metadata. - Watch commands exist for local Codex and Claude Code session stores and can run once or continuously with debounce.
- Every persisted document updates a default full-text index, and status output can aggregate manual, watch, and scheduled runs consistently.
Activity
fix: address remaining code review findings (#5-#14)
fix(sources): classify Hermes candidates before session admission (#4365
fix(sources): classify Hermes candidates before session admission (#4365
fix(sources): classify Hermes candidates before session admission (#4365