Skip to content

fix(review): stop anchoring unchanged seams onto unrelated changed lines - #3968

Merged
EffortlessSteven merged 1 commit into
mainfrom
claude/language-quality-kairya-review-anchor
Sep 24, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
claude/language-quality-kairya-review-anchor

Conversation

@claude

@claude claude Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Requested by Steven · project thread

Summary

Before: in a PR that changed discounted_total and added loyalty_price below the unchanged with_shipping, ripr review-comments placed the with_shipping seam on line 26 with mode: same_file_changed_line. The seam is on line 20, outside the diff, and line 26 is a blank line before the new function. CI annotated line 26 with 5_000 (equality boundary). ripr gate evaluate --mode acknowledgeable blocked on src/lib.rs:26 with Changed owner: src/lib.rs::with_shipping and Changed behavior: amount >= 5_000, which this PR did not change.

After: that seam is a summary-only recommendation at src/lib.rs:20 with no_safe_changed_line_placement, and it gets no annotation. The gate lists it as advisory ("seam is outside this PR's changed lines, so the summary-only recommendation remains visible and advisory") under Owner: and Behavior: labels. The changed discounted_total seam still anchors on line 11 and still blocks, with exit 2.

How:

  • Placement fallback. same_file_changed_line now requires the changed line to sit inside the seam owner's span. That is the case where owner attribution bound the changed line to a nested function. A seam that only shares a file with the diff is no longer placed. When the owner span is unknown, the seam fails closed to summary-only.
  • Owner lookup. The review-comments CLI records every enclosing owner of each changed line from the index build it already performs (analysis::changed_line_ownership_for_lines, rust_index::find_enclosing_functions).
  • Gate. The eligibility rule is unchanged: it already kept no_safe_changed_line_placement summary items advisory. For those items it now states the reason and no longer labels the owner or behavior as changed.

Found in the onboarding thread's new-user re-walk (F60-5), on main plus the onboarding PRs.

Swarm / Source Boundary

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

Source-of-truth Links

Spec: RIPR-SPEC-0012. It already said a seam outside the diff gets "summary-only guidance, not a misplaced line annotation". The text now defines the narrowed same_file_changed_line.
Issue: none filed. The re-walk evidence is F60-5.

Scope Classification

  • One production behavior

Single acceptance criterion:

  • A seam whose own line and owner span are outside every diff hunk is not line-anchored, is not labeled changed, and does not block the gate.

Non-goals:

  • F60-6: the new untested loyalty_price gets no route to tests/pricing.rs. That is test-target resolution, owned by the onboarding lane. It is unchanged here: still an exact_seam_line comment at line 29 and gate-advisory with incomplete_repair_route.
  • Route readiness and is_safe_for_repair_packet are untouched.
  • Candidate selection in agent_brief::why_now_for (SameFileSeam) is unchanged. It is reasonable context for an agent brief; the defect was placement.

Decisions (overrule on review)

  • Fixed at placement, not in the gate. The gate trusted a placement it was given, and its eligibility rule was already correct for summary-only items. placement_for produces the comments.json contract and is not a renderer.
  • Legitimate same_file_changed_line kept. When a changed line is inside a nested fn, the outer owner's seam still places and blocks. A nested-function repro confirms it.
  • No JSON schema change. The placement.mode enum and repair_route.changed_owner key keep their names. Only the meaning of same_file_changed_line narrows, and SPEC-0012 and OUTPUT_SCHEMA document it.

Support-tier Impact

  • none

Policy Impact

  • Gate: an unchanged seam no longer blocks under acknowledgeable mode. A changed seam blocks as before, and a negative test pins that.

Proof

At a43d966:

cargo test -p ripr --lib review_comments                       # 59 passed
cargo test -p ripr --lib -- changed_line_ownership output::gate    # 98 passed
cargo test -p ripr --lib -- agent_brief review_comments gate owner # 598 passed
cargo test -p ripr --test cli_smoke -- gate review             # 9 passed
cargo test -p ripr --test generated_review_workflow            # 1 passed
cargo test -p xtask dogfood_                                   # 64 passed
cargo xtask goldens check                                      # 235 fixtures, 0 drift
cargo xtask fixtures / check-fixture-contracts / check-output-contracts / check-traceability / dogfood   # pass
cargo xtask precommit                                          # exit 0 (clippy -D warnings, git diff --check)

