Skip to content

fix(analysis): a logical-or field value is not closure syntax (#14326) - #14368

Merged
EffortlessSteven merged 6 commits into
mainfrom
claude/fix-14326-logical-or-field
Nov 12, 2026
Merged

EffortlessSteven merged 6 commits into
mainfrom
claude/fix-14326-logical-or-field

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

  • has_closure_syntax in classify/propagation_witness.rs treated any two pipes as a closure. A constructed field such as verbose: flag == "-v" || flag == "--verbose" therefore made the direct propagation witness opaque. Propagation stayed weak with nothing missing, so even an exact assertion on that field could not close the gap, and verify stayed refused. This is the agent-eval struct_field case from feat(xtask): answer-keyed agent eval for tokens to the answer and loop closure (#14298) #14335.
  • A binary || 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 not move, return, break, yield, in or else. Closures such as || body, move || ..., handler: || ready and |a, b| a || b still read as closures, so the witness stays fail-closed on them.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-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-field
Stack 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: the without_logical_or mask and the test logical_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.
  • Cache schema 1.180, with the sharded and compact lanes at 0.182. The bump is carried through the pinned consumers: the corpus currentness constants, the OUTPUT_SCHEMA.md examples, and the first-useful-action fixture digests plus a golden changelog entry.
  • Honesty corpus reports recaptured at 1.180 with ripr check --mode draft --format repo-exposure-json.
  • changelog.d/14326-logical-or-field-witness.md.

Scope Classification

  • One production behavior

Proof

Before and after on the eval's struct_field scenario: the cliopts crate with verbose: flag == "-v" || flag == "--verbose" changed in the head.

test state before after
existing retries test only weakly_exposed, propagate weak, missing - weakly_exposed, missing verbose: ... (correct, no test reads the field)
plus an exact assert_eq!(opts.verbose, true) / assert!(opts.verbose) still weakly_exposed, propagate weak exposed, gaps=0 exposed=1

verify on that scenario is still refused. The cause is a separate predicate probe that reports infection_unknown, which predates this fix, and it is noted on #14326 for the lane that owns #14325 / #14327.

Local checks run, all passing:

  • propagation_witness tests (51) and schema_versions_pin / output::schemas::tests
  • cli_smoke first_useful_action
  • cargo xtask check-evidence-promotion-honesty
  • cargo xtask goldens check
  • cargo xtask precommit, exit 0, run on the pre-merge head; after the main merge the honesty gate was re-run

Claim 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

`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
@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 Nov 11, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Inconclusive 2

Failed Failed checks: 2 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Description check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…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 EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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, and break '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, static and const are now keywords.
    • Each keyword has a closure case.
  • Round 2 (4f3b83c) found &mut || work(). It is fixed in 965b0ac with mut, gen and use, 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, and code ends 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 own predicate probe with its own activation judgment.

Local checks, all passing:

  • propagation_witness (51 tests, including the extended logical_or_is_not_closure_syntax)
  • cargo xtask check-evidence-promotion-honesty
  • cargo xtask precommit on 4f3b83c (exit 0)

The 965b0ac delta is two keywords and two test strings, and its unit tests were re-run.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 11, 2026 15:37
@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!

Copy link
Copy Markdown
Member Author

The cargo-deny red check is not from this PR. It reports RUSTSEC-2026-0486 (rustix 1.1.5, unsound xattr functions), and the Security workflow is also red on main. The fix is #14240 (rustix 1.1.6, issue #14239). This PR does not touch dependencies, and the check is not required.


Generated by Claude Code

@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 3 potential issues.

Devin Review

@github-actions

Copy link
Copy Markdown
Contributor

ripr static exposure check

Commit a772386eeff5 · run · advisory, static evidence only (not a mutation run).

#ripr agent static-advisory base=aabcf1d104d3c9b0021e7fc4978b47143a5c1726 findings=34 gaps=1 infection_unknown=5 propagation_unknown=3 static_unknown=16 weakly_exposed=10
weakly_exposed|crates/ripr/src/analysis/classify/propagation_witness.rs:2917|without_logical_or(&masked, text).matches('\|').count() >= 2|missing=Check unconfirmed: no supported assertion that distinguishes the changed behavio…|test=t1|id=probe:crates_ripr_src_analysis_classify_propagation_witness.rs:predicate:94ab89f3
stages=reach:yes,infect:yes,propagate:yes,observe:yes,discriminate:weak
t1=crates/ripr/src/analysis/classify/propagation_witness.rs:3305 logical_or_is_not_closure_syntax relational_check `assert!(!has_closure_syntax(text), "{text}");` miss=weak_assertion
limits=infection_unknown:5,propagation_unknown:3,static_unknown:16,weakly_exposed:9
next=ripr explain --root . --base aabcf1d104d3c9b0021e7fc4978b47143a5c1726 --committed --mode draft --format agent probe:crates_ripr_src_analysis_classify_propagation_witness.rs:predicate:94ab89f3
verify=refused|outcome=complete_with_findings|findings=34|exposed=0|reason=gaps_remain

Took 339s.

@github-actions

Copy link
Copy Markdown
Contributor

merge-ready is set, but no qualification run exists for head a772386e: it was pushed after the label was applied, or the label event was dropped. Remove and re-apply merge-ready to request it again.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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_syntax is 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

Copy link
Copy Markdown
Member Author

Heads-up from the merge-queue screening: this PR moves CACHE_SCHEMA_VERSION from 1.178 to 1.180 and recaptures the evidence-promotion-honesty corpus reports. #12801, ahead of it in the queue (enqueued 16:12Z vs 18:44Z), moves the same line to 1.179 and recaptures the same report files. Once #12801 lands, or is building ahead of this entry, this PR's group will conflict on those lines. After #12801 lands, merge main, keep a version above the landed one, recapture the reports with ripr check --mode draft --format repo-exposure-json --root <subject>, re-review, then re-enqueue. Details are on #14331.


Generated by Claude Code

Merged via the queue into main with commit 7a4ebfd Nov 12, 2026
82 of 84 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/fix-14326-logical-or-field branch November 12, 2026 14:20
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