Skip to content

Show the proposed edit when offering to update acceptance criteria after a review #1077

Description

@williamthorsen

Problem

After a review, the next-steps menu's Deviations sub-block offers "📝 Update the acceptance criteria" as a bare action label. The mapping from deviations to criteria is a judgment the agent makes silently (a platform-floor bump becomes a criterion; a refactor does not), so the user consents to a ticket edit without seeing what it contains. The Source divergence sub-block has the same defect: its options mutate the ticket and/or PR description sight unseen.

The bare render is prescribed, not accidental: both sub-blocks' "pros and cons are omitted by default" rule suppresses the content the user needs.

Context

Both sub-blocks live in packages/agents/content/skills/_partials/next-steps-after-review.md, inlined into review-branch (and reached by review-pr). The Deviations option invokes align-ticket-with-implementation, which has only a whole-ticket mode, so its executed edit reaches sections a criteria preview cannot describe. Originating observation: KB event 01KY4M9G9H10DJ2F7EM0VB37JZ (codeassembly store).

Other consent menus are unaffected: the Findings sub-block's content (the findings) and design-and-plan's remote-issue offer (the refined ticket) are already fully visible at consent time.

Proposed solution

Render a proposed-edit preview above the numbered options in each artifact-mutating sub-block; the option line stays a bare action. For ticket edits the preview is a delta: Add: / Reword: / Drop: lines for criteria, derived from the review's Specification compliance section, plus Rewrite: lines for the narrative sections a whole-ticket ratification regenerates, derived from the divergent D-rows. For PR-description edits it shows the concrete claim changes keyed to the divergent D-rows. The preview is carved out of the terseness rule rather than the rule being relaxed, and no exclusions line is rendered (rejected: a "substantive exclusions" filter would over-trigger into noise); a deviation genuinely arguable as a criterion goes into the proposed edit itself, where it can be struck.

Give align-ticket-with-implementation a criteria-only mode and scope the Deviations option to it, so that option's edit matches its label. Whole-ticket ratification stays with the Source divergence options, which is where the Rewrite: lines apply.

Acceptance criteria

Must have

  • The Deviations sub-block renders the concrete criteria delta (added, reworded, dropped) above its options.
  • The Source divergence sub-block renders the proposed edit for each target it would mutate (ticket, PR description, or both — case 4 included). "Leave as-is" options carry no preview.
  • When a proposed edit would settle or obviate an open finding, the preview carries a ⚠️ line naming the finding.
  • The terseness rule in both sub-blocks explicitly exempts the preview, so it cannot suppress it.
  • The executed edit matches the previewed one; an edit exceeding the preview requires re-confirmation.
  • The rendered examples in the partial (including Combined output format) show the preview shape.

Metadata

Metadata

Labels

featureAdded or improved external functionalityscope:agents

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions