Skip to content

feat(providers): report importer package completeness (#2180) - #2189

Merged
Sinity merged 2 commits into
masterfrom
feature/feat/provider-completeness-2180
Jun 19, 2026
Merged

Sinity merged 2 commits into
masterfrom
feature/feat/provider-completeness-2180

Conversation

@Sinity

@Sinity Sinity commented Jun 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds a provider/importer package completeness report that makes provider readiness explicit by public origin and capture mode. The report records detector, raw model, parser, normalizer, fixture, schema, query/read, ImportExplain, privacy, docs, and debt-row evidence for each package mode.

Problem

Provider support was scattered across parser files, fixtures, schemas, docs, and generated surfaces. That made it easy to treat a parser as product-ready while missing ImportExplain evidence, privacy caveats, docs, or query/read coverage. #2180 calls for a finite importer/provider completeness map rather than relying on implicit source inspection.

Solution

  • Added typed provider completeness payloads in polylogue.surfaces.payloads.
  • Added polylogue.sources.provider_completeness with accepted/proposed package-mode rows keyed by origin + capture_mode.
  • Added devtools provider completeness with table, JSON, origin-filter, and --check modes.
  • Added docs/provider-completeness.md, README/docs-surface wiring, devtools catalog wiring, topology/generated-surface updates, and focused tests.
  • Fixed two harness issues exposed by the broad seed run: search runtime state now resets between tests, and the status JSON alias test parses stdout instead of stderr-contaminated combined output.

browser-capture is intentionally marked proposed; incomplete proposed rows are visible but do not fail --check. Accepted rows fail --check when required evidence is missing or partial.

Closes #2180

Verification

  • devtools provider completeness --json --origin codex-session
  • devtools provider completeness --check --origin unknown-export
  • devtools test tests/unit/sources/test_provider_completeness.py tests/unit/devtools/test_provider_completeness.py -> 6 passed
  • devtools test tests/unit/storage/test_fts5.py::test_search_invalid_query_reports_error tests/unit/pipeline/test_ingest_batch.py::test_process_ingest_batch_sync_commits_fts_repair_and_invalidates_search_cache -> 2 passed
  • devtools test tests/unit/cli/test_status.py::test_status_command_accepts_json_alias_flag -> 1 passed
  • devtools verify --quick -> passed
  • devtools verify --seed-testmon --skip-slow -> 11,543 passed, 1 xfailed in 246s; peak pytest tree RSS 3.4 GiB
  • pre-push devtools verify --quick -> passed

Summary by CodeRabbit

  • New Features

    • Added devtools provider completeness command to inspect and report provider/importer package readiness status with JSON export, origin filtering, and validation mode (--check).
  • Documentation

    • Added provider package completeness documentation defining readiness criteria, status models, required items, and guidance for adding new providers.

Sinity added 2 commits June 19, 2026 21:03
Problem: the broad seed run exposed two harness leaks unrelated to provider completeness. A storage test could leave the search runtime using a monkeypatched connection helper through the public search package, and the status JSON test parsed stderr warnings as JSON payload data.

What changed: reset both public and runtime search cache state between tests, restore the canonical read connection helper, and parse status JSON from stdout while preserving combined-output assertions for Click errors.

Verification: devtools test tests/unit/storage/test_fts5.py::test_search_invalid_query_reports_error tests/unit/pipeline/test_ingest_batch.py::test_process_ingest_batch_sync_commits_fts_repair_and_invalidates_search_cache; devtools test tests/unit/cli/test_status.py::test_status_command_accepts_json_alias_flag; devtools verify --seed-testmon --skip-slow.
Problem: provider/importer readiness was implicit in scattered parser files, fixture names, schemas, and docs. That made it easy to add a parser while missing ImportExplain, privacy caveats, generated docs, or query/read surface evidence.

What changed: add a finite provider-package completeness model and devtools report keyed by public origin plus capture mode. The report exposes item-level evidence and blockers for accepted rows, treats browser capture as proposed rather than complete, and adds docs/tests plus generated-surface updates.

Compatibility: this is a readiness/reporting surface only. Runtime import behavior is unchanged, and --check gates accepted provider packages without blocking proposed modes.

Ref #2180
github-actions Bot pushed a commit that referenced this pull request Jun 19, 2026
@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4f2f4e5a-508c-4f6c-adca-fb26d50929a2

📥 Commits

Reviewing files that changed from the base of the PR and between 4aee6b6 and 3bd019e.

📒 Files selected for processing (17)
  • AGENTS.md
  • README.md
  • devtools/click_dispatch.py
  • devtools/command_catalog.py
  • devtools/docs_surface.py
  • devtools/generated_surfaces.py
  • devtools/provider_completeness.py
  • docs/devtools.md
  • docs/plans/topology-target.yaml
  • docs/provider-completeness.md
  • docs/topology-status.md
  • polylogue/sources/provider_completeness.py
  • polylogue/surfaces/payloads.py
  • tests/conftest.py
  • tests/unit/cli/test_status.py
  • tests/unit/devtools/test_provider_completeness.py
  • tests/unit/sources/test_provider_completeness.py

📝 Walkthrough

Walkthrough

Adds a provider/importer package completeness reporting system. New Pydantic payload models define the schema; polylogue/sources/provider_completeness.py implements per-row status computation against a PACKAGE_MODE_SPECS table; devtools/provider_completeness.py exposes a CLI with --json, --origin, and --check flags. Devtools wiring, generated-surface inputs, documentation, and tests are all included.

Changes

Provider Package Completeness Feature

Layer / File(s) Summary
Completeness payload schema
polylogue/surfaces/payloads.py
Introduces ProviderCompletenessStatus, CompletenessItemStatus, and four SurfacePayloadModel classes (ProviderCompletenessItemPayload, ProviderPackageCompletenessRowPayload, ProviderPackageCompletenessTotalsPayload, ProviderPackageCompletenessPayload), plus exports in __all__.
Core readiness engine
polylogue/sources/provider_completeness.py
Defines _PackageModeSpec, PACKAGE_MODE_SPECS, _item (path-existence checks), _row_for_spec (status/blocker computation), _totals, provider_package_completeness(origin=...), and accepted_blockers(report).
CLI tool
devtools/provider_completeness.py
New main(argv) function renders completeness as a human-readable table or JSON, with --check returning exit code 1 when accepted_blockers is non-empty.
Devtools wiring
devtools/click_dispatch.py, devtools/command_catalog.py, devtools/docs_surface.py, devtools/generated_surfaces.py
Registers provider group help, adds CommandSpec, adds DocsEntry and README title, and expands inputs for cli-reference, openapi, devtools-reference, and docs-surface generated surfaces.
Documentation
docs/provider-completeness.md, README.md, AGENTS.md, docs/devtools.md
New doc defines the readiness model, status values, item evidence fields, --check semantics, and provider-addition procedure. Generated references in README, AGENTS, and devtools docs are updated.
Tests and test-infra fixes
tests/unit/sources/test_provider_completeness.py, tests/unit/devtools/test_provider_completeness.py, tests/conftest.py, tests/unit/cli/test_status.py
Adds source and CLI tests for completeness reporting, origin filtering, JSON payload shape, and blocker detection; updates conftest.py to clear polylogue.storage.search.runtime state; fixes test_status.py to parse result.stdout.
Topology and config
docs/plans/topology-target.yaml, docs/topology-status.md
Registers polylogue/sources/provider_completeness.py in the topology target with owner: stable and increments Stable/Total summary counts.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant devtools_CLI as devtools provider completeness
  participant provider_package_completeness
  participant _row_for_spec
  participant _item as _item(paths)
  participant accepted_blockers

  User->>devtools_CLI: --origin X [--json] [--check]
  devtools_CLI->>provider_package_completeness: origin=X
  loop for each PACKAGE_MODE_SPECS entry
    provider_package_completeness->>_row_for_spec: spec
    _row_for_spec->>_item: declared paths per category
    _item-->>_row_for_spec: missing / partial / complete
    _row_for_spec-->>provider_package_completeness: ProviderPackageCompletenessRowPayload
  end
  provider_package_completeness-->>devtools_CLI: ProviderPackageCompletenessPayload
  alt --check flag set
    devtools_CLI->>accepted_blockers: report
    accepted_blockers-->>devtools_CLI: blocker strings (accepted rows only)
    devtools_CLI-->>User: exit 1 + stderr blockers (if any)
  else normal output
    devtools_CLI-->>User: table or JSON to stdout
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

  • Sinity/polylogue#1970: Both PRs modify docs/topology-status.md summary counts after adding new polylogue/**/*.py modules, so they touch the same generated artifact.

Poem

🐇 Hop, hop, a new command appears,
"Provider completeness" — check the readiness gears!
Each origin and mode gets a status row,
Blockers bubble up so teams will know.
--check returns one when accepted rows lag,
A rabbit's proud work waving the completeness flag! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.65% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title "feat(providers): report importer package completeness (#2180)" directly describes the main change: adding a provider/importer package completeness report feature.
Description check ✅ Passed The PR description comprehensively follows the template with all required sections: Summary, Problem, Solution, Verification, Changelog, and Risks/Follow-ups. Each section is well-detailed and addresses the completeness report feature.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/provider-completeness-2180

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3bd019efea

ℹ️ 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".

rows = tuple(
row
for row in (_row_for_spec(spec) for spec in PACKAGE_MODE_SPECS)
if origin is None or row.origin == origin or row.provider_wire == origin

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Map provider aliases before filtering completeness rows

In the current core mapping, both Provider.GEMINI and Provider.DRIVE collapse to Origin.AISTUDIO_DRIVE, but this filter only matches the single row.provider_wire value recorded on the row (gemini). As a result, devtools provider completeness --origin drive --check returns a zero-row report and exits successfully instead of auditing the accepted Drive/AI Studio importer, even though the CLI help says provider-wire tokens are accepted.

Useful? React with 👍 / 👎.

@Sinity
Sinity merged commit 25b9ccd into master Jun 19, 2026
14 checks passed
@Sinity
Sinity deleted the feature/feat/provider-completeness-2180 branch June 19, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(providers): report provider/importer package completeness by origin and capture mode

1 participant