Repository navigation
fix(autopilot): the design gate can't be approved before there is anything to look at - #315
Merged
Merged
Conversation
…thing to look at An owner could press "Approve design" on Board > Tasks while a review was still Pending (no screenshots: the Testing agent hadn't run), and that blind approval passed the gate. Two lab tickets were approved that way. - UI: a review without screenshots shows "Waiting for screenshots" instead of Approve design / Ask for changes; Check again stays only for a check that couldn't run. The Design checks list labels it the same way. - Server: IDesignReviewStore.DecideAsync (EF + in-memory, on the stored row) and BoardTaskService.DecideAsync / DecideDesignAsync (on the copy the person saw) refuse a decision on a review with no screenshots, in plain words. DecideDesignAsync no longer creates an empty review to hold a decision. Owner decisions are audited (design.decided). - Gate: an approval passes only with screenshots behind it, so existing blind approvals (Pending + Approved, no shots) never read Passed. Ask for changes always counts. - New screenshots clear an earlier approval: a test run's capture (DesignVerdictUpdate.NewCapture), or the first screenshots of a review approved with none. Audited (design.approval_cleared) and said on the task feed. No migration needed. - Standalone sample #8 (waiting for screenshots) + E2E; unit tests for the refusal, the gate, the clearing and the unchanged approve-after-shots path. - ADR-0016, README, CONFIG updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB
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.
Change description
Bug: on Board › Tasks the owner could press Approve design while a design review was still Pending. At that point there are no screenshots because the Testing agent hasn't run yet, and the approval still passed the gate. A real owner approved two lab tickets this way: #122 run 0 and #123 run 2, both Pending + Approved with no screenshots.
Fix, end to end (Design gate, #292 / ADR-0016):
DesignPanel.razor,DesignChecks.razor): when a review has no screenshots, Approve design and Ask for changes are hidden. The panel shows a plain-language status instead: "Waiting for screenshots — The Testing agent takes them during Test…" (Chip+.design-panel-decision,role="status", no new CSS). Check again stays only forNotRun. The badge and the Design checks row also read Waiting for screenshots. If an old blind approval is still stored, the panel says it doesn't count.IDesignReviewStore.DecideAsync(EF and in-memory, against the stored row).BoardTaskService.DecideAsync/DecideDesignAsyncalso check the copy the person looked at. The refusal is anInvalidOperationExceptionwith a plain-language message (DesignReview.NothingToDecideYet), which the panel shows as a toast.DecideDesignAsyncno longer creates an empty Pending review just to hold a decision. Owner decisions are now audited asdesign.decided. There is no REST decide endpoint (DesignReviewEndpointsonly has list and shots), so the Board service plus the store are the decide path.Approvedgives Passed only when the review has screenshots (DesignReview.BlindApproval/OwnerDecided). The two lab rows now read not checked, never Passed. Ask for changes always counts, because it can only hold a merge back. A blind approval also no longer stops automatic re-runs or the orphaned-Checking reset.DesignVerdictUpdate.NewCapture. In that same write the store clears any earlier approval. It also clears one when a review approved with no screenshots gets its first ones, whoever brings them. Each clear is audited (design.approval_cleared) and announced on the task feed. Ask for changes is never cleared. No migration was needed: the rule comes from the existing shots column, and RLS is unchanged.Claude Design: the waiting state still needs to be pushed to the
ui_kits/agentos/board-design-checks.htmlcard. This session had no DesignSync auth, so the repo is ahead of the Design project. Push it with/design-login→ DesignSyncwrite_files.Type of change
Related issues
Follow-up to #292 (Design gate, ADR-0016).
Checklist
dotnet buildpasses locally in Release mode (0 code warnings)dotnet testpasses: full solution 2711 total, 0 failed (95 env-gated skips).DesignReviewStoreTestsalso ran against a real Postgres (RUN_AGENTOS_E2E_REAL): migration, RLS count, refusal and clearing on EF.Test plan
DesignDecisionTests, new):BeginTestAsync(captureDesign: true)clears a lab-style blind approval, audits it, posts it on the feed, and the owner can then approve;DesignReviewStoreTests, in-memory + real Postgres): refusal; approve after screenshots survives a Designer verdict on the same screens;NewCaptureclears an approval; a legacy blind approval is never Passed and its first screenshots clear it. The existing race tests now carry screenshots.DesignGateFlowTests): blind approval is never Passed; Ask for changes without screenshots still holds the merge back; a blind approval doesn't block retries.DesignGateTests, standalone Web on :5199): the newBoardTasks_DesignPanel_WithoutScreenshots_WaitsForThem_AndOffersNoDecisionpasses (row and badge say Waiting for screenshots, status text shown, no Approve / Ask / Check again / grid). The existing feat(aspire): AppHost + ServiceDefaults + e2e tests #7 grid / approve / ask flow is unchanged. 3/3 passed.AGENTOS_E2E_SCREENSHOTS(not committed).lab.ps1 update, then check that security(deps): pin Microsoft.OpenApi past GHSA-v5pm-xwqc-g5wc #122 and chore(deps): Bump the nuget-minor-patch group with 4 updates #123 show Waiting for screenshots / "approved before there were any screenshots — that doesn't count", and that Autopilot doesn't merge them before a real test and decision.🤖 Generated with Claude Code
https://claude.ai/code/session_018WAdQ7Rm24xss5QDSvXtJB