Skip to content

[unic-pr-review] Re-review Coordinator + reply path + persistent-unaddressed + force-push fallback #152

@orioltf

Description

@orioltf

Parent

docs/issues/unic-pr-review/PRD.md

What to build

The full re-review write path. A new agents/re-review-coordinator.md (LLM agent — per the motto: get out of the models' way) merges aspect-agent priorVerdicts (#151), ADO Thread status, and human-Reply signals into the four Thread Classifications (addressed / disputed / pending / obsolete), decides reply-vs-new-Thread per Finding, and emits a structured plan that the ADO Writer (#150) consumes mechanically. The Writer posts Replies to existing Threads instead of duplicates, patches Thread status to auto-resolve addressed, and rewrites the Summary General Comment in place. A "Persistent unaddressed findings" Notice is added to the top of the Summary when any Finding has been raised across ≥2 iterations.

Force-push fallback: if signature.mjs parses a prior Revision that no longer exists in the PR's Revision history, the orchestrator emits a warning Notice and runs as first-review-fallback for this iteration.

No deterministic rule table, no drift constants. Classification quality is validated by acceptance testing on real PRs.

Acceptance criteria

  • agents/re-review-coordinator.md exists with distinct name + colour; receives RAW_THREADS_JSON, identity ID, the signature prefix from signature.mjs, the delta diff, prior Findings, and the aspect agents' new Findings + priorVerdicts.
  • The Coordinator emits a structured plan { threadActions: [{ threadId, action: 'reply'|'resolve'|'leave'|'reopen', body? }], persistentUnaddressed: [{ threadId, threadUrl, title, sinceIteration }], freshFindings: [...] }. No Bot Signature footer in the agent output.
  • ADO Writer (extended) consumes the plan: posts Replies via az devops invoke (not new Threads), patches Thread status for resolve actions, leaves disputed Threads alone, opens new Threads only for freshFindings.
  • Summary General Comment is rewritten in place (PATCH on the existing Summary thread identified by content + author), not appended as a new comment. Exactly one Summary exists per iteration.
  • persistentUnaddressed entries (Findings raised across ≥2 iterations, recomputed every re-review from the prior Plugin-signed Replies on each Thread — no local state per ADR-0006) render as a top-of-Summary Notice with Thread URLs, ordered by sinceIteration.
  • review-summary-renderer.mjs knows how to format the persistent-unaddressed notice as part of the Notices block.
  • Force-push path: when the prior Revision is not in the PR's Revision history, the orchestrator emits a warning Notice "prior reviewed Revision no longer exists in this PR (force-push); falling back to first-review mode", sets the mode to first-review-fallback, and runs the first-review path for this iteration.
  • Bot Signature footer on every Reply and the rewritten Summary carries the new iteration number, not the prior one.
  • tests/ado-cli-smoke.test.mjs is extended to cover the reply, patch-status, and Summary PATCH invocations.
  • Manual acceptance test: a re-run on a sandbox PR with mixed Thread states correctly replies / auto-resolves / leaves alone, and the persistent-unaddressed notice appears only when applicable.
  • Cross-platform CI green.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew capabilityfeature/unic-pr-reviewIssues from the unic-pr-review featureready-for-agentFully specified, ready for an AFK agent

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions