Repository navigation
test(maintenance): give the reindex canary a real authority drift to find - #4027
Merged
Merged
Conversation
…find
Ref polylogue-tjr4z
The corpus side moved, not the comparison. Dumping both sides in the
fixture shows the canary compared every scoped table and found nothing:
differences=(), counts_by_table={}, missing_tables=(), missing_columns=(),
with raw_revision_applications 20 rows and raw_revision_heads 18 rows
IDENTICAL on the active index and the candidate generation. A faithful
rebuild of this campaign corpus now reproduces the active index exactly,
so the divergence the canary was written to surface no longer exists to be
surfaced.
The >0 assertion is untouched, and so is the differ. Instead the fixture
now creates the drift it claims to detect: before the canary runs, the
ACTIVE index's accepted authority is perturbed semantically -- one
raw_revision_heads.accepted_content_hash reversed, one
raw_revision_applications.decision flipped to superseded.
Both columns are chosen deliberately. reindex_canary's
_VOLATILE_COLUMNS_BY_TABLE ignores decided_at_ms (and decision_id) on
exactly these two tables so that accepted/superseded authority drift stays
visible, so a timestamp nudge would be correctly ignored and would prove
nothing. Perturbing the accepted tuple is the drift class the canary
exists for.
This strengthens the anti-vacuity property rather than relaxing it. The
assertion previously depended on an incidental rebuild discrepancy that
has since been fixed; it now depends on a declared divergence the test
itself creates, so the paired assertion -- counts_by_table being exactly
{raw_revision_applications, raw_revision_heads} -- confirms the canary
reported that specific drift and could not have come from a fabricated
summary.
The untouched-active digest is re-anchored after the deliberate edit, so
the post-canary assertion still means "the canary did not write to the
active index" instead of silently absorbing it.
xfail marker removed in the same commit; the file is 4 passed.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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 |
Sinity
added a commit
that referenced
this pull request
Aug 19, 2026
…k-authority mechanism note Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HWcPJJJvuF25CqVwTFgSQC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The canary's anti-vacuity assertion failed because the corpus side moved, not the comparison. A faithful rebuild of the campaign corpus now reproduces the active index exactly, so there was no divergence left for the canary to surface. The
> 0assertion and the differ are both untouched; instead the fixture now creates the authority drift it claims to detect.Problem
test_real_inactive_rebuild_and_canary_preserve_active_and_reject_parser_as_duplicateassertedcanary.comparison.unexpected_count > 0and got 0.The ledger asked which side moved. Dumping both sides inside the fixture answers it unambiguously — the canary compared everything it was supposed to and found nothing:
Identical row counts on both tables, zero differences across every compared table, nothing missing. The comparison is reading the candidate's real read model perfectly well — there is simply nothing to report. The divergence the assertion depended on was an incidental rebuild discrepancy that has since been fixed, which makes the assertion vacuous rather than wrong.
This is the class the lead flagged from #4007's review advisories (fixture not genuinely divergent), and it lands on the fixture rather than on the comparison — so per that direction, the fix is to make the fixture genuinely divergent.
Solution
Before the canary runs, perturb the active index's accepted authority semantically: reverse one
raw_revision_heads.accepted_content_hash, and flip oneraw_revision_applications.decisiontosuperseded.The column choice is the load-bearing part.
reindex_canary._VOLATILE_COLUMNS_BY_TABLEdeliberately ignoresdecided_at_ms(anddecision_id) on exactly these two tables, with the comment that their semantic decision tuple stays compared "so accepted/superseded/rejected authority drift stays visible". A timestamp nudge would therefore be correctly ignored and prove nothing; perturbing the accepted tuple is precisely the drift class the canary exists to surface.This strengthens the anti-vacuity property rather than relaxing it. The assertion previously rode on an accidental discrepancy; it now rides on a divergence the test declares itself. The paired assertion —
set(counts_by_table) == {"raw_revision_applications", "raw_revision_heads"}— passes because the canary reported that specific drift and nothing else, which a fabricated summary could not produce. That is the mutation the docstring names.The untouched-active digest is re-anchored immediately after the deliberate edit, so the post-canary
_digest(root / "index.db") == active_beforeassertion still means "the canary did not write to the active index" instead of silently absorbing it.I did not weaken the
> 0assert, and I did not touch_compare_tableor the delta-expectation classification #4007 introduced.Verification
devtools verify --quick— all ten steps ok.devtools test tests/unit/maintenance/test_reindex_campaign.py— 4 passed, with thexfailmarker removed in the same commit (the file previously reported1 xfailed).origin/masterthe test failsassert 0 > 0under--runxfail; with the drift in place it passes, and reverting only the drift restores the identical failure.devtools verifydeliberately skipped per the lane gate policy for bootstrap-predicted lanes; focused + quick is the gate and the merge receipt is recorded centrally.Bead disposition matrix
polylogue-tjr4z> 0assert and differ untouched; xfail removed.polylogue-0x7nh(intersection-only column diffs, the "v43" fixture carrying current DDL, row-declarations waiving schema diffs) are untouched and remain that bead's scope.Ref polylogue-tjr4z