Skip to content

refactor(cli): generalize message role output filtering #318

Closed

Description

@Sinity

Problem

A local --user-only query/output flag makes one role projection special even though the underlying need is broader: users should be able to project conversation output by any canonical message role, and the storage/streaming paths should share that model.

Scope

  • Replace the bespoke user-only output surface with a composable message-role filter.
  • Keep --dialogue-only as a shorthand for user + assistant dialogue output.
  • Normalize provider role aliases consistently at CLI, in-memory projection, storage streaming, and semantic facts.
  • Remove arbitrary domain helpers where a generic role projection is sufficient.

Acceptance Criteria

  • CLI exposes a repeatable/comma-separated generic role filter instead of --user-only.
  • Explicit role filters supersede --dialogue-only when both are supplied.
  • Streamed output pushes role filtering into SQL instead of buffering full conversations unnecessarily.
  • Markdown and JSONL stream headers expose the effective role projection.
  • Unit tests cover CLI parsing, output routing, projection laws, storage streaming, and role-count stats.
  • devtools verify passes locally before merge.

Activity

  1. added
    type:refactor
    on Apr 22, 2026
  2. added 4 commits that reference this issue on Apr 22, 2026
    8192eb3
    6fb036c
    c08be9d
    2a4a36a
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:clitype:refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions