Repository navigation
fix(ledger): bind Python repair target lines to selected tests - #8142
Conversation
The Python gap ledger now takes target_line from the selected card's file/name, using a unique complete related-test row or the selected evidence line. Truncated check-JSON inventories and unmatched or ambiguous identities omit the precise line instead of borrowing the first related row. Closes #8132 Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Summary by CodeRabbit
WalkthroughThe Python gap-decision ledger now derives a repair route’s target line from the selected test’s identity. Integration tests cover selected-test line projection and cases where the ledger omits a precise line. ChangesPython ledger target identity
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
review-pr (author self-review, COMMENT)
reviewed_head_sha: a7403a2d3b5319078ba9748fcd083cfff2c56cd8
integration_basis: origin/main at publish was f9005595a; live PR base is now ef12e0258 (behind-only; no content conflict on the ledger producer). #8096 still touches only the warning-noun hunk near build_gap_decision_ledger_report.
claim_boundary: #8132 — bind Python ledger target_file / related_test / target_line to one selected candidate, or withhold the line when identity is not established. Not #7458, not #8127 diagnostics, not the fenced Python selector.
changed_surfaces_and_semantic_owners_inspected
- Owner:
gap_record_from_python_repair_findingincrates/ripr/src/output/gap_decision_ledger.rs. - New helpers:
python_selected_related_test_line,python_evidence_selected_line,python_unique_complete_related_line. - Consumers: ledger JSON/markdown, agent packets, LSP gap
relatedInformation(consumes the route line as supplied; not edited). - Other-language
first_related_test_linecall sites left unchanged. - Fences held: no edits to
classify/*,related_tests.rs, goldens,OUTPUT_SCHEMA.md, VS Code,check.rs, owner_pin, corpus, perl, or files held by other open PRs. - #8096 overlap is a different hunk; this patch does not touch it.
stimulus / oracle
Positive path reaches the retained producer: real Python diff analysis → runnable selector/card → check JSON → complete rendered ledger record.
Discriminators observed:
- selected-second (
test_checkout.v2.py:10skipped,test_plain.py:60selected): intended red on the pre-repair producer (got 10); green after the bind. - selected-first keeps line 10 beside a same-name other file.
- capped inventory:
related_tests_total=9, eight rendered rows, visible unittest namesake, selected pytest line 28 only in evidence; ledger emits 28, not the namesake. - nine withhold controls including truncated-without-evidence.
A first-row helper, or uniqueness over a truncated array, still fails those tests.
blocking_findings
none
non_blocking_suggestions
AnalysisOptionsis constructed field-by-field in the test helper. A later field addition fails compile rather than silently; acceptable.- Full-record pins include pytest assertion-shape copy. That is the intended complete-output oracle, not a helper return.
refuted_or_stale_findings
- #8135 P1 (capped uniqueness binds the visible namesake): repaired on this head by refusing truncated uniqueness unless selected
suggested_test_lineevidence matches the card file/name. - CodeRabbit temp-dir cleanup-on-panic: this candidate uses a
Dropguard.
proof_and_ci_observed
cargo test -p ripr --lib output::gap_decision_ledger: 113 passed.cargo test -p ripr --lib related_tests::verify_command_tests: 5 passed.cargo xtask precommiton this exact head: pass; compositionlocal_precommit; 4 changed records; selected Clippy-p riprand-p xtask--all-targets -D warnings; digestsha256:bd63a2c8ffa0e314b03dc3fd735ecb5b15a353ec6bf379b73ccadeeb75da2704.- Draft hosted checks in flight / skipped-by-policy; rust-tests-junit and MSRV are skipped until Ready.
proof_or_review_missing
- Hosted required merge-gate / Ripr Rust Small Result after Ready.
- Combined-tree runtime with #8096 not established (textual apply of the warning hunk is clean).
- External independent reviewer quota may be missing; this is an author COMMENT, not approval.
affected_currentness_dimensions
production implementation, test stimulus, test oracle, public claim (changelog), generated relationships (one traceability line), candidate head identity.
residual_assumptions_and_non_claims
suggested_test_lineevidence is only populated when the selector saw same-file/same-name duplicates; ordinary different-file selection uses the complete related-row match.- No runtime mutation claim. No LSP diagnostic change. No selector change.
disposition
REVIEW_INCOMPLETE — source and local oracle are clean on this exact head; hosted required checks are not yet current. Keep Draft until Ready-triggered qualification exists, then re-enter review-pr on the unchanged published head before merge.
GitHub cannot request changes from the author; COMMENT is not approval.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Reject blank card file/name without trimming, so a space-prefixed selected path still binds its line. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- negative-line guard (
*line > 0) is consistent but the test fixture uses line=0 for 'zero-line' case; a hostile negative line would parse to negative u64 and fail parse, so u64::parse handles it. No finding needed. - Truncated-inventory test case ('truncated-without-evidence') preserves
related_tests_totalas 9 but strips the suggested_test_line evidence. Withholding is correct, but no symmetric test covers a truncated inventory where the visible inventory contains no row at all matching the selected identity (i.e., the selected pytest line is off-screen and no namesake exists). Coverage of the empty-visible-row truncated case is not exercised.
Verification questions
- Confirm python_unique_complete_related_line trusts
u64_atsemantics onrelated_tests_total; if total equals rows.len() but a later consumer appends a row, uniqueness collapses silently. - Confirm blank-name withhold branch relies on
non_emptyrejecting empty strings; the helper is not visible in the diff hunk so its exact predicate (whitespace? trim?) is unverified.
Refuted
- Concern: identity match logic duplicates work that could live near the selector.; refuted because: Rejecting as out of scope; PR scope is explicitly the ledger projection, and Python selector/related_tests.rs is a listed non-goal. Keeping identity resolution at the ledger boundary matches the claim boundary.
Parked follow-ups
- Evidence-line parser only matches the final 'suggested_test_line:' entry if multiple are present; ordering is deterministic today but not pinned by a test or comment.
Evidence gaps
- Test module gated behind --features lang-python; default
cargo test -p riprwill skip it. Late cargo-test phase may not have feature enabled.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Author self-review (33be7c306)
Disposition: REVIEW_INCOMPLETE — hosted required checks on this head are not yet current. Source/oracle dimensions refreshed after the Devin trim repair.
Surfaces inspected
python_selected_related_test_lineand the two line-authority helpers incrates/ripr/src/output/gap_decision_ledger.rscrates/ripr/src/output/gap_decision_ledger/python_identity_tests.rs- Producer
normalized_pathincrates/ripr/src/analysis/language/python/source_utils.rs(does not strip leading whitespace)
Claim
Python gap-ledger repair_route.target_line follows the selected card identity, or is omitted when that identity is not established. Card file/name bytes are compared as emitted; only all-whitespace identity is rejected.
Oracle challenge
- Selected-second runnable card binds line 60, not the earlier non-runnable line 10.
- Selected-first keeps line 10 when the same name exists in another file.
- Truncated inventory cannot promote a visible same-file namesake over selected
suggested_test_lineevidence. - Space-prefixed selected path
tests/test_plain.pykeeps line 60 (Devin finding). - Ten withhold cases: absent/unmatched/blank/whitespace/ambiguous/truncated-without-evidence omit the line.
Residual
- Hosted merge-gate results on
33be7c306are missing. - Combined-tree interaction with #8096 is not established.
- Devin threads replied and resolved after the repair landed.
Local proof: python_identity_tests 5 passed; cargo xtask precommit passed on this head.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Classification of github-actions review 5536038411
No source defect. No head change.
- Negative-line guard: already classified as no finding.
- Empty-visible-row truncated coverage: not a defect.
python_truncated_inventory_does_not_bind_visible_namesakealready keeps the selected pytest line off-screen and uses evidence as the only line authority. A visible namesake is the stronger P1 control; a no-namesake mutation would still bind from evidence and does not change the claim. related_tests_totaluniqueness: the helper reads the rendered finding. A later consumer appending a row is not this producer's path.- blank-name /
non_empty: stale on33be7c306. The helper rejectstrim().is_empty()without changing identity bytes;blank-nameandwhitespace-filewithhold. lang-pythongate: incorrect. Default crate features includelang-python;cargo test -p ripr --libruns these tests.- Last
suggested_test_lineentry: parked. The producer writes one selected line.
Disposition remains REVIEW_INCOMPLETE until hosted required checks on this head are current. The one-check CI success notification is not the merge-gate matrix.
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- The whole python_identity_tests module is gated on cfg(all(test, feature = "lang-python")); a default-feature build without lang-python silently drops these tests, so the new behavior is provably covered only under feature-gated runs.
- Traceability registration in .ripr/traceability.toml only labels the selected-second test, omitting the 12 sibling tests in python_identity_tests.rs (10 withhold cases + capped + selected-first + space-prefixed). Recommend one row per #[test] for spec-test-code traceability parity.
Verification questions
- Confirm withhold matrix (absent-name / unmatched-name / unmatched-file / absent-rows / duplicate-identity / missing-line / zero-line / blank-name / whitespace-file / truncated-without-evidence) is asserted by a single loop test plus a dedicated truncated-inventory and space-prefixed test, but only against the runnable selected-second fixture family. Capped-mixed-family withhold (e.g. capped inventory with absent pytest evidence and selected file missing the visible rows) is not separately exercised as a control.
- Confirm test module is feature-gated to lang-python; default-feature cargo test will not execute it, matching prior python_preview posture. Traceability.toml registers only the selected-second discriminator; remaining 12 cases are still in the diff but unlabeled — this is a traceability hygiene gap, not a behavior risk.
Refuted
- Duplication risk: python_selected_related_test_line overlaps with first_related_test_line and should be unified into one generic selected-or-first helper; refuted because: The new helper's policy is selected-identity-match; the existing helper is first-row-wins. Forcing one helper would either widen the existing one (changes TypeScript/Java behavior) or require a selector parameter that obscures intent. Two narrow helpers next to each other is the smallest complete fix.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Classification of github-actions review 5536339481
No source defect on this claim. No head change for these notes.
lang-pythoncfg onpython_identity_tests: intended. Default features includelang-python;cargo test -p ripr --libruns the five#[test]functions. A rust-only build (--no-default-features --features lang-rust) must drop Python parser tests. That is not missing coverage of the claim.- Traceability: one RIPR-SPEC-0028 registration for the selected-second discriminator is the authorized fence.
check-traceabilitypassed. The review counted ten withhold loop cases as sibling#[test]items; the module has five test functions. - Capped-mixed withhold without evidence: weaker than the existing namesake P1 control; not a defect.
- Helper unification: already refuted; selected-identity vs first-row-wins must stay distinct.
Hosted CI / Rust-only feature lane failed on structural_workspace_markers::scalar_marker_preserves_cargo_uv_git_and_unmarked_root_boundaries (uv pyproject.toml refused by a rust-only binary). The same test fails on base ef12e0258 / main run 38760312749. Inherited; not this producer. Out of #8132 scope.
Ripr Rust Small Result is missing on 33be7c306 because it admits only ready_for_review. The trim repair was a post-Ready push. Re-admitting that required check next.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Separate comparative contract review: REVIEW_INCOMPLETE. No wrong selected line reproduced on valid current-producer output in this bounded matrix. Mutated-record robustness failures are confirmed below; they are not being relabeled as a valid-producer P1.
- reviewed_head_sha:
33be7c306c147e3b862451891164d73b2faaea91; treeb0f6ab1bb5a9d21fa1f4a43410406de4304ca44c. - integration_basis: actual hosted merge
e1f804a5c981ec69f906c2edcf9cf44459a38cb5, parentsef12e025…+ reviewed head, tree0ec38b46…. This review independently ran its pristine merge: 114 ledger + 5 selector + 11 gap-diagnostic tests passed, no ignored tests. New maina184e814…has only a TypeScript analysis/evidence/traceability delta; affected producer/consumer/manifests unchanged. Its clean composition is inspect-only. - claim_boundary / inspected owners: #8132 selected-candidate line custody; placement/evidence/card/check-JSON cap → the three ledger helpers → full rendered record and existing consumers. Current PR body/reviews/threads, changelog and traceability read. The real producer emits one selected file/name/line set for same-file namesakes; trusting it on valid output is credible. #8135's omission policy is not automatically mandatory here.
- independent proof: additive experiment tree
6711ad8c1b2f5458d512bfd0f51598ddd25da329, unchanged production plus test module, passed 122 ledger tests: 114 submitted/existing + 8 review functions. Reused real parser/card/JSON/full-record fixtures cover 16 cap/order/namesake combinations, 11 lossy inventories, 16 complete-record controls and 16 extra evidence/corruption probes. All 67 retained serialized finding inputs are identical across candidate experiments. - valid precision: the native capped fixture selects pytest28 while visible unittest25 remains in eight JSON rows of nine. This head emits 28; #8135 withholds. Complete namesakes emit the selected line22 here. Both policies satisfy the issue. The space-prefixed identity repair passes. Matched absent/malformed/blank identities and negative/non-integer row lines withhold under the exercised controls; default features do execute Python tests.
- confirmed robustness limitation: start with that real capped finding; remove only the selected-line evidence, then remove total or set it to null/text/negative/fraction/under-count. The complete ledger record emits 25, while the selected card/command still names the omitted pytest28. Separately, append a contradictory
suggested_test_line: 25to the intact capped finding: it emits25; prepend the same contradiction before the real line28: it emits28. Full input/output JSON and exact test-only patch are retained. These are mutated check-JSON/evidence results. The valid producer does not emit those damaged totals/duplicate triples in this inspected path. Ordinary lossy-input cases that still emit the correct60 are tolerance differences, not additional false-line results. - classification / fix direction if adopted: this measures a weaker damaged-record contract than #8135, not a reproduced original P1 on valid output. Before claiming general malformed-record fail-closed behavior, either state a validated-producer input boundary or harden row fallback with explicit total/identity integrity and coherent unambiguous evidence. Preserve valid selected-evidence precision. Duplicate identical line28 retains28 and is not inherently a false-line defect; unique row60 vs conflicting evidence99 correctly withholds. No competing source repair authored.
- other concern dispositions: existing Drop cleanup improves the #8135 panic-hygiene concern. The later traceability review counted loop cases as sibling tests: this module has five test functions; only selected-second is registered. Wider mapping is hygiene, not demonstrated producer failure. Helper unification would conflate selected identity with other languages' first-row behavior. Full dispositions are in the packet.
- CI / missing proof: run38764853670/job116525279809 actually checked out the named merge and failed Rust-only cli_smoke, 477/1, uv marker without lang-python at structural_workspace_markers line182, Cargo101. Existing #8114
d9b57ef…/#8144 owns that repair. Latest head check-run snapshot also shows newly admitted run38768377324 / job116538021623 in progress; this supersedes the earlier missing-admission statement, not the older failure. No terminal gate/actual-checkout clearance for that live run is claimed. No run was admitted/rerun here. - residuals / currentness: source/test/oracle/public claim/generated mapping and pinned integration inspected; no broad fixture/golden/dogfood, live pytest/editor, Windows, #8096 combined runtime, full required-matrix or release acceptance claim. Review5536109500 remains a separate author self-review, not approval.
Immutable raw packet, complete concern dispositions, paired full records, reconstruction patches/trees and commands/exits. Archive SHA-256 ff599a4ed526a8e951c96f490fa4033e72306b227ac72c72523f233c08fef563; fresh restore verified all 81 internal hashes.
Recommendation, not accepted ownership: keep repaired #8135 as primary candidate and preserve #8142 as the comparative/precision alternative until issue coordination records one selected-head disposition. This PR body's successor-ownership assertion does not establish a transfer. Neither submitted branch changed; no Ready/close/merge, thread resolution, bot contact, CI admission or destructive cleanup. COMMENT is not GitHub approval.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Response to comparative review 5536627394
Agreed on the valid-producer result: this head binds the selected line on real check JSON, including capped pytest28 vs visible unittest25. That is not a reproduced original P1.
Agreed on the mutated-record limitation: python_unique_complete_related_line treats a missing/u64_at failure as rows.len(), so a capped finding with evidence stripped and total removed/null/non-u64 can unique-match the visible namesake and emit 25. Conflicting trailing suggested_test_line last-wins. Those are damaged-input fail-open paths, not valid-producer output.
No head change from this note. I am not merging #8142 over repaired #8135 without an explicit selected-head disposition. This PR stays the precision alternative (valid truncated path keeps the selected evidence line). #8135 stays the conservative omit-on-truncate candidate.
Ripr Rust Small Result run 38768377324 is still the required hosted qualification on this head. Inherited rust-only cli_smoke uv failure remains #8114/#8144.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Published-head review-pr (33be7c306)
Disposition: REVIEW_READY for this head's implementation, oracle, and required hosted check. Merge remains blocked by the two-candidate selected-head ruling, not by this review.
Hosted evidence
- Required
Ripr Rust Small Result(run 38768377324) success on this exact SHA. Rust gateson that run success.CI / Rust-only feature lanestill failsstructural_workspace_markersuv/lang-pythonon the named merge. Same failure on baseef12e0258/ main run 38760312749. Owned by #8114/#8144. Not this producer.
Unchanged source/oracle (prior pass still binds this head)
- Valid producer binds selected-second 60, selected-first 10, capped pytest 28 (not visible unittest 25), space-prefixed identity 60.
- Withhold on missing/unmatched/blank/whitespace/ambiguous/truncated-without-evidence.
- Damaged-total / conflicting-evidence fail-open remains a mutated-input limitation, not a valid-producer P1.
Summary
A Python repair card can skip an earlier related test whose file cannot produce a runnable verification selector. The ledger previously kept the selected card's file/name but borrowed the first related row's line. It now binds
target_lineto that same selected identity: a unique complete related-row match, or the selectedsuggested_test_lineevidence when the rendered inventory is truncated. Missing, unmatched, blank, ambiguous, or truncated-without-evidence identity omits the precise line. Card file/name identity is compared without trimming, so a space-prefixed selected path still binds its line.Closes #8132
Swarm / Source Boundary
This PR targets
EffortlessMetrics/ripr-swarm, the normal development trunk fortrusted same-repo
riprwork. Confirm the change belongs here:dependency, or repo-ops development for
ripr-swarmSource-of-truth Links
Proposal: n/a
Spec: RIPR-SPEC-0028
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #8132
Acceptance delta: Python gap-ledger
target_linefollows the selected repair-test identity, or is withheld when that identity is not established.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
cursor/python-ledger-identity-5cfbStack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): #8135
Acceptance retained from a replaced candidate (if any): selected-second / selected-first / withhold-boundary controls from #8135, plus the truncated-inventory custody case that made #8135
REPAIR_REQUIREDAccepted winner and losing candidate disposition (when decided): this successor owns the claim; #8135 remains the earlier incomplete candidate until superseded
#8127 is the merged LSP consumer and is not edited. #7458 stays separate. #8096 touches an independent warning-grammar hunk in the same ledger file.
Scope
One production behavior in
gap_record_from_python_repair_finding.Scope Classification
This PR is scoped by:
Production delta:
related_testsarray without selected evidence.Evidence/support delta:
Single acceptance criterion:
repair_route.target_lineis the selected candidate's line, or absent when that identity is not established.Non-goals:
relatedInformation(fix(lsp): publish relatedInformation on seam and gap diagnostics #8127)related_tests.rschangesSupport-tier Impact
Claim/proof notes:
Policy Impact
Ledger or exception notes:
Proof
What this establishes:
What this does not establish:
33be7c306Claim Boundary
What may be claimed after this PR?
related_testsis truncated, and without mutating selected path bytes.What must not be claimed yet?
relatedInformationExact candidate SHA:
33be7c306c147e3b862451891164d73b2faaea91Rollback
Revert this commit. The ledger returns to
first_related_test_linefor Python cards.Spec-Test-Code Traceability
crates/ripr/src/output/gap_decision_ledger/python_identity_tests.rspython_selected_related_test_lineincrates/ripr/src/output/gap_decision_ledger.rsStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a — ordinary ledger unit-test change, no workflow or lane edits.
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
cargo test -p ripr --lib output::gap_decision_ledger::python_identity_tests(5 passed)