Repository navigation
fix(analysis): a logical-or field value is not closure syntax (#14326) - #14368
Conversation
`has_closure_syntax` counted any two pipes as a closure, so a constructed field such as `verbose: flag == "-v" || flag == "--verbose"` made the direct propagation witness opaque. Propagation stayed weak with nothing missing and an exact assertion on the field could never close the gap. Binary `||` operators are now masked before the pipe count, while `|| body`, `move ||` and `|a, b|` closures still read as closures. Bumps the cache schema to 1.180 (sharded and compact lanes to 0.182) and carries it through the pinned consumers, the honesty corpus report and the first-useful-action fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzTr5S4jfQDq1e81UWt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzTr5S4jfQDq1e81UWt
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Pre-merge checks:
|
…ents (#14326) Independent review of b2e2cd9 found three fail-open spellings in the logical-or mask: `async || body` (async closures are stable), a `||` after comment text, and `break 'label || x`. The operand check now reads code from the masked text and only a masked literal from the original, treats a label as no operand, and keeps `async`, `static` and `const` with the other closure-opening keywords. Every keyword in the list now has a closure case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzTr5S4jfQDq1e81UWt
…14326) Second review of 4f3b83c: `&mut || work()` was stripped. Adds the keywords and cases for `&mut ||` and a line comment ending in a quote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzTr5S4jfQDq1e81UWt
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
This review is of head 965b0ac.
Independent review, two fresh subagent rounds of the exact heads:
- Round 1 (b2e2cd9) found three fail-open spellings:
async || body, a||after comment text, andbreak 'label || x. It also found a test gap on the keyword list. All are fixed in 4f3b83c:- The operand check reads code from the masked text, and reads only a masked literal from the original.
- A label is not an operand.
async,staticandconstare now keywords.- Each keyword has a closure case.
- Round 2 (4f3b83c) found
&mut || work(). It is fixed in 965b0ac withmut,genanduse, plus a case for a line comment that ends in a quote. - Both rounds found no panic path. Slices go through
.get, the mask preserves length, andcodeends on a char boundary.
Accepted limits. Both cost credit in some cases, or are rare enough not to block:
- A
||after a block}or an attribute]that starts a closure statement ({ .. } || f(),#[allow(x)] || f()) is still treated as a logical-or. This is rare in a field or return fragment. - Short-circuit evaluation on the right of
||is not separately gated on the field path. That matches the existing&&handling, where field text with&&already completed the witness. The comparison inside is its ownpredicateprobe with its own activation judgment.
Local checks, all passing:
propagation_witness(51 tests, including the extendedlogical_or_is_not_closure_syntax)cargo xtask check-evidence-promotion-honestycargo xtask precommiton 4f3b83c (exit 0)
The 965b0ac delta is two keywords and two test strings, and its unit tests were re-run.
Generated by Claude Code
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
The Generated by Claude Code |
…test (#14326) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzTr5S4jfQDq1e81UWt
ripr static exposure checkCommit Took 339s. |
|
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Head a772386. The production code and tests are unchanged since 965b0ac, which had two rounds of independent subagent review with every finding fixed. The a772386 commit is documentation and mapping only:
- RIPR-SPEC-0265 rule 3 now states the closure-syntax reading and its known limits.
logical_or_is_not_closure_syntaxis registered under RIPR-SPEC-0265 in.ripr/traceability.toml.
That answers Devin's traceability thread. The other two Devin threads, the raw-identifier missed credit and the quoted pipes, got source-backed replies and are resolved. No threads are open.
Local checks on this head: cargo xtask precommit exit 0, and check-traceability and check-spec-format pass. cargo-deny is red repo-wide (RUSTSEC-2026-0486, #14240), and paste-ubuntu-latest failed on an apt DNS error. Neither is required or caused by this PR.
Generated by Claude Code
|
Heads-up from the merge-queue screening: this PR moves Generated by Claude Code |
Summary
has_closure_syntaxinclassify/propagation_witness.rstreated any two pipes as a closure. A constructed field such asverbose: flag == "-v" || flag == "--verbose"therefore made the direct propagation witness opaque. Propagation stayedweakwith nothing missing, so even an exact assertion on that field could not close the gap, andverifystayed refused. This is the agent-evalstruct_fieldcase from feat(xtask): answer-keyed agent eval for tokens to the answer and loop closure (#14298) #14335.||is now masked before the pipes are counted. The rule is that the trimmed text before the||ends in an operand, and its last word is notmove,return,break,yield,inorelse. Closures such as|| body,move || ...,handler: || readyand|a, b| a || bstill read as closures, so the witness stays fail-closed on them.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal:
Spec:
ADR:
Plan item:
Governing issue or accepted claim: #14326
Acceptance delta (one sentence): A changed constructor field spelled with a logical-or gets a complete propagation witness, so an exact assertion on that field exposes the gap instead of leaving propagation weak with nothing missing.
Source review: REVIEW_READY a772386
Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
claude/fix-14326-logical-or-fieldStack parent or prerequisite PR (if any): none. #12801 bumps the cache to 1.179 and lane caches to 0.181; this PR takes 1.180 / 0.182 so both can land in either order. Whichever lands second only has to resolve the version lines.
Proposed replacement of PR (if any; not yet accepted): none
Scope
propagation_witness.rs: thewithout_logical_ormask and the testlogical_or_is_not_closure_syntax. It has five negatives (field, call, chained, index plus?, and a string containing|). It has five closure positives. It also asserts that the FieldConstruction witness completes.OUTPUT_SCHEMA.mdexamples, and the first-useful-action fixture digests plus a golden changelog entry.ripr check --mode draft --format repo-exposure-json.changelog.d/14326-logical-or-field-witness.md.Scope Classification
Proof
Before and after on the eval's
struct_fieldscenario: the cliopts crate withverbose: flag == "-v" || flag == "--verbose"changed in the head.retriestest onlyweakly_exposed, propagateweak, missing-weakly_exposed, missingverbose: ...(correct, no test reads the field)assert_eq!(opts.verbose, true)/assert!(opts.verbose)weakly_exposed, propagateweakexposed, gaps=0 exposed=1verifyon that scenario is still refused. The cause is a separatepredicateprobe that reportsinfection_unknown, which predates this fix, and it is noted on #14326 for the lane that owns #14325 / #14327.Local checks run, all passing:
propagation_witnesstests (51) andschema_versions_pin/output::schemas::testsfirst_useful_actioncargo xtask check-evidence-promotion-honestycargo xtask goldens checkcargo xtask precommit, exit 0, run on the pre-merge head; after the main merge the honesty gate was re-runClaim Boundary
Only
||operator spellings change. Any other opaque text, such as real closures, macros or blocks, still keeps the witness incomplete. Dropping credit stays the default.Rollback
Revert the commit. The cache version bump invalidates entries either way.
Generated by Claude Code