Skip to content

fix: close Wave 1 post-merge review debt (re4a, iwth, ihwv) - #2901

Merged
Sinity merged 3 commits into
masterfrom
feature/fix/wave1-followup-debt
Jul 14, 2026
Merged

Sinity merged 3 commits into
masterfrom
feature/fix/wave1-followup-debt

Conversation

@Sinity

@Sinity Sinity commented Jul 14, 2026

Copy link
Copy Markdown
Owner

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:

  • polylogue-re4a: the excision-bypass regression test routed through the pre-existing small-payload gate, never touching the new streaming blob-ref gate it claimed to prove.
  • polylogue-iwth: (1) the operator-judgment-guard test asserted only fields that are deterministically identical whether or not the guard fires, so it would pass even with the guard removed; (2) repair_duplicate_raw_identity's apply path skipped RebuildLease, unlike its sibling actuators.
  • polylogue-ihwv: sinex_mode's own fix was independently re-verified correct (existing targeted tests green); two residual nits: material_adapter.py silently dropped unrecognized blocks without declaring a fidelity gap, and ObligationStatus.PUBLISHING was declared but never written.

Solution

  • tests/unit/sources/test_live_batch_support.py: patch _STREAMING_FULL_INGEST_BYTES down 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-memory mock.patch on is_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 an updated_at_ms-unchanged assertion — the one field upsert_assertion's ON CONFLICT always 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 returning None only for the guard's own read, real behavior otherwise) — bypassing the guard moves updated_at_ms as predicted. Wrapped repair_duplicate_raw_identity's apply block in RebuildLease(archive_root).
  • polylogue/sinex/material_adapter.py + test: session_material_from_session now emits a FidelityGapInput(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: added mark_publishing(), a pre-attempt transition distinct from mark_attempt (no attempt_count/receipt outcome yet). PublicationService._attempt now durably marks the obligation PUBLISHING immediately before the transport call, in its own short transaction, so a crash mid-attempt is now observably distinguishable from a never-tried pending row — consistent with pending()/lag() already including PUBLISHING in 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 passed
  • 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
  • devtools test tests/unit/sinex/ — 25 passed
  • devtools verify --quick — exit 0, all 16 steps green

Ref polylogue-re4a. Ref polylogue-iwth. Ref polylogue-ihwv.

Sinity added 3 commits July 14, 2026 18:01
…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.
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 23fba1f9-47d2-4f3a-b947-cc67be8538bb

📥 Commits

Reviewing files that changed from the base of the PR and between 17e0137 and 6da6103.

📒 Files selected for processing (8)
  • polylogue/sinex/material_adapter.py
  • polylogue/sinex/obligations.py
  • polylogue/sinex/service.py
  • polylogue/storage/repair.py
  • tests/unit/sinex/test_material_adapter.py
  • tests/unit/sinex/test_obligations.py
  • tests/unit/sources/test_live_batch_support.py
  • tests/unit/storage/test_browser_capture_origin_repair.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix/wave1-followup-debt

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Sinity
Sinity merged commit bb77f9c into master Jul 14, 2026
2 checks passed
@Sinity
Sinity deleted the feature/fix/wave1-followup-debt branch July 14, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant