Skip to content

fix(python): pair each line of a replacement block with its own old line (#7556) - #7600

Merged
EffortlessSteven merged 11 commits into
mainfrom
claude/project-thread-svy0f3
Oct 13, 2026
Merged

EffortlessSteven merged 11 commits into
mainfrom
claude/project-thread-svy0f3

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Before: in a Python replacement block, only the first added line found its old line. When a clamp went into return under a rewritten comment, every token on the return read as changed. A test that only observed the unchanged operand (_balance) then earned a false exposed.

After: the Python adapter reads every old line from ChangedFile::aligned_counterparts (#7524/#7554). Even blocks pair by position, uneven blocks by content, and interrupted runs by coordinate. The same clamp reads weakly_exposed whether it is a one-line edit or the second line of a block.

How:

  • python.rs computes the counterparts once per file. The sink delta, the docstring check and the added-import check all read from them.
  • The new-declaration guard in classify.rs now treats a def as changed only when its paired old line looks like it (lines_look_alike). This is the same rule TypeScript uses: a new def paired by position with an unrelated old line stays unprobed, and a renamed header keeps its probe.
  • Content pairing compares trimmed text, so both annotation-only guards now also require the paired lines to share their indentation. A line that moves out of an if block is behavior.

Swarm / Source Boundary

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

Source-of-truth Links

Governing issue or accepted claim: #7556
Acceptance delta (one sentence): a changed Python line inside a multi-line replacement block is judged against its own old line.

Candidate Relationships

Candidate branch: claude/project-thread-svy0f3
Stack parent or prerequisite PR: #7554 (merged; supplies aligned_counterparts)

Scope Classification

  • One production behavior

Production delta:

  • Python adapter old-line pairing, plus three guards (new-declaration and both annotation-only guards).

Evidence/support delta:

  • New authored corpus subject authored-py-pytest-blocks with three cases, labeled by running pytest on each edit:
    • py-blocks-account-clamp-second-line: the target. The clamp survives, so truth is not_discriminated. Main read it as credited/exposed (a false verdict).
    • py-blocks-account-clamp-one-line: the one-line control. Reads gap/weakly_exposed on main and on this PR.
    • py-blocks-wallet-clamp-second-line: the discriminating control. The clamp is killed. Reads credited/exposed on main and on this PR.
  • Six unit tests in python/replaced_block_tests.rs.

Non-goals: deleted-statement carrier tracking in uneven blocks (filed as #7587).

Proof

cargo xtask precommit                                # exit 0
cargo test -p ripr --lib analysis::language          # 1600 passed
cargo xtask verdict-corpus check-all                 # exit 0, after merging main
  • Moved rows: only py-blocks-account-clamp-second-line, which goes from credited/exposed/false_exposed to gap/weakly_exposed/ideal. Python false verdicts on the merged tree: 6/68. Without this fix it would be 7/68.
  • Negative experiments, each reverted afterwards:
    • restoring the coordinate lookup fails the even-block and uneven-block tests;
    • restoring old_line_text.is_none() in the new-declaration guard fails the new-def test;
    • dropping the indentation check fails the dedent test;
    • forcing the guard to ignore the look-alike check fails the rename test.

Claim Boundary

This PR claims that Python later-line pairing matches TypeScript's. It makes no claim about deleted-line carriers (#7587).

Rollback

Revert the squash commit. The corpus row then returns to credited (false), and the controls are unaffected.

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

Engineering Check

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01U7GbrVC98fTYnLnhe3vhFM


Generated by Claude Code

…#7556)

The second line of a comment-plus-return replacement block reads a false
exposed on main: the return loses its old line, every token reads as
changed, and a test observing only the unchanged operand gets credit.
One-line and discriminating controls read correctly.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GbrVC98fTYnLnhe3vhFM
…ine (#7556)

Every removed line of a block shares the new-side line where the added
run starts, so the coordinate lookup found an old line only for the
run's first added line. A later changed line read every token as delta
and a test observing only an unchanged operand earned a false exposed.
The adapter now reads old lines from ChangedFile::aligned_counterparts
(#7524), and the new-declaration guard treats a def as changed only
when its paired old line looks like it.

py-blocks-account-clamp-second-line moves from credited (false
exposed) to gap (weakly_exposed); Python false verdicts 6/66 -> 5/66.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GbrVC98fTYnLnhe3vhFM
…ge (#7556)

Content pairing compares trimmed text, so an annotation that leaves an
if block paired with its indented old self and the annotation-only
guard suppressed the probe. Both annotation guards now require the
paired lines to share their indentation. Adds a rename test (look-alike
header keeps its probe) and a body-line positive control, and narrows
the SPEC wording to the two second-line cases.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GbrVC98fTYnLnhe3vhFM
@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 Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: ef53c744-d7d4-42d3-942c-a63b53979083
📥 Commits

Reviewing files that changed from the base of the PR and between 2fd0403 and 65d3e9f.

📒 Files selected for processing (33)
  • .ripr/traceability.toml
  • changelog.d/7556-python-block-pairing.md
  • crates/ripr/src/analysis/language/python.rs
  • crates/ripr/src/analysis/language/python/classify.rs
  • crates/ripr/src/analysis/language/python/replaced_block_tests.rs
  • crates/ripr/src/output/gap_decision_ledger.rs
  • docs/specs/RIPR-SPEC-0108-evidence-promotion-honesty-meta-gate.md
  • fixtures/evidence-promotion-honesty-corpus/corpus.json
  • fixtures/python-verdict-corpus/SPEC.md
  • fixtures/python-verdict-corpus/cases/py-blocks-account-clamp-one-line.diff
  • fixtures/python-verdict-corpus/cases/py-blocks-account-clamp-one-line.json
  • fixtures/python-verdict-corpus/cases/py-blocks-account-clamp-second-line.diff
  • fixtures/python-verdict-corpus/cases/py-blocks-account-clamp-second-line.json
  • fixtures/python-verdict-corpus/cases/py-blocks-wallet-clamp-second-line.diff
  • fixtures/python-verdict-corpus/cases/py-blocks-wallet-clamp-second-line.json
  • fixtures/python-verdict-corpus/expected/rows/py-blocks-account-clamp-one-line.json
  • fixtures/python-verdict-corpus/expected/rows/py-blocks-account-clamp-second-line.json
  • fixtures/python-verdict-corpus/expected/rows/py-blocks-wallet-clamp-second-line.json
  • fixtures/python-verdict-corpus/subjects/authored-py-pytest-blocks.json
  • fixtures/python-verdict-corpus/subjects/authored-py-pytest-blocks/ledger/__init__.py
  • fixtures/python-verdict-corpus/subjects/authored-py-pytest-blocks/ledger/account.py
  • fixtures/python-verdict-corpus/subjects/authored-py-pytest-blocks/pyproject.toml
  • fixtures/python-verdict-corpus/subjects/authored-py-pytest-blocks/tests/__init__.py
  • fixtures/python-verdict-corpus/subjects/authored-py-pytest-blocks/tests/test_account.py
  • fixtures/python_adversarial_replaced_block_non_delta_operand/SPEC.md
  • fixtures/python_adversarial_replaced_block_non_delta_operand/diff.patch
  • fixtures/python_adversarial_replaced_block_non_delta_operand/expected/CHANGELOG.md
  • fixtures/python_adversarial_replaced_block_non_delta_operand/expected/check.json
  • fixtures/python_adversarial_replaced_block_non_delta_operand/expected/human-full.txt
  • fixtures/python_adversarial_replaced_block_non_delta_operand/expected/human.txt
  • fixtures/python_adversarial_replaced_block_non_delta_operand/input/ripr.toml
  • fixtures/python_adversarial_replaced_block_non_delta_operand/input/src/account.py
  • fixtures/python_adversarial_replaced_block_non_delta_operand/input/tests/test_account.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Summary by CodeRabbit

  • Bug Fixes
    • Python analysis now correctly pairs changed lines within multi-line replacements, improving findings when the behavior-changing statement is not the first replaced line.
    • New or changed Python declarations are recognized more accurately, including cases involving decorators and indentation changes.
    • Annotation-only changes are no longer incorrectly flagged when indentation differs.
    • Findings better distinguish changes that a test reaches from changes whose results the test actually checks.

Walkthrough

The Python analyzer now pairs added lines with their replaced counterparts and uses those pairs in import detection and classification. Declaration guards account for paired lines and indentation. New regression tests, verdict-corpus cases, and an adversarial fixture record expected classifications and reports.

Changes

Python replacement-block pairing

Layer / File(s) Summary
Pair replaced lines and classify declarations
crates/ripr/src/analysis/language/python.rs, crates/ripr/src/analysis/language/python/classify.rs
The analyzer uses aligned old and new lines for import detection and classifier input. Declaration and annotation guards now account for paired lines and indentation.
Test replacement-block behavior
crates/ripr/src/analysis/language/python/replaced_block_tests.rs, crates/ripr/src/analysis/language/python.rs, changelog.d/7556-python-block-pairing.md
Regression tests cover return-line classification in replacement blocks, declaration-header probes, and indentation-sensitive annotation guards. The changelog records the fix.
Add authored Python verdict cases
fixtures/python-verdict-corpus/SPEC.md, fixtures/python-verdict-corpus/cases/*, fixtures/python-verdict-corpus/expected/rows/*, fixtures/python-verdict-corpus/subjects/authored-py-pytest-blocks.json, fixtures/python-verdict-corpus/subjects/authored-py-pytest-blocks/*
The Python verdict corpus adds an authored project and account and wallet clamp cases, with case metadata and expected verdict rows.
Add non-delta operand fixture and expected reports
fixtures/python_adversarial_replaced_block_non_delta_operand/*, fixtures/evidence-promotion-honesty-corpus/corpus.json, docs/specs/RIPR-SPEC-0108-evidence-promotion-honesty-meta-gate.md, .ripr/traceability.toml, crates/ripr/src/output/gap_decision_ledger.rs
A new fixture checks that the changed return pairs with its own old line and remains weakly exposed. Expected reports and corpus entries record the classification and its evidence.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 65d3e

The replacement-block fix and its regression fixtures have no identified issue requiring a change before merge.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 52.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 8 files. (23 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main production change: pairing each line of a Python replacement block with its corresponding old line.
Description check Passed The description is mostly complete and directly explains the problem, implementation, scope, tests, claim boundary, rollback, and known non-goals. Several template sections are omitted, including supp…
Full details: Docstring Coverage

Explanation

Docstring coverage is 52.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 8 files. (23 skipped: 23 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

I’m a rabbit with a diff to inspect,
I pair each old line with care and respect.
A clamp may change what returns from the call,
While tests check the headers and indent and all.
The fixtures record each finding in view,
And my soft paws hop through the review.

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Member Author

Review of record

Head: d5233177735c29420cbd5510a204ccf83f5cdba4

Reviewers: three independent agent reviews. Gemini and CodeRabbit were quota-limited on this PR and produced no review.

Angle Subject Result
Correctness and edge cases: every old-line consumer, wrong suppression or credit, missed coordinate lookups 4d4962050 Nothing blocking. One wrong suppression caused by this change was found and fixed (below).
Tests, corpus labels, spec and contract: labels re-run with pytest, diffs applied, manifest hashes, rows, SPEC, changelog 4d4962050 Nothing blocking. Diffs apply; labels match pytest (control killed by test_an_overdrawn_wallet_reads_its_debt); hashes match; only the target row moves.
Repair delta and merge regression 4d4962050..d5233177 Nothing blocking. The merge touches no Python adapter or diff code.

Findings and resolutions

  1. Fixed in 91d93e256. Content pairing ignored indentation. Content pairing compares trimmed text, so a module-scope annotation leaving an if block paired with its indented old self, and the annotation-only guard suppressed the probe. Both annotation guards now require equal leading whitespace. dedented_annotation_change_keeps_its_probe covers this, and fails without the check.
    • Residual: an annotation edit combined with a same-depth reindent (tabs↔spaces, black reflow) now keeps its probe. That is fail-closed and accepted.
  2. Filed as python: a deleted statement in an uneven block can lose its only probe once a moved comment pairs by content #7587. A moved comment can leave a deleted statement uncarried. In an uneven block, a re-indented comment can pair by content with its old self, so a deleted statement loses its carrier. The effect is a missed advisory, never a false credit.
  3. Fixed. Test gaps. Added a body-line positive control to the new-def test and a rename test for the look-alike side of the new-declaration guard.
  4. Fixed. SPEC wording. It now names the two *-second-line cases.
  5. No change. Short commit hash. The 7-character ripr_commit hash is cosmetic.

Proof

  • cargo xtask precommit exits 0.
  • cargo test -p ripr --lib analysis::language: 1600 passed.
  • verdict-corpus check-all exits 0 on the merged tree.
  • Four negative experiments each fail the intended test:
    • coordinate lookup;
    • is_none() guard;
    • no indentation check;
    • guard ignoring look-alike.

Disposition: nothing blocking. Marking Ready for the required check.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 13, 2026 02:48
@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 2 potential issues.

Devin Review

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

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • fixtures/python-verdict-corpus/subjects/authored-py-pytest-blocks.json retains ledger/init.py and tests/init.py with sha256 of the empty-file hash (e3b0c44…b855), which is correct but means the manifest's 'retained_files' can't distinguish present-empty from absent in diffs. Not a correctness issue today, but the corpus tooling's contract should be checked.

Verification questions

  • Confirm devin also observed that the new promoted corpus row depends on a single fixture being re-blessed; AGENTS.md evidence-promotion honesty gate should pin an independent non-promotion control.
  • Confirm the same_indentation helper compares leading whitespace via is_whitespace(), so lines using tabs vs spaces (or mixed) could match differently on different platforms and flip annotation-only guard verdicts.
  • Confirm the current diff does not reopen the deleted-carrier concern.
  • Confirm adopt the authored subject at the hash pinned by version_label (authored@3eef453). The subject JSON lists sha256 for retained files but nothing in the PR proves the running pytest used exactly these bytes; if the blessed hashes drift, the 'full_checkout_verdict' label silently rots.

Refuted

  • All three guards (two annotation + new-declaration) suppress probes whenever an added line pairs with a content-equivalent old line, so any indentation-only or whitespace-only move is treated as annotation-only.; refuted because: All three call sites now require same_indentation(old, line_text) (annotation-only) or lines_look_alike (new-declaration) before suppressing, and a dedicated dedented_annotation_change_keeps_its_probe test plus negative experiments cover the move-out-of-block case.

Parked follow-ups

  • Devin also flagged missing independent evidence-promotion pin; non-goal here, but worth tracking.
  • A living tracker outside this PR owns the concern.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

…posed in the honesty corpus (#7556)

Review of #7600 (Devin): a rename that shares few tokens with its old
header failed lines_look_alike, so the relaxed new-declaration guard
suppressed a header that coordinate pairing used to keep. An old def
header in the paired position now marks a changed header too.

Graduates the confirmed false promotion into the evidence-promotion
honesty corpus (RIPR-SPEC-0108) as py_replaced_block_non_delta_operand,
backed by the new python_adversarial_replaced_block_non_delta_operand
fixture: the return of a two-line block must stay weakly_exposed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GbrVC98fTYnLnhe3vhFM
…aration (#7556)

Review follow-up: a new def paired by position with a removed decorator
or class line is a changed declaration, so its header keeps its probe.
Moves the doc comments back onto their functions and corrects the
fixture SPEC: the block fixture drops the @Property of the one-line
#1276 trap, so its test is related and the class is weakly_exposed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GbrVC98fTYnLnhe3vhFM

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

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • Honesty-corpus entry pins expected_class AND maximum_class both weakly_exposed: a re-bless that escalates to exposed would fail the gate independently of the verdict-corpus row, which closes Devin's promotion-honesty concern at PR scope.

Refuted

  • Same indentation helper using is_whitespace() could match tabs and spaces interchangeably and flip annotation-only verdicts on mixed-indent files.; refuted because: is_whitespace() treats space, tab, and form-feed uniformly, so leading-whitespace sequences compare by character identity, not by visual column width. Mixed tab/space indentation that produces identical prefix strings will match; sequences with different chars will not. Behavior is deterministic and platform-stable.
  • Boundary placement: is_python_def_line/same_indentation should be promoted to analysis::diff next to lines_look_alike rather than colocated with classify.rs; refuted because: classify.rs is the only caller and the rules encode Python-specific semantics (def/async def trim, indentation-only-suppresses-annotation); colocating avoids a cross-module dep and keeps the diff boundary at the adapter.
  • Annotation-only guard will silently accept a mixed-tab/space dedent because lines_look_alike trims but same_indentation compares leading chars via is_whitespace, so ' ' and ' ' both count as whitespace and a CR or NBSP could pass differently on platforms.; refuted because: Both branches trim via trim_start for look-alike and walk leading whitespace generically; a Python source line cannot contain raw CR/NBSP indentation in normal source. Even at edge, only an indentation-only shift with matching content would match, and the changelog and test suite pin the behavior. No reproducible false positive in fixture set.

Evidence gaps

  • Rip sensor returned exit-code 2 in the packet, so no ripr binary witness was produced; correctness claims rest on author-attested cargo output and the read of the diff, not on a fresh end-to-end run.
  • Ripr sensor failed exit 2 on this diff; rust behavior or tests touched and source changed per flags, but cargo-build/clippy/fmt/check all skipped by profile. Failure blocks local reproduction of the 1600-test count and the goldens pipeline.
  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 13, 2026 04:27
@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 commented Oct 13, 2026 •

Copy link
Copy Markdown
Member Author

Review of record (update)

Head: bbb38ab61c82c708eb5146c08105a78b796791ec. Supersedes the record for d5233177.

Changes since the last record

3c7f3e670: Devin's red-circle finding. A low-similarity rename of a def lost its header probe. An old declaration line in the paired position now marks a changed header. This commit also graduates the false promotion into the evidence-promotion honesty corpus:

  • new case py_replaced_block_non_delta_operand;
  • new fixture python_adversarial_replaced_block_non_delta_operand;
  • RIPR-SPEC-0108 row and traceability entry.

15fad90b3: old decorator or class line. An independent agent review of 3c7f3e670 found nothing blocking. Its nits are fixed:

  • doc comment placement;
  • fixture SPEC wording;
  • an old decorator or class line in the paired position now also marks a changed declaration (def_paired_with_an_old_decorator_keeps_its_probe, fails without the @ prefix).

bbb38ab61: CI fix. The Rust-only feature lane failure was python_repair_card_corpus_pins_alignment_inventory. The new fixture adds one orthogonal repair card, so the pinned count goes from 12 (main's value after #7561) to 13, with a comment.

Merge. Merged origin/main at 41f3d9c, which includes #7560's Python verdict fixes.

Proof on the merged tree

Disposition: nothing blocking. Marked Ready for the required check.


Generated by Claude Code

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

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • PR body claims 'cargo xtask verdict-corpus check-all exit 0, after merging main' but no receipt is in this packet. The honest test is the post-merge verdict-corpus row counts, not just the precommit suite; ship a CI receipt.

Verification questions

  • Confirm authored subject 'authored-py-pytest-blocks' pins sha256 of two empty files (ledger/init.py and tests/init.py) to the empty-file hash e3b0c44…b855.
  • Confirm cargo-test is scheduled-late, not a pytest witness. If pytest tooling can't be wired into the broker, document the manual witness command.

Refuted

  • Boundary placement: is_python_def_line/same_indentation should be promoted to analysis::diff next to lines_look_alike rather than colocated with classify.rs; refuted because: classify.rs is the only caller and the rules encode Python-specific semantics (def/async def trim, indentation-only-suppresses-annotation); colocating avoids a cross-module dep and keeps the rules with their semantics. EffortlessSteven review of record agrees.
  • Lift is_python_def_line and same_indentation to analysis::diff next to lines_look_alike to keep classify.rs free of Python-specific knowledge.; refuted because: Both helpers encode Python-only semantics (def/async def trim, indentation suppression). Promoting them to analysis::diff would leak Python-specific rules into the diff model. classify.rs is the sole caller, so colocating avoids a cross-module dep and keeps the diff layer language-agnostic, matching the established pattern for lines_look_alike's Python guards.
  • Annotation-only guard now requires same_indentation, which uses char.is_whitespace() and compares leading-char sequences verbatim.

Parked follow-ups

  • ledger/init.py and tests/init.py retained_files both list the empty-file sha256 e3b0c44…b855; the corpus contract cannot distinguish present-empty from absent in diffs. Not a correctness issue today but worth a contract clarification follow-up.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

…ved by #6670

#6670 (an inequality is never an exact oracle) merged after #7572 added
oracle-kind fields to the rows and did not re-bless them, so main's
verdict-corpus check fails. The assert_ne/ensure/helper rows now read
relational_check, and the assert_ne struct-literal row reads weak, an
overclaim that becomes a match. Rust false verdicts 47 -> 46. No-op
once main carries the same re-bless.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GbrVC98fTYnLnhe3vhFM
@EffortlessSteven
EffortlessSteven marked this pull request as draft October 13, 2026 06:27

Copy link
Copy Markdown
Member Author

Ripr Rust Small Result on bbb38ab61 failed, and the cause is not this PR.

cargo xtask verdict-corpus check-all drifted on five Rust spec0231 rows:

  • assert-ne-ok-value, assert-ne-scalar, ensure-not-equal and helper-assert-not-equal: exact_value → relational_check;
  • assert-ne-struct-literal: strength strong → weak.

Cause. #6670 ("an inequality is never an exact oracle") landed on main after #7572 added oracle-kind fields to the rows, and the rows were never re-blessed. This PR touches only the Python adapter. The drift reproduces on current main merged in.

Ported fix in b85722a36. Merged main and re-blessed the Rust corpus:

  • exactly those five rows move;
  • the struct-literal row changes from an overclaim to a match;
  • Rust false verdicts go from 47/379 to 46/379.

The re-bless is a no-op once main carries it.

Re-validated on b85722a36:

  • precommit exits 0;
  • verdict-corpus check-all exits 0;
  • check-evidence-promotion-honesty passes;
  • analysis::language tests: 1628 passed;
  • gap_decision_ledger tests: 110 passed.

Toggling Draft→Ready to re-run the required check.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 13, 2026 06:27
@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!

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

Refuted

  • ship a CI receipt showing post-merge cargo xtask verdict-corpus check-all exit 0 and the 6/68 to 7/68 false verdict delta is held.; refuted because: Author labeled at ripr_commit=3eef453 with full_checkout_classifications matching expected rows; the follow-up review thread from EffortlessSteven documents the post-merge rust re-bless (b85722a) and that the re-bless is a no-op once main carries it. Receipt lives outside this PR's diff but its effect is captured in row counts.
  • is_python_declaration_line/same_indentation should be promoted to analysis::diff next to lines_look_alike; refuted because: classify.rs is the only caller; rules encode Python-specific semantics (def/async def/class/@, indentation-only-suppresses-annotation). Colocation avoids cross-module dep and keeps rules with semantics. EffortlessSteven review of record agrees.
  • same_indentation using is_whitespace() could match tabs and spaces interchangeably and flip annotation-only verdicts on mixed-indent files.; refuted because: Helper compares prefix strings character-by-character after take_while(c.is_whitespace()); unequal prefix strings do not match. Mixed sequences that happen to share the same Unicode scalar sequence will match, others will not. Behavior is deterministic.

Parked follow-ups

  • Delete-statement carriers (#7587) remain a parked follow-up; this PR does not claim them. Within its own scope the diff is internally consistent.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven
EffortlessSteven marked this pull request as draft October 13, 2026 07:31
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 13, 2026 07:31

Copy link
Copy Markdown
Member Author

Rust gates on b85722a failed in one xtask test: reports::dx_scoreboard::population_tests::oracle_committed_rates_keep_labeled_and_unlabeled_cases asserted oracle accuracy 26/34 and read 31/34. This branch re-blessed the five RIPR-SPEC-0231 rows that #6670 left stale. Main landed the same re-bless as #7631, which also moved this test's numerator to 31. The failure belongs to that interaction, not to the Python change.

Fix: merged main as 65d3e9f. The Rust corpus rows now match main byte for byte. Local results on 65d3e9f:

  • the failing test passes;
  • cargo xtask verdict-corpus check-all passes, with Rust oracle accuracy 31/34;
  • cargo xtask precommit passes.

I re-toggled Ready for the required check. The review dimensions are unchanged: there are no production or test edits beyond the main merge.


Generated by Claude Code

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

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • No other Python old-line readers were observed in the changed surfaces; consolidation appears complete. Residual risk: future readers added outside this PR could re-introduce coordinate-only pairing.

Verification questions

  • Confirm classification guards (annotation-only def, annotation-only var, new-declaration) all read old_line_text and now apply indentation-equality and declaration-line checks before suppressing; failures move to the look-alike rule from analysis::diff, matching TypeScript's posture.
  • Confirm effortlessSteven merged main (65d3e9f) after a Rust spec0231 drift that reproduced on current main, blaming #6670 oracle-kind fields, not this PR. Reviewers should not reintroduce the 5 rust rows or re-bless them on a branch pending another capability.

Parked follow-ups

  • Authored subject authored-py-pytest-blocks retains init.py files whose sha256 is the empty-file hash; manifest cannot distinguish present-empty from absent in diffs. Not a correctness issue for this PR but worth noting for downstream tooling contract.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants