Repository navigation
refactor: drop provider vocabulary from public read surfaces (#1810) - #1901
Conversation
Public CLI/MCP/daemon read surfaces must speak the origin vocabulary only; the provider-wire Provider enum had leaked into three of them. - cli/archive_query.py: remove the dead provider/exclude_provider root query fallbacks and the _PROVIDER_TO_ARCHIVE_ORIGIN map. The root CLI only exposes --origin/--exclude-origin, so the provider branches were unreachable. - daemon/http.py, mcp/server_insight_tools.py: route the insight source_name -> origin projection through a new shared helper instead of importing the Provider enum locally. - core/sources.py: add source_name_to_origin(), the canonical bridge that projects a stored source_name (origin token or provider-wire token) onto the public origin vocabulary. - guard test asserting these three surfaces never bind the Provider enum and that origin resolution no longer honors provider tokens. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude <[email protected]>
|
Warning Review limit reached
More reviews will be available in 42 minutes and 42 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 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: 837c9a9933
ℹ️ 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".
…n bridge (#1810) Codex P2 on #1901: source_name_to_origin fed Source.family tokens through Provider.from_string; families like gemini-export/drive-takeout are not provider values, so they normalized to unknown and grouped sessions under unknown-export instead of their real origin. Map family tokens via _FAMILY_TO_PROVIDER first, then fall back to provider-wire parsing. +test. Co-Authored-By: Claude <[email protected]>
|
Fixed in the latest push: |
…1818) (#1907) ## Summary Converges the CLI's 6 ad-hoc `{mode:"mutation",...}` JSON outputs onto the shared typed `MutationResultPayload` (the contract MCP and the daemon already use), completing #1818 P4. Also fixes 3 unrelated master-red tests (see below). ## Problem The CLI emitted hand-rolled mutation dicts (`archive_query.py`), diverging from the `MutationResultPayload` MCP/daemon use — #1818 wants one machine-output mutation contract. ## Solution (option A — additive) - `surfaces/payloads.py`: `MutationResultPayload` gains two optional fields, both default `None` so MCP/daemon `exclude_none=True` dumps are **byte-unchanged** (no mcp/daemon call site touched): `operation: str | None` (bulk-mutation discriminator) and `session_ids: tuple[str,...] | None` (dry-run enumeration). `status` docstring notes the new `preview`/`aborted` CLI values. - `cli/archive_query.py`: all 6 sites build `MutationResultPayload` and emit `.to_json(exclude_none=True)` (one finite JSON value). Mappings: `changed→affected_count`, `matched→session_count`, `deleted→affected_count`, `dry_run/aborted→status`, combined tag+meta → `tag_count`+`applied_count` (documented inline). ## Bundled fix (master-red, #1810 regression) 3 tests in `test_query_exec_laws.py` were left red on master by the #1810 provider sweep (#1901) — they fed `{provider: codex}` expecting origin mapping that was intentionally removed; PR CI missed it (test job is PR-skipped). Their inputs are updated to `origin`/`exclude_origin`. Bundled here because this PR already edits that file (avoids a conflict). ## Verification ``` devtools test test_query_exec_laws test_verb_cardinality # 99 passed (3 ex-red now green) devtools verify --quick # exit 0 ``` No snapshots/baselines pin the mutation shape (confirmed). Ref #1818 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Mutation operations now support additional status indicators for dry-run previews and user-aborted confirmations. * **Refactor** * Standardized response format for mutation and deletion operations. * Updated archive filtering parameters to use `origin` instead of `provider`. * **Tests** * Updated test suite to match revised operation response formats. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
|
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
Removes
Provider-token vocabulary from the public CLI/MCP/daemon read surfaces, leaving them origin-only (#1810). Provider-wire surfaces (schema packages) are intentionally retained.Problem
Provider(lab/product-wire identity) leaked onto public read surfaces that should speakOrigin(source-origin: claude-code-session, chatgpt-export, …). #1810's anti-goal: no provider wording on public filters/payloads.Solution (3 sites)
cli/archive_query.py: dropped the deadprovider/exclude_provider→origin fallback in_resolve_origins/_resolve_excluded_origins(no--providerflag exists on the query surface — the fallback was API/dead). Public root query is origin-only.mcp/server_insight_tools.py: provider param → origin on the public read tool.daemon/http.py: provider facet label → origin (label-only change).core/sources.py: small helper for the origin/provider boundary mapping where internal contracts still need a provider token.tests/unit/core/test_public_surface_origin_vocabulary.py— guard asserting no provider vocabulary on these public read surfaces.Retained (correctly):
schema.py's--providerflags — schema generate/promote/audit operate on provider-wire schema packages, a #1810-exempt surface.Verification
Ref #1810