Skip to content

refactor(api): disambiguate the two ArchiveStats types #584

Closed as not planned

Description

@Sinity

Summary

There are two same-name ArchiveStats types with different fields and consumers. This is not yet proven to drop data at a boundary, but it creates active ambiguity between public facade summary stats and storage/archive readiness stats.

Parent: #578

Evidence

  • polylogue/operations/archive.py:455 defines a public facade ArchiveStats with conversation_count, message_count, word_count, tags, last_sync, and recent.
  • polylogue/lib/stats.py:9 defines storage/archive ArchiveStats with total_conversations, embedding coverage fields, db size, and retrieval readiness.
  • ArchiveStatsMixin.storage_stats() returns the lib stats at polylogue/operations/archive.py:501.
  • ArchiveStatsMixin.summary_stats() returns the operations stats at polylogue/operations/archive.py:504.
  • API exports the operations version; MCP/TUI payloads consume the lib stats shape.

Acceptance criteria

  • Rename or otherwise disambiguate the two stats types so public API summary stats and storage readiness stats cannot be confused.
  • Update type hints, exports, docs, and tests to use the explicit names.
  • Add or adjust a test that would fail if the public API accidentally returned the storage stats shape, or vice versa.

Activity

  1. added
    type:refactor
    area:core
    on May 1, 2026
  2. Sinity commented on May 1, 2026

    @Sinity
    OwnerAuthor

    Superseded by #621. I consolidated this finding into the composite issue so the work can be handled as one coherent slice instead of as a tiny standalone ticket. The original evidence remains available in this issue history.

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:corearea:storagetool:codextype:refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions