Repository navigation
fix(syntax): index one test per row of a same-file macro_rules! test table (#6925) - #9208
Conversation
…table (#6925) A table generator such as itoa's test! { name(value, expected) ... } was refused as a repetition, so the code its tests call read as no_static_path. The expander now splits a whole-matcher repetition into rows and expands the body once per row; layouts it cannot split exactly index nothing. RIPR-SPEC-0117 gains example 8 and five runtime-labeled corpus cases; the seam cache moves to 1.88 / 0.94. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 20 minutes. View limit details
Comment |
…byte cap, sliced argument text A matcher's trailing comma is a literal the invocation must carry, and an invocation's trailing comma does not fit a matcher without one; both previously picked the wrong arm. A table invocation now refuses beyond 128 KiB of expansion text, and argument text is sliced from its parent rather than copying the parent per argument, which made a table's cost rows times its size. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- A table transcriber that uses anything other than a separator-free repetition is refused.
Verification questions
- Confirm prior disposition is a single-body, separator-free
$( body )*over the matcher's variables; the diff enforces this inexpand_rowsand is independently unit-tested.
Refuted
- match_rows could leave
position == elements.len()in a loop that returns rows.len() == MAX_REPETITION_ROWS but never breaks, panicking on >512-row tables; refuted because: Bounds checkif rows.len() == MAX_REPETITION_ROWS { return None; }runs before each row, so the limit-guard path is unreachable past 512; the loop ends whenposition >= elements.len()after a row or short-circuits to None on layout error.match_rowsreturnsOption<Vec<...>>, no panic path on benign input.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Spec example 8 wording suggests the four-table subject reads as boundary/semicolon credited and far/smoke gap, but corpus cases only enumerate five table owners with one refused case; the PR's
main->HEADmapping for thearrowowner (no_static_path) is not asserted in unit tests beyond golden rows. No behavior regression, but the 'acceptance delta' line requires runtime labels per owner; this PR relies on the corpus projectioncargo xtask verdict-corpus checkrather than a unit-level per-owner assertion. - Architecture posture report only.
Verification questions
- Confirm accept
# inside transcriber is not in tests; default behavior treats any non-#[test]/ non-cfg(test)/cfg_attras refusal via text_has_conditional_attribute.
Refuted
- expansion uses argument single() via cloned text slice from parent - argument() previously copied and the new code references parent.text() directly; if the parser later mutates the parent text (none observed, but conceptually), the slice would dangle.; refuted because: ra_ap_syntax syntax nodes are immutable post-parse within a single expand_local_test_macros call; argument() returns owned Argument strings only. Slicing rather than copying avoids per-row allocation of the parent String.
Parked follow-ups
- Smallest-complete-fix is preserved: spec example 8, allowlisted fragments (ident/literal/tt/block/expr), separators (, ; :), and one separator-free $(body)* are exactly the moved line in the spec. Out-of-scope shapes (=> row, nested repetition, expr without separator, unsupported fragment) all refuse without expansion, so this change does not generalize the macro expander.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm unit tests in local_test_macros.rs cover both the boundary-only
rows()allocation change and the new bounded-shape behavior: one-test-per-row happy path, separators/groups/+ repetition, refusal cases (=> trailing separator, leftover token, wrong group arity, wrong delimiter, literal-as-ident, empty, nested repetition, expr-without-separator, unsupported fragment, repeated variable, => inside row, transcriber separator, transcriber extra item, unbound variable, body without test attribute), local-macro refusal (row+body), arm-selection ordering, trailing-comma agree, plus row and expansion size bounds at MAX_REPETITION_ROWS=512 and MAX_EXPANSION_BYTES=128KiB. The previously-passing refusal-test for whole-matcher repetition was removed consistent with the new support. Integration coverage in macro_generated_tests.rs asserts related_tests names surface and refused layouts add no test. - Confirm no cargo-test execution witness was attached to this packet; red/green claims rest on golden snapshots and the model's read of the unit tests. Gate the merge on a real focused test run.
- Confirm goldens for macro-table-* cases were added alongside the source change; only the boundary/semicolon/far/smoke subjects are validated end-to-end by
cargo xtask verdict-corpus check(503 cases, 5/503 false). The=>rejected shape is asserted via golden rowobserved_verdict: limitedrather than a per-shape run; not a regression but worth flagging as a verification gap.
Refuted
- The table-expansion path (match_rows/expand_rows) belongs in its own helper file (e.g., local_test_macros_table.rs) to keep modules small.; refuted because: All repetition-table logic (~250 lines) lives in exactly one module alongside the existing simple-arm logic; substitute was refactored to a lookup closure so both arms share it; module cohesion is improved, not diluted.
- Expression parsing could fabricate table rows by consuming an arbitrary prefix through a separator.; refuted because: This is an intentional conservative limitation documented by the PR and spec: separator-free expressions are unsupported, and ambiguous rows are refused rather than indexed.
Parked follow-ups
- RIPR-SPEC-0117 example 8 wording claims four table rows read boundary/semicolon credited and far/smoke gap, but corpus cases only enumerate five table owners with one refused case — the mapping for arrow owner (no_static_path) is asserted via golden row only, not a per-owner unit test.
Evidence gaps
- Verdict-corpus expected rows are golden snapshots: boundary/semicolon read 'credited', far 'gap', smoke 'gap', arrow-refused 'limited' (abstained because of
=>). Full-checkout observation block in cases/*.json also reports 'credited', 'gap', 'limited' respectively. test-shape labels classify the four table families plus one refusal. These assertions can only red/green via the built corpus runner; absent the cargo-test receipt the rows are reasoned-about, not executed. - Model proof intent was rejected by deterministic validation.
… without one Devin review on #9208: top_level_arguments drops a trailing comma, so edge(10,) bound as ($v:expr) although rustc selects a later arm. Refuse it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Status pass (2026-10-22 04:25 UTC): this PR is green-gated on The golden-fixture conflicts need the fixture pipeline re-run rather than a textual pick — flagging for the owning lane rather than patching blind. Happy to help validate once a rebased head is pushed. |
Cache generation moves to 1.91 / 0.98 over main's 1.90 / 0.97; corpus floor 145. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
…ache 1.91 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Expression-row boundaries are approximated by scanning for a separator token rather than by Rust’s expression follow set.
Verification questions
- Confirm the corpus acceptance mapping is asserted only through projection fixtures; direct integration coverage exists for one table shape but not every corpus owner/layout.
Refuted
- The table path requires broad macro evaluation or may leak through unrelated sibling routes.; refuted because: The route is intentionally limited to a whole-matcher repetition and separator-free transcriber; unsupported layouts and other repetition forms return None, while the integration refusal test confirms no generated test is added.
- The change needs generalized macro expansion or a shared arbitrary-repetition implementation.; refuted because: The implementation intentionally supports one bounded table grammar and refuses nested repetition, unsupported separators, leftovers, wrong arity, and ambiguous trailing commas; broad evaluation would exceed the stated scope.
- The 512-row and 128-KiB limits leave an unbounded expansion path.; refuted because: The row count is checked before adding another row, and the expansion byte budget is checked after each emitted body, so the table route is bounded.
Evidence gaps
- Executable proof on the current head is still required before accepting the PR's runtime-label and corpus claims.
- Model proof intent was rejected by deterministic validation.
- Executable proof for the changed Rust behavior is absent from this packet: cargo-test is only scheduled late and ripr failed with exit code 2.
- Current-head executable evidence is absent because cargo-test is late and the ripr sensor failed with exit code 2.
- Current-head executable evidence is still required before relying on the claimed red/green behavior because the ripr sensor failed and cargo-test remains scheduled.
- Current executable proof is not available in the review packet: ripr failed and cargo-test is only scheduled-late.
… / 0.107) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
…o-table arrow case Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
|
Head 84c02b7 merges main again (spec-coverage floor 191→202 after #10117 and others). One reasoned edit: Rust Nested-separator bot finding: expression rows split only at top-level separator tokens (delimited groups are single token trees), and a fragment split at a top-level generic comma fails the expression parse and refuses. Pinned by Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the accepted table grammar is intentionally bounded, but expression boundaries are inferred by the first recognized separator rather than Rust’s full expression follow set, so valid separator-like expressions may be refused or mis-split.
- Confirm the PR’s public claim is limited to itoa-shaped same-file tables, while the implementation also accepts several literal separator/group layouts; documentation and tests define that boundary, but the corpus owner-to-verdict mapping is asserted through projections rather than direct integration assertions for every owner.
- Confirm the documented expression-row boundary is narrower than Rust's expression follow set, so some valid rows may be refused or split at the wrong top-level separator.
Refuted
- The expression-row separator approximation permits unsafe over-acceptance of rows containing nested or delimiter-like expression tokens.; refuted because: The implementation only splits at recognized top-level separator kinds and refuses fragments that do not parse or fit; the remaining uncertainty is coverage of Rust expression follow-set cases, not a demonstrated false expansion.
- The 512-row and 128-KiB limits permit unbounded work or a panic.; refuted because: Rejected: the row cap is checked before accepting another row, expansion is rejected after exceeding the byte budget, and both boundaries have unit coverage.
Evidence gaps
- Current-head focused execution has not yet established the claimed macro-table behavior.
- Model proof intent was rejected by deterministic validation.
- Current-head executable proof is not yet attached to this review packet.
- Current-head executable proof for the new parser and end-to-end indexing remains absent: the ripr sensor failed with exit code 2 and cargo-test is only scheduled-late.
…n's equality test is red) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
|
Head 84c02b7's only red step was Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm top-level expression rows are split by scanning for the next configured separator, so valid expressions containing separator-like tokens at top level may be refused or split incorrectly.
Refuted
- The 512-row and 128-KiB limits permit unbounded work or a 513th-row panic.; refuted because: The row cap is checked before adding another row, and expansion returns None as soon as text exceeds the byte budget; unit tests cover both limits.
- The implementation should share or generalize the arbitrary-repetition expansion path.; refuted because: That would exceed the documented scope and introduce macro-evaluation semantics beyond the bounded table contract; the dedicated helpers contain the new behavior and reject unsupported forms.
- The implementation must support arbitrary macro repetition to avoid false negatives.; refuted because: The PR explicitly defines one bounded same-file table grammar and refuses other repetition forms, which is consistent with the scope and avoids claiming general macro evaluation.
Parked follow-ups
- Expression-row splitting is narrower than Rust's expression follow set; valid separator-like expressions may be conservatively refused rather than mis-indexed.
Evidence gaps
- The table route can index a generated test without current-head executable proof because the ripr sensor failed and cargo-test is only scheduled.
- Model proof intent was rejected by deterministic validation.
- Current-head executable proof remains unavailable in this packet: the ripr sensor failed with exit code 2 and cargo-test is scheduled late rather than completed.
- The PR's public table claim reaches existing generated-test indexing and cache consumers rather than stopping at syntax expansion.
- Current-head executable proof is absent from this packet, so the behavioral acceptance mapping remains unverified here.
… / 0.108) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm expr rows use the next configured separator as their boundary rather than Rust's expression follow set, so a valid top-level separator-like token may be split or refused.
Refuted
- The 512-row and 128-KiB limits permit unbounded work or a 513th-row panic.; refuted because: The row cap is checked before another row is added, expansion returns None after crossing the byte budget, and row_and_expansion_size_are_bounded exercises both limits.
Parked follow-ups
- The accepted grammar is intentionally narrower than general Rust expression parsing, but the implementation refuses ambiguous fragments instead of splitting them into multiple rows.
- Expression-row boundaries are approximated by the next top-level separator rather than Rust's complete expression follow set, so some valid forms may be refused or split differently.
Evidence gaps
- Executable current-head proof is still trust-relevant because the ripr sensor failed with exit code 2 and cargo-test has not yet supplied its late receipt.
- Model proof intent was rejected by deterministic validation.
Review of record: head fc8836cChecks on this head: Angles (independent agent reviews of the production delta, plus bot reviews):
Findings and resolutions: Devin trailing-comma finding fixed. Contract reviewer's missing blessing entry added. Changelog fragment present. Rust Missing: Gemini and CodeRabbit reviews (quota). Not counted as clean. Known limits, not blockers: Proceeding to protected squash merge on this exact head. Generated by Claude Code |
Summary
macro_rules!test table such as itoa'stest! { name(value, expected) ... }was refused as a repetition, so the code its tests call read asno_static_path("No tests were found") even when a row pinned the changed boundary.=>rows, a trailing separator, a leftover token, a wrong-arity group, nested repetition) still index nothing.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal: none
Spec: docs/specs/RIPR-SPEC-0117-rust-macro-reach-limitation.md (new example 8, "Same-File Test Generators" amended)
ADR: none
Plan item: 0.11 readiness blocker 3 (first-run five-shape re-walk, itoa)
Governing issue or accepted claim: #6925
Acceptance delta (one sentence): four table rows in the new
authored-macro-tablesubject move fromlimitedtocredited,credited,gap,gap, and no existing row moves.Candidate Relationships
Candidate branch:
claude/project-thread-c7grv2Stack parent or prerequisite PR: none
Proposed replacement of PR: none
Note: the unrelated mock call-count change that used this branch (#8606) was closed as superseded by #9077; this PR starts from current main.
Scope
syntax::local_test_macros: repetition-table matcher and body expansion, bounded to 512 rows.authored-macro-tableand five cases labeled by runningcargo testagainst the baseline and two mutants per owner.Scope Classification
Production delta:
$( row ) sep? *and whose transcriber is one$( body )*indexes one test per invocation row.Evidence/support delta:
Single acceptance criterion:
exposed; far or oracle-free rows do not; unsplittable layouts keepno_static_path.Non-goals:
=>rows,exprrows with no separator.Support-tier Impact
Policy Impact
Ledger or exception notes:
cargo xtask precommitneedsworkspace_status.rs|Command::newallowlisted, which main lacks since fix(mcp): ripr_refresh base argument, Git precondition in status, accurate attempt_not_found #9075; policy: allowlist the workspace-status git-marker mkfifo probe #9201 and ci: allowlist the test-only mkfifo in workspace_status #9202 carry that fix and this PR does not touch it.Proof
Result, failures, or skipped proof:
limited(checked with this change stashed); with it they readcredited,credited,gap,gap. The=>row stayslimited.limit > widthandlimit + 1 >= widthfail one table test each for the boundary tables and none for the far and smoke tables.Claim Boundary
#[macro_use]imports, or any generator the expander refuses.Rollback
Spec-Test-Code Traceability
local_test_macros.rs::tests::*table*,crates/ripr/tests/macro_generated_tests.rs::a_table_*crates/ripr/src/analysis/syntax/local_test_macros.rsfixtures/rust-verdict-corpus/expected/rows/macro-table-*.jsonStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.https://claude.ai/code/session_011vJe7tsVbzfQsHJiNujJgV
Generated by Claude Code