Skip to content

Reviewer cohort reuse loops on files no agent can cover #562

Description

@rianjs

Reviewer cohort reuse should tolerate inherently unassigned files

Problem

After a fresh review of yakshed PR 7, .github/workflows/ci.yml is intentionally reported by the normal coverage gate as unassigned because no current reviewer agent glob matches it. The saved cohort then makes every plain follow-up fail before reviewer execution with:

saved reviewer cohort leaves changed file ".github/workflows/ci.yml" uncovered; pass --fresh-session

Running --fresh-session selects the same catalog and cannot make the file coverable, so the guidance creates a loop and discards useful reviewer-session continuity.

Root cause

First-run selection permits files that match no selected agent to remain in the existing incomplete_unassigned coverage bucket. Cohort rebasing applies a stricter invariant: every changed file must be assigned to a saved member, even when no agent in the current catalog can match it. That makes later-run behavior inconsistent with first-run behavior.

Change

Keep the fixed-cohort contract and its useful incompatibility failures, but distinguish recoverable from inherent gaps while rebasing:

  • Reassign new files to saved broad members or saved scoped members whose globs match, as today.
  • If no saved member can take a file but another current catalog agent can match it, retain the terminal --fresh-session guidance because reselection can help.
  • If no current catalog agent can match the file, leave it unassigned and continue with the saved cohort. The existing reviewer-coverage gate remains authoritative and must report incomplete_unassigned; this does not silently make approval eligible.
  • Preserve saved reviewer ordering and provider-session reuse.
  • Preserve failures for adapter/runtime incompatibility, missing cohort members, and undersized --max-agents.
  • Update the lifecycle documentation to describe the distinction.

TDD verification

  1. Add a failing rebase test with a saved scoped reviewer covering main.go and an unmatched .github/workflows/ci.yml; expect successful cohort reuse with only main.go assigned.
  2. Prove the downstream coverage summary still contains an unassigned entry for the workflow file.
  3. Add/retain a failing case where a catalog agent outside the saved cohort can match the newly uncovered file; expect --fresh-session guidance.
  4. Run focused pipeline tests, race-sensitive tests if the changed path has concurrent state, and make check.

Empirical definition of done

Build the combined candidate from draft PR #561. Using the established yakshed PR 6 and PR 7 cohorts, run normal non-posting follow-up reviews without --fresh-session:

  • PR 6 completes without dossier process-vocabulary rejection.
  • PR 7 completes without the saved-cohort uncovered-file terminal error, preserves reviewer reuse, and reports .github/workflows/ci.yml through the ordinary unassigned coverage entry.

Both commands must exit successfully. No yakshed review is posted.

Delivery

Implement as a separate commit after 6c59cfb on draft PR #561. Update that PR to close this issue as well as #559. Run one independent TDD coverage assessment for the combined PR, the normal cr review loop, CI, and squash-merge only after both empirical gates pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions