Skip to content

Merge approval and documentReview into one approval type#449

Draft
DKuleshov wants to merge 2 commits into
mainfrom
feature/pr-13-merge-approval-documentreview
Draft

Merge approval and documentReview into one approval type#449
DKuleshov wants to merge 2 commits into
mainfrom
feature/pr-13-merge-approval-documentreview

Conversation

@DKuleshov
Copy link
Copy Markdown
Collaborator

@DKuleshov DKuleshov commented May 29, 2026

Linked issue

Closes #445

Summary of changes

Merge the documentReview question type into approval. Attachments become optional on approval; reviewer decision narrows to approved / rejected. Outpost Decisions tab and Mothership respond form both render the merged shape.

Two commits, one per surface:

  • feat(server) — type enum, validator, RespondFormHandler, Respond.cshtml, unit + integration + Playwright + Mothership QA fixture
  • feat(mcp,outpost)task_mark_needs_input + task_answer_question schema; outpost actions.js drops Abstain + renders attachment checklist when present

Behaviour:

  • documentReview removed from the allowed type set
  • approval decisions narrowed to approved / rejected; drops abstained / changes_requested / comment_only
  • Approval question can carry attachments; respond surfaces render the per-attachment "I reviewed this" checklist and block submission until at least one is acknowledged
  • reviewedAttachmentIds flows through /api/responses and /api/task/answer
  • comment required only when decision = rejected
  • CheckDeliverableSummary validator rule parked pending outpost support for emitting attachment summary; tests covering the rule marked Skip so intent stays documented

Screenshots / recordings

n/a — no new UI surface; existing approval card simplified (Abstain dropped, attachment checklist enabled when applicable).

Testing notes

  • dotnet test server/tests/Dotbot.Server.Tests/ — 326/326 pass, 2 skip (the parked deliverableSummary tests)
  • pwsh tests/Run-Tests.ps1 — Layer 1-3 pass on local
  • Playwright mothership-question-flow.spec.ts updated to drive the merged shape; locator + decision values reflect approved/rejected
  • Test-E2E-Mothership-QA.ps1 updated; documentReview scenario dropped
  • Manual e2e through a workflow + Mothership round-trip: approval question fired from analysis, reviewer responded via magic link, response persisted on the server

Out of scope / follow-ups

  • Framework bugfixes surfaced during the manual e2e (resumed-task field propagation in ProcessRegistry, model not propagated by workflow-manifest, hashtable-vs-PSObject probe in Invoke-WorkflowProcess) — separate PR
  • Teaching 98-analyse-task.md when to use approval vs singleChoice vs other question types — separate PR
  • Wiring needs_review to publish an approval question to Mothership instead of parking locally — separate issue

Refs #29 (parent), #417 (dual-surface).

Checklist

  • Tests added or updated
  • Docs updated (if behaviour changed)
  • Linked issue exists
  • Follows the contribution guide

DKuleshov and others added 2 commits May 29, 2026 12:55
- Drop `documentReview` from QuestionTypes.AllowedTypes
- Allow optional `attachments` on `approval`; render attachment review
  checklist before decision buttons in Pages/Respond.cshtml
- Replace verb-form decisions with past-tense `approved` / `rejected`
  (drops abstain / request-changes / comment-only)
- Require `comment` when decision = `rejected`
- Update validator + form handler tests; update Playwright spec and
  Mothership QA fixture to drive the merged type
- Park CheckDeliverableSummary out of the validator pending outpost
  support for preparing attachment summaries; tests covering it marked
  Skip so the intent stays documented

Closes #445.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…445]

MCP tools (`task_mark_needs_input`, `task_answer_question`):
- Drop `documentReview` from the allowed `type` enum.
- Restrict `approval` decisions to `approved` / `rejected`; drop
  `abstained`, `changes_requested`, `comment_only`.
- Require `comment` only when decision = `rejected`.

NotificationClient.psm1:
- Drop the `documentReview` switch branch in ConvertTo-TypedResponse;
  approval handling now covers both attachment-bearing and no-document
  cases.

