Repository navigation
feat: add product export bundles - #381
Conversation
Problem: downstream consumers need a stable handoff format for derived archive products, including coverage and readiness evidence rather than ad hoc CLI scraping. What changed: add a versioned product export bundle writer with manifest, readiness coverage, product schemas, JSONL payloads, generated README, target protection, and degraded-readiness recording. Wire it through archive operations, the Polylogue facade, and the products export CLI command. Verification: pytest -q tests/unit/core/test_product_export_bundles.py tests/unit/cli/test_products.py; devtools lab-scenario verify-baselines; devtools verify; devtools verify --quick. Closes #375 Co-Authored-By: Codex <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughA new Changes
Sequence DiagramsequenceDiagram
actor User
participant CLI as polylogue products export
participant Ops as operations.archive
participant Core as export_product_bundle()
participant DB as SQLite Archive
participant FS as File System
User->>CLI: invoke with --out, --product, --since, --until, --format
CLI->>Ops: export_product_bundle(request)
Ops->>Core: export_product_bundle(operations, config, request)
Core->>DB: query_readiness_coverage(selected_products, provider, since, until)
DB-->>Core: coverage_report
loop for each product
Core->>DB: fetch_product_data(product, bounds)
DB-->>Core: product_rows, errors/warnings
Core->>FS: write schema.json
Core->>FS: write product.jsonl
end
Core->>FS: write manifest.json (metadata, query, summaries, warnings)
Core->>FS: write coverage.json (readiness verdicts)
Core->>FS: write README.md (human summary)
Core->>FS: atomic replace to target directory
Core-->>Ops: ProductExportBundleResult
Ops-->>CLI: result
alt --json flag
CLI->>User: JSON(result)
else
CLI->>User: plain text bundle summary
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ec29eef47
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
## Summary Adds a versioned archive-product export bundle surface for downstream consumers. Bundles contain product JSONL payloads, Pydantic-derived product schemas, readiness coverage, a manifest with provenance, and a generated README. ## Problem Product surfaces were inspectable through CLI/API commands, but there was no durable handoff format that packaged product rows together with the readiness evidence and schema contracts needed by downstream tools. Consumers had to infer whether exported rows were complete, stale, or safe to trust. ## Solution - Added `polylogue/product_export_bundles.py` with typed bundle request/result models, exportable product normalization, registry-backed product fetching, product schema emission, manifest writing, readiness coverage, target protection, and cleanup on failed writes. - Wired the bundle writer through archive operations and the `Polylogue` facade with `export_product_bundle()`. - Added `polylogue products export` with provider/date bounds, repeated `--product`, JSON output, overwrite support, and inherited root filters. - Updated generated CLI, quality, verification-catalog, and showcase help baselines for the new command. - Added unit coverage for bounded exports, existing-target protection, stale-readiness manifests, and the CLI JSON surface. ## Verification - `ruff check polylogue/product_export_bundles.py polylogue/operations/archive.py polylogue/facade_archive.py polylogue/cli/commands/products.py tests/unit/core/test_product_export_bundles.py tests/unit/cli/test_products.py` - `mypy polylogue/product_export_bundles.py polylogue/operations/archive.py polylogue/facade_archive.py polylogue/cli/commands/products.py tests/unit/core/test_product_export_bundles.py tests/unit/cli/test_products.py` - `pytest -q tests/unit/core/test_product_export_bundles.py tests/unit/cli/test_products.py` -> `36 passed` - `devtools lab-scenario verify-baselines` -> `All baselines match` - `devtools verify` -> `all checks passed` - `devtools verify --quick` -> `all checks passed` - pre-push `devtools verify --quick` -> `all checks passed` Closes #375
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Adds a versioned archive-product export bundle surface for downstream consumers. Bundles contain product JSONL payloads, Pydantic-derived product schemas, readiness coverage, a manifest with provenance, and a generated README.
Problem
Product surfaces were inspectable through CLI/API commands, but there was no durable handoff format that packaged product rows together with the readiness evidence and schema contracts needed by downstream tools. Consumers had to infer whether exported rows were complete, stale, or safe to trust.
Solution
polylogue/product_export_bundles.pywith typed bundle request/result models, exportable product normalization, registry-backed product fetching, product schema emission, manifest writing, readiness coverage, target protection, and cleanup on failed writes.Polyloguefacade withexport_product_bundle().polylogue products exportwith provider/date bounds, repeated--product, JSON output, overwrite support, and inherited root filters.Verification
ruff check polylogue/product_export_bundles.py polylogue/operations/archive.py polylogue/facade_archive.py polylogue/cli/commands/products.py tests/unit/core/test_product_export_bundles.py tests/unit/cli/test_products.pymypy polylogue/product_export_bundles.py polylogue/operations/archive.py polylogue/facade_archive.py polylogue/cli/commands/products.py tests/unit/core/test_product_export_bundles.py tests/unit/cli/test_products.pypytest -q tests/unit/core/test_product_export_bundles.py tests/unit/cli/test_products.py->36 passeddevtools lab-scenario verify-baselines->All baselines matchdevtools verify->all checks passeddevtools verify --quick->all checks passeddevtools verify --quick->all checks passedCloses #375
Summary by CodeRabbit
New Features
products exportsubcommand to export product data as versioned bundles with manifest and coverage metadataDocumentation
Tests