Skip to content

feat: widen MCP, facade, and product registry surfaces #194

Closed

Description

@Sinity

Context

The archive/product operations layer has moved ahead of several public surfaces. Product list methods and archive-debt operations exist, and MCP product tools are registry-driven, but some product types and operational affordances still are not reachable from the durable CLI/facade/MCP surfaces.

Current gaps

  • ArchiveDebtProduct and ArchiveDebtProductQuery exist in polylogue.archive_products, and archive operations can list debt products, but polylogue.products.registry does not register a debt product type. That means no polylogue products debt command and no registry-backed MCP product tool.
  • Polylogue exposes stats() but lacks the explicit get_archive_stats() alias expected by API readers.
  • Readiness/health and session-product rebuild are operations users can trigger through CLI maintenance flows, but the async facade has no direct health_check() or rebuild_products() methods.
  • MCP has single-conversation export and single-tag mutation, but lacks batch tagging, query-result export, and an explicit session-product rebuild tool.
  • CLI has query-mode formatting, but no direct polylogue export --format <fmt> <conversation-id> command for a single known conversation.

Strengthened scope

  1. Register archive debt in the product registry with CLI/MCP metadata, presentation fields, root filters where supported, and focused tests.
  2. Widen the async facade with explicit maintenance/read APIs:
    • get_archive_stats() as a stable alias for archive summary stats.
    • health_check() returning the canonical readiness report.
    • rebuild_products(conversation_ids: Sequence[str] | None = None) rebuilding durable session products and returning typed counts.
  3. Add MCP tools that delegate to existing operations/storage semantics instead of duplicating domain logic:
    • registry-backed archive-debt listing from the product registry.
    • rebuild_session_products with optional targeted conversation IDs.
    • bulk_tag_conversations for many conversation IDs and one or more tags.
    • export_query_results that runs the shared query contract and returns formatted conversation exports in a machine-readable bundle payload.
  4. Add CLI polylogue export --format <format> <conversation-id> using the existing rendering formatter for json, yaml, html, csv, obsidian, org, plaintext, and markdown.
  5. Regenerate CLI/MCP/product docs and add verification coverage across registry, CLI, facade, and MCP contracts.

Acceptance criteria

  • ArchiveDebtProduct appears in products/registry.py and produces polylogue products debt plus a registry-backed MCP product tool.
  • Facade exposes stats, health, and session-product rebuild without callers reaching into operations internals.
  • MCP exposes archive debt, product rebuild, bulk tag, and query-result export with JSON payloads covered by tests.
  • polylogue export --format json <id> works and shares formatter behavior with existing query/export paths.
  • Generated CLI/devtools/product documentation is in sync.
  • Focused validation covers the new API surface and the existing archive-data-products lane stays green.

Activity

  1. Sinity commented on Apr 23, 2026

    @Sinity
    OwnerAuthor

    Starting execution.

    I strengthened the issue to reflect the current code: product list methods and registry-driven MCP tools already exist, so this branch will focus on missing ownership edges rather than rebuilding surfaces. The target is debt registration, explicit facade health/rebuild/stats APIs, MCP rebuild/bulk-tag/query-export tools, CLI single-conversation export, generated docs, and focused contract tests.

  2. added a commit that references this issue on Apr 23, 2026
    a432de6
  3. Sinity commented on Apr 23, 2026

    @Sinity
    OwnerAuthor

    Completion log:

    Verification run locally:

    • pytest -q tests/unit/cli/test_export.py tests/unit/cli/test_products.py tests/unit/core/test_facade_api.py tests/unit/mcp/test_server_surfaces.py tests/unit/mcp/test_tool_contracts.py
    • ruff format --check polylogue tests devtools
    • ruff check polylogue tests devtools
    • mypy polylogue/cli/commands/export.py polylogue/facade_archive.py polylogue/mcp/server_maintenance_tools.py polylogue/mcp/server_mutation_tools.py polylogue/operations/archive.py polylogue/products/registry.py polylogue/rendering/formatting.py
    • devtools render-all --check
    • devtools run-validation-lanes --lane archive-data-products
    • devtools verify
    • devtools verify-showcase
    • pre-push quick verification baseline

    GitHub rerun notes:

    • PR metadata, lint, typecheck, Nix build/check, CodeQL, GitGuardian, CodeRabbit, and showcase-verify were green before merge.
    • The Python matrix was still running when merged; local full verification had already passed, and the user explicitly allowed not waiting on quota/noisy CI when locally confident.
  4. added a commit that references this issue on May 7, 2026
    b101db2
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:mcptype:feat

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions