Repository navigation
fix(analysis): a replaced bare literal adds no base-side static_unknown twin (#14325) - #14380
Conversation
…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
|
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 7 minutes. View limit details
Pre-merge checks:
|
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
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
ripr static exposure checkCommit Took 65s. |
EffortlessSteven
left a comment
There was a problem hiding this comment.
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_unknowntwin keepsverify=refusedafter 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_probelocation/before anchoring (diff.rs:2287, 2313); the added-line shape path whosebeforederives from the same counterpart (diff.rs:391-398); thenearby_removed_linefallback (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-combineandrust-tests-junitare 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) incrates/ripr/src/lsp/backend.rs:14646+ andcrates/ripr/src/edit_cage/mod.rs:2133. Those files are byte-identical to the merge-base (git diff --stat base..HEADover 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 mentionanalysis/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 withbeforeequal 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 thechanged_constant_returnscenario of open PR #14335 (cargo xtask agent-evaldoes 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 ofbeforewith 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::StaticUnknownguard), 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-formatlocally (hostedsource-of-truthandspec-maintenance-digestpassed at this head);cargo xtask goldens check(no golden files change in the diff; the author's local claim is unverified here).
|
Generated by Claude Code |
Requested by Steven · project thread
Summary
1200->1500) no longer seeds a base-sidestatic_unknowntwin for the removed value when the added line paired with it by the replacement block already carries a modeled-family probe whosebeforeis that literal. That twin keptverify=refusedafter 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).replaced_line_counterpart), not text: an equal literal deleted outright elsewhere in the file keeps its own probe (fail closed). Thenearby_removed_linefallback is not treated as a pairing.Swarm / Source Boundary
ripr-swarmSource-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
verifyreach complete.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
claude/project-thread-jba9kuStack 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.rsremoved-side seeding, plus tests, spec paragraph, traceability rows and changelog fragment.Scope Classification
Production delta:
static_unknownprobe skipped for a bare-literal removed line whose paired replacement already has a modeled probe with matchingbefore.Evidence/support delta:
a_replaced_bare_literal_adds_no_base_side_static_unknown_twin(positive, trailing-comma, and mixed replaced/deleted control) andbare_literal_lines_are_single_literals_only(positive and negative literal shapes).Single acceptance criterion:
verify=completeinstead ofverify=refused.Non-goals:
Support-tier Impact
Policy Impact
Proof
Exact head
577403ed56237eef4dbad7298090d5ab05eb3a80, Linux, bash, Rust 1.95.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 preparethencargo 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
fbc8cf4dfound 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.maxread 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 checkpass,cargo xtask check-traceabilitypass.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_returnreference_test_closes_loopNO -> yes withverify=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
.ripr/traceability.toml)crates/ripr/src/analysis/probes/diff.rscargo xtask goldens check)Static 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_01YVdGzUd5rvboz66tmL9unq
Generated by Claude Code