fix(discovery): persist shared metadata refresh evidence - #984
fix(discovery): persist shared metadata refresh evidence#984seonghobae wants to merge 8 commits into
Conversation
|
Warning Review limit reachedNext included review available in 14 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (10)
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 |
|
Fresh post-custom-store audit found and fixed two exact-head validation regressions in
Locked proof:
The concurrency evidence boundary remains intact: offset capture, external-evidence writes, provider refresh writes, and tail slicing are within the shared |
|
Cross-PR integration contract: routing identity is provider-neutral |
# Conflicts: # contextual_orchestrator/model_discovery.py # docs/product-technical-gap-baseline.md
Merge conflict resolved + a latent test breakage found and fixedMerged current
Verified: Generated by Claude Code Generated by Claude Code |
| if metadata_refreshes: | ||
| external_evidence_offset = len( | ||
| store.external_metadata_refresh_evidence() | ||
| ) |
There was a problem hiding this comment.
🟡 Default discovery breaks custom catalog stores
With a custom store and any Models.dev-backed source, bootstrap_provider_catalog_runtime calls evidence methods absent from previously valid stores. The catalog refresh aborts.
Prompt for agents
Preserve bootstrap_provider_catalog_runtime compatibility with existing custom ProviderCatalogStore implementations when default discovery emits Models.dev evidence. The public catalog_store seam previously required only provider catalog methods, but lines 571-584 now unconditionally require the two new external-metadata methods whenever a Models.dev-backed credential is registered. Add a compatibility strategy that still lets legacy stores complete provider refreshes, while built-in stores continue to persist and report external metadata evidence. Cover a legacy structural store used with default discovery and a Models.dev-backed source.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Re-verified as of the current head: still real, but not currently exercised by any built-in store or test double, and not fixed here — deliberately left for @seonghobae's call rather than decided unilaterally (see the fuller reasoning in #984 (comment)). ProviderCatalogStore is a Protocol where every method is required, and this repo's own test doubles already follow "the Protocol is the whole contract, implementors update together" rather than duck-typed partial degradation for earlier protocol extensions. Adding a hasattr-guarded compatibility shim here would be a real, repo-wide policy change (silent degradation vs. fail-loud for legacy ProviderCatalogStore implementors), not a narrow bug fix, so it isn't something to make unilaterally on this pass. Leaving this thread open and unresolved for that decision.
Generated by Claude Code
Devin found this repo's canonical consolidated DDL file was missing the new table, breaking the established pattern where every table in docs/provider_catalog_database.sql (provider_account, provider_model, model_serving_tag, catalog_refresh_run) is also duplicated there. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
Devin's two findings"Canonical database design omits refresh evidence" — fixed (head "Default discovery breaks custom catalog stores" — verified real but not currently exercised; leaving for your call rather than pushing a fix. Confirmed: Generated by Claude Code Generated by Claude Code |
…-20260901-metadata-freshness
…-20260901-metadata-freshness Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
noema-review failure investigation + branch updateActual i.e. the reviewer model emitted malformed JSON and the bounded repair path timed out before producing a usable verdict — a transient review-model output failure, not a defect in this PR's code. All other checks on the prior head ( What I did:
New head: Generated by Claude Code |
…-20260901-metadata-freshness
"Full unit and contract suite" failure — same already-fixed admin-contract bug, branch updatedWhat failed: Root cause: not a defect in this PR's diff (it never touches Fix applied: merged current Verification:
The pending Protocol-compatibility thread on Generated by Claude Code |
Summary
external_metadata_refresh_runrecord alongside provider refresh evidence and expose it through the bootstrap reportWhy
orchestrator/freeand related free/privacy decisions consume shared Models.dev metadata, but the durable catalog could not distinguish "not free", "no metadata matched", and "metadata fetch failed so the gateway failed closed". This change adds bounded freshness evidence without inventing price or free-tier facts.Testing
uv run pytest tests/test_provider_catalog_store.py tests/test_provider_catalog_store_boundaries.py tests/test_provider_catalog_bootstrap.py tests/test_model_discovery.py158 passed in 11.89s