fix(embeddings): preserve recipe snapshot in status reads (#3951) - #3951
Conversation
Problem: exact status counts reloaded ambient configuration, so they could evaluate completed and terminal rows with a different recipe than the payload.\n\nWhat changed: pass the resolved EmbeddingRecipe through the exact-state read and align non-drift fixtures with the current default while preserving explicit recipe-change coverage.\n\nVerification: ran the focused embedding freshness, contracts, readiness, and CLI status selections with one pytest worker.\n\nCo-authored-by: Codex <noreply@openai.com>
Problem: archive status counts can disagree with the configured recipe when an exact read falls back to ambient configuration. What changed: retain the duck-typed config seam while resolving the recipe, and prove the public status payload reports vectors as pending after a model change. Verification: direnv exec . devtools test tests/unit/storage/test_embedding_contracts.py tests/unit/storage/test_embedding_freshness_invariant.py and direnv exec . devtools verify --quick. Co-authored-by: Codex <noreply@openai.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe status payload now resolves the configured embedding recipe and applies it when counting archive session states. Tests cover model alignment and freshness invalidation after a configuration change. ChangesEmbedding status freshness
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
Archive embedding status now evaluates exact session counts with the same resolved recipe the payload reports. The regression test covers the public payload route across a genuine split archive.
Problem
_archive_embedding_status_payload()resolved the configured model for its payload but delegated exact state counting to a helper that could reload ambient configuration. A model change could therefore let the status payload describe one recipe while classifying completed and terminal rows with another.Solution
polylogue/storage/embeddings/status_payload.pyresolves oneEmbeddingRecipethrough the existing duck-typed configuration seam and passes it to the exact archive-state read.tests/unit/storage/test_embedding_freshness_invariant.pymaterializes an archive undervoyage-4, resolves status undervoyage-5, and requires the status payload to report that session pending. The contracts fixture also uses the currentvoyage-4-litedefault while explicit recipe-change coverage remains onvoyage-4andvoyage-5.Verification
direnv exec . devtools test tests/unit/storage/test_embedding_contracts.py tests/unit/storage/test_embedding_freshness_invariant.py->64 passeddirenv exec . devtools verify --quick-> successful, including ruff, mypy, generated renders, layering, and policy checksdevtools verify --quickat5d58a78b7successfully before publication.Anti-vacuity: the regression does not mock
count_archive_embedding_session_state; it usesembedding_status_payloadwith an actualindex.dbplus siblingembeddings.db, so omitting the recipe argument restores ambientvoyage-4classification and fails the required pending count.Bead disposition
Self-contained scope. No Beads were assigned or mutated.
Summary by CodeRabbit