• Will Chen's avatar
    Security Panel MVP (#1660) · c50527b4
    Will Chen 提交于
    TODOs:
    
    - [x] Add documentation
    - [x] e2e tests: run security review, update knowledge, and fix issue
    - [x] more stringent risk rating
    
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > Introduces a new Security mode with a Security Review panel that runs
    reviews, edits rules, parses findings via IPC, and supports fixing
    issues, with tests and prompt/runtime support.
    > 
    > - **UI/Preview Panel**:
    > - Add `security` preview mode to `previewModeAtom` and ActionHeader
    (Shield button).
    > - New `SecurityPanel` showing findings table (sorted by severity), run
    review, fix issue flow, and edit `SECURITY_RULES.md` dialog.
    >   - Wire into `PreviewPanel` content switch.
    > - **Hooks**:
    >   - `useSecurityReview(appId)`: fetch latest review via IPC.
    > - `useStreamChat`: add `onSettled` callback to invoke refreshes after
    streams.
    > - **IPC/Main**:
    > - `security_handlers`: `get-latest-security-review` parses
    `<dyad-security-finding>` from latest assistant message.
    >   - Register handler in `ipc_host`; expose channel in `preload`.
    >   - `ipc_client`: add `getLatestSecurityReview(appId)`.
    > - `chat_stream_handlers`: detect `/security-review`, use dedicated
    system prompt, optionally append `SECURITY_RULES.md`, suppress
    Supabase-not-available note in this mode.
    > - **Prompts**:
    > - Add `SECURITY_REVIEW_SYSTEM_PROMPT` with structured finding output.
    > - **Supabase**:
    > - Enhance schema query to include `rls_enabled`, split policy
    `using_clause`/`with_check_clause`.
    > - **E2E Tests**:
    > - New `security_review.spec.ts` plus snapshots and fixture findings;
    update test helper for `security` mode and findings table snapshot.
    > - Fake LLM server streams security findings for `/security-review` and
    increases batch size.
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    5022d01e22a2dd929a968eeba0da592e0aeece01. This will update automatically
    on new commits. Configure
    [here](https://cursor.com/dashboard?tab=bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    c50527b4
名称
最后提交
最后更新
..
chat 正在载入提交数据...
home 正在载入提交数据...
preview_panel 正在载入提交数据...
settings 正在载入提交数据...
ui 正在载入提交数据...
AppList.tsx 正在载入提交数据...
AppSearchDialog.tsx 正在载入提交数据...
AppUpgrades.tsx 正在载入提交数据...
AutoApproveSwitch.tsx 正在载入提交数据...
AutoFixProblemsSwitch.tsx 正在载入提交数据...
AutoUpdateSwitch.tsx 正在载入提交数据...
CapacitorControls.tsx 正在载入提交数据...
ChatInputControls.tsx 正在载入提交数据...
ChatList.tsx 正在载入提交数据...
ChatModeSelector.tsx 正在载入提交数据...
ChatPanel.tsx 正在载入提交数据...
ChatSearchDialog.tsx 正在载入提交数据...
CommunityCodeConsentDialog.tsx 正在载入提交数据...
ConfirmationDialog.tsx 正在载入提交数据...
ContextFilesPicker.tsx 正在载入提交数据...
CreateAppDialog.tsx 正在载入提交数据...
CreateCustomModelDialog.tsx 正在载入提交数据...
CreateCustomProviderDialog.tsx 正在载入提交数据...
CreatePromptDialog.tsx 正在载入提交数据...
CustomErrorToast.tsx 正在载入提交数据...
DeleteConfirmationDialog.tsx 正在载入提交数据...
DyadProSuccessDialog.tsx 正在载入提交数据...
EditCustomModelDialog.tsx 正在载入提交数据...
ErrorBoundary.tsx 正在载入提交数据...
GitHubConnector.tsx 正在载入提交数据...
GitHubIntegration.tsx 正在载入提交数据...
HelpBotDialog.tsx 正在载入提交数据...
HelpDialog.tsx 正在载入提交数据...
ImportAppButton.tsx 正在载入提交数据...
ImportAppDialog.tsx 正在载入提交数据...
InputRequestToast.tsx 正在载入提交数据...
LoadingBlock.tsx 正在载入提交数据...
MaxChatTurnsSelector.tsx 正在载入提交数据...
McpConsentToast.tsx 正在载入提交数据...
McpToolsPicker.tsx 正在载入提交数据...
ModelPicker.tsx 正在载入提交数据...
NeonConnector.tsx 正在载入提交数据...
NeonDisconnectButton.tsx 正在载入提交数据...
NeonIntegration.tsx 正在载入提交数据...
NodePathSelector.tsx 正在载入提交数据...
PortalMigrate.tsx 正在载入提交数据...
PriceBadge.tsx 正在载入提交数据...
ProBanner.tsx 正在载入提交数据...
ProModeSelector.tsx 正在载入提交数据...
ProviderSettings.tsx 正在载入提交数据...
ReleaseChannelSelector.tsx 正在载入提交数据...
RuntimeModeSelector.tsx 正在载入提交数据...
SettingsList.tsx 正在载入提交数据...
SetupBanner.tsx 正在载入提交数据...
SetupProviderCard.tsx 正在载入提交数据...
SupabaseConnector.tsx 正在载入提交数据...
SupabaseIntegration.tsx 正在载入提交数据...
TelemetryBanner.tsx 正在载入提交数据...
TelemetrySwitch.tsx 正在载入提交数据...
TemplateCard.tsx 正在载入提交数据...
ThinkingBudgetSelector.tsx 正在载入提交数据...
VercelConnector.tsx 正在载入提交数据...
VercelIntegration.tsx 正在载入提交数据...
app-sidebar.tsx 正在载入提交数据...
appItem.tsx 正在载入提交数据...