Repository navigation
fix(python): link src-layout tests to their owner module - #3944
Conversation
A free-function owner under the PyPA src layout (`src/pricing/discounts.py`) had only one module-identity form, `src.pricing.discounts`. Tests in a src layout import the package by name (`from pricing.discounts import ...`), so a strong direct exact-value test was reported `weakly_exposed` with `strong_oracle_observes_different_sink`, and the repair card asked the user to strengthen a test that already pins the value. The identical flat layout reported `exposed`/`direct`. `owner_module_paths` now returns the repository-relative dotted path plus, for each directory segment named `src`, the dotted path below that import root (`pricing.discounts`; monorepo `packages/x/src/foo/bar.py` -> `foo.bar`). Matching stays exact-equality on complete module paths: bare stems, arbitrary suffixes and same-named functions from other modules still fail closed. The `src.`-qualified form keeps matching. Proof: production-path classify tests (positive fails on main), a discriminating negative set, and fixture python_src_layout_package_import pinning `exposed`/`direct` for the imported module next to an orthogonal, non-eligible same-named owner in another module. The repair-card alignment corpus inventory gains that one orthogonal record. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018QP9k41E538Xgytw8QCSfM
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Lane scope mismatch: no resizable buffers, ArrayBuffer/TypedArray resize/detach/transfer, or stale length snapshots exist in this Rust analyzer PR; active-view surface is empty by construction.
- Residual ambiguity the author flagged and explicitly accepted: a repo with both x.py and src/x.py, or two monorepo packages with identical module path under src, can share an import name; resolution needs sys.path. Claim boundary respected; this is documented, not an architecture defect.
Verification questions
- Confirm artifact-verifier failed (exit 2); lane cannot independently confirm fixture contract (
cargo xtask check-fixture-contracts,cargo xtask goldens check) executed clean before this review. PR body claims pass; receipt missing from sensor evidence.
Refuted
owner_module_pathscould panic via the sliceget(idx + 1..)index when iterating past the finalsrcdirectory segment; refuted because: Thetake(directory_count)cap restricts iteration to indices[0, parts.len()-2]whenpartsis non-empty, soidx + 1never exceedsparts.len();geton a&Vec<String>accepts the exact end-of-slice index andunwrap_or_defaultcovers the empty-slice case anyway.- Renaming owner_module_path → owner_module_paths could break an external caller that imported the helper directly.; refuted because: owner_module_path and owner_module_paths are both
pub(super)inside analysis/language/python module; private to the ripr crate. No crate-level re-export or pub use found in the diff or the renamed-symbol neighborhood. The breaking surface is internal-only.
Parked follow-ups
- Pyproject-configured source roots (e.g. lib/, custom package_dir) are explicitly out of scope and should be parked, not broadened by sibling search.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- PR body proof is from author precommit run; cargo-test is scheduled-late and artifact-verifier failed (exit 2). Receipt for the actual fixture regeneration in this PR is not in the evidence packet.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Review (exact head 2f9f2ef)
Surfaces: analysis/language/python/related_tests.rs (+40/-14), its tests, one ledger line, RIPR-SPEC-0028 amendment, new python_src_layout_package_import fixture (input, diff, expected check/human).
- Change:
owner_module_path→owner_module_paths, adding the below-srcalias sosrc/pricing/discounts.pyis reachable both assrc.pricing.discountsandpricing.discounts— the layout pytest actually imports through. Identity stays fail-closed: a bareimport X(emptysource_module) still never matches. - Evidence: the fixture pins the end-to-end classification (
exposedwhen the package import reaches the owner); unit tests classify through both owner spellings. - Lane position: this is the base of the Python related-test lane; the later over-credit controls (#3955, #3980) build on it and are handled separately.
- Validation: published-head required check SUCCESS.
Disposition: REVIEW_READY.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Confirmed findings
- Residual ambiguity the author explicitly accepted: a repo with both x.py and src/x.py, or two monorepo packages with identical module path under src, can share an import name; resolution needs sys.path, which static analysis lacks. Claim boundary respected; documented, not a defect.
- src_layout_owner_imported_by_package_name_credits_exposed pins post-boundary value 101 but never asserts quantity == 100, so a future >=→> regression on the equality-boundary line is not locally discriminated; same pattern acknowledged by legacy.py test where missing discriminator is exactly that boundary.
Verification questions
- Confirm artifact-verifier sensor failed (exit 2); security lane cannot independently confirm fixture-contract and golden checks executed clean. PR body claims pass; receipt missing.
- Confirm artifact-verifier failed (exit 2) so cargo xtask check-fixture-contracts and cargo xtask goldens check cannot be independently re-witnessed by this lane; relying on PR-body proof list and on-tree unit assertions only. No public comment proposed; tracked for the human reviewer.
- Confirm owner_module_paths is the single site that strips a src segment; no parallel helper in callers/sinks/free-function module-identity derives paths the same way. Sibling paths limited to this function.
- Confirm public API consumers in the Python lane: import_source_module_matches_owner is the only caller of owner_module_path(s); no sibling helper matched the old one-line signature. Renaming is local.
Refuted
- New src-layout tests are smoke/tautology because they pass under both main and fix; refuted because: Negative test explicitly loops four distinct wrong imports + app/ non-src owner and asserts alignment_reason=='strong_oracle_observes_different_sink', which main currently violates (it would emit Exposed via src-strip fallback); only the fix's exact-equality invariant keeps them on the orthogonal branch.
- owner_module_paths could panic via slice get(idx + 1..) when iterating past the final src directory segment; refuted because: take(directory_count) caps the iteration to indices [0, parts.len()-2] when parts is non-empty; idx+1 is therefore <= parts.len()-1, and get returns Some only when within bounds; the unwrap_or_default branch is unreachable but safe.
- The PR introduces resizable buffers, ArrayBuffer/TypedArray detach/transfer, or stale length snapshots in an active-view region; refuted because: Diff is a Python static analyzer change: dotted module path generation, equality check against a Vec, new fixture files, and a spec paragraph. No JS runtime, no resizable Vec ops, no length captured across a mutating call.
Evidence gaps
- cargo test receipt claimed in PR body (380/5300 passing, goldens, fixture contracts, judged panel) not in current sensor evidence; cargo-test is scheduled-late and artifact-verifier failed exit 2.
- Model proof intent was rejected by deterministic validation.
- artifact-verifier failed (exit 2) so lane cannot independently confirm cargo xtask check-fixture-contracts / goldens check ran clean for the new fixture.
…lt-base change #4002 made CheckInput::default().base None and reblessed every --diff fixture on its base. #3944 (python_src_layout_package_import) and #3985 (tail_comparison_boundary) were blessed on bases without #4002, so each merged with "base": "origin/main" and base_revision "origin/main", and `cargo xtask goldens check` on main reports both as drift. Reblessed with a RIPR-SPEC-0084 reason; only base/base_revision change, the same delta #4002 applied to the other fixtures. goldens check: 0 drift entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
…lt-base change #4002 made CheckInput::default().base None and reblessed every --diff fixture on its base. #3944 (python_src_layout_package_import) and #3985 (tail_comparison_boundary) were blessed on bases without #4002, so each merged with "base": "origin/main" and base_revision "origin/main", and `cargo xtask goldens check` on main reports both as drift. Reblessed with a RIPR-SPEC-0084 reason; only base/base_revision change, the same delta #4002 applied to the other fixtures. goldens check: 0 drift entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 7930fef)
…lt-base change #4002 made CheckInput::default().base None and reblessed every --diff fixture on its base. #3944 (python_src_layout_package_import) and #3985 (tail_comparison_boundary) were blessed on bases without #4002, so each merged with "base": "origin/main" and base_revision "origin/main", and `cargo xtask goldens check` on main reports both as drift. Reblessed with a RIPR-SPEC-0084 reason; only base/base_revision change, the same delta #4002 applied to the other fixtures. goldens check: 0 drift entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 7930fef)
…lt-base change #4002 made CheckInput::default().base None and reblessed every --diff fixture on its base. #3944 (python_src_layout_package_import) and #3985 (tail_comparison_boundary) were blessed on bases without #4002, so each merged with "base": "origin/main" and base_revision "origin/main", and `cargo xtask goldens check` on main reports both as drift. Reblessed with a RIPR-SPEC-0084 reason; only base/base_revision change, the same delta #4002 applied to the other fixtures. goldens check: 0 drift entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 7930fef)
…lt-base change fixture on its base. #3944 (python_src_layout_package_import) and #3985 (tail_comparison_boundary) were blessed on bases without #4002, so each merged with "base": "origin/main" and base_revision "origin/main", and `cargo xtask goldens check` on main reports both as drift. Reblessed with a RIPR-SPEC-0084 reason; only base/base_revision change, the same delta Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 7930fef)
…lt-base change #4002 made CheckInput::default().base None and reblessed every --diff fixture on its base. #3944 (python_src_layout_package_import) and #3985 (tail_comparison_boundary) were blessed on bases without #4002, so each merged with "base": "origin/main" and base_revision "origin/main", and `cargo xtask goldens check` on main reports both as drift. Reblessed with a RIPR-SPEC-0084 reason; only base/base_revision change, the same delta #4002 applied to the other fixtures. goldens check: 0 drift entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 7930fef)
Conflict resolution toward current main semantics (forward-only): - 5 fixture expected/CHANGELOG.md journals (python_adversarial_changed_sink_ non_delta_operand, python_dynamic_route_registration_limit, python_fixture_name_relation, python_related_test_name_similarity, python_same_stem_test): both sides appended a pending bless entry at EOF with the same '(2)' heading. Kept the PR's RIPR-SPEC-0028 entry as (2) (blessed 2026-09-23T11:16Z) and renumbered main's RIPR-SPEC-0084 no-default-base entry as (3) (landed in fd572c8, 2026-09-24T02:25Z), preserving the append-only journal chronology and the MD024 unique-heading scheme enforced by next_pending_heading. - Auto-merged and verified by inspection: check.json envelopes (main's base/base_revision null change) combined with PR findings changes; related_tests.rs (PR's test_references_owner gate + #3944's owner_module_paths src-layout broadening, which the gate reuses); tests.rs (both sides' tests present); RIPR-SPEC-0028 (both paragraphs); traceability.toml.
Forward-only merge of main a4db66c (GREEN). Resolutions: - fixtures/python_*/expected/CHANGELOG.md (5 files): both appended Pending bless sections kept; PR RIPR-SPEC-0028 entry stays (3), main's later RIPR-SPEC-0084 entry (#4002) appended as (4), keeping headings unique per the accumulated-bless-log design (goldens check does not compare CHANGELOG.md bytes). - expected/check.json auto-merge verified: main's base/base_revision None change (#3952) combined with this PR's evidence additions; input_identity unchanged per fixture. - No product-code conflicts; main's flow.rs tail-comparison (#3985) is Rust-only and semantically consistent; main's related_tests.rs src-layout matching (#3944) only widens the strong-call set this PR's boundary rule consumes.
…SPEC-0028) The three src-layout unit tests asserted exposed for a strong exact-value oracle whose only call, bulk_discount(101), sits away from the changed quantity == 100 boundary, so the RIPR-SPEC-0028 boundary rule correctly downgrades them to weakly_exposed. Keep the #3944 import-discovery discriminators by pinning the oracle call to the boundary itself (bulk_discount(100) == 0.0, the input where > and >= disagree), and add src_layout_owner_called_off_boundary_does_not_credit_exposed asserting the 101 call fails closed to weakly_exposed with the named quantity == 100 boundary while the import identity stays direct. The boundary-downgraded python_src_layout_package_import finding now carries a direct-aligned repair card, so the repair-card corpus inventory pin moves from (2, 28, 11) to (3, 28, 11).
…t at the boundary (#3955) * fix(python): require boundary evidence before crediting exposed on relational predicates A changed Python relational predicate (`qty > item.on_hand` -> `qty >= item.on_hand`) was reported `exposed` whenever a strong exact-value oracle reached the owner, even when the only test called it far from the boundary (`reserve(Item("a", 10), 3) == 7`), which passes before and after the change. Mirror the Rust activation rule (classify/activation.rs missing_boundary_discriminator): once a strong related test calls the owner with a literal argument, `exposed` requires one such call to bind both comparison operands to equal values (literals, or owner parameters bound via positional, keyword, alias, method-after-self, or literal defaults). Otherwise the finding fails closed to `weakly_exposed`, infection reads weak, and a simple-operand boundary is named as the missing discriminator with the observed operand values. Unresolvable operands (attributes, computed expressions, comprehension locals, multi-comparison lines) never count as observed; computed boundaries are not named as typed repair targets. When no strong call binds any literal argument the oracle verdict stands (as Rust does for empty call_values) and exposed findings carry a named `boundary_activation_unresolved` limitation, keeping the judged-panel structlog construct-call row `exposed`. Literal owner-call arguments and observed boundary equalities now populate `observed_values` for predicate findings. Reblessed five Python fixtures whose only drift is that additive evidence; no classification moved. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018QP9k41E538Xgytw8QCSfM * fix(python): do not name a boundary repair target through an unresolved operand When an operand of the changed comparison is never bound by a strong related call (an attribute such as item.on_hand), the test input may sit on the boundary at runtime. The finding still fails closed to weakly_exposed, but the equality is no longer handed out as a missing discriminator, so no Python repair card asks for a test that may already exist. RIPR-SPEC-0028 states the rule. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018QP9k41E538Xgytw8QCSfM * docs(spec): record observed_values before the failure modes in RIPR-SPEC-0028 Rides the ub-review 'spec sentence order' nit the author parked for the next push: the observed_values sentence sat between two sentences about the unresolved case and read as its artifact. It now follows the rule statement directly; the unresolved-operand and no-literal-input cases follow in order. Meaning unchanged. * test(goldens): bless python_src_layout_package_import under the boundary rule (RIPR-SPEC-0028) * test(python): reconcile src-layout pins with the boundary rule (RIPR-SPEC-0028) The three src-layout unit tests asserted exposed for a strong exact-value oracle whose only call, bulk_discount(101), sits away from the changed quantity == 100 boundary, so the RIPR-SPEC-0028 boundary rule correctly downgrades them to weakly_exposed. Keep the #3944 import-discovery discriminators by pinning the oracle call to the boundary itself (bulk_discount(100) == 0.0, the input where > and >= disagree), and add src_layout_owner_called_off_boundary_does_not_credit_exposed asserting the 101 call fails closed to weakly_exposed with the named quantity == 100 boundary while the import identity stays direct. The boundary-downgraded python_src_layout_package_import finding now carries a direct-aligned repair card, so the repair-card corpus inventory pin moves from (2, 28, 11) to (3, 28, 11). * test(goldens): reconcile sibling-owner fixture under the boundary rule (RIPR-SPEC-0028) The #3980 python_same_stem_sibling_owner_not_related fixture landed on main after this branch's last main merge, so the merge-ref run combines its flat-layout fixture with this PR's boundary rule. The two tests call discounted_total(5000) and discounted_total(20000), which take the same branch on both sides of the amount >= DISCOUNT_THRESHOLD change and never sit on the amount == 10000 boundary where > and >= disagree, so the strong exact-value oracle reaches the owner but does not observe the changed comparison and the finding honestly fails closed to weakly_exposed (infect/discriminate weak, confidence 0.6 -> 0.4). loyalty_price stays no_static_path (4 findings unchanged). The boundary literal is an unresolved module constant, so the recommendation fields stay empty rather than inventing a boundary value, and the downgrade carries the direct-aligned strengthen_existing_test repair card. Local proof at merge 20d8da3 (origin/main 5901c0c + afe0ccd): goldens check passes; cargo fmt --check clean; predicate_boundary 14 passed; same_stem 11 passed (incl. #3980 mirrors). --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Steven Zimmerman, CPA <15812269+EffortlessSteven@users.noreply.github.com>
…d repair (#3960) * feat(output): carry the agent repair start on repair cards and gate routes Where a review card, gate repair route, or inline PR comment already names a seam that passes the repair-packet flip, lead with `ripr agent repair --root . --seam-id <id> --phase before` instead of the snapshot verify command. The command is computed once in evidence_record::canonical_repair_command_for, gated on repair_packet_eligibility(entry).eligible(), and carried (never derived) by review_comments, the gate repair route, and the inline comment publisher. Non-actionable routes and gap-record routes emit nothing and keep the existing verify guidance. Refs #3906 (outcome 3, gate and repair-card surfaces). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * test(output): rebind fixtures to the carried repair start and bind the flip The repo-exposure evidence record, the dogfood gate-adoption receipts, and the gate-decision verification fixture now carry repair_command. The first-useful-action unchanged-after-attempt snapshots are regenerated through the corpus test's own normalizer, and the verify and receipt artifacts are rebound to the new snapshot bytes; their movement is unchanged. The evidence-record test now calls the builder with an actionable state directly, so removing the eligibility check fails it. Refs #3906. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * fix(output): withhold the repair start for inline-test seams and lead CI comments with it agent repair refuses an edit target outside a test surface, so a seam whose recommended test lives in an inline #[cfg(test)] module was offered a repair start it could not use. repair_start_command_for now also requires the recommended test file to be a test surface, and canonical_repair_command_for goes through it. The generated CI's compact inline comment headline read only the Verify line, so a card carrying "Start the repair:" still led with Verify. The jq now captures the repair start and leads with it when present. Refs #3906 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * feat(output): start first-pr and pr-summary from a carried review-card repair Generated CI builds the gap ledger from repo-exposure, whose records are all repo-scoped, so `ripr first-pr` always fell to no_action for Rust even when the review-comments file held a card that passed the repair-packet flip. The review-comments input was only checked for existence. first-pr: when the ledger yields no top gap, read the review-comments input and select the first actionable card in comments[] then summary_only[] that carries a non-empty llm_guidance.repair_command. The command is carried byte-for-byte; first-pr never builds `agent repair` from a seam, gap, or probe id. Every selected field comes from that same card (source_artifact is the review-comments path, repair.route is AgentRepairTransaction, verify and receipt are the card's), never mixed with a ledger record. The card is used only when the report is tool=ripr, status=advisory, and names this invocation's root, base, and head; otherwise it fails closed to no_action. The selection keeps state top_gap so the editor projection and pr-summary consume it unchanged. receipt_path and agent_packet_command are null for a card selection: the card is not a ledger gap and first-pr does not parse commands for paths. selected.repair_command is present only when carried, so ledger-selected packets are byte-identical to before. The repair start is not added to `commands`: the VS Code first-pr projection fails the whole packet closed (unsafeCommand) on any `commands` value outside its allowlist, and `ripr agent repair` is not on it. CLI and Markdown render a "Start repair" line before Verify. A no_action reason now says why no card supplied a start and, when the cards are missing or were rendered from the gap ledger, names the seam-level `ripr review-comments --root --base --head --out` route. pr-summary: carry start-here selected.repair_command into TopRepair (never read review comments directly, which could mis-pair a card with start-here's top gap), render a "start repair" line before verify in both Markdown surfaces, and make it the first local reproduction command when present. Docs: OUTPUT_SCHEMA start-here and pr-evidence-summary contracts, FIRST_PR_WORKFLOW, RIPR-SPEC-0075 field tables. Refs #3906 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * test(first-pr): cover the head-mismatch refusal for review-card repair starts The fail-closed test covered base, status, root, scope and a missing report but not a report generated for another head. Removing the head check from review_comments_currentness_problem now fails it. Refs #3906 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * fix(test): pass the changed-line flag in the gate repair-start test `cargo test -p ripr --lib` does not compile on main since 64f3b92. #3936 added `repair_route_leads_with_the_repair_start_when_carried`, which calls `push_repair_route(out, route)`. #3968, branched before #3936 landed, added a third `changed_line_anchored: bool` parameter. Each PR was green on its own base; the combined tree fails with E0061 at output/gate/presentation.rs:630 and :642. The test now passes `true`. The start-repair line it pins does not depend on the flag. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 9884f9b) * test(fixtures): regenerate the packet-index Markdown goldens for the single Start here block #4011 made dogfood_report_packet_index_scenarios_have_checked_receipts render the corpus instead of comparing two goldens, and #3973 removed the second "Start here:" block from the rendered index. Each merged green against a main without the other, so main now fails that required xtask test on its first case. Regenerated all seven cases with the corpus canonical_command. Six index.md files lose the duplicate block; every index.json is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 3a0d679) * test(fixtures): rebless two check goldens blessed before the no-default-base change #4002 made CheckInput::default().base None and reblessed every --diff fixture on its base. #3944 (python_src_layout_package_import) and #3985 (tail_comparison_boundary) were blessed on bases without #4002, so each merged with "base": "origin/main" and base_revision "origin/main", and `cargo xtask goldens check` on main reports both as drift. Reblessed with a RIPR-SPEC-0084 reason; only base/base_revision change, the same delta #4002 applied to the other fixtures. goldens check: 0 drift entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 7930fef) --------- Co-authored-by: Claude <noreply@anthropic.com>
…el and the evidence ledger (#3962) * feat(output): carry the agent repair start on repair cards and gate routes Where a review card, gate repair route, or inline PR comment already names a seam that passes the repair-packet flip, lead with `ripr agent repair --root . --seam-id <id> --phase before` instead of the snapshot verify command. The command is computed once in evidence_record::canonical_repair_command_for, gated on repair_packet_eligibility(entry).eligible(), and carried (never derived) by review_comments, the gate repair route, and the inline comment publisher. Non-actionable routes and gap-record routes emit nothing and keep the existing verify guidance. Refs #3906 (outcome 3, gate and repair-card surfaces). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * test(output): rebind fixtures to the carried repair start and bind the flip The repo-exposure evidence record, the dogfood gate-adoption receipts, and the gate-decision verification fixture now carry repair_command. The first-useful-action unchanged-after-attempt snapshots are regenerated through the corpus test's own normalizer, and the verify and receipt artifacts are rebound to the new snapshot bytes; their movement is unchanged. The evidence-record test now calls the builder with an actionable state directly, so removing the eligibility check fails it. Refs #3906. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * feat(output): lead PR-review surfaces with the carried repair start First-useful-action, the PR-review front panel, the PR evidence ledger, and RIPR Zero status now lead with `ripr agent repair --root . --seam-id <id> --phase before` exactly when an input artifact already carries it, and never synthesize a repair-loop command from a bare seam id. The fail-closed decision stays with repair_packet_eligibility(..).eligible() upstream; these surfaces carry the string and do not re-run eligibility. First-useful-action: a new route ahead of the missing-assistant-proof route. When no assistant proof exists yet and the first review card (comments, then summary_only) carries a non-empty llm_guidance.repair_command, the report is `actionable` / `write_focused_test` with `commands.repair` set to that string and every `selected`/`target` field, verify, and receipt command taken from that same card. A fresh PR no longer asks for post-repair assistant proof before any repair exists. The same card without the command keeps the missing_required_artifact route; post-proof routing is unchanged. `commands.repair` is skipped when absent, so existing goldens are stable. Markdown adds a `Start Repair` section and a one-screen `Repair start` line. Generated CI's first-action summary and at-a-glance block print `.commands.repair` (template, test, and docs/CI.md mirror). Front panel: `top_issue.repair_command` is carried from first-action `commands.repair`, a card's `llm_guidance.repair_command`, or an acknowledged gate route's `repair_route.repair_command`. `agent_command` is that command, else a carried read-only inspection command (`commands.context_packet`, `llm_guidance.command`, or the gate route's `inspection_command`), else null. The three `agent start --seam-id` syntheses are gone. Markdown shows `Repair start` in the top issue and the Repair block. The invalid-improved assertion now pins the exact carried handoff instead of `is_some()`. Evidence ledger: `top_repair_route.repair_command` is carried from the card, gate route, or RIPR Zero route; the gap and baseline arms name no repair start and drop their synthesized `agent start` (verify kept). Also fixes the card receipt command, which cards put at the root, not under llm_guidance (kept as fallback), so it was always null. RIPR Zero status (item 4 decision): the gap-record arm synthesized `agent start --seam-id <canonical_gap_id>`, a gap id rather than a seam id; it now names none. The baseline arm carries `evidence_record.canonical_item.repair_command` when present, else null. Left in place: test_oracle_assistant_proof handoff. The proof is a post-attempt artifact (it needs before/after/receipt) and its handoff records the workflow that produced its --agent-packet input. assistant_loop_health derives every repair-queue command root from that field (command_root), so nulling it would regress those roots to `.`. It needs its own root carrier first; tracked as follow-up. Goldens: new first-useful-action/repair-start and pr-review-front-panel/repair-start cases (exact-line card carrying the command), regenerated through the production renderers. Front-panel actionable/blocked now show the carried context-packet command, acknowledged/summary-only show null, and the mixed ledger shows null; the mixed ripr-zero-status input is rebound to the producer contract. No hash-bound artifact changed. Refs #3906. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * fix(output): withhold the repair start for inline-test seams and lead CI comments with it agent repair refuses an edit target outside a test surface, so a seam whose recommended test lives in an inline #[cfg(test)] module was offered a repair start it could not use. repair_start_command_for now also requires the recommended test file to be a test surface, and canonical_repair_command_for goes through it. The generated CI's compact inline comment headline read only the Verify line, so a card carrying "Start the repair:" still led with Verify. The jq now captures the repair start and leads with it when present. Refs #3906 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * feat(output): start first-pr and pr-summary from a carried review-card repair Generated CI builds the gap ledger from repo-exposure, whose records are all repo-scoped, so `ripr first-pr` always fell to no_action for Rust even when the review-comments file held a card that passed the repair-packet flip. The review-comments input was only checked for existence. first-pr: when the ledger yields no top gap, read the review-comments input and select the first actionable card in comments[] then summary_only[] that carries a non-empty llm_guidance.repair_command. The command is carried byte-for-byte; first-pr never builds `agent repair` from a seam, gap, or probe id. Every selected field comes from that same card (source_artifact is the review-comments path, repair.route is AgentRepairTransaction, verify and receipt are the card's), never mixed with a ledger record. The card is used only when the report is tool=ripr, status=advisory, and names this invocation's root, base, and head; otherwise it fails closed to no_action. The selection keeps state top_gap so the editor projection and pr-summary consume it unchanged. receipt_path and agent_packet_command are null for a card selection: the card is not a ledger gap and first-pr does not parse commands for paths. selected.repair_command is present only when carried, so ledger-selected packets are byte-identical to before. The repair start is not added to `commands`: the VS Code first-pr projection fails the whole packet closed (unsafeCommand) on any `commands` value outside its allowlist, and `ripr agent repair` is not on it. CLI and Markdown render a "Start repair" line before Verify. A no_action reason now says why no card supplied a start and, when the cards are missing or were rendered from the gap ledger, names the seam-level `ripr review-comments --root --base --head --out` route. pr-summary: carry start-here selected.repair_command into TopRepair (never read review comments directly, which could mis-pair a card with start-here's top gap), render a "start repair" line before verify in both Markdown surfaces, and make it the first local reproduction command when present. Docs: OUTPUT_SCHEMA start-here and pr-evidence-summary contracts, FIRST_PR_WORKFLOW, RIPR-SPEC-0075 field tables. Refs #3906 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * test(first-pr): cover the head-mismatch refusal for review-card repair starts The fail-closed test covered base, status, root, scope and a missing report but not a report generated for another head. Removing the head check from review_comments_currentness_problem now fails it. Refs #3906 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * docs(schema): keep the front-panel vocabulary sentences in their own bullet The #3906 repair_command bullet was spliced mid-sentence into the typed one-screen vocabulary contract: the mirror/evidence-strength sentences described top_issue.current_evidence_strength and friends, not the new carried-command fields. Restore them to the vocabulary bullet so the repair_command bullet ends at the never-synthesize rule. Reviewed as part of #3962. * fix(test): pass the changed-line flag in the gate repair-start test `cargo test -p ripr --lib` does not compile on main since 64f3b92. #3936 added `repair_route_leads_with_the_repair_start_when_carried`, which calls `push_repair_route(out, route)`. #3968, branched before #3936 landed, added a third `changed_line_anchored: bool` parameter. Each PR was green on its own base; the combined tree fails with E0061 at output/gate/presentation.rs:630 and :642. The test now passes `true`. The start-repair line it pins does not depend on the flag. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 9884f9b) * test(fixtures): regenerate the packet-index Markdown goldens for the single Start here block #4011 made dogfood_report_packet_index_scenarios_have_checked_receipts render the corpus instead of comparing two goldens, and #3973 removed the second "Start here:" block from the rendered index. Each merged green against a main without the other, so main now fails that required xtask test on its first case. Regenerated all seven cases with the corpus canonical_command. Six index.md files lose the duplicate block; every index.json is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 3a0d679) * test(fixtures): rebless two check goldens blessed before the no-default-base change #4002 made CheckInput::default().base None and reblessed every --diff fixture on its base. #3944 (python_src_layout_package_import) and #3985 (tail_comparison_boundary) were blessed on bases without #4002, so each merged with "base": "origin/main" and base_revision "origin/main", and `cargo xtask goldens check` on main reports both as drift. Reblessed with a RIPR-SPEC-0084 reason; only base/base_revision change, the same delta #4002 applied to the other fixtures. goldens check: 0 drift entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 7930fef) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Steven Zimmerman, CPA <15812269+EffortlessSteven@users.noreply.github.com>
…gap (#4019) * feat(output): carry the agent repair start on repair cards and gate routes Where a review card, gate repair route, or inline PR comment already names a seam that passes the repair-packet flip, lead with `ripr agent repair --root . --seam-id <id> --phase before` instead of the snapshot verify command. The command is computed once in evidence_record::canonical_repair_command_for, gated on repair_packet_eligibility(entry).eligible(), and carried (never derived) by review_comments, the gate repair route, and the inline comment publisher. Non-actionable routes and gap-record routes emit nothing and keep the existing verify guidance. Refs #3906 (outcome 3, gate and repair-card surfaces). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * test(output): rebind fixtures to the carried repair start and bind the flip The repo-exposure evidence record, the dogfood gate-adoption receipts, and the gate-decision verification fixture now carry repair_command. The first-useful-action unchanged-after-attempt snapshots are regenerated through the corpus test's own normalizer, and the verify and receipt artifacts are rebound to the new snapshot bytes; their movement is unchanged. The evidence-record test now calls the builder with an actionable state directly, so removing the eligibility check fails it. Refs #3906. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * fix(output): withhold the repair start for inline-test seams and lead CI comments with it agent repair refuses an edit target outside a test surface, so a seam whose recommended test lives in an inline #[cfg(test)] module was offered a repair start it could not use. repair_start_command_for now also requires the recommended test file to be a test surface, and canonical_repair_command_for goes through it. The generated CI's compact inline comment headline read only the Verify line, so a card carrying "Start the repair:" still led with Verify. The jq now captures the repair start and leads with it when present. Refs #3906 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * feat(output): start first-pr and pr-summary from a carried review-card repair Generated CI builds the gap ledger from repo-exposure, whose records are all repo-scoped, so `ripr first-pr` always fell to no_action for Rust even when the review-comments file held a card that passed the repair-packet flip. The review-comments input was only checked for existence. first-pr: when the ledger yields no top gap, read the review-comments input and select the first actionable card in comments[] then summary_only[] that carries a non-empty llm_guidance.repair_command. The command is carried byte-for-byte; first-pr never builds `agent repair` from a seam, gap, or probe id. Every selected field comes from that same card (source_artifact is the review-comments path, repair.route is AgentRepairTransaction, verify and receipt are the card's), never mixed with a ledger record. The card is used only when the report is tool=ripr, status=advisory, and names this invocation's root, base, and head; otherwise it fails closed to no_action. The selection keeps state top_gap so the editor projection and pr-summary consume it unchanged. receipt_path and agent_packet_command are null for a card selection: the card is not a ledger gap and first-pr does not parse commands for paths. selected.repair_command is present only when carried, so ledger-selected packets are byte-identical to before. The repair start is not added to `commands`: the VS Code first-pr projection fails the whole packet closed (unsafeCommand) on any `commands` value outside its allowlist, and `ripr agent repair` is not on it. CLI and Markdown render a "Start repair" line before Verify. A no_action reason now says why no card supplied a start and, when the cards are missing or were rendered from the gap ledger, names the seam-level `ripr review-comments --root --base --head --out` route. pr-summary: carry start-here selected.repair_command into TopRepair (never read review comments directly, which could mis-pair a card with start-here's top gap), render a "start repair" line before verify in both Markdown surfaces, and make it the first local reproduction command when present. Docs: OUTPUT_SCHEMA start-here and pr-evidence-summary contracts, FIRST_PR_WORKFLOW, RIPR-SPEC-0075 field tables. Refs #3906 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * test(first-pr): cover the head-mismatch refusal for review-card repair starts The fail-closed test covered base, status, root, scope and a missing report but not a report generated for another head. Removing the head check from review_comments_currentness_problem now fails it. Refs #3906 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * fix(first-pr): stop on unusable review cards instead of reporting no gap Re-walk F60-10. On a fresh Rust checkout, following first-pr's own next commands (repo exposure, then gap ledger) ended in `State: no actionable gap` with no next command, while the PR had a repair-ready seam. The repo-exposure ledger holds only repo-scoped records, so first-pr's second source, the review cards, decides; with the cards missing, first-pr gave a no-action verdict on evidence it never read. Now a Rust root stops on the cards instead: - missing: `missing_artifact` for `PR repair cards`, next command the seam-level `ripr review-comments --root . --base <base> --head <head> --out target/ripr/review/comments.json`; - not a RIPR report, or no status/root/base/head: `malformed_artifact`; - status not advisory: `blocked_artifact`; - another root: `wrong_root`; another base or head: `stale_artifact`. Current cards with no repair start, and cards rendered from the gap ledger, still end in no-action with the reason naming the route. The `artifacts[]` entry for the cards on a Rust root now names the same seam-level command. It named the `--gap-ledger` form, whose cards cannot carry a repair start. Preview-language roots keep the gap-ledger form. Fresh-checkout re-walk on the pricing repo: repo exposure, gap ledger, review cards, then `top_gap` with `Start repair: ripr agent repair ... --phase before`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK * fix(test): pass the changed-line flag in the gate repair-start test `cargo test -p ripr --lib` does not compile on main since 64f3b92. #3936 added `repair_route_leads_with_the_repair_start_when_carried`, which calls `push_repair_route(out, route)`. #3968, branched before #3936 landed, added a third `changed_line_anchored: bool` parameter. Each PR was green on its own base; the combined tree fails with E0061 at output/gate/presentation.rs:630 and :642. The test now passes `true`. The start-repair line it pins does not depend on the flag. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 9884f9b) * test(fixtures): regenerate the packet-index Markdown goldens for the single Start here block #4011 made dogfood_report_packet_index_scenarios_have_checked_receipts render the corpus instead of comparing two goldens, and #3973 removed the second "Start here:" block from the rendered index. Each merged green against a main without the other, so main now fails that required xtask test on its first case. Regenerated all seven cases with the corpus canonical_command. Six index.md files lose the duplicate block; every index.json is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 3a0d679) * test(fixtures): rebless two check goldens blessed before the no-default-base change #4002 made CheckInput::default().base None and reblessed every --diff fixture on its base. #3944 (python_src_layout_package_import) and #3985 (tail_comparison_boundary) were blessed on bases without #4002, so each merged with "base": "origin/main" and base_revision "origin/main", and `cargo xtask goldens check` on main reports both as drift. Reblessed with a RIPR-SPEC-0084 reason; only base/base_revision change, the same delta #4002 applied to the other fixtures. goldens check: 0 drift entries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK (cherry picked from commit 7930fef) * test(first-pr): cover the malformed review-card branches in the fail-closed loop Another tool's report, and reports that do not record their status, root or head, each stop first-pr as malformed_artifact with the seam-level regeneration command. Only the stale, blocked, wrong-root and missing cases were exercised before. Disabling the tool check fails the test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steven · project thread
Summary
Before: in the PyPA src layout (
src/pricing/discounts.py, tests doingfrom pricing.discounts import bulk_discount), a test that pins the changed boundary (assert bulk_discount(100) == 0.15, which really fails on the>=→>change) was reportedweakly_exposed/strong_oracle_observes_different_sink. The repair card asked the user to strengthen that same test forquantity == 100. Doing so changed nothing, so the loop could never close. The identical flat-layout repo reportedexposed/direct.After: the src-layout repo reports the same result as the flat layout. In the walkthrough repro,
discounts.py:6goes fromweakly_exposed (0.40)toexposed (0.60),direct/strong_oracle_observes_owner_name. The summary goes from 7 probes / 0 exposed / 7 weak to 7 probes / 1 exposed / 6 weak.How:
owner_module_pathreturned onlysrc.pricing.discounts, andimport_source_module_matches_ownerrequired exact equality with the test's import. It now also yields the dotted path below eachsrcdirectory segment (pricing.discounts;packages/x/src/foo/bar.py→foo.bar). Matching stays exact on complete module paths, and thesrc.-qualified form still matches.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Spec: RIPR-SPEC-0028 (one paragraph added on module identity)
Issue: none filed; found in the language-quality walkthrough for 0.11
Scope Classification
Single acceptance criterion:
Non-goals:
pyproject.tomlpackage-dir/pythonpath, so non-srcroots such aslib/are not covered.exposedwithout a boundary test, untested functionsweakly_exposedthrough test-file names, and suggested assertions that copy production code.Decisions (overrule on review)
srcsegment, exact match only.src. It misses monorepos (packages/x/src/...) at the same risk.exposedpattern the code already guards against.x.pyandsrc/x.py, or two monorepo packages with the same module path undersrc, can share an import name. Resolving that needssys.path, which static analysis does not have.Support-tier Impact
Policy Impact
Proof
related_tests.rs,src_layout_owner_imported_by_package_name_credits_exposedand the nested/monorepo test fail (bothWeaklyExposed). They pass here.strong_oracle_observes_different_sink: imports ofpricing.other,src.pricing.other,discountsandother.pricing.discounts, and anapp/pricing/discounts.pyowner that is not undersrc.python_src_layout_package_import:discounts.pyisexposed/direct.legacy.pyhas the same function name but is not imported, and staysweakly_exposed/orthogonal.weakly_exposed/orthogonal.gap_decision_ledger.rsfrom (2,28,10) to (2,28,11).python_src_layout_repair_gapis unchanged because its only oracle is a weak smoke assertion.Not run:
cargo test -p xtask, Windows.Claim Boundary
May claim: src-layout Python projects get the same related-test identity as flat layouts. Must not claim: pyproject-configured source roots are resolved.
Rollback
Revert the commit; the new fixture and the ledger count revert with it.
Static Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code or tests.🤖 Generated with Claude Code
https://claude.ai/code/session_018QP9k41E538Xgytw8QCSfM
Generated by Claude Code