Skip to content

fix(proposals): stop payload precheck shadowing dead claim refs - #601

Merged
plind-junior merged 1 commit into
testfrom
fix/dead-claim-refs-precheck-shadow
Jul 30, 2026
Merged

fix(proposals): stop payload precheck shadowing dead claim refs#601
plind-junior merged 1 commit into
testfrom
fix/dead-claim-refs-precheck-shadow

Conversation

@plind-junior

Copy link
Copy Markdown
Member

What changed

approve() no longer runs the page→claim existence check from
_payload_block_reason; it passes the new skip_dead_claim_refs=True so its
own dead-claim-refs branch is the one that decides. check_approvable keeps
the check unchanged, so the batch vouch approve a b precheck still flags
dangling refs and stays all-or-nothing.

Why

two landed changes collided semantically on test. the propose-time payload
validation added a page→claim existence check to _payload_block_reason, and
approve() runs that precheck before reaching its dead-claim-refs handling.
so a page proposal citing a deleted claim raised a flat ProposalError,
DeadClaimRefsError could never surface through the real entrypoint, the
drop_missing_claims strip path became unreachable, and the jsonl surface
reported invalid_request instead of dead_claim_refs.

three cases in tests/test_dead_claim_refs.py are red on test (and on every
pr based on it, e.g. #599) across py3.11/3.12/3.13.

What might break

nothing on disk. no file moves, no field shape changes. the only behaviour
change is at the approve gate, and it restores the documented contract: a page
citing a missing claim raises DeadClaimRefsError (still a ProposalError, so
existing except ProposalError callers are unaffected) instead of the generic
block, and the dangling ref is still never written.

VEP

not a surface change — restores the already-specified approve behaviour.

Tests

  • make check passes locally (lint + mypy + pytest)
  • New / changed behaviour has a test — tests/test_dead_claim_refs.py goes
    green again; test_approve_page_update_rejects_stale_claim_ref now pins
    the specific DeadClaimRefsError and asserts the existing page body is
    left untouched
  • CHANGELOG.md updated under ## [Unreleased] — fixes unreleased
    breakage introduced on test, nothing user-visible to note

the propose-time payload validation added a page->claim existence check
to _payload_block_reason. approve() runs that precheck before its own
dead-claim-refs handling, so a page citing a deleted claim raised a flat
ProposalError and DeadClaimRefsError could never surface -- the
drop_missing_claims strip path became unreachable and three
tests/test_dead_claim_refs.py cases went red on test.

approve() now passes skip_dead_claim_refs=True; check_approvable keeps
the check so the batch cli precheck still flags dangling refs and stays
all-or-nothing. the storage test that asserted the old wording now pins
the specific DeadClaimRefsError and that the page body is untouched.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 13 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: CHILL

Plan: Pro Plus

Run ID: 26569c76-01b8-4421-b239-75f15439622a

📥 Commits

Reviewing files that changed from the base of the PR and between 4cea97e and 71b9db0.

📒 Files selected for processing (2)
  • src/vouch/proposals.py
  • tests/test_storage.py

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.

@github-actions github-actions Bot added storage kb storage, migrations, schemas, and proposals tests tests and fixtures size: XS less than 50 changed non-doc lines ci: passing ci is green labels Jul 30, 2026
plind-junior added a commit that referenced this pull request Jul 30, 2026
picks up the approve-gate fix (#601) so this branch's ci is green on its
own base rather than inheriting the three red dead-claim-refs cases from
test.
@plind-junior
plind-junior merged commit 5f9e67b into test Jul 30, 2026
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci: passing ci is green size: XS less than 50 changed non-doc lines storage kb storage, migrations, schemas, and proposals tests tests and fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant