Skip to content

fix(autopilot): the design gate can't be approved before there is anything to look at - #315

Merged
hoangsnowy merged 1 commit into
mainfrom
fix/design-gate-no-blind-approve
Nov 2, 2026
Merged

hoangsnowy merged 1 commit into
mainfrom
fix/design-gate-no-blind-approve

Conversation

@hoangsnowy

Copy link
Copy Markdown
Owner

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):

  • UI (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 for NotRun. 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.
  • Server: the store refuses a decision on a review with no screenshots. Both stores check this in IDesignReviewStore.DecideAsync (EF and in-memory, against the stored row). BoardTaskService.DecideAsync / DecideDesignAsync also check the copy the person looked at. The refusal is an InvalidOperationException with a plain-language message (DesignReview.NothingToDecideYet), which the panel shows as a toast. DecideDesignAsync no longer creates an empty Pending review just to hold a decision. Owner decisions are now audited as design.decided. There is no REST decide endpoint (DesignReviewEndpoints only has list and shots), so the Board service plus the store are the decide path.
  • Gate semantics: Approved gives 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.
  • New screenshots clear an approval: when a test run sends screenshots back, it saves them with 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.
  • Standalone sample: besides feat(aspire): AppHost + ServiceDefaults + e2e tests #7, the sample seeds a second check, feat(platform-v2): live agents + Microsoft Agent Framework + Workflows #8, that is still waiting for screenshots. This makes the waiting state visible and E2E-testable without a database.
  • Docs: ADR-0016 (amendment under §8 + Consequences), README, CONFIG.

Claude Design: the waiting state still needs to be pushed to the ui_kits/agentos/board-design-checks.html card. This session had no DesignSync auth, so the repo is ahead of the Design project. Push it with /design-login → DesignSync write_files.

Type of change

  • New feature (new agent / endpoint / capability)
  • Bugfix
  • Refactor (no behavior change)
  • Documentation / README
  • Infrastructure / CI configuration

Related issues

Follow-up to #292 (Design gate, ADR-0016).

Checklist

  • dotnet build passes locally in Release mode (0 code warnings)
  • dotnet test passes: full solution 2711 total, 0 failed (95 env-gated skips). DesignReviewStoreTests also ran against a real Postgres (RUN_AGENTOS_E2E_REAL): migration, RLS count, refusal and clearing on EF.
  • No secrets committed (API keys, connection strings)
  • README / docs updated if public behavior changed
  • Measurable results provided when related to agent output quality (n/a)

Test plan

  • Unit (DesignDecisionTests, new):
    • refused with no review, and creates none;
    • refused on a Pending review without screenshots, for both Approve and Ask for changes;
    • refused from a copy without screenshots even if screenshots landed since;
    • an approve with screenshots still passes the gate and is audited;
    • BeginTestAsync(captureDesign: true) clears a lab-style blind approval, audits it, posts it on the feed, and the owner can then approve;
    • a re-test keeps Ask for changes.
  • Store (DesignReviewStoreTests, in-memory + real Postgres): refusal; approve after screenshots survives a Designer verdict on the same screens; NewCapture clears an approval; a legacy blind approval is never Passed and its first screenshots clear it. The existing race tests now carry screenshots.
  • Domain (DesignGateFlowTests): blind approval is never Passed; Ask for changes without screenshots still holds the merge back; a blind approval doesn't block retries.
  • E2E (DesignGateTests, standalone Web on :5199): the new BoardTasks_DesignPanel_WithoutScreenshots_WaitsForThem_AndOffersNoDecision passes (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.
  • Screenshots of the waiting state, light and dark, captured with AGENTOS_E2E_SCREENSHOTS (not committed).
  • To do on the lab after merge: 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

…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
@hoangsnowy
hoangsnowy merged commit 16443cd into main Nov 2, 2026
4 checks passed
@hoangsnowy
hoangsnowy deleted the fix/design-gate-no-blind-approve branch November 28, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant