Repository navigation
fix(sources): acquire Antigravity's real .pb conversations in the live daemon - #3638
Conversation
Problem ------- polylogue-3m3de: the live daemon never acquires Antigravity's real conversations/*.pb trajectories -- only a one-shot `polylogue import` run does. A periodic daemon reconciliation loop needs to convert only cascades not yet in raw_sessions on each tick, instead of paying the language-server subprocess + markdown-conversion cost for the whole corpus every time. Solution -------- Add an `only_cascade_ids` filter to `antigravity.iter_language_server_exports` and thread it through `source_parsing.iter_antigravity_language_server_sessions`. `None` (default) preserves existing behavior (export everything); an empty frozenset is a real no-op (no cascades exported, no fallback triggered since the conversations/ directory still exists). Verification ------------ devtools test tests/unit/sources/test_antigravity_language_server.py -- 21 passed
…t path Problem ------- polylogue-3m3de: `parse_sources_archive`'s multi-worker branch called `iter_antigravity_language_server_sessions(source)` without `capture_raw=True`. Every exported session's raw_data was therefore None, so `_archive_raw_payload`/`_archive_raw_source_path` fell back to a JSON dump of the parsed session and the shared source root path -- collapsing every conversation's raw provenance onto one non-unique source_path instead of its real `.pb` file and bytes. The sequential (workers<=1) path already passed capture_raw=True via `iter_source_sessions_with_raw`; only the parallel optimization added for Antigravity's sequential-subprocess carve-out missed it. Solution -------- Pass capture_raw=True, blob_root, and blob_store through on the parallel path too, matching the sequential path's behavior. Verification ------------ devtools test tests/unit/pipeline/test_archive_ingest_shared_raw.py tests/unit/pipeline/test_archive_ingest_commit_batching.py tests/unit/sources/parsers/test_antigravity.py -- 21 passed
Problem ------- polylogue-3m3de: verified live 2026-08-03, raw_sessions origin='antigravity- session' held 232 rows (grown from 116 before PR #3441 merged), every one a brain/*.md.metadata.json sidecar, and zero rows for conversations/*.pb -- the 44 real conversations (314MB) were still never acquired despite #3441 fixing the batch importer's directory-gate bug. Root cause: the live daemon's acquisition model is entirely the WatchSource file-watcher (sources/live/watcher.py), which for antigravity only matches `*.metadata.json` (`WatchSource(name="antigravity", ..., suffixes=(".metadata.json",))`). `.pb` files are structurally invisible to it, and even if watched, the watcher's per-file streaming-JSON model has no hook to drive the local Antigravity language-server subprocess the `.pb` -> markdown conversion requires. #3441's fix only reached the batch importer (`pipeline/services/archive_ingest.py`), which the running daemon never calls -- only a one-shot `polylogue import` does. So the watcher kept admitting metadata-only fragments forever while the real conversations sat permanently un-acquired by the daemon. Solution -------- New `polylogue/daemon/antigravity_conversation_acquisition.py`, following the existing periodic-daemon-check shape (`embedding_backlog.py`, `blob_gc_periodic.py`): `periodic_antigravity_conversation_acquisition_check` runs on a 30-minute cadence via `daemon_write_coordinator`, diffs `conversations/*.pb` cascade ids against `raw_sessions` to find not-yet- acquired ones, and converts only those (bounded to 25 per tick) via `iter_antigravity_language_server_sessions(..., only_cascade_ids=...)` (polylogue-3m3de.1, this PR's other commit). Wired into `daemon/cli.py`'s periodic_loops alongside the other maintenance checks. `polylogue/daemon` importing storage/pipeline/sources substrate directly is an existing, accepted pattern for this class of periodic maintenance module (`embedding_backlog.py`, `blob_gc_periodic.py`, `secret_scan_sweep.py` are all already baselined the same way); added 7 new entries to `docs/plans/layering-surface-baseline.json` for the new file rather than routing through `insights`/`operations` -- there is no existing product- layer seam for "acquire raw provider bytes", and every sibling periodic check takes the same direct-substrate path. `docs/plans/topology-target.yaml` regenerated for the new module (`devtools render topology-projection`). Verification ------------ devtools test tests/unit/daemon/test_antigravity_conversation_acquisition.py -- 4 passed devtools verify --quick -- exit_code 0 (format/lint/mypy/render-all/layering all ok) Ref polylogue-3m3de
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
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 |
…ition PR Synthetic antigravity fixtures wrote a flat root/*.md.metadata.json layout and used Source(name='antigravity-test', ...) -- PR #3638's iter_antigravity_language_server_sessions requires source.name to resolve via Provider.from_string (must be exactly 'antigravity') and its brain-metadata fallback requires root/brain/<subdir>/*.metadata.json, matching the real ~/.gemini/antigravity layout. Neither matched, so every synthetic antigravity fixture silently parsed to zero sessions. Also updated a stale test double missing the new only_cascade_ids kwarg. Co-Authored-By: Claude <[email protected]>
Summary
The live daemon never acquired Antigravity's real conversation trajectories (
conversations/*.pb) despite PR #3441 fixing the batch-importer's directory-gate bug. This closes the daemon-side acquisition gap with a new periodic reconciliation loop, plus two related bugs found while tracing the root cause.Problem
Verified live 2026-08-03 (polylogue-3m3de):
raw_sessionsorigin='antigravity-session' held 232 rows (grown from 116 before PR #3441 merged three days earlier), every one abrain/*.md.metadata.jsonsidecar fragment, and zero rows forconversations/*.pb-- the 44 real conversations (314MB) sitting permanently un-acquired by the running daemon.Root cause traced to
sources/live/watcher.py: the live daemon's only acquisition model for local sources is theWatchSourcefile-watcher, and for antigravity it only matches*.metadata.json(WatchSource(name="antigravity", root=antigravity_path(), suffixes=(".metadata.json",)))..pbfiles are structurally invisible to it, and even if watched, the watcher's per-file streaming-JSON model has no hook to drive the local Antigravity language-server subprocess the.pb-> markdown conversion requires. #3441's fix only reached the batch importer (pipeline/services/archive_ingest.py), which the running daemon never calls -- only a one-shotpolylogue importdoes. So the watcher kept admitting metadata-only fragments forever while the real conversations sat permanently un-acquired.Reproduced directly: running
antigravity.iter_language_server_exportsagainst the real~/.gemini/antigravityarchive (44 real.pbfiles, 314MB) works correctly and yields real conversation content -- the acquisition code is sound, it is simply never invoked by the live daemon.Two more bugs surfaced while tracing this:
pipeline/services/archive_ingest.py's multi-worker parse branch callediter_antigravity_language_server_sessions(source)withoutcapture_raw=True(unlike the sequential branch), so every exported session'sraw_datawasNoneand raw provenance collapsed onto one non-unique source_path instead of each conversation's actual.pbfile/bytes.iter_language_server_exportsalways converted the whole corpus, which would make a periodic reconciliation loop re-run the language-server subprocess for already-acquired conversations on every tick.Solution
sources/parsers/antigravity.py: addedonly_cascade_idsfilter toiter_language_server_exports, threaded throughsource_parsing.iter_antigravity_language_server_sessions.None(default) preserves existing behavior.pipeline/services/archive_ingest.py: fixed the parallel-pathcapture_rawomission.polylogue/daemon/antigravity_conversation_acquisition.py:periodic_antigravity_conversation_acquisition_check, following the existing periodic-daemon-check shape (embedding_backlog.py,blob_gc_periodic.py). Runs on a 30-minute cadence viadaemon_write_coordinator, diffsconversations/*.pbcascade ids againstraw_sessionsto find not-yet-acquired ones, and converts only those (bounded to 25/tick) via the newonly_cascade_idsfilter. Wired intodaemon/cli.py'speriodic_loops.docs/plans/layering-surface-baseline.json: added 7 entries for the new daemon module's direct substrate imports, matching the existing pattern for sibling periodic-check modules (embedding_backlog.py,blob_gc_periodic.py,secret_scan_sweep.pyare baselined the same way -- there is no existing product-layer seam for "acquire raw provider bytes" and every sibling periodic check takes the same direct-substrate path).docs/plans/topology-target.yamlregenerated for the new module.Not in scope / deferred: actually re-triggering full acquisition against the live production archive (this PR ships the mechanism; the daemon will pick up the 44 real conversations on its next reconciliation tick after deploy). Did not add a
.pbsuffix to theWatchSourceitself -- the per-file streaming-JSON watcher model cannot drive a subprocess conversion, so a dedicated periodic loop is the correct shape, not a watcher suffix change.Verification
devtools test tests/unit/sources/test_antigravity_language_server.py-- 21 passed (includes 2 new tests foronly_cascade_ids)devtools test tests/unit/pipeline/test_archive_ingest_shared_raw.py tests/unit/pipeline/test_archive_ingest_commit_batching.py tests/unit/sources/parsers/test_antigravity.py-- 21 passeddevtools test tests/unit/daemon/test_antigravity_conversation_acquisition.py-- 4 passed (new file: acquisition, idempotent re-run, bounded batching)devtools verify --quick--exit_code: 0(format/lint/mypy/render-all/layering all ok)Ref polylogue-3m3de