Skip to content

Admit assert_ne and debug_assert* through the shared execution gate - #10404

Merged
EffortlessSteven merged 2 commits into
mainfrom
claude/project-thread-4g2cqz-8983
Oct 25, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
claude/project-thread-4g2cqz-8983

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Before: only assert_eq! (and bare assert! for some families) went through the execution-admission gate. assert_ne!, debug_assert_eq!, debug_assert_ne! and debug_assert! credited findings from contexts that never run (after return, uncalled fn or closure, if false, impossible match arm, cfg!(any())).

After: all six assertion macros, bare or std::/core::-qualified, take the same admission. Dead-context assertions no longer credit return-value or side-effect findings, and a dead sibling does not change a live assertion's credit.

How: one ADMITTED_ASSERTION_MACROS list in classify/owner_pin.rs drives the gate, the compound-expression scan and the std-root proof; the syntax collector in syntax/owner_pin.rs now collects the same six names.

Source-of-truth Links

Governing issue or accepted claim: #8983
Acceptance delta (one sentence): assert_ne and the debug_assert* macros are admitted or refused by the same execution gate as assert_eq, bare or std-qualified.

Scope

  • Execution admission for the six assertion macros.

Non-goals: boolean assert!/debug_assert! return-value credit from dead contexts (#10389; gating it moves 6 Rust verdict-corpus rows including two ideal gap rows to limited), swallowed macros, outer infinite loops, process::exit.

Proof

cargo test --locked -p ripr --test dead_context_assertion_admission   # 264-row matrix; fails on main
cargo test --locked -p ripr --lib owner_pin
cargo xtask verdict-corpus check --language rust   # no moved rows, 3/668 false unchanged
cargo xtask check-evidence-promotion-honesty
cargo xtask precommit

Matrix versus main (396 findings): 96 dead-context findings flipped to reachable_unrevealed; no live, direct, mixed or extraction row changed.

Claim Boundary

May claim: the six macros share one admission gate for the families covered by the matrix. Must not claim: boolean assert! return-value dead credit is closed (#10389).

Rollback

Revert the commit; no schema or generated-artifact change.

Spec-Test-Code Traceability

  • Tests: crates/ripr/tests/dead_context_assertion_admission.rs
  • Code: crates/ripr/src/analysis/classify/owner_pin.rs, crates/ripr/src/analysis/syntax/owner_pin.rs

Generated by Claude Code

… gate (#8983)

assert_ne!, debug_assert_eq!, debug_assert_ne!, assert! and debug_assert!
(bare and std/core-qualified) now take the same execution admission as
assert_eq!, so an assertion in a context that cannot run no longer credits
a return-value or side-effect finding, and a dead sibling does not change a
live assertion's credit. Boolean assert!/debug_assert! return-value credit
from dead contexts stays open as #10389.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 25, 2026 15:14
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

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).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 176 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 726e16ac-9bd8-4387-9158-a98b0a4cdf2b
Commits

Reviewing files that changed from the base of the PR and between 237fa0a and 74ae0ab.

Files selected for processing: 6
  • .ripr/traceability.d/8983-assertion-macro-admission.toml
  • changelog.d/8983-assertion-macro-execution-admission.md
  • crates/ripr/src/analysis/classify/owner_pin.rs
  • crates/ripr/src/analysis/syntax/owner_pin.rs
  • crates/ripr/tests/dead_context_assertion_admission.rs
  • docs/specs/RIPR-SPEC-0197-owner-return-pins.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verification questions

  • Confirm the matrix claims coverage for all six macros, but its qualification loop only exercises bare and std:: forms, not core:: forms.
  • Confirm the six admitted macros are limited to bare and std/core-rooted spellings, and qualified names still require root proof or a trusted standard-macro path.
  • Confirm the public changelog says bare or std/core-qualified assertions are admitted, but the route matrix does not directly test core-qualified spellings or rebound roots.
  • Confirm the new 264-case matrix exercises bare and std-qualified forms, but it does not visibly cover core-qualified spellings despite the implementation and changelog claiming them.
  • Confirm the new integration matrix covers live and dead contexts but does not exercise buffer active-view semantics.
  • Confirm the stated proof scope is broader than the matrix: only bare and std-qualified spellings are exercised, while implementation advertises core qualification and handles root rebinding/unbound-root proofs.

Refuted

  • The change might mishandle an active view or stale length snapshot after a backing-store mutation.; refuted because: No buffer/view API or backing-store mutation is changed; the patch is limited to macro-name classification, root proof, syntax collection, tests, and changelog text.
  • The change might broaden beyond the documented assertion family into unrelated sibling macros.; refuted because: The shared list is explicitly limited to six assertion macro leaves, and the test matrix exercises those names bare and with std qualification rather than introducing a broader macro classification.

Evidence gaps

  • The focused matrix is scheduled late and its receipt was not yet available in this lane packet.
  • The classifier and syntax collector both recognize the same six macro names, but the owning specification still appears to enumerate only the older set.
  • The new integration test exercises dead and live contexts across all six macros and both bare/std forms, but the repository's ripr sensor failed with exit code 2 and cargo-test was not yet available.
  • Model proof intent was rejected by deterministic validation.

)

Review of 55fb28b found the check-helper collector still read only
assert_eq/assert, so a helper-borne assert_ne!/debug_assert* lost credit
once the gate covered it; the doctest root-proof refusal had the same
narrow list. Both now use the shared lists. SPEC-0197 lists the admitted
macros and the open #10389 residual, the changelog states the residual,
and the tests are registered in traceability.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG

Copy link
Copy Markdown
Member Author

Review of record, head 74ae0ab

Angles (two read-only reviewer agents on 55fb28b, plus Devin and the github-actions bot; CodeRabbit and Gemini were rate-limited, so those providers are missing, not clean):

  • Correctness and edge cases: found that the check-helper collector still read only assert_eq/assert, so a helper-borne assert_ne!/debug_assert*! lost live credit (real regression). Fixed with a shared ASSERTION_CANDIDATES list; helper_borne_assertions_keep_credit_for_every_admitted_macro fails on assert_ne without the fix (static_unknown). No shadowing hole found: local macro_rules! and use rebinds are refused by the existing trusted-name scan.
  • Tests and spec: SPEC-0197 still said these macros were not covered; updated, with the Boolean assert!/debug_assert! in a dead context still credits return-value findings #10389 residual. Added a live return_value control for assert_eq. Changelog now states the residual and no longer claims core:: coverage it does not test. Both tests registered in traceability.
  • Devin: doctest root proof only checked assert_eq/assert (fixed); spec traceability (fixed). Both threads resolved.
  • github-actions bot asked for core:: coverage in the matrix: the matrix exercises bare and std::; core:: shares the same root-proof code and the spellings are in STD_ROOTED_ASSERT_EQ, not separately tested. Left as is.

Proof on this head: matrix (264 rows) and helper test pass, owner_pin lib tests 332 pass, Rust verdict corpus unchanged (3/668 false, no moved rows), evidence-promotion honesty passes, cargo xtask precommit exit 0. Matrix versus main: 96 dead-context findings flipped to reachable_unrevealed, no live row changed.

Open: boolean assert!/debug_assert! return-value dead credit (#10389). Hosted Ripr Rust Small Result is running on this head.


Generated by Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed findings

  • The ripr sensor failed without a diagnostic in the shared packet; this weakens independent review confidence but does not establish a source defect.

Verification questions

  • Confirm the public changelog limits qualification to bare or std-qualified forms, while SPEC-0197 says bare or std/core-qualified; the implementation supports core qualification.
  • Confirm the new matrix directly covers bare and std-qualified spellings but not core-qualified spellings or root rebinding, despite implementation support for core roots.
  • Confirm core-qualified spellings are implemented and root-checked, but the new matrix does not directly exercise core qualification.
  • Confirm the implementation advertises core-qualified admission, but the new matrix tests only bare and std-qualified spellings; core root behavior is therefore unverified by this oracle.
  • Confirm the documented core-qualified behavior is implemented but is not directly represented in the new 264-case matrix, which tests bare and std-qualified forms.
  • Confirm the 264-case matrix tests bare and std-qualified forms, but its live return-value credit assertion covers only assert_eq, leaving assert_ne and debug equality macros without a live-credit oracle.

Refuted

  • The diff contains no JS-backed worker, async, GC, detach, or transfer boundary; its scope is assertion-macro execution admission and syntax collection.
  • A stale active-view or resized backing store could make this change admit an assertion from an inactive region.; refuted because: The changed routes contain no buffer/view representation, mutation, resize, detach, transfer, or length snapshot; admission is determined from Rust source syntax and execution context.
  • Adding assert_ne! and debug_assert*! to the shared gate could introduce a lifetime or aliasing hazard through extra admitted macro arguments.; refuted because: Admission changes only whether existing findings receive execution credit. No argument is evaluated, stored, borrowed, or dereferenced by this code, and no unsafe/native seam is modified.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.
  • The failure of the ripr sensor leaves its exit code 2 reason unresolved, although other static sensors completed and cargo-test is scheduled late.

Copy link
Copy Markdown
Member Author

merge-queue/status.md line (write path refused in this session): #10404 merged e37bb2626 — #8983 assert_ne/debug_assert* execution admission (matrix, helper+doctest paths); residual #10389; corpus unchanged 3/668


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants