Skip to content

fix(analysis): a replaced bare literal adds no base-side static_unknown twin (#14325) - #14380

Merged
EffortlessSteven merged 4 commits into
mainfrom
claude/project-thread-jba9ku
Nov 12, 2026
Merged

EffortlessSteven merged 4 commits into
mainfrom
claude/project-thread-jba9ku

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Summary

  • A changed bare literal (1200 -> 1500) no longer seeds a base-side static_unknown twin for the removed value when the added line paired with it by the replacement block already carries a modeled-family probe whose before is that literal. That twin kept verify=refused after a correct exact test, so the agent loop could not finish (verify stays refused after a correct exact test: a changed literal leaves a base-side static_unknown twin no test can move #14325).
  • Pairing is by line identity (replaced_line_counterpart), not text: an equal literal deleted outright elsewhere in the file keeps its own probe (fail closed). The nearby_removed_line fallback is not treated as a pairing.

Swarm / Source Boundary

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

Source-of-truth Links

Proposal: n/a
Spec: RIPR-SPEC-0001 (removed-side reconciliation paragraph)
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #14325
Acceptance delta (one sentence): A replaced bare literal whose head-side probe already judges the replaced value no longer adds a base-side static_unknown finding, so a correct exact test lets verify reach complete.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): claude/project-thread-jba9ku
Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): n/a
Accepted winner and losing candidate disposition (when decided): n/a

Scope

  • crates/ripr/src/analysis/probes/diff.rs removed-side seeding, plus tests, spec paragraph, traceability rows and changelog fragment.

Scope Classification

  • One production behavior

Production delta:

  • Removed-side static_unknown probe skipped for a bare-literal removed line whose paired replacement already has a modeled probe with matching before.

Evidence/support delta:

  • Unit tests: a_replaced_bare_literal_adds_no_base_side_static_unknown_twin (positive, trailing-comma, and mixed replaced/deleted control) and bare_literal_lines_are_single_literals_only (positive and negative literal shapes).

Single acceptance criterion:

  • Issue repro ends verify=complete instead of verify=refused.

Non-goals:

Support-tier Impact

  • none

Policy Impact

  • none

Proof

Exact head 577403ed56237eef4dbad7298090d5ab05eb3a80, Linux, bash, Rust 1.95.

cargo fmt --check                                  # pass
cargo clippy -p ripr --lib -- -D warnings          # pass
cargo xtask check-static-language                  # pass
cargo xtask check-spec-format                      # pass
cargo xtask check-traceability                     # pass
cargo xtask check-local-context                    # pass
cargo xtask check-no-panic-family                  # pass
cargo xtask check-allow-attributes                 # pass
CARGO_BUILD_JOBS=1 cargo xtask precommit           # pass
CARGO_BUILD_JOBS=1 cargo test -p ripr --lib analysis::probes::   # 378 passed
cargo xtask goldens check                          # pass
# issue repro (two-commit repo, 1200 -> 1500, exact test added with git add -N):
ripr check --quiet --format agent --base main
#   origin/main 46b62971 binary: findings=2 ... verify=refused|...|reason=gaps_remain
#   this head binary:            findings=1 ... verify=complete|outcome=complete_with_findings|findings=1|exposed=1

