Repository navigation
feat(daemon): post-ingest embedding status and cost cap (#828) - #915
Conversation
Add embedding readiness to DaemonStatus, cost cap enforcement in the embed convergence stage, model/dimension change detection, and dimension-aware vec0 DDL. - DaemonStatus gains EmbeddingReadiness sub-model with 8 fields: embedding_enabled, embedding_model, embedding_dimension, embedding_pending_count, embedding_stale_count, embedding_coverage_percent, embedding_failure_count, embedding_estimated_cost_usd — populated from embedding_status and embeddings_meta tables. - EmbeddingStatsSnapshot gains failure_count and total_estimated_cost_usd fields, computed from the embedding status tables with rough Voyage API pricing. - Embed convergence stage enforces embedding_max_cost_usd cap, halting when cumulative estimated cost exceeds the configured threshold. Reads model/dimension from PolylogueConfig and passes them through create_vector_provider to SqliteVecProvider. - Model/dimension change detection in the embed check: when configured model or dimension differs from stored embeddings_meta, all embedding_status rows are marked needs_reindex=1. Dimension mismatch also drops and recreates the vec0 virtual table via _reconcile_vec0_dimension. - vec0 DDL is now dimension-aware: _ensure_tables generates the vec0 CREATE with the configured dimension instead of hardcoded 1024, and detects/recreates on dimension mismatch. - Docs updated: daemon.md embedding section describes TOML config, model/dimension change behaviour, and coverage commands. architecture.md references config-driven setup instead of env vars. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
✨ 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: a57c885934
ℹ️ 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".
| ) | ||
|
|
||
| if model_changed or dimension_changed: | ||
| conn.execute("UPDATE embedding_status SET needs_reindex = 1, error_message = NULL") |
There was a problem hiding this comment.
Re-embed all pending conversations after config change
When _reconcile_embedding_config_change marks every embedding_status row with needs_reindex = 1, the embed stage still executes only for conversation IDs derived from the currently changed source paths (execute/execute_many filter through _conversation_ids_for_source_path(s)). In archives where many conversations are unchanged at the moment of model/dimension change, those rows remain permanently pending and are never re-embedded by daemon convergence, so the migration cannot complete without unrelated file churn.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR activates the daemon-owned post-ingest embedding pipeline by surfacing embedding readiness in daemon status, enforcing an embedding cost cap, and handling embedding model/dimension changes (including dimension-aware vec0 DDL and rebuild behavior).
Changes:
- Add
embedding_readinesstoDaemonStatus(coverage/pending/stale/failures/cost + formatting). - Add convergence-stage reconciliation for embedding model/dimension changes plus cost-cap halting during embedding.
- Make sqlite-vec vec0 table DDL dimension-config-driven and add helpers to detect/reconcile dimension mismatches.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| polylogue/storage/search_providers/sqlite_vec_support.py | Add shared cost-estimation constants for embedding. |
| polylogue/storage/search_providers/sqlite_vec_runtime.py | Dimension-aware vec0 DDL + dimension detection/reconcile helpers. |
| polylogue/storage/search_providers/init.py | Allow passing model/dimension through provider factory. |
| polylogue/storage/embeddings/status_payload.py | Include failure count and estimated cost in embedding stats payload. |
| polylogue/storage/embeddings/sql.py | Add SQL fragments for failure count, stored model, and total message count. |
| polylogue/storage/embeddings/models.py | Extend EmbeddingStatsSnapshot with failure count and estimated cost fields. |
| polylogue/storage/embeddings/embedding_stats.py | Compute failure count and estimated cost in embedding stats snapshot. |
| polylogue/daemon/status.py | Add EmbeddingReadiness model and embed readiness probe + status output. |
| polylogue/daemon/convergence_stages.py | Add config-change reconciliation + cost-cap enforcement during embedding stage. |
| docs/daemon.md | Document TOML-driven embedding configuration and readiness fields. |
| docs/architecture.md | Update embedding integration docs to reference TOML config keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Detects dimension mismatches between the configured dimension and the | ||
| existing vec0 table. Drops and recreates the vec0 table when the | ||
| dimension has changed. | ||
| """ |
| def _reconcile_vec0_dimension(conn: sqlite3.Connection, configured_dimension: int) -> None: | ||
| """Drop vec0 table when its dimension differs from the configured dimension.""" | ||
| current = _vec0_table_dimension(conn) | ||
| if current is not None and current != configured_dimension: | ||
| logger.info( | ||
| "vec0 dimension mismatch: stored=%d configured=%d — dropping message_embeddings", | ||
| current, | ||
| configured_dimension, | ||
| ) | ||
| conn.execute("DROP TABLE IF EXISTS message_embeddings") | ||
| conn.commit() | ||
|
|
| coverage = 0.0 | ||
| if total_conv > 0: | ||
| embedded_conv = max(0, total_conv - pending) | ||
| coverage = embedded_conv / total_conv * 100 |
| pending = optional_count_sync(conn, "SELECT COUNT(*) FROM embedding_status WHERE needs_reindex = 1") | ||
| stale = optional_count_sync( |
| if total_conv > 0: | ||
| total = embedded_msg | ||
|
|
||
| # Rough cost: (embedded + pending) * 500 tokens/msg * $0.10/1M tokens | ||
| from polylogue.storage.search_providers.sqlite_vec_support import ( | ||
| ESTIMATED_TOKENS_PER_MESSAGE, | ||
| VOYAGE_4_COST_PER_1M_TOKENS, | ||
| ) | ||
|
|
||
| estimated_tokens = (total + pending) * ESTIMATED_TOKENS_PER_MESSAGE |
| # Check stored model | ||
| stored_models = conn.execute( | ||
| "SELECT DISTINCT model FROM embeddings_meta WHERE target_type='message' ORDER BY model" | ||
| ).fetchall() | ||
| stored_model = str(stored_models[0][0]) if stored_models else None | ||
|
|
||
| model_changed = stored_model is not None and stored_model != configured_model | ||
| dimension_changed = False | ||
|
|
||
| if stored_model is not None: | ||
| stored_dim_row = conn.execute( | ||
| "SELECT dimension FROM embeddings_meta WHERE target_type='message' LIMIT 1" | ||
| ).fetchone() | ||
| if stored_dim_row: | ||
| stored_dimension = int(stored_dim_row[0]) | ||
| dimension_changed = stored_dimension != configured_dimension | ||
|
|
||
| if model_changed: | ||
| vec_logger.info( | ||
| "embedding model changed: stored=%s configured=%s — marking all for reindex", | ||
| stored_model, | ||
| configured_model, | ||
| ) | ||
| if dimension_changed: | ||
| vec_logger.info( | ||
| "embedding dimension changed: stored=%d configured=%d — dropping vec0 + reindex", | ||
| stored_model and _stored_dim_from_meta(conn) or 0, |
| retrieval_bands=retrieval_bands, | ||
| failure_count=parts.failure_count, | ||
| total_estimated_cost_usd=round( | ||
| _estimated_cost(parts.total_message_count, parts.pending_conversations), |
| WHERE target_type = 'message' | ||
| ORDER BY model | ||
| """ | ||
| EMBEDDING_TOTAL_TOKENS_SQL = """ |
| embedded_msg = optional_count_sync(conn, "SELECT COUNT(*) FROM message_embeddings") | ||
| failure = optional_count_sync(conn, "SELECT COUNT(*) FROM embedding_status WHERE error_message IS NOT NULL") |
| failure_count=optional_count_sync(conn, EMBEDDING_FAILURE_COUNT_SQL), | ||
| total_message_count=optional_count_sync(conn, EMBEDDING_TOTAL_TOKENS_SQL), | ||
| ) |
The embedding pipeline existed (vec0 table, voyage-4 provider, embed_conversation_sync) but was dormant: no status visibility, no cost governance, no graceful model/dimension change. The daemon could not expose embedding coverage or halt embedding when cost exceeded a configured cap. - `EmbeddingReadiness` Pydantic sub-model with eight fields (`embedding_enabled`, `embedding_model`, `embedding_dimension`, `embedding_pending_count`, `embedding_stale_count`, `embedding_coverage_percent`, `embedding_failure_count`, `embedding_estimated_cost_usd`) populated from `embedding_status` / `embeddings_meta` via a bounded read-only probe and surfaced through `daemon_status_payload` / `format_daemon_status_lines`. - Cost cap: `EmbeddingStatsSnapshot` gains `failure_count` and `total_estimated_cost_usd`; the embed convergence stage reads `embedding_max_cost_usd` from config, tracks cumulative cost (rough estimate 500 tokens/msg × $0.10/1M), and halts when the cap is exceeded. - Dimension change: `_reconcile_embedding_config_change()` compares the configured model/dimension against `embeddings_meta`; on mismatch it sets `needs_reindex=1` and, on dimension mismatch, drops and recreates the vec0 virtual table via `_reconcile_vec0_dimension()`. - DDL is now dimension-aware: `_ensure_tables()` and `_vec0_table_dimension()` read/produce the configured dimension instead of hardcoded 1024. Refs #828
Three small closeouts after the issue acceptance review. - #819 (MCP envelopes): adds the missing CLI/MCP parameter parity test in `tests/unit/mcp/test_tool_contracts.py` so future filter changes cannot drift between the two surfaces without a failing test. - #828 (embedding convergence): adds focused tests in `tests/unit/daemon/test_convergence_stages.py` covering the embedding stage gating, cost-cap halt, and dimension-change reconciliation introduced in PR #915. - #830 (tiered health): wires an additional health-check endpoint into `polylogue/daemon/http.py` so the periodic health loop has the readout the operator runbook documents. Refs #819, #828, #830
The embedding pipeline existed (vec0 table, voyage-4 provider, embed_conversation_sync) but was dormant: no status visibility, no cost governance, no graceful model/dimension change. The daemon could not expose embedding coverage or halt embedding when cost exceeded a configured cap. - `EmbeddingReadiness` Pydantic sub-model with eight fields (`embedding_enabled`, `embedding_model`, `embedding_dimension`, `embedding_pending_count`, `embedding_stale_count`, `embedding_coverage_percent`, `embedding_failure_count`, `embedding_estimated_cost_usd`) populated from `embedding_status` / `embeddings_meta` via a bounded read-only probe and surfaced through `daemon_status_payload` / `format_daemon_status_lines`. - Cost cap: `EmbeddingStatsSnapshot` gains `failure_count` and `total_estimated_cost_usd`; the embed convergence stage reads `embedding_max_cost_usd` from config, tracks cumulative cost (rough estimate 500 tokens/msg × $0.10/1M), and halts when the cap is exceeded. - Dimension change: `_reconcile_embedding_config_change()` compares the configured model/dimension against `embeddings_meta`; on mismatch it sets `needs_reindex=1` and, on dimension mismatch, drops and recreates the vec0 virtual table via `_reconcile_vec0_dimension()`. - DDL is now dimension-aware: `_ensure_tables()` and `_vec0_table_dimension()` read/produce the configured dimension instead of hardcoded 1024. Refs #828
Three small closeouts after the issue acceptance review. - #819 (MCP envelopes): adds the missing CLI/MCP parameter parity test in `tests/unit/mcp/test_tool_contracts.py` so future filter changes cannot drift between the two surfaces without a failing test. - #828 (embedding convergence): adds focused tests in `tests/unit/daemon/test_convergence_stages.py` covering the embedding stage gating, cost-cap halt, and dimension-change reconciliation introduced in PR #915. - #830 (tiered health): wires an additional health-check endpoint into `polylogue/daemon/http.py` so the periodic health loop has the readout the operator runbook documents. Refs #819, #828, #830
…, lint debt) (#1001) ## Summary Restores `devtools verify --quick` to green on master. Three independent debt classes had accumulated across the 2026-05-09 PR wave (and earlier), each individually small but jointly blocking every new branch from passing the pre-push hook. ## Problem `gh run list --branch master --workflow CI` shows master CI has been red since 2026-05-02. PRs continued to merge through that window, and each one nudged at least one of the three following gates further out of sync: 1. **Rendered doc surfaces** drifted — `docs/cli-reference.md` missed the `maintenance` group and `message_type_backfill` target added by #871/#839; `AGENTS.md` carried stale worktree-relative include paths from before #eeace79; `test-quality-workflows.md` and `verification-catalog.md` were similarly stale. 2. **File-size budgets** caught three production files growing past their declared ceilings: `polylogue/storage/repair.py` (1281>1200, from #818+#839), `polylogue/operations/archive.py` (1141>1100, from #861/#862), and `polylogue/daemon/status.py` (1128>1100, from #844/#898/#915). 3. **Lint/type debt** — 42 ruff errors (mostly import-sort drift after #eeace79 added `devtools.repo_root` to many devtools modules) and 3 mypy errors (`TagMutationResult` referenced in `polylogue/api/archive.py` but never imported; `get_index_status` returning a `TypedDict` typed as `dict[str, object]`). The pre-push hook (`.githooks/pre-push` → `devtools verify --quick`) is correctly enforcing the gate; what was missing was a forcing function for the cumulative state. This PR is that function. ## Solution Three atomic commits: - `f51e15be chore(docs): regenerate rendered surfaces stale on master` — pure regeneration via `devtools render-all`, no logic changes. - `0b4eadee chore(budgets): raise ceilings for three files past their cap on master` — three new exception entries in `docs/plans/file-size-budgets.yaml`. Each entry names the architectural-split candidate that would let the ceiling shrink, matching the convention used for existing exceptions. No code splits in this PR — the budgets file is the right place to make the pressure visible. - `372ad23b chore: clear ruff/mypy debt accumulated on master` — 39 ruff auto-fixes (import sort, typing modernization, unused imports), 4 manual ruff fixes, 3 mypy fixes (missing imports, return-type tightening, click.Context handling in tests). Total: 45 files, +121/-79 lines. ## Verification ``` $ devtools verify --quick verify: running local verification baseline ruff format ... ok (0.0s) ruff check ... ok (0.0s) mypy ... ok (73.4s) render-all ... ok (102.0s) verify-topology ... ok (0.3s) verify-layering ... ok (0.9s) verify-file-budgets ... ok (0.4s) verify-test-ownership ... ok (1.4s) verify-schema-roundtrip ... ok (1.5s) verify-cross-cuts ... ok (0.3s) verify-suppressions ... ok (3.1s) verify-manifests ... ok (5.5s) verify-witness-lifecycle ... ok (3.2s) verify-lane-assertions ... ok (1.4s) proof-pack check ... ok (7.0s) verify: all checks passed ``` `pytest tests/unit/daemon/test_maintenance_endpoints.py tests/unit/daemon/test_raw_failure_sample.py tests/unit/cli/test_maintenance_registration.py tests/unit/pipeline/test_message_type_backfill.py -q` — 41 passed (no behavioural change introduced by the type-cleanup edits). ## Follow-ups - Three "split candidate" hints in `file-size-budgets.yaml` — `repair.py` lift backfill into `pipeline/services`, per-domain operation modules under `operations/`, payload modules per `daemon/status.py` section — should be filed as separate refactor issues if/when the ceilings need to shrink again. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Documentation** * Updated CLI reference with maintenance command documentation * Updated file-size budget exceptions and verification catalog metrics * **Improvements** * Enhanced archive maintenance API with improved type safety for index status queries * Improved code organization in development utilities and test infrastructure [](https://app.coderabbit.ai/change-stack/Sinity/polylogue/pull/1001) <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
A deliberate three-pass audit of `1d901ec73` ("perf: preserve pytest
width and
share wire receipts", #4867 — 176 files, +23,948/−9,052).
That commit already accounted for ~35 defects found incidentally across
this
campaign. Auditing it directly found **16 more, none of which any test
would
catch**. Its own recorded verification (`verify --quick` plus 43 focused
tests)
could not have caught any of them — and there is a structural reason:
**`gate atlas` is not among `verify --quick`'s 15 gates**
(`polylogue-6cdzy`).
## Fixed here (5)
**The daemon cannot restart after `kill -9` or an OOM kill.** The
pre-bind unlink
was deleted, and the CLI silently degrades, so the cause is invisible to
the
operator. Restored *with a liveness probe*, so it cannot resurrect the
kadx3
socket-stealing bug the unlink removal was presumably guarding against.
This
matters directly: the campaign's build runs a long-lived daemon, and an
unclean
exit would have left it unable to come back.
**Session profile cost columns reported VALID while stale.**
`_refresh_provider_usage_rollup` reads `source_message_id` and
`occurred_at_ms`,
neither of which was projected. The completeness guard covered 2
relations; it now
covers all 6.
**Three lost failure contracts on pinned-connection readers.** The
squash added
pinned-connection twins throughout and repeatedly copied the queries
*without*
their failure contract — one systematic error, found in three separate
files. The
pinned frontier reader had lost its path twin's
`sqlite3.Error → RawRetentionSafetyError` conversion; two more instances
in
`archive_readiness.py`.
**`classify_gaps` default inverted** against the documented
bounded-status
contract — **40× measured**, and during a rebuild nearly every raw is
unmaterialized, so this is a rebuild-time status regression rather than
an edge
case. Fixed at the definition rather than the caller, respecting another
worker's
scope on `daemon_status.py`.
**Two durable doc anchors** pointing into the 1,685 deleted lines of
`status.py`.
Each fix has its anti-vacuity condition proven.
## Filed (15 beads; 4 linked as blocking `polylogue-reindex-2026.1`)
**Rebuild-blocking:**
- `polylogue-163ku` — one unparseable file refuses an **entire source
generation**
on the reacquisition route. The `FAILED` branch is unreachable because
the
callable *raises*.
- `polylogue-g827i` — embeddings status reports a **complete vector set
as
`none`** and prescribes a paid Voyage backfill when sqlite-vec cannot
load.
That corrupts the go/no-go decision on whether `embeddings.db` survived,
which
the campaign explicitly relies on (vectors are expensive to rebuild).
- `polylogue-2kbrl` — a failed `accept_ingest` **permanently wedges the
audit
tier**, which is append-only and irreplaceable; recovery replays the
same
payload.
- `polylogue-gwns3` — `settled_read` leaks a non-`Pending` error through
all six
handlers, breaking exactly the bootstrap ordering a rebuild performs.
**Other P0/P1:** `go581` — a semantic query can **DROP every stored
vector** on
dimension mismatch (pre-existing, #915, *not* this commit — but
destructive and
provably untested) · `ji49p` pre-dispatch refusals reported as
indeterminate
mutations · `b9egs` principal granted all 22 capabilities, writing false
authority
into `audit.db` · `pw5jd` reads raise instead of degrading · `bwu75` one
bad ZIP
member aborts the whole input · `nd2tb` 543 lines of dead ingest code.
Plus
`hfyig`, `6cdzy`, `g8uvu`, `lyqzg`, `ms4uy`.
## Established clean — so it is not re-audited
113 removed symbols: every surviving reference is a *moved* definition,
not a
stranded caller. The `authorization_token` → `authorization_refs` rename
is fully
swept. No route or operation verb was dropped.
**The enumeration/sealing path** — chased hardest as the rebuild risk —
is
coherent: coordinate/member parity holds, empty inputs seal correctly,
the gate is
opt-in per generation. Also clean: `source_generation_receipts.py`,
`audit_leaf.py`, `raw_failure_lifecycle`, `blob_publication`, live
`metrics`/`cursor`, and the watcher's session-profile callback (opt-in
and
bounded — the *opposite* of the known always-on defect).
One assigned lead was **disproved**: the `raw_convergence` attachment
hazard was
real in the squash, but the scanner has since been deleted.
## Verification
```
devtools verify --quick exit 0, 15 gates, no "out of sync"
```
Focused runs all PASSED across `test_archive_readiness`,
`test_raw_retention`,
`test_session_partition_convergence`,
`test_session_profile_{derivation,cost_columns,model_usage_consistency}`,
`test_session_insight_refresh`, `test_uds_socket_scoping`,
`test_uds_diagnostic_capture`, `test_derived_schema_identity`,
`test_verify_schema_manifest`.
Honest residuals: `gate atlas` shows 123 BLOCKs, **all pre-existing** —
none of
these files appear. `polylogue-2kbrl`'s deterministic trigger could not
be
constructed from source; the design gap stands regardless.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **Bug Fixes**
- Daemon restarts now recover from stale socket files without disrupting
active connections.
- Readiness and retention checks return safe, readable status when
underlying storage is damaged, unavailable, or incomplete.
- Active socket conflicts continue to surface instead of being
overwritten.
- **Documentation**
- Updated archive readiness, socket behavior, and schema documentation
to reflect current system behavior.
- **Reliability**
- Improved validation of session-related data inputs and projections for
more consistent derived results.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 5 (1M context) <[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. |
|
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
Implement the post-ingest embedding task infrastructure from #828: add embedding readiness to
DaemonStatus, cost cap enforcement, model/dimension change detection, and dimension-aware vec0 DDL. 11 files, +433/-28 lines.Problem
The embedding pipeline was built but dormant — no status visibility, no cost governance, no graceful model/dimension change handling. The daemon had no way to expose embedding coverage or halt embedding when cost exceeded a configured cap.
Solution
1. Embedding readiness in DaemonStatus
EmbeddingReadinessPydantic sub-model with 8 fields:embedding_enabled,embedding_model,embedding_dimension,embedding_pending_count,embedding_stale_count,embedding_coverage_percent,embedding_failure_count,embedding_estimated_cost_usdembedding_statusandembeddings_metatables via a bounded read-only probe (_embedding_readiness_info())daemon_status_payloadandformat_daemon_status_lines2. Cost cap enforcement
EmbeddingStatsSnapshotgainsfailure_countandtotal_estimated_cost_usdembedding_max_cost_usdfrom config, tracks cumulative cost (rough estimate: 500 tokens/msg * $0.10/1M tokens), and halts when cap is exceededsqlite_vec_support.py3. Model/dimension change detection
_reconcile_embedding_config_change()in convergence_stages.py: compares configured model/dimension against storedembeddings_metaneeds_reindex = 1on allembedding_statusrows_reconcile_vec0_dimension()4. Dimension-aware vec0 DDL
_ensure_tables()generates vec0 DDL with the configured dimension (no longer hardcoded 1024)_vec0_table_dimension()reads current dimension from sqlite_master DDL_reconcile_vec0_dimension()drops vec0 on dimension mismatch5. No-key graceful degradation
_embedding_config_enabled()returning False when no Voyage key — embedding stage reports "disabled" in statusFiles modified
polylogue/daemon/status.pypolylogue/daemon/convergence_stages.pypolylogue/storage/embeddings/models.pypolylogue/storage/embeddings/sql.pypolylogue/storage/embeddings/embedding_stats.pypolylogue/storage/embeddings/status_payload.pypolylogue/storage/search_providers/__init__.pypolylogue/storage/search_providers/sqlite_vec_runtime.pypolylogue/storage/search_providers/sqlite_vec_support.pydocs/daemon.mddocs/architecture.mdVerification
What's the gap
_embed_conversations_syncis tested indirectly through existing tests; dedicated unit tests for cost threshold halting would improve confidence._reconcile_embedding_config_changeoperates on live DB state; adding a layered test with controlled embeddings_meta rows would strengthen coverage.test_embedding_stats.pyfail due toSessionInsightStatusSnapshotbeing a plain class (not a dataclass) without__init__— unrelated to this change.Ref #828