Repository navigation
feat(storage): route antigravity acquisition through raw-admission chokepoint - #3688
Conversation
…okepoint Problem: polylogue-1fijp's admit_raw_observation() chokepoint had one real production call site (Claude Code fact-artifact admission, PR #3668). antigravity_conversation_acquisition.py's acquire_antigravity_conversations_once still wrote raw_sessions rows via write_raw_and_parsed_result(), which always persists a bare FULL/revision=None row -- the nullable "figure it out later" limbo the chokepoint exists to eliminate. This call site is structurally BASELINE-only: it pre-filters to .pb cascade ids not already present in raw_sessions, so no prior head ever exists to compare against. Solution: added admit_raw_and_parsed_result() to revision_governance.py, a narrower sibling of write_raw_and_parsed_result() that resolves admit_raw_observation()'s typed arms against prior_head=None and raises if the caller's BASELINE-only contract is violated (any other arm would mean a prior head existed and the caller under-filtered). Wired an ArchiveStore wrapper method (mirroring admit_raw_artifact_payload's existing shape) and switched the antigravity call site to it. Also widened admit_raw_observation itself to accept and forward additional_blob_refs (attachment blob refs) to its four session-content write_source_raw_session calls -- the original chokepoint silently dropped this parameter, which write_raw_and_parsed_result had always forwarded; without this widening, migrating any attachment-bearing call site would have quietly lost attachment blob refs on the raw row. Not migrated (documented, not force-fit): sources/live/append_ingest.py and sources/live/batch.py both resolve real prior-head revision chains (bind_raw_revision/classify_raw_revision_cohort_for_live_watch) that require a parsed session's provider_session_id to derive logical_source_key -- architecturally incompatible with admit_raw_observation's single-call, pre-parse model. archive_ingest.py's main batch-import path uses content-addressed deterministic_raw_session_id + shared_raw_ids dedup, a different idempotency mechanism than revision-chain byte comparison. storage/repair.py's raw_sessions INSERT is a browser-origin repair copy-forward of already-proven evidence into a synthetic row, not a fresh acquisition. codex_title_census.py, context/*_correlation.py, hooks.py, storage/raw_reconciler.py, storage/hook_payload_ref_reconciliation.py were verified via grep against current source: none of them call write_source_raw_session or any raw-write wrapper at all (read-only queries or comments referencing the raw_sessions table) -- the bead/PR #3668's cited call-site list had drifted from current source. Verification: - devtools test tests/unit/daemon/test_antigravity_conversation_acquisition.py tests/unit/storage/test_raw_admission.py -> 13 passed - mypy --strict on raw_admission.py, revision_governance.py, archive.py, antigravity_conversation_acquisition.py -> Success: no issues found in 4 source files Ref polylogue-1fijp Co-Authored-By: Claude <[email protected]>
…ypoint devtools verify layering's writer-module-entrypoint-inventory check flagged the new revision_governance.py function added for polylogue-1fijp (a directly-detected mutating entrypoint via its admit_raw_observation/ _index_parsed_for_retained_raw calls). Add it to docs/plans/layering.yaml's declared entrypoint list for that module, matching its sibling writer functions. Verification: devtools verify layering -> No layering violations found (pre-existing 306 baselined-import-violation / 2 stale-baseline-entry counts unrelated to this change, unchanged from before it). Ref polylogue-1fijp Co-Authored-By: Claude <[email protected]>
|
Warning Review limit reached
Next review available in: 37 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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 (5)
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 |
Summary
Migrates one real production call site (
antigravity_conversation_acquisition.py) off the directwrite_raw_and_parsed_result()writer onto polylogue-1fijp's raw-admission chokepoint (admit_raw_observation(), mechanism landed in #3668), and audits the bead/PR's own cited call-site list against current source.Problem
PR #3668 landed
admit_raw_observation()with one routed call site (Claude Code fact-artifact admission) and surveyed 11+ otherwrite_source_raw_sessioncall sites as not-yet-migrated. Re-grepping current source for this dispatch found that survey has drifted:codex_title_census.py,context/codex_spawn_edge_correlation.py,context/hermes_delivery_correlation.py,daemon/antigravity_conversation_acquisition.py(as originally listed),sources/hooks.py,storage/repair.py,storage/raw_reconciler.py, andstorage/hook_payload_ref_reconciliation.pydo not callwrite_source_raw_sessionor any raw-write wrapper at all today — they only read/reference theraw_sessionstable (SELECT queries, comments). The real remaining direct callers ofwrite_source_raw_sessionare exclusively the two generic writer primitives insiderevision_governance.pyitself (write_raw_payload,write_raw_and_parsed_result); production feature code reaches raw writes only through those orsources/live/*.Solution
polylogue/storage/sqlite/archive_tiers/raw_admission.py: widenedadmit_raw_observation()to accept and forwardadditional_blob_refs(attachment blob refs) to its four session-contentwrite_source_raw_sessioncalls (BASELINE/APPEND/SUPERSEDE/REFUSED_AMBIGUOUS). The chokepoint previously silently dropped this parameter relative towrite_source_raw_session's own capability — migrating any attachment-bearing call site without this fix would have quietly lost attachment blob refs on the raw row.polylogue/storage/sqlite/archive_tiers/revision_governance.py: addedadmit_raw_and_parsed_result(), a narrower sibling ofwrite_raw_and_parsed_result()that resolvesadmit_raw_observation()'s typed arms againstprior_head=Noneand raises if the caller's BASELINE-only contract is violated. Wired anArchiveStore.admit_raw_and_parsed_resultwrapper (mirrors the existingadmit_raw_artifact_payloadshape from feat(storage): add raw-admission chokepoint mechanism + atomic-read contract #3668).polylogue/daemon/antigravity_conversation_acquisition.py: switchedacquire_antigravity_conversations_onceto the new entrypoint. This call site is structurally BASELINE-only — it pre-filters to.pbcascade ids not already present inraw_sessions, so no prior head ever exists to compare against.docs/plans/layering.yaml: declared the new entrypoint (devtools verify layering's writer-module-entrypoint-inventory check requires it).Scope / call-site status (acceptance-criteria honesty)
daemon/antigravity_conversation_acquisition.py(arm: BASELINE only).sources/live/append_ingest.py/sources/live/batch.py— both resolve real prior-head revision chains (bind_raw_revision/classify_raw_revision_cohort_for_live_watch) that require a parsed session'sprovider_session_idto derivelogical_source_key, i.e. the decision depends on content only available after parsing.admit_raw_observationis a single synchronous pre-parse call — architecturally incompatible. The bead itself calls this family "mostly compliant"; explicitly out of scope per the dispatch.pipeline/services/archive_ingest.py's main session-ingest path (write_pair'swrite_raw_and_parsed_resultcall) — uses content-addresseddeterministic_raw_session_id+shared_raw_idsin-batch dedup, a different idempotency mechanism than revision-chain byte comparison against a mutable head. Forcing it through the typed arms would be an architecture mismatch, not a mechanical swap, and it's the highest-traffic write path in the system.storage/repair.py'sraw_sessionsINSERT (browser-origin repaircopy_forward) — constructs a synthetic row from already byte-proven evidence during repair, not a fresh acquisition observation; doesn't fit the "compare fresh payload to prior head" model at all.sources/drive/__init__.py/pipeline/services/ingest_batch/_core.pyDrive lineage bind — explicitly excluded per dispatch (separate JSON-structural-diff classifier lane, per feat(storage): add raw-admission chokepoint mechanism + atomic-read contract #3668's own scope notes).codex_title_census.py,context/*_correlation.py,sources/hooks.py,storage/raw_reconciler.py,storage/hook_payload_ref_reconciliation.py— verified via grep against current source: nowrite_source_raw_session/raw-write-wrapper calls exist in these files at all. The bead/PR feat(storage): add raw-admission chokepoint mechanism + atomic-read contract #3668's cited list had drifted; nothing to migrate here.AC status (polylogue-1fijp)
Verification
devtools test tests/unit/daemon/test_antigravity_conversation_acquisition.py tests/unit/storage/test_raw_admission.py-> 13 passeddevtools test -k "revision_governance or raw_admission or archive_ingest or antigravity"-> 132 passedmypy --strictonraw_admission.py,revision_governance.py,archive.py,antigravity_conversation_acquisition.py->Success: no issues found in 4 source filesdevtools verify --quick->exit_code: 0devtools verify layering->No layering violations found(306 pre-existing baselined-import violations / 2 stale-baseline entries unchanged from before this PR, unrelated)Ref polylogue-1fijp