Repository navigation
Description
Context
Polylogue derived products have become first-class downstream inputs: session profiles, work events, phases/threads, rollups, and future export bundles. Consumers need to know not only whether a table exists, but whether the product is current, complete for a provider/date range, and compatible with the current schema.
This came up while consuming Polylogue from Lynchpin: session_work_events was valuable and fast to read directly, but product coverage and freshness had to be inferred manually from table contents. Earlier Lynchpin integration also hit legacy materialized profile rows whose inference payload shape no longer matched the current model.
Execution-strengthened scope
Make this a canonical product-readiness contract, not just another health command. The implementation should define a typed report in the product/storage/operations layer first, then expose the same report through CLI/facade surfaces. devtools, future product export bundles (#375), MCP, and external consumers should be able to reuse the report without scraping CLI text or reimplementing SQLite checks.
The report should answer three questions for each product family:
- storage readiness: are the expected table/FTS/index artifacts present and populated enough to read safely?
- coverage readiness: which providers/date ranges/conversation counts are covered, partially covered, stale, empty, or missing?
- contract readiness: which materializer/schema/inference/enrichment versions produced the rows, and are any rows incompatible with current typed models?
It should also include an aggregate verdict suitable for deployment gates and export manifests: ready, partial, empty, missing, stale, legacy, or unknown, with evidence and repair hints.
Problem
Current health/check/rebuild surfaces do not expose enough product-readiness detail for downstream consumers or operators. The missing distinctions are important:
- product table absent vs present-but-empty;
- product rows generated by an older schema/payload version;
- product coverage by provider and date range;
- raw conversations newer than their derived products;
- partial materialization where only some providers/products are current;
- rows quarantined or skipped during product refresh;
- recommended repair command for the specific stale/missing product.
Without this, consumers either trust products too much or reimplement ad hoc coverage checks against SQLite internals.
Scope
Add a product materialization readiness report, available through CLI and library surfaces and consumable by MCP/export code.
Candidate command/API shape:
polylogue products status --format json
polylogue products status --product session-work-events --since 2026-03-01 --until 2026-03-31The report should include, per product:
- product id/name and schema or payload version;
- table/storage presence;
- row count;
- provider coverage;
- min/max timestamps or dates where applicable;
- source conversation count vs materialized row coverage where meaningful;
- stale/raw-newer-than-product indicators;
- legacy/incompatible payload counts;
- current storage/readiness artifact flags, reusing existing status descriptors where possible;
- last successful refresh metadata if available;
- recommended repair/rebuild command.
Acceptance criteria
- Product readiness can be queried in machine-readable form without direct SQLite inspection.
- A typed report model exists below CLI surfaces and is reachable from operations/facade code.
polylogue products statusrenders both human-readable and JSON output from the same report contract.- At least session profiles, session enrichments, work events, phases, work threads, day summaries, week summaries, tag rollups, and provider analytics produce a report entry, even where some coverage fields are intentionally unknown.
- At least session profiles and work events report row count, provider coverage, date range, and schema/materialization version.
- The report distinguishes absent, stale, partial, legacy-incompatible, empty, and ready states.
- A downstream export can include the readiness report in its manifest or coverage file without depending on CLI rendering.
- Tests cover ready, missing, empty, stale, partial, and legacy/incompatible product states.
- Generated CLI/help/proof surfaces are refreshed.
Non-goals
- Redesigning the product extraction taxonomy.
- Hiding all low-level SQLite diagnostics; this is a stable summary layer over them.
- Making every historical product perfectly complete before the status surface lands.
- Implementing the product export bundle itself; feat: add versioned product export bundles for downstream consumers #375 should consume this contract later.
Activity
Sinity commentedon Apr 23, 2026
Starting execution.
Decision log before coding:
polylogue products statusa thin rendering surface over a typed operations/facade report so feat: add versioned product export bundles for downstream consumers #375 can embed the same report in export manifests later.Sinity commentedon Apr 23, 2026
Execution log for #376:
polylogue/product_readiness.pyas the report kernel for storage readiness, coverage readiness, version/schema-contract readiness, aggregate verdicts, evidence, and repair hints.Polylogue.product_readiness_report(), andpolylogue products statusplain/JSON output.help-products-statusbaseline.Verification run:
pytest -q tests/unit/core/test_product_readiness.py tests/unit/cli/test_products.py->37 passeddevtools lab-scenario verify-baselines->Ran 44 exercises;All baselines matchdevtools verify->all checks passeddevtools verify --quick->all checks passeddevtools verify --quick->all checks passedPR: #380
feat: add product readiness status reports (#380)
feat: add product readiness status reports (#380)