Merge approval and documentReview into one approval type#449
Draft
DKuleshov wants to merge 2 commits into
Draft
Conversation
- 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>
Contributor
|
This PR is missing a linked issue reference. Please add one of the following to the PR description:
If this is a trivial change that doesn't need an issue, ask a maintainer to add the |
Contributor
There was a problem hiding this comment.
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
documentReviewand narrows approval decisions toapproved/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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Closes #445
Summary of changes
Merge the
documentReviewquestion type intoapproval. Attachments become optional onapproval; reviewer decision narrows toapproved/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 fixturefeat(mcp,outpost)—task_mark_needs_input+task_answer_questionschema; outpost actions.js drops Abstain + renders attachment checklist when presentBehaviour:
documentReviewremoved from the allowed type setapprovaldecisions narrowed toapproved/rejected; dropsabstained/changes_requested/comment_onlyreviewedAttachmentIdsflows through/api/responsesand/api/task/answercommentrequired only when decision =rejectedCheckDeliverableSummaryvalidator rule parked pending outpost support for emitting attachment summary; tests covering the rule markedSkipso intent stays documentedScreenshots / 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 localmothership-question-flow.spec.tsupdated to drive the merged shape; locator + decision values reflectapproved/rejectedTest-E2E-Mothership-QA.ps1updated; documentReview scenario droppedOut of scope / follow-ups
ProcessRegistry,modelnot propagated byworkflow-manifest, hashtable-vs-PSObject probe inInvoke-WorkflowProcess) — separate PR98-analyse-task.mdwhen to useapprovalvssingleChoicevs other question types — separate PRneeds_reviewto publish an approval question to Mothership instead of parking locally — separate issueRefs #29 (parent), #417 (dual-surface).
Checklist