Outpost Decisions tab (core/ui/static/modules/actions.js):
- Drop the Abstain button on `approval` cards.
- When the question carries attachments (`question.attachments` /
  `question.attachmentList`), render the "I reviewed this" checklist and
  block submission until at least one attachment is acknowledged;
  reviewed IDs flow through `reviewed_attachment_ids` on the
  `/api/task/answer` payload.

Test-Components.ps1:
- Update ConvertTo-TypedResponse fixture to use the merged `approval`
  type with attachments.
- Add `documentReview` rejection assertion and lock the deprecated
  `changes_requested` decision out of approval-typed answers.

Refs #445.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 29, 2026 13:08
@DKuleshov DKuleshov requested a review from andresharpe as a code owner May 29, 2026 13:08
@github-actions
Copy link
Copy Markdown
Contributor

This PR is missing a linked issue reference.

Please add one of the following to the PR description:

  • Closes #<issue-number>
  • Fixes #<issue-number>
  • Resolves #<issue-number>

If this is a trivial change that doesn't need an issue, ask a maintainer to add the no-issue label.

@DKuleshov DKuleshov changed the title Merge approval and documentReview into one approval type [#445] Merge approval and documentReview into one approval type May 29, 2026
@DKuleshov DKuleshov marked this pull request as draft May 29, 2026 13:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR merges documentReview into the existing approval question type, simplifying approval workflows across the server, MCP tools, outpost UI, and tests.

Changes:

  • Removes documentReview and narrows approval decisions to approved / rejected.
  • Adds attachment-review checklist behavior to approval UI paths.
  • Updates server validation, respond form handling, MCP schemas, outpost rendering, docs, and related tests.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Test-E2E-Mothership-QA.ps1 Updates Mothership E2E fixtures for merged approval type.
tests/Test-Components.ps1 Updates PowerShell component expectations for new approval shape.
tests/e2e-server/specs/mothership-question-flow.spec.ts Updates Playwright approval decision values and removes documentReview branches.
server/tests/Dotbot.Server.Tests/Unit/RespondFormHandlerTests.cs Reworks respond validation tests for approval with/without attachments.
server/tests/Dotbot.Server.Tests/Unit/QuestionTemplateValidatorTests.cs Updates template validation expectations and parks summary-rule coverage.
server/tests/Dotbot.Server.Tests/Integration/MagicLinkMiddlewareTests.cs Switches magic-link fixture from documentReview to approval.
server/src/Dotbot.Server/Validation/RespondFormHandler.cs Merges approval and document-review response validation.
server/src/Dotbot.Server/Validation/QuestionTemplateValidator.cs Removes active deliverable-summary rule and scopes parked logic to approval attachments.
server/src/Dotbot.Server/Services/Delivery/NotificationSummaryBuilder.cs Updates summary comment for merged approval behavior.
server/src/Dotbot.Server/Pages/Respond.cshtml Renders approval decisions and optional attachment checklist in one branch.
server/src/Dotbot.Server/Models/QuestionTypes.cs Removes documentReview from question type constants.
server/src/Dotbot.Server/Models/ApprovalDecisions.cs Narrows approval decision constants and labels.
server/docs/MOTHERSHIP-E2E-SETUP.md Updates documented E2E question type list.
core/ui/static/modules/actions.js Updates outpost approval UI, removes Abstain, and adds attachment checklist request data.
core/mcp/tools/task-mark-needs-input/script.ps1 Removes documentReview from allowed MCP question types.
core/mcp/tools/task-mark-needs-input/metadata.yaml Updates MCP schema enum for question types.
core/mcp/tools/task-answer-question/script.ps1 Updates MCP answer validation for merged approval decisions.
core/mcp/tools/task-answer-question/metadata.yaml Updates answer schema decision enum and descriptions.
core/mcp/modules/NotificationClient.psm1 Removes documentReview response parsing branch and updates help text.
.gitignore Ignores Visual Studio .csproj.user files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +908 to +912
const body = {
task_id: taskId,
answer: decision,
decision: decision,
comment: comment || null
decision: decision,
comment: comment || null
};
if (reviewedAttachmentIds) body.reviewed_attachment_ids = reviewedAttachmentIds;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

[PR-13/#29] Merge approval and documentReview into one approval type

2 participants