Skip to content

fix(repair): gate explicit repair subjects on eligibility (#8166 Slice A) - #8273

Merged
EffortlessSteven merged 1 commit into
mainfrom
fix/8166-repair-eligibility-gate
Oct 16, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
fix/8166-repair-eligibility-gate

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Slice A of #8166 (2026-10-16 slice plan): gate explicit ripr repair
subjects on repair eligibility before any before-phase attempt.

resolve_repair_subject previously returned RepairSubject::Seam for
an exact seam ID or a unique canonical gap ID with no
repair_packet_eligibility / AgentBriefPolicy check, while
resolve_repair_start gated implicit selection on
eligible() && omission.is_none(). The façade then drove
Seam -> drive_before_phase unconditionally. Downstream, the
lock-before-persist path (cli/mod.rs) already prevented a persisted
attempt for ineligible seams, but with exit 2 (Failure) instead of
3 (Decision), a downstream packet message instead of a named resolver
reason, and a .before.lock / repair-attempt-store side effect.

Refs #8166 Slice A. Does not close #8166.

Production delta

  • crates/ripr/src/app/task_first.rs: new shared
    repair_refusal_reason gate (producer-owned repair_packet_eligibility
    flip first, then AgentBriefPolicy::omission_reason_for_class, same
    precedence as the auto selector). resolve_repair_start now uses it
    (byte-identical reason strings), and resolve_repair_subject uses it
    for both exact seam IDs and unique canonical gap IDs: eligible ->
    Seam, ineligible -> Decision naming the item, the seam, and the
    reason (not a headline repair target, configured off,
    repair route not ready, ...), before drive_before_phase acquires
    the lock. Unknown/ambiguous/truncated behavior unchanged.

Evidence delta

  • crates/ripr/tests/task_first_facade.rs: three durable CLI tests
    (exit code, stderr, stdout emptiness, attempt-store and .before.lock
    absence, plus eligible positive control).
  • .ripr/traceability.toml: new tests mapped under existing
    RIPR-SPEC-0011 (where every sibling façade test lives). No new
    .allow/spec-system/slices/ file: no repair-façade slice exists
    (the gate-repair-route-eligibility slice owns the PR-gate contract
    for fix(gate): gap-ledger records can never block — seam_id hardcoded None makes route perpetually incomplete #1933, not this resolver), so no slice was invented.
  • changelog.d/8166-repair-eligibility-gate.md: Fixed fragment.

Acceptance matrix

Case Pre-fix (observed) Post-fix
Explicit eligible seam exit 0, 1 attempt exit 0, 1 attempt (positive control passes both)
Explicit ineligible seam (boundary gripped) exit 2, downstream agent packet ... configured off for strongly_gripped message exit 3, ... not repair-eligible: not a headline repair target, no attempt, no .before.lock, no attempt store
Explicit canonical gap + seam, class configured off exit 2, downstream packet message exit 3, named configured off reason, no attempt/lock/store
Implicit selection unchanged reasons/exits full façade suite green (21 tests)

Pre-fix red (unmodified production, cargo test -p ripr --test task_first_facade repair_explicit): 1 passed; 2 failed with
expected exit 3, left: Some(2) on both ineligible tests.

Proof

  • cargo test -p ripr --test task_first_facade repair_explicit: 3 passed.
  • cargo test -p ripr --test task_first_facade: 21 passed.
  • cargo test -p ripr --lib task_first: 17 passed.
  • cargo fmt --check: clean.
  • cargo xtask check-fast: see CI / comment.

Limitations / non-goals

  • No Slice B (explain/context selector), Slice C (check drill-down),
    fix(agent): name the family mismatch for gap: IDs passed as seam IDs (#8158) #8207 hint changes, or new probe:/file:line repair mappings.
  • ripr agent repair --seam-id keeps its existing downstream typed
    refusal; only the task-first façade resolver is gated here.
  • Ineligible canonical gap is exercised via policy omission (canonical
    IDs only exist for headline-eligible classes, so the packet flip
    alone cannot make one ineligible).

Rollback

Revert the single commit: explicit subjects return to the downstream
packet refusal (exit 2, lock side effect) with no schema or store
format change; no migration needed.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 071bf7db-1a55-4fb4-a2f0-938f528b3ed1
📥 Commits

Reviewing files that changed from the base of the PR and between ae48684 and 770ef7c.

📒 Files selected for processing: 4
  • .ripr/traceability.toml
  • changelog.d/8166-repair-eligibility-gate.md
  • crates/ripr/src/app/task_first.rs
  • crates/ripr/tests/task_first_facade.rs

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

Summary by CodeRabbit

  • Bug Fixes
    • Explicitly selecting a seam or gap that is not eligible for repair, or is excluded by policy, now stops before a repair attempt begins and provides the reason for the decision.
    • Eligible explicit selections continue to start a repair attempt. Unknown and ambiguous gap selections retain their existing behavior.

Walkthrough

Repair selection now uses a shared gate to check seam eligibility and brief policy. Explicit ineligible or policy-omitted subjects return a no-start decision. Tests verify that refused selections create no repair attempt, attempt store, or before-phase lock.

Changes

Repair eligibility

Layer / File(s) Summary
Shared repair admission gate
crates/ripr/src/app/task_first.rs
A shared refusal check now controls automatic seam selection. The auto-selector records up to three distinct refusal reasons.
Explicit subject resolution and validation
crates/ripr/src/app/task_first.rs, crates/ripr/tests/task_first_facade.rs, changelog.d/8166-repair-eligibility-gate.md, .ripr/traceability.toml
Explicit seam and canonical gap IDs resolve only when the seam passes the gate. Tests cover eligible selection, ineligible and policy-omitted refusals, and the absence of attempt-related side effects. The changelog and traceability manifest document and reference these cases.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 770ef

No actionable merge-blocking risk is identified for this eligibility-gate slice. It is mergeable after normal checks.

Pre-merge checks: Passed 2 · Failed 3

Failed Failed checks: 3 warnings

Check name Status Explanation Resolution
Linked Issues check Warning The PR satisfies the Slice A behavior for explicit seam IDs and unique canonical gap IDs. repair_refusal_reason applies packet eligibility before policy omission, and resolve_repair_subject return… Implement the remaining [#8166] acceptance criteria, or remove the direct link and track this Slice A work under a child issue. Add tests for exact eligible, zero, ambiguous, stale, and unestablished probe:... and file:line mappings; se…
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 2 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description gives a clear summary, production and evidence changes, acceptance cases, proof, limitations, and rollback. It omits many required template sections, including source boundary, source-… Complete the missing template sections. Mark applicable checklist items, provide source and relationship details, document scope and policy impacts, add claim-boundary and traceability entries, and record the required engineering and gate r…
Passed Passed checks: 2 passed
Check name Status Explanation
Out of Scope Changes check Passed The reviewed production change is limited to the repair-admission gate for the task-first resolver. The added façade tests, traceability entries, and changelog entry support that behavior. No unrelate…
Title check Passed The title clearly identifies the main change: gating explicit repair subjects on eligibility.
Full details: Out of Scope Changes check

Explanation

The reviewed production change is limited to the repair-admission gate for the task-first resolver. The added façade tests, traceability entries, and changelog entry support that behavior. No unrelated implementation or behavior is demonstrated.

Full details: Linked Issues check

Explanation

The PR satisfies the Slice A behavior for explicit seam IDs and unique canonical gap IDs. repair_refusal_reason applies packet eligibility before policy omission, and resolve_repair_subject returns a Decision before the attempt path for ineligible subjects. The active linked issue [#8166] also requires probe:... and file:line resolution in ripr repair, seam ID resolution in ripr explain and ripr context, and eligible repair output from ripr check. The PR description and the reviewed diff show that these requirements are not implemented. The reported tests cover the Slice A façade behavior, not the missing issue criteria.

Resolution

Implement the remaining [#8166] acceptance criteria, or remove the direct link and track this Slice A work under a child issue. Add tests for exact eligible, zero, ambiguous, stale, and unestablished probe:... and file:line mappings; seam ID resolution for explain and context; and conditional ripr repair output from ripr check.

Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 2 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Description check

Explanation

The description gives a clear summary, production and evidence changes, acceptance cases, proof, limitations, and rollback. It omits many required template sections, including source boundary, source-of-truth links, candidate relationships, scope classification, support-tier impact, policy impact, claim boundary, traceability, engineering checks, and gates.

Resolution

Complete the missing template sections. Mark applicable checklist items, provide source and relationship details, document scope and policy impacts, add claim-boundary and traceability entries, and record the required engineering and gate results or explicitly mark them as not applicable.

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

A rabbit checks each seam with care,
The eligible may enter there.
If policy says “off,” it stops,
No lock or attempt ever drops.
Then hops away with reasons clear.

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

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Exact-head review (author self-review, COMMENT disposition):

reviewed_head_sha: 770ef7cc1840b90c1bd9834724619ba0bc7be210
integration_basis: origin/main 20ddb3707248e3ac0053ad0e69973ed329554830 (candidate parent, verified in handback)
claim_boundary: #8166 Slice A only. Explicit ripr repair subjects pass the repair-admission gate before any attempt. No Slice B/C, no #8207 changes, no new probe:/file:line mappings.
changed_surfaces_and_semantic_owners_inspected: app/task_first.rs repair_refusal_reason (the one admission gate: packet eligibility flip first, then AgentBriefPolicy omission, same precedence as the auto selector), resolve_repair_start refactored onto it with byte-identical reason strings, resolve_repair_subject gating exact seam and unique canonical-gap subjects into Decision with named reason; tests/task_first_facade.rs three durable CLI tests; traceability under RIPR-SPEC-0011; changelog fragment.
blocking_findings: none. The gate reuses the producer-owned eligibility owner instead of a parallel validator; unknown/ambiguous/truncated resolutions are unchanged.
proof_and_ci_observed: pre-fix red recorded in the PR body (cargo test -p ripr --test task_first_facade repair_explicit: 1 passed, 2 failed with expected exit 3, left Some(2) on both ineligible tests); post-fix 3 passed, full facade suite 21 passed, lib task_first 17 passed, fmt clean. The tests assert exit code, stderr naming, stdout emptiness, and absence of attempt store and .before.lock, so an attempt_ids-only false green cannot pass.
proof_or_review_missing: hosted required gate on this exact head, requested by the Ready transition following this record; cargo xtask check-fast result to be read from CI.
residual_assumptions_and_non_claims: canonical-gap ineligibility is exercised through policy omission (canonical IDs exist only for headline-eligible classes); ripr agent repair --seam-id keeps its downstream typed refusal and is out of this slice.
disposition: REVIEW_READY conditional on the hosted required gate succeeding on 770ef7cc1.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 16, 2026 20:58
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Decision

  • Needs one verification check before upstream.

Verification questions

  • Confirm ast-grep scan of RepairSubject::{Seam,Decision} constructors shows the new ineligible_repair_item is the sole new Decision constructor introduced; ambiguous_gap_item, unknown_repair_item, and canonical_truncated paths retain prior semantics. drive_before_phase is only invoked from the Seam arm, so ineligible items bypass lock and attempt-store side effects.

Refuted

  • A second eligibility validator parallel to repair_packet_eligibility could be needed inside resolve_repair_subject to avoid coupling.; refuted because: The diff does not introduce a parallel validator; it factors a single shared helper that both call sites use, which is the minimal-coupling solution.

Parked follow-ups

  • Pre-existing ambiguous canonical-gap arm does not surface ineligibility reasons even when all candidates would be refused by the gate; out of scope for #8166 Slice A but worth a parked follow-up so the next slice can decide whether to gate it.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ux(cli): one canonical finding ID from check to explain and repair (#8158 item 5)

1 participant