Repository navigation
fix: close Wave 1 post-merge review debt (re4a, iwth, ihwv) - #2901
Conversation
…e payload one Problem: PR #2875's anti-vacuity test for the excision-bypass blocker routed its small fixture payloads through write_raw_payload -> write_source_raw_session (the pre-existing excision gate), never touching write_raw_blob_ref -> write_source_raw_session_blob_ref (the new gate the test claims to prove). Found by independent adversarial re-review; the underlying production fix was separately verified correct, so this was a coverage gap, not a code gap. What changed: patch _STREAMING_FULL_INGEST_BYTES down to 1 (matching the pattern already used elsewhere in this file) so both fixture files route through the blob-ref write path. Verified with an in-memory mock.patch on is_blob_hash_excised (not a file edit -- the auto mode classifier correctly blocked editing the production gate itself): the test fails with excised_skips == 0 when the gate is mocked off, and passes with it intact. Ref polylogue-re4a.
…ldLease Problem: independent adversarial re-review of PR #2877 found two gaps. (1) test_record_conflict_blockers_never_clobbers_an_operator_judged_row asserted only status/value after a re-run, both of which are deterministically identical to the first run regardless of whether the guard fires (same evidence -> same computed value; upsert_assertion's own terminal-judgment chokepoint separately protects status) -- so the test would pass even with the guard removed. (2) repair_duplicate_raw_identity's --apply path mutated index.db directly without acquiring RebuildLease, unlike its two sibling actuators (repair_quarantined_accepted_raws, _repair_browser_capture_origin_mismatches). What changed: the test now also asserts updated_at_ms is unchanged across the re-run -- upsert_assertion's ON CONFLICT always sets updated_at_ms = excluded.updated_at_ms unconditionally, so this is the one field a guard-bypassed write would move that a guard-respecting short-circuit would not. Verified as a genuine negative control via an in-memory mock (side_effect returning None only for the guard's own read_assertion_envelope call, real behavior otherwise): with the guard bypassed, updated_at_ms moves; with it removed via the actual code path, the real test now fails (confirmed by temporarily reverting the mocked scenario). repair_duplicate_raw_identity now wraps its apply block in RebuildLease(archive_root), matching its siblings. Verification: devtools test tests/unit/storage/test_browser_capture_origin_repair.py -k test_record_conflict_blockers_never_clobbers_an_operator_judged_row (1 passed); devtools test tests/unit/storage/test_duplicate_raw_identity_repair.py (13 passed). Ref polylogue-iwth.
…status Problem: independent re-review of PR #2873's sinex_mode unwired-fix found the fix itself genuinely correct (verified independently here too, via tests/unit/core/test_config_inventory.py's sinex_mode diagnostic tests), plus two smaller residual gaps. (1) material_adapter.py's _block_input() silently returned None (dropping the block) for a missing/unrecognized block type, without recording a FidelityGapInput -- inconsistent with the module's own stated "honest under-coverage, not silent data loss" principle for the lineage/usage/session-event gap it does declare. (2) ObligationStatus.PUBLISHING was declared and read in queries/sets but never written by any code path. What changed: session_material_from_session now emits one FidelityGapInput (gap_kind="dropped_block") per dropped block, naming the message/block position. Verified against the existing test_material_adapter.py fixture, which already had a "not-a-real-block-type" block commented "must be dropped, not raise" -- extended its assertions to require the new gap rather than adding a fresh fixture. For PUBLISHING: added obligations.mark_publishing(), a pre-attempt transition distinct from mark_attempt (no attempt_count/receipt outcome yet, since the transport call hasn't run). PublicationService._attempt now durably marks the obligation PUBLISHING immediately before calling transport.publish_revision, in its own short transaction -- a crash mid-attempt now leaves the row observably at "publishing" instead of indistinguishable from a never-tried "pending" row, which is what the existing pending()/lag() queries already assumed when they included PUBLISHING in their status filter. Verification: devtools test tests/unit/sinex/ (25 passed); devtools verify --quick (exit 0, all 16 steps green). Ref polylogue-ihwv.
|
Warning Review limit reached
Next review available in: 30 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 Run ID: 📒 Files selected for processing (8)
✨ 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 |
Summary
Closes three small pieces of independent-reviewer-flagged residual debt from Wave 1's merged clusters (excision #2875, raw-identity #2877, sinex evidence mode #2873). Done directly, without a separate implementer/reviewer Workflow round, per operator instruction.
Problem
Each item is a real gap an independent adversarial reviewer found in an already-merged PR:
repair_duplicate_raw_identity's apply path skippedRebuildLease, unlike its sibling actuators.material_adapter.pysilently dropped unrecognized blocks without declaring a fidelity gap, andObligationStatus.PUBLISHINGwas declared but never written.Solution
tests/unit/sources/test_live_batch_support.py: patch_STREAMING_FULL_INGEST_BYTESdown to 1 (existing pattern in this file) so the excised/normal fixtures route through the blob-ref write path. Verified as a genuine anti-vacuity check with an in-memorymock.patchonis_blob_hash_excised(not a file edit to the production gate — the auto-mode classifier correctly blocked that as a security-weakening action).tests/unit/storage/test_browser_capture_origin_repair.py+polylogue/storage/repair.py: added anupdated_at_ms-unchanged assertion — the one fieldupsert_assertion'sON CONFLICTalways moves regardless of the guard, so it's the only observable proof the guard short-circuited before writing. Verified as a genuine negative control with an in-memory mock (side_effect returningNoneonly for the guard's own read, real behavior otherwise) — bypassing the guard movesupdated_at_msas predicted. Wrappedrepair_duplicate_raw_identity's apply block inRebuildLease(archive_root).polylogue/sinex/material_adapter.py+ test:session_material_from_sessionnow emits aFidelityGapInput(gap_kind="dropped_block")per dropped block. Extended the existing fixture's assertions (it already had a"not-a-real-block-type"block commented "must be dropped, not raise").polylogue/sinex/obligations.py+service.py+ test: addedmark_publishing(), a pre-attempt transition distinct frommark_attempt(no attempt_count/receipt outcome yet).PublicationService._attemptnow durably marks the obligationPUBLISHINGimmediately before the transport call, in its own short transaction, so a crash mid-attempt is now observably distinguishable from a never-triedpendingrow — consistent withpending()/lag()already includingPUBLISHINGin their filters.Verification
devtools test tests/unit/sources/test_live_batch_support.py -k test_full_ingest_skips_durably_excised_content_without_aborting_batch— 1 passeddevtools test tests/unit/storage/test_browser_capture_origin_repair.py -k test_record_conflict_blockers_never_clobbers_an_operator_judged_row— 1 passeddevtools test tests/unit/storage/test_duplicate_raw_identity_repair.py— 13 passeddevtools test tests/unit/sinex/— 25 passeddevtools verify --quick— exit 0, all 16 steps greenRef polylogue-re4a. Ref polylogue-iwth. Ref polylogue-ihwv.