New tests. All failed with the old nearest-same-file fallback restored:

  • review_comments_places_nearest_same_file_changed_line (rewritten). A nearer changed line in another owner loses to a changed line inside the seam owner's nested function.
  • review_comments_keeps_unchanged_same_file_seam_summary_only. This is the F60-5 shape, plus the fail-closed case with no enclosing-owner evidence.
  • gate_blocks_changed_seam_but_not_unchanged_same_file_seam. It runs end to end over the produced comments.json into build_gate_decision_report. The changed seam blocks; the unchanged one is advisory at its own line.
  • changed_line_ownership_names_outer_owner_of_nested_function_line.

Repro on a copy of the re-walk pricing repo:

  • Before: gate Blocking: 2, including src/lib.rs:26 … Changed owner: src/lib.rs::with_shipping.
  • After: Blocking: 1 (line 11, discounted_total) and Advisory: 2. with_shipping appears at line 20.

Not established:

  • The full-workspace cargo test was not run. Hosted CI and Windows will supply their own results.
  • Python and TypeScript seams do not go through this review-comments placement path.
  • pr-summary, pilot and the front panel were not re-walked.
  • One case now goes to summary-only instead of being placed: a seam whose only changed line is its owner's signature or doc line, when the index span excludes those lines. That direction under-annotates; it does not falsely block.

Claim Boundary

May claim: review comments and the gate no longer present an unchanged seam as changed or block on it. Must not claim: every seam outside the diff is correctly prioritized. That is F60-6 and route resolution.

Rollback

Revert the commit. The spec and docs text revert with it.

Spec-Test-Code Traceability

  • Spec: RIPR-SPEC-0012 (.ripr/traceability.toml updated)
  • Tests: output/review_comments.rs tests, analysis/mod.rs tests
  • Code: output/review_comments.rs::placement_for, analysis/mod.rs, analysis/rust_index.rs, cli/commands.rs, cli/commands_agent_support.rs, output/gate*.rs, app/agent_brief.rs

Static Language Check

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

CI Economics

n/a

Engineering Check

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

🤖 Generated with Claude Code

https://claude.ai/code/session_018QP9k41E538Xgytw8QCSfM


Generated by Claude Code

A seam whose own line and owner span sit outside every diff hunk was
anchored onto the nearest changed line in the same file
(`same_file_changed_line`). That put check annotations on unrelated lines,
presented the seam as changed, and made `ripr gate evaluate` block the PR
on behavior it did not change (F60-5: `with_shipping` at line 20 placed on
a blank line 26 before a newly added function).

`same_file_changed_line` now requires the changed line to sit inside the
seam owner's span, which owner attribution bound to a nested function.
The review-comments CLI records every enclosing owner of each changed line
from the same Rust index build it already uses for innermost owners. Any
other same-file seam is summary-only with `no_safe_changed_line_placement`,
so annotations skip it and the gate's existing summary-only rule keeps it
advisory. Unknown owner spans fail closed to summary-only. The gate states
that the seam is outside the PR's changed lines and labels its owner and
behavior without "Changed".

Seams on an exact changed line or in a changed owner function still anchor
and block as before.

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

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 12dc423d-9445-4415-9241-4efb20896bcc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • Placement rule now fails closed when enclosing_owner evidence is missing or owner span excludes signature/doc lines; under-annotates rather than mis-places. PR body acknowledges the under-annotation direction in 'Not established' and claim boundary correctly scopes it.

Verification questions

  • Confirm gate presentation labels (Changed owner/Changed behavior → Owner/Behavior) only flip when !changed_line_anchored, computed from source=='summary_only' && summary_reason == SUMMARY_REASON_NO_SAFE_PLACEMENT. Same summary-only items produced by other reasons keep Changed labels; F60-5 fixture uses no_safe_changed_line_placement so the fixture passes.
  • Confirm review_comments_places_nearest_same_file_changed_line rewritten to require enclosing-owner match; nearest-by-distance cannot win against an outer owner that has no changed line in its span.
  • Confirm gate presentation relabels Changed owner/behavior to Owner/Behavior only when changed_line_anchored is false; check annotations reader that consumed 'Changed owner' is not in this diff.

Refuted

  • Renaming 'Changed owner/behavior' to 'Owner/Behavior' in gate markdown breaks the JSON contract or downstream automation; refuted because: Field names (changed_owner, changed_behavior) and JSON schema unchanged per PR body; only the human-readable Markdown labels in push_repair_route changed, gated by the new changed_line_anchored boolean. GateDecision struct keeps repair_route intact.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@claude

claude Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Disposition for the ub-review of a43d966. I checked each verification question against the diff; none needs a code change.

  • Where the label flip happens. It is gated only on candidate_lacks_changed_line_placement in output/gate.rs: source == "summary_only" and summary_reason == SUMMARY_REASON_NO_SAFE_PLACEMENT. Summary-only items with any other reason get changed_line_anchored = true and keep the Changed owner / Changed behavior labels. They also keep the existing reason, "summary-only recommendation remains visible and advisory".
  • Nearest-line fallback. review_comments_places_nearest_same_file_changed_line now requires an enclosing_owners entry whose owner equals the seam owner and whose line is a changed production line. Nearest distance is only a tiebreak among those lines. Changed line 84 belongs to apply_fee, so it cannot win for the discounted_total seam; the test asserts line 95.
  • Other consumers of the labels. No annotation reader consumes the Markdown labels. changed_line_anchored is not serialized: GateDecision JSON keeps repair_route.changed_owner / changed_behavior, and check-output-contracts passes.
  • Under-annotation. Accepted and already listed under Not established. It fails in the advisory direction and never blocks falsely.
  • "Model proof intent was rejected." That line is the reviewer's own validation step; it is not a finding about this diff.

CI is green on a43d966 (Rust gates success).


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review September 24, 2026 02:50
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head review-placement review — REVIEW_READY

Reviewed head a43d966df33f2a892e882a0b1e44e97398695fca against RIPR-SPEC-0012 and the current gate/review-comment contract.

Accepted semantic change

  • same_file_changed_line now requires actual enclosing-owner evidence: a changed line must lie inside the seam owner's indexed span, not merely share the source file.
  • Nested-function changes still allow an outer-owner seam to place because the index returns the complete enclosing-owner chain.
  • Unknown owner spans fail closed to summary-only rather than manufacturing a line anchor.
  • Summary-only seams with no_safe_changed_line_placement remain visible and advisory but are no longer described as Changed owner / Changed behavior.
  • An exactly changed seam still places and blocks under acknowledgeable mode.

Evidence inspected

  • Real owner-chain indexing distinguishes the nested owner, outer owner, blank line and unrelated function.
  • End-to-end test writes the produced PR-guidance JSON into gate evaluation and proves one changed seam blocks while the unchanged same-file seam is advisory at its own line.
  • A deliberate no-owner-evidence case under-emits rather than using nearest-line proximity.
  • Required Rust CI is successful; Devin and CodeRabbit statuses are successful; no unresolved review threads exist.
  • The PR remains mergeable on current main. Later repair-route additions carried by the gate are orthogonal; this change narrows placement and presentation labels without replacing their semantic owner.

Local limitation retained

A changed signature/doc line excluded from the indexed body span may now under-annotate. That direction is explicit and safer than false attribution; complete prioritization/test-target routing remains outside this claim.

Disposition: REVIEW_READY for protected squash merge.

@EffortlessSteven
EffortlessSteven merged commit 64f3b92 into main Sep 24, 2026
27 of 28 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/language-quality-kairya-review-anchor branch September 24, 2026 02:51

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • Under-annotation direction acknowledged in PR body: seam whose only changed line is the owner signature/doc line, when the Rust index span excludes those lines, goes summary-only instead of placing. Direction is safe (no false blocks) but minor signal loss. Documented in 'Not established'.

Verification questions

  • Confirm cargo-test receipt is scheduled-late and not yet landed; cargo test -p ripr --lib review_comments and the dogfood/golden commands in the PR body are the published proof and should land before the gate. No missing evidence today, but lane cannot independently confirm green at the assertion level until cargo-test receipt arrives.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

claude Bot pushed a commit that referenced this pull request Sep 24, 2026
`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)
claude Bot pushed a commit that referenced this pull request Sep 24, 2026
`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)
claude Bot pushed a commit that referenced this pull request Sep 24, 2026
`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)
claude Bot pushed a commit that referenced this pull request Sep 24, 2026
`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)
claude Bot pushed a commit that referenced this pull request Sep 24, 2026
`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)
claude Bot pushed a commit that referenced this pull request Sep 24, 2026
Main now carries #3968's changed-line flag on push_repair_route and
#3981's not_available limitations rule. Conflicts resolved by keeping
both: the test calls take main's three-argument form, and the
OUTPUT_SCHEMA / RIPR-SPEC-0075 text keeps this branch's repair_command
sentences alongside main's not_available limitation rule.

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
Conflicts and how they were resolved:
- gate/presentation.rs test: kept this branch's transaction-order test and
  gave both push_repair_route calls main's changed-line argument (#3968).
- report_packet_index.rs: kept main's push_entry helper (#3973) and routed
  its missing-entry line through this branch's push_next_command, so the
  assistant-proof entry keeps its "after the repair's after phase" wording.
- report-packet-index goldens: re-rendered through the corpus
  canonical_command (main's #4011 live corpus) with this tree's binary,
  generated_at pinned to unix_ms:0. The only differences from the #3962
  goldens are this branch's runnable next commands.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JR38133FoyEXqWZtnC9UeK
EffortlessSteven pushed a commit that referenced this pull request Sep 24, 2026
…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>
EffortlessSteven added a commit that referenced this pull request Sep 24, 2026
…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>
EffortlessSteven pushed a commit that referenced this pull request Sep 25, 2026
…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>
EffortlessSteven added a commit that referenced this pull request Sep 26, 2026
…ses the discriminator (#4105) (#4107)

* fix(output): supply missed changed_line_anchored arg in gate presentation tests

#3968 (64f3b92) added the changed_line_anchored parameter to
push_repair_route but missed two test call sites in
output/gate/presentation.rs, breaking every --tests compile of the ripr
lib on main (e375575, reproduced on the exact base). Pass the neutral
unanchored value: the affected test asserts Start repair/Verify ordering
only and does not assert the owner/behavior labels.

Inherited base repair needed so the #4105 lane can run any lib test
locally; route separately or squash at merge if preferred.

* fix(output): fail TS repair packet closed when the observed input misses the discriminator (#4105)

A complete TypeScript repair packet reused the observed test call's
input verbatim as the assertion shape even when that input statically
cannot reach the named missing discriminator — an agent following the
packet verbatim duplicated a non-discriminating assertion while the
packet claimed complete and delegatable (wrongfam repro: boundary
user.length == 3, observed login('alice'), length 5).

typescript_target_assertion_shape now derives a static reachability
verdict before reusing the observed oracle shape:

- Parse the discriminator as <receiver> <op> <boundary> (ident or
  ident.length receiver; int or plain-string boundary).
- Parse the observed expression as a plain call and require the callee
  to resolve to the finding's owner.
- Bind the receiver to the call argument only when the call has exactly
  one argument (no signature evidence — multi-argument binding would be
  a guess), then evaluate string length / int / string-equality
  statically. Escapes, member tails, wrapped calls, non-literal
  boundaries, and non-owner callees stay undecided (fail-open is
  allowed only where non-reach cannot be proven).

On a provable miss the shape becomes the repo-convention placeholder
login(/* boundary input for user.length == 3 */) and the packet fails
closed through the ONLY flip authority: agent_packet projection
eligibility is marked ineligible with the precise reason, so the shared
validator keeps repair_packet_ready false. The record also carries a
stop condition forbidding reuse of the observed call input. Landed
boundary-hitting behavior is unchanged (c).

The human repair-packet field-note now gates the actionable rendering on
the same shared validator (it previously rendered any projected record
as complete-contract), and the blocked path discloses the
non-delegatable target shape so the boundary stays visible.

New fixture ts_repair_packet_boundary_unreachable pins the end-to-end
contract: repair_packet_ready false, no typescript_repair_packet in
JSON, human limitation naming the boundary placeholder.
OUTPUT_SCHEMA.md documents the shape contract.

* fix(output): harden TS packet static reachability parsing (review + static-language gate)

- parse_static_call_expression: quote/escape-aware matching close must be
  the final char (rejects compound expressions)
- parse_plain_string_literal: reject inner matching quotes
- String.length compares UTF-16 code units, not scalar values
- replace prohibited 'proven' vocabulary in doc comment
- sync SPEC.md placeholder shape with the projected .toBe(expected)
- add discriminating tests for all three behaviors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants