Skip to content

Config schema carries unnecessary indirection and attachments are invisible to search #27

Closed

Description

@Sinity

Context

The current configuration model routes output paths through defaults.output_dirs.* with six individually configured directories, while provider exports live in a separate exports.* section. The NixOS module mirrors this complexity: a 230-line generator reads automation_targets.json to produce per-target oneshot services with systemd timers, but every real deployment just calls polylogue sync X --watch in a long-running service. The result is a config surface that's hard to initialize from scratch and a module that's hard to audit.

Meanwhile, attachment files (PDFs, images, text) sit in per-conversation attachments/ directories on disk but are completely opaque to polylogue search. Users who want to find "which conversation had that PDF about X" have to grep the filesystem manually.

Motivation

  • Config simplification: a new user should be able to run polylogue config init and get a two-key config (input_root, output_root) instead of manually populating six output_dirs entries plus exports paths. Provider subdirectories should derive automatically.
  • NixOS module parity: the module should express what people actually run — persistent watchers, not timer-triggered oneshots that approximate the same thing with OnUnitActiveSec.
  • Attachment searchability: polylogue search --in-attachments "quarterly report" should work against text extracted at import time, including PDFs and optionally OCR'd images.
  • Non-TTY safety: several CLI paths currently block on input() when stdin isn't a TTY, which breaks cron, systemd, and CI environments.

Scope

  • Rewrite config.json schema to paths/ui/index structure
  • Simplify provider directory naming (gemini-sync → gemini, etc.)
  • Replace NixOS timer machinery with watch-service generator
  • Add attachment text extraction service with PDF and optional OCR support
  • Extend SQLite schema to v3 with attachments + attachments_fts tables
  • Wire attachment search into the existing search command
  • Audit every input() call for non-TTY safety
  • Add disk-space preflight and failure recording

Acceptance criteria

  • polylogue config init produces a valid two-key config that round-trips through config show --json
  • polylogue search --in-attachments "term" returns hits from attachment text content
  • NixOS module creates watch services (not timer+oneshot pairs) and starts cleanly
  • Plain-mode CLI never blocks on stdin when sys.stdin.isatty() is False
  • --max-disk 0.001 aborts early on any non-trivial operation

Activity

  1. added
    type:refactor
    faux-pull-request
    on Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliarea:pipelinearea:schemaarea:storagefaux-pull-requesttype:refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions