Repository navigation
feat(output): start first-pr and pr-summary from a carried review-card repair - #3960
Merged
Merged
Conversation
…outes 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
…e 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
… 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
…e-repair-route # Conflicts: # crates/ripr/src/output/gate/tests.rs
…d 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
|
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 |
Contributor
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- cargo-test sensor receipt is scheduled-late; PR-body's claim of -3/-2/-2 failures per negative-control revert is not yet sensor-attested. Trust is deferred until cargo-test receipt lands.
Verification questions
- Confirm review_card_repair_start_fails_closed_on_stale_or_missing_reports covers base/status/root/scope/missing but skips the head-ref mismatch branch of review_comments_currentness_problem.
- Confirm selection::TopGap fields agent_packet_command and receipt_path changed from String to Option at first_pr.rs. All in-crate read sites updated (renderers, JSON, to_json). Need confirmation that no out-of-crate consumer deserializes these fields as String.
Refuted
- Negative control (pr-summary builds repair_command from seam_id) cannot actually fire — derive_local_reproduction_commands only prepends from top_repair.repair_command, which derive_top_repair only reads from start-here's selected.repair_command; there is no seam_id derivation path to revert.
- pr-summary might re-derive a repair command from seam_id or other card-derived field instead of carrying start-here's selected.repair_command; refuted because: derive_top_repair only reads value_path(sel, ["repair_command"]) via a non-empty trim filter; the negative case in start_here_repair_command_is_carried_into_top_repair asserts no repair_command is rebuilt from seam_id and that 'agent repair' never appears in JSON/MD when absent.
- markdown command block could corrupt a repair_command containing backticks/newlines; refuted because: format!-based rendering wraps command in backticks; review_card_repair_start_is_carried_When_the_ledger_selects_nothing uses literal command without metacharacters; carry-only invariant keeps producer responsible for content.
Parked follow-ups
- Non-main-base CI path is explicitly parked; currentness will reject cards causing under-emission.
Evidence gaps
- PR-body negative controls enumerated six revert/restore cases (first-pr copied value None, first-pr builds from seam_id 3 failures, pr-summary copied None 2 failures, pr-summary builds from seam_id 2 failures); receipts confirm shape but no receipt artifact in sensors/.
- Model proof intent was rejected by deterministic validation.
- Negative controls in PR body claim each reverted and cmp-restored; artifact-verifier failed exit 2, no receipt.
11 tasks done
…r 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
Contributor
Author
|
Replies to the ub-review questions:
Generated by Claude Code |
Base automatically changed from
claude/onboarding-gate-repair-route
to
main
September 24, 2026 02:33
…st-pr-repair-start # Conflicts: # docs/OUTPUT_SCHEMA.md # docs/specs/RIPR-SPEC-0075-pr-evidence-summary.md
`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)
…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)
…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)
Keeps #3962 (stacked on this branch) measurable: #3962 already carries main, so while this base lacked it, #3962's PR-evidence diff counted all of main's recent changes (8191 changed Rust lines against the 7500 budget) and the Rust gates job failed. Clean merge. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
claude Bot
pushed a commit
that referenced
this pull request
Sep 24, 2026
Tree unchanged: this branch already carried main. The merge makes the base contain main too, so the PR-evidence diff measures only this PR's own delta again. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
claude Bot
pushed a commit
that referenced
this pull request
Sep 24, 2026
Keeps this stacked branch's base current so its PR-evidence diff measures only its own change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
EffortlessSteven
marked this pull request as ready for review
September 24, 2026 14:54
Contributor
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm artifact-verifier failed with exit code 2; trust is deferred until cargo-test late receipt lands and artifact-verifier re-runs or is explained. Not a code-correctness blocker for the carried-repair-start contract; the receipts concern the build/proof pipeline, not the behavioral change.
Refuted
- pr-summary could re-derive repair_command from seam_id or other card field, bypassing the carried-only rule; refuted because: derive_top_repair reads only start_here_value via value_path(sel, &["repair_command"]); derive_local_reproduction_commands takes only the Option<&str>; no seam_id or card path enters either function. PR-body negative control (rebuilt from seam_id) fails 2 tests.
- language forced to rust/stable on every card selection would corrupt preview-language PRs; refuted because: Card projection is reached only after the review-comments fail-closed guard; preview roots are skipped via uses_check_output_gap_ledger short-circuit. Hardcoding language is a deliberate boundary until the card producer grows non-Rust card types.
Parked follow-ups
- Option for agent_packet_command and receipt_path: in-crate read sites use .as_str/.as_deref/serde Option; out-of-crate consumers (VS Code stringField+undefined filter, xtask Option deser, pr-summary value_path) tolerate null per PR-body reply.
- Sibling surfaces (xtask legacy summary.md, VS Code firstPrProjection.ts) are NOT updated in this PR — author explicitly defers them as parked follow-ups. No silent mixing.
- Route label is fixed
AgentRepairTransactionand does not reuse a ledger kind; VS Code projection (outside diff) allowlistscommandsvalues, so placing repair_command on selected only and omitting it from commands is the correct boundary — the diff is structurally consistent with the PR body's Decisions bullet. Out-of-crate readers handled per PR body'sStringField/Option<String>argument and refuted in the seeded thread.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- Option for agent_packet_command and receipt_path risk out-of-crate String deserializers; PR thread claims VS Code stringField, pr-summary value_path, and xtask Option all tolerate null.
EffortlessSteven
deleted the
claude/onboarding-first-pr-repair-start
branch
September 24, 2026 15:26
claude Bot
pushed a commit
that referenced
this pull request
Sep 24, 2026
…anch #3960 landed as one squash commit, so this branch's copy of its history no longer matches main. Replayed only this PR's own changes (the diff from #3960's last head to this branch) onto current main, which also carries #3962; they applied cleanly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
EffortlessSteven
added a commit
that referenced
this pull request
Sep 24, 2026
Resolve the post-squash stack dissolution: landed #3960/#3962 content (main) replaces the carried stack text; the #3987 init generated-CI runnable-next-steps delta survives (init.rs, generated workflow template, labels, goldens, replay test), with main's #4005/#4012/#4014 movement and shared fixture-git helpers retained. process_allowlist counts recomputed against the merged files (cli_smoke 12, generated_review_workflow 9).
claude Bot
pushed a commit
that referenced
this pull request
Sep 24, 2026
#3987 was brought onto main by a merge that replaced the stacked history this branch carried. Replayed only this PR's own changes (the diff from the #3987 head last merged here to this branch) onto #3987's new head; they applied cleanly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steven · project thread
Stacked on #3936. The base is
claude/onboarding-gate-repair-route. Once #3936 merges, this retargets tomain.Before: generated CI builds the gap ledger from repo-exposure, and every record in that ledger is repo-scoped. So for a Rust PR
ripr first-pralways fell tono_action, even whentarget/ripr/review/comments.jsonheld a card with a repair start. first-pr only checked that the review-comments file existed. pr-summary had no repair start to show.After: when the ledger selects nothing, start-here selects the first actionable review card that carries
llm_guidance.repair_command. It checkscomments[]first, thensummary_only[].selected.repair_commandcarries that command unchanged.top_repair.repair_command, lists it first under local reproduction, and renders a "start repair" line before verify.no_actionreason says why. When the cards are missing or were rendered from the gap ledger, it also names the seam-level route:ripr review-comments --root … --base … --head … --out ….How: every field of a card selection comes from that one card, so a card is never mixed with a ledger record, and first-pr never builds
agent repairitself. The card is used only when the report hastool = riprandstatus = advisoryand records this invocation's root, base and head. Otherwise the result fails closed tono_action.Summary
agent repair#3906 outcomes 3 and 4 for first-pr/start-here and pr-summary.agent repair#3906 or ux(0.11): prove a blind installed shift-left agent journey before the swarm cut #3797.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Spec: RIPR-SPEC-0075 (updated); RIPR-SPEC-0087 §8
Docs:
docs/OUTPUT_SCHEMA.md,docs/FIRST_PR_WORKFLOW.mdIssue: #3906 (partial). Parent: #3797
Scope Classification
Production delta:
selected.repair_commandon start-here, present only when carried;top_repair.repair_commandon pr-summary;receipt_pathandagent_packet_commandbecome null on a card selection.Ledger-selected packets are byte-identical to before, so no golden changed.
Single acceptance criterion: start-here and pr-summary offer the repair start exactly when a current review card carries one, and never build one.
Non-goals:
Decisions (overrule on review)
selected.statestaystop_gap. The VS Code projection reports any unknown state asunsupportedSchema, and pr-summary, the CI jq summary and the xtask consumers all key ontop_gap.repair.routeis a new fixed label,AgentRepairTransaction, because cards carry no route kind.commands. VS Code checks every value incommandsagainst an allowlist (FIRST_PR_SAFE_COMMAND_PREFIXES) and fails the whole packet (unsafeCommand) on anything else.ripr agent repairis not on that list. The card's verify and receipt commands (ripr agent verify,ripr agent receipt) are on it, so the editor still projects a card selection.languageis set torust/stable. It is the one field not read from the card. The card producer only builds a repair start from a classified Rust seam.receipt_pathandagent_packet_commandare null on a card selection. The card is not a ledger gap, soagent packet --gap-iddoes not apply, and first-pr does not parse commands for paths.selected.repair_command, so it cannot pair a card with a different top gap.Follow-ups (not in this PR)
mainbase PRs. CI runsripr first-prwithout--base, so it usesorigin/main, whilereview-commentsusesorigin/${{ github.base_ref }}. On PRs whose base is notmain, the currentness guard correctly rejects the card and first-pr under-emits with the recovery reason. Fixing it means passing--basein the template, and that step also runs wherebase_refis empty. That is a separate template decision.selected.repair_commandyet. That needs an allowlist entry and a projection field ineditors/vscode.cargo xtask ripr-pr-summary's legacysummary.mdpath (xtask/src/reports/pr_evidence_summary/render.rs) has its own copy ofrender_start_here_top_gapand does not print the line. Its JSON goes through the crate and carries the field.Support-tier Impact
Claim/proof notes:
OUTPUT_SCHEMA.md(the start-here and pr-evidence-summary contracts),FIRST_PR_WORKFLOW.mdand RIPR-SPEC-0075's field tables are updated. Both new fields are omitted when absent.Policy Impact
Proof
Run on
f4910d059(on #3936's headfcf2e0f72), Linux,CARGO_INCREMENTAL=0:cargo fmt --check: exit 0cargo test -p ripr --lib: 5313 passedcargo test -p ripr --tests: every binary passed on the--no-fail-fastrerun.common::fixture_git::tests::zero_deadline_reports_timeouts_without_retrying_state, which this change does not touch. That test's own comment (test(ripr): de-flake the parallel-build test family — fixture git hardening, wall-clock asserts, fixed repo paths #3742) describes the scheduling race.cargo xtask goldens check,check-output-contracts,check-fixture-contracts: exit 0cargo clippy -p ripr --all-targets -- -D warnings: exit 0cargo xtask precommit: exit 0New tests:
review_card_repair_start_is_carried_when_the_ledger_selects_nothingruns end to end: the realwrite_first_pr, thenbuild_pr_evidence_summaryon the packet it writes.--root crates/pricing.agent_packetand nocommands.repair. "Start repair" precedes Verify in all three renderings. pr-summary'stop_repair.repair_commandandlocal_reproduction_commands[0]equal the command.review_card_without_repair_start_stays_no_action: an actionable card with a seam id but no command givesno_action, and "agent repair" appears nowhere.ledger_top_gap_keeps_its_route_beside_an_eligible_card: the ledger record still wins, keeps its--gap-idpacket and carries norepair_command.review_card_repair_start_fails_closed_on_stale_or_missing_reportscovers:incompletestatus;start_here_repair_command_is_carried_into_top_repair(pr_summary/json.rs) plus its negative case, where no command is rebuilt fromseam_id.start_here_top_gap_leads_with_the_carried_repair_start(pr_summary/render.rs).Negative controls, each reverted and checked restored with
cmp:None: the end-to-end test fails.seam_id: 3 tests fail.None: 2 tests fail.seam_id: 2 tests fail.Not run: the Windows lane.
Claim Boundary
May claim: first-pr/start-here and pr-summary carry a current review card's repair start and never build one.
Not yet: the non-
main-base CI case, the editor projection, and the xtask legacy summary (see Follow-ups). No first_successful_pr corpus fixture covers the card path; the proof is the tests inside the crate.Rollback
Revert this PR's commit.
Spec-Test-Code Traceability
crates/ripr/src/output/first_pr.rs,crates/ripr/src/output/first_pr/rendering.rs,crates/ripr/src/app/pr_summary/{model,json,render}.rsStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
cargo fmt --checkcargo clippy -p ripr --all-targets -- -D warningscargo xtask precommit🤖 Generated with Claude Code
https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
Generated by Claude Code