Result, failures, or skipped proof:

  • CARGO_BUILD_JOBS=1 cargo xtask precommit: pass (exit 0) at this head.

  • CARGO_BUILD_JOBS=1 cargo test -p ripr --lib analysis::probes::: 378 passed, 0 failed (includes both new tests).

  • cargo xtask goldens prepare then cargo xtask goldens check: pass.

  • Note: with default parallel jobs the ripr lib-test rustc is OOM-killed on this 15 GB container; one job fits.

  • Independent review: fresh subagent review of fbc8cf4d found no blocking issues (pairing is line-identity only, equal-length uninterrupted runs, no cross-hunk pairing; mixed control discriminates text pairing). Its one non-blocking fail-open (1.max read as a bare literal) is fixed in commit 3. Bot reviews were quota-limited.

  • Main merged in at 1f99b186 (clean; 2 upstream commits, no overlap): analysis::probes:: 378 passed, cargo xtask goldens check pass, cargo xtask check-traceability pass.

  • Independent eval evidence (separate thread, head 577403e): cargo xtask agent-eval (feat(xtask): answer-keyed agent eval for tokens to the answer and loop closure (#14298) #14335) shows changed_constant_return reference_test_closes_loop NO -> yes with verify=complete; the other nine scenarios show no regressions. A second swarm reviewer's exact-head review also found no blocking issues.

Source review: REVIEW_READY 1f99b18

Claim Boundary

May claim: a one-literal change with a correct exact test no longer sticks on a base-side twin. Must not claim: other base-side probe noise is fixed.

Rollback

Revert the squash commit; no schema or output contract change.

Spec-Test-Code Traceability

  • Spec: RIPR-SPEC-0001
  • Tests: the two tests above (registered in .ripr/traceability.toml)
  • Code: crates/ripr/src/analysis/probes/diff.rs
  • Golden outputs: unchanged (cargo xtask goldens check)
  • Metrics: n/a
  • ADR/learning: n/a

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.

https://claude.ai/code/session_01YVdGzUd5rvboz66tmL9unq


Generated by Claude Code

…wn twin (#14325)

When an added-side probe of a modeled family already pairs the removed
line as its before text, a removed bare literal (number, bool, string,
char) gets no second removed-side static_unknown probe. That twin is
judged against code no test can reach any more and kept agent
verification refused after the new value was fully exposed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzRYREPQUN43jLNBofB
…4325)

Review found the text-only match could drop the removed-side probe of an
equal literal deleted elsewhere in the file. The skip now requires the
added line that replacement_counterparts pairs with this removed line to
carry the modeled probe. Adds the mixed replaced+deleted control, more
non-literal negatives, and the RIPR-SPEC-0001 rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzRYREPQUN43jLNBofB
@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 self-assigned this Nov 11, 2026
@coderabbitai

coderabbitai Bot commented Nov 11, 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 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 145 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: 0ca2e19b-0ff5-4665-bf6c-9cb3ec42a29f
Commits

Reviewing files that changed from the base of the PR and between 3cd01df and 1f99b18.

Files selected for processing: 4

  • .ripr/traceability.toml
  • changelog.d/14325-replaced-literal-no-base-side-twin.md
  • crates/ripr/src/analysis/probes/diff.rs
  • docs/specs/RIPR-SPEC-0001-static-exposure-loop.md
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

Review follow-up: `1.max` or `1.0.abs` passed the numeric branch of
bare_literal_body. Allow at most one `.`, followed by a digit or the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzUd5rvboz66tmL9unq
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 11, 2026 21:54
@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!

@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 1 potential issue.

Devin Review

Comment thread crates/ripr/src/analysis/probes/diff.rs Resolved
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

ripr static exposure check

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

#ripr agent static-advisory base=3cd01df7d7d7be30c9a45fe979c815d28a79c0d7 findings=50 gaps=2 propagation_unknown=2 static_unknown=13 weakly_exposed=35
weakly_exposed|crates/ripr/src/analysis/probes/diff.rs:3290|shapes_probes_with_deletions(added, removed, &[], shapes, file_source)|missing=No strong discriminator was detected|test=t1|id=probe:crates_ripr_src_analysis_probes_diff.rs:return_value:c647596b
stages=reach:yes,infect:yes,propagate:yes,observe:yes,discriminate:weak
weakly_exposed|crates/ripr/src/analysis/probes/diff.rs:3309|removed_lines.extend(deletions.iter().map(\|(old_line, text)\| ChangedLine { line:…|missing=No strong discriminator was detected|test=t2|id=probe:crates_ripr_src_analysis_probes_diff.rs:call_deletion:22de6191
stages=reach:yes,infect:yes,propagate:yes,observe:yes,discriminate:weak
t1=crates/ripr/src/analysis/probes/diff.rs:4731 a_body_predicate_edit_keeps_the_arm_head unknown miss=assertion_admission_unproven
t2=crates/ripr/src/analysis/probes/diff.rs:6208 a_replaced_bare_literal_adds_no_base_side_static_unknown_twin unknown miss=assertion_admission_unproven
limits=propagation_unknown:2,static_unknown:13,weakly_exposed:33
next=ripr explain --root . --base 3cd01df7d7d7be30c9a45fe979c815d28a79c0d7 --committed --mode draft --format agent probe:crates_ripr_src_analysis_probes_diff.rs:return_value:c647596b
verify=refused|outcome=complete_with_findings|findings=50|exposed=0|reason=gaps_remain

Took 65s.

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

Exact-head review (head 577403e)

Surfaces read

  • Full diff vs merge-base 46b62971d1ea: crates/ripr/src/analysis/probes/diff.rs (+233), .ripr/traceability.toml (+2 test rows), changelog.d/14325-replaced-literal-no-base-side-twin.md (new), docs/specs/RIPR-SPEC-0001-static-exposure-loop.md (+8, removed-side reconciliation paragraph).
  • Governing issue #14325 (base-side static_unknown twin keeps verify=refused after a correct exact test); the PR body including its recorded local-evidence gap; the Devin thread (synthetic-shape point) and the author's reply; the hosted advisory dogfood comment (run 43107135811).
  • Changed-code context: ChangedFile::replaced_line_counterpart / replacement_counterparts (crates/ripr/src/analysis/diff/model.rs:58-91: positional k-th pairing, equal-length uninterrupted runs only, no text comparison); the removed-side loop (crates/ripr/src/analysis/probes/diff.rs:659-788); build_probe location/before anchoring (diff.rs:2287, 2313); the added-line shape path whose before derives from the same counterpart (diff.rs:391-398); the nearby_removed_line fallback (diff.rs:2687-2688), which the new code does not call.

Commands run (detached worktree F:/code/Rust/delta-14380 at this head, isolated CARGO_TARGET_DIR)

  • cargo fmt --check: pass.
  • cargo test -p ripr --lib probes::diff: 118 passed, 0 failed, including both new tests executing (a_replaced_bare_literal_adds_no_base_side_static_unknown_twin, bare_literal_lines_are_single_literals_only). To my knowledge this is their first execution anywhere: rust-tests-combine and rust-tests-junit are skipped at this head, and the PR body records that the author's container could not build lib tests (OOM).
  • cargo clippy -p ripr --all-targets -- -D warnings: fails on this Windows host with 3 errors (dead_code / unused_variables) in crates/ripr/src/lsp/backend.rs:14646+ and crates/ripr/src/edit_cage/mod.rs:2133. Those files are byte-identical to the merge-base (git diff --stat base..HEAD over them is empty), and the flagged items' callers sit behind #[cfg(unix)] (edit_cage/mod.rs:2151) and #[cfg(target_os = "linux")] (lsp/backend.rs:14733), which compile out on Windows. Zero diagnostics mention analysis/probes/diff.rs. Inherited platform-conditional lint mismatch, not attributable to this PR; I did not reproduce clippy at the exact base (a second full build) — the inheritance is established from byte-identity plus cfg gating, not from a base run.
  • gh api .../commits/<head>/check-runs: 43 runs, 0 failing, 0 pending (15 success, 27 skipped, 1 neutral).

Findings

  • Medium — crates/ripr/src/analysis/probes/diff.rs:6208 (with the PR body): the issue's single acceptance criterion (repro ends verify=complete) has no automated witness in this tree. The new unit tests pin the suppression logic but seed a synthetic parser shape (shapes_probes_with_deletions, diff.rs:3295); the real-parser linkage — a modeled return-value probe with before equal to the removed literal on the paired added line — is exercised only by the author's manual binary repro recorded in the PR body and by the changed_constant_return scenario of open PR #14335 (cargo xtask agent-eval does not exist at this head). The author's Devin reply discloses exactly this and defers the rebaseline to #14335. Acceptable as an in-flight state; the durable end-to-end regression should not be treated as landed until #14335 lands.

Design audit (no additional findings)

  • The suppression is fail-closed as claimed: it requires exact positional pairing (ChangedFile::replaced_line_counterpart, model.rs:58 — no nearby fallback), a modeled (non-static_unknown) probe seeded on the paired added line, and exact-string equality of before with the removed text or its literal body (diff.rs:809-822). The mixed control in the new test pins that an equal literal deleted outright elsewhere keeps its own probe (line identity, not text); an unclassified head-side replacement still seeds the twin (family != ProbeFamily::StaticUnknown guard), matching the issue's requirement.
  • bare_literal_body (diff.rs:837) is conservative: method calls (1.max, 1.0.abs), ranges (1..10), raw/byte strings, unterminated quotes and two-token lines all stay probed. Residual: numeric-shaped non-literals that are invalid Rust (1e, 0b) would read as bare, but such lines cannot occur as changed lines of compiled base source, so I judge this unreachable in practice.

Not established

  • Hosted Linux clippy/test lanes at this head (skipped); the issue-repro binary run (not rerun here — it would require building two full binaries; the PR body's recorded run is the only end-to-end witness); cargo xtask check-traceability / check-spec-format locally (hosted source-of-truth and spec-maintenance-digest passed at this head); cargo xtask goldens check (no golden files change in the diff; the author's local claim is unverified here).

Copy link
Copy Markdown
Member Author

cargo-deny is red on this head from RUSTSEC-2026-0486 (rustix 1.1.5 via tar -> xattr, unsound xattr functions). That is not from this diff, which touches no dependencies: main is red on the same advisory (#14239), and the bump is in #14240. I'm not porting the lockfile bump here, to keep this PR to its one objective; it clears once #14240 lands.


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