Repository navigation
refactor: split classify_raw_revision_cohort's identity-split flag - #3645
Conversation
Replace the single check_source_path_identity_split boolean parameter with two named entry points -- classify_raw_revision_cohort_for_rebuild_repair (always applies the source-path cross-key divergent-evidence guard) and classify_raw_revision_cohort_for_live_watch (never does). The shared implementation moves to a private _classify_raw_revision_cohort. Problem: the function's own docstring stated the guard is sound for the offline rebuild/backfill caller and unsound for the live-watch caller, so every caller had to independently pass the correct literal boolean by hand. Solution: name each question instead of sharing one flag. Updated the two production call sites (sources/revision_backfill.py, sources/live/batch.py, sources/live/append_ingest.py), ArchiveStore's delegating methods, and every test call site (including the ArchiveBlobPublisher/ArchiveStore monkeypatch targets in tests/infra/append_cohort_memory_counter.py and tests/integration/test_append_cohort_memory.py, which patch the method by name). Pure refactor -- no behavior change at any call site. Ref polylogue-vp2ky Co-Authored-By: Claude <[email protected]>
docs/plans/layering.yaml's writer-module entrypoint audit for revision_governance.py still listed the retired classify_raw_revision_cohort name; list the two replacement entrypoints instead. Ref polylogue-vp2ky Co-Authored-By: Claude <[email protected]>
|
Warning Review limit reached
Next review available in: 11 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 (13)
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 |
PR #3645 (vp2ky, split classify_raw_revision_cohort into _for_rebuild_repair/_for_live_watch variants) and PR #3639 (sp72, Drive revision lineage) landed within minutes of each other; sp72's new call site in _core.py still referenced the removed name, breaking every polylogue CLI invocation on master (ImportError). Use _for_live_watch, matching the actual live-tailed-watcher call sites (sources/live/append_ingest.py, sources/live/batch.py) and sp72's own stated intent ('the same governance the live tailed-watcher path already uses'). Co-Authored-By: Claude <[email protected]>
Summary
classify_raw_revision_cohort'scheck_source_path_identity_split: boolparameter answered two semantically distinct questions that happened to share one flag: whether to apply the source-path cross-key divergent-evidence guard. Its own docstring stated the heuristic is sound for one caller and unsound for the other, so every caller had to independently get the right literal right. This PR replaces the single flag with two named entry points.Problem
polylogue/storage/sqlite/archive_tiers/revision_governance.py:classify_raw_revision_cohortgates a source-path identity-split guard behindcheck_source_path_identity_split. The rebuild/backfill path (sources/revision_backfill.py) always needs the guard on (a stale pre-fix parser identity can split one physical document's re-acquisitions across two logical_source_keys). The live-watch path (sources/live/batch.py,sources/live/append_ingest.py) must always leave it off (a watched source path can be legitimately, atomically replaced with a different session's content, which must not be quarantined as "divergent evidence"). A boolean shared between two callers who need opposite fixed answers is a naming/logic bug waiting to bite the next caller that gets the literal wrong.Solution
_classify_raw_revision_cohort(unchanged body/logic).classify_raw_revision_cohort_for_rebuild_repair(always applies the guard) andclassify_raw_revision_cohort_for_live_watch(never does), each a thin wrapper with no boolean parameter.ArchiveStore's two delegating methods, the three production call sites, every test call site (including theArchiveStore/ArchiveBlobPublishermonkeypatch targets intests/infra/append_cohort_memory_counter.pyandtests/integration/test_append_cohort_memory.py, which patch the method by name), anddocs/plans/layering.yaml's writer-module entrypoint inventory.Verification
devtools test tests/unit/storage/test_revision_replay.py tests/unit/sources/test_live_append_cursor_resynthesis.py tests/unit/storage/test_raw_authority_verdict_projection.py->44 passeddevtools test tests/integration/test_append_cohort_memory.py-> 1 passed, 3 pre-existing failures confirmed unrelated (reproduced identically against unmodifiedorigin/masterbefore this change; these tests do not referenceclassify_raw_revision_cohortin their failure path)devtools test tests/unit/sources/test_live_batch_support.py-> 3 pre-existing failures (test_full_ingest_skips_durably_excised_content_without_aborting_batch,test_full_ingest_writes_archive_with_route_observability,test_append_multi_session_payload_is_rejected_before_index_write) confirmed to reproduce identically on unmodifiedorigin/master; not caused by this changedevtools verify --quick-> exit 0 (all steps ok, includingverify layeringafter updatingdocs/plans/layering.yaml's entrypoint list)Ref polylogue-vp2ky
Co-Authored-By: Claude [email protected]