Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions BitFun-Installer/src/i18n/generatedLocaleContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const SHARED_TERMS_BY_APP_LANGUAGE = {
"features": {
"remoteControl": "Remote Control",
"codeAgent": "Code Agent",
"deepReview": "Deep Review",
"deepReview": "Review: Strict",
"settings": "Settings",
"workspace": "Workspace",
"accountLogin": "Account Login"
Expand Down Expand Up @@ -110,7 +110,7 @@ export const SHARED_TERMS_BY_APP_LANGUAGE = {
"features": {
"remoteControl": "远程控制",
"codeAgent": "代码助手",
"deepReview": "深度代码评审",
"deepReview": "严格审查",
"settings": "设置",
"workspace": "工作区",
"accountLogin": "账户登录"
Expand Down Expand Up @@ -161,7 +161,7 @@ export const SHARED_TERMS_BY_APP_LANGUAGE = {
"features": {
"remoteControl": "遠端控制",
"codeAgent": "程式碼助手",
"deepReview": "深度程式碼審查",
"deepReview": "嚴格審查",
"settings": "設定",
"workspace": "工作區",
"accountLogin": "帳號登入"
Expand Down
39 changes: 24 additions & 15 deletions docs/architecture/deep-review.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# DeepReview Architecture
# DeepReview / Strict Review Architecture

## Scope

DeepReview is a child-session workflow that runs a configurable Code Review Team against a review target. The current implementation has three layers:
DeepReview is the compatibility runtime for `Review: Strict`, the highest-strength mode of the unified Review experience. It remains implemented as a child-session workflow that runs a configurable read-only reviewer set against a review target, but it should not be presented as a second ordinary product entry next to Review.

Product-facing guardrails live in [review-verify-implementation-guardrails.md](../sdlc-harness/review-verify-implementation-guardrails.md):

- `Review` is the primary user-facing entry.
- `/review` is the intended long-term command entry; `/DeepReview` is only a transitional typed compatibility command for historical strict-review launches.
- `ReviewTeam` is an internal strict-review reviewer-set configuration, not a separate product concept users must learn.
- PR Review consumes review/verify results and readiness projections; it must not own another reviewer executor.

The current implementation has three layers:

- Frontend launch and UI orchestration in `src/web-ui`.
- Platform adapter commands in `src/apps/desktop/src/api/agentic_api.rs`.
- Platform-agnostic runtime policy, task admission, queue state, retry metadata, and report enrichment in `src/crates/assembly/core/src/agentic`.

The backend does not choose the review target or build the launch manifest. The frontend builds the effective `ReviewTeamRunManifest`, persists it on the DeepReview child session, and sends it with the first user message.
The backend does not choose the review target or build the launch manifest. The frontend builds the effective `ReviewTeamRunManifest`, persists it on the DeepReview child session, and sends it with the first user message. The manifest, session kind, agent type, storage keys, and queue event names stay compatible with historical DeepReview sessions.

## Runtime Roles

Expand All @@ -29,14 +38,14 @@ The reviewer agents use instruction-only context and read/search/git/diff tools.

## Launch Flow

DeepReview can be launched from session-file review controls or a `/DeepReview` slash command.
Strict Review can currently be launched from session-file review controls or the canonical typed `/review strict` command. Historical `/DeepReview` and `/deepreview` inputs remain compatibility aliases that route into the same strict Review path, but new product entry points should route through unified Review and `/review`, then select strict review only when task scope, difficulty, risk, explicit quality intent, and budget justify L3.

Frontend launch code lives in `src/web-ui/src/flow_chat/deep-review/launch`:

- `commandParser.ts` identifies `/DeepReview` commands and optional file or git targets.
- `commandParser.ts` identifies canonical `/review strict` commands, transitional `/DeepReview` compatibility aliases, and optional file or git targets.
- `targetResolver.ts` resolves slash-command targets from git status, changed files, and diffs when a workspace is available.
- `launchPrompt.ts` formats the user-facing launch prompt.
- `DeepReviewService.ts` builds the review-team manifest, creates a child session, opens it in the auxiliary pane, sends the launch prompt, and inserts the parent-session summary marker.
- `DeepReviewService.ts` builds the review-team manifest, creates a child session, sends the launch prompt, and inserts the parent-session summary marker. Launch does not automatically open the auxiliary pane; the summary-card detail action is the normal user-facing way to inspect the background review run.
- `src/web-ui/src/flow_chat/services/DeepReviewService.ts` is a compatibility re-export.

`launchDeepReviewSession` creates a child session with:
Expand All @@ -49,11 +58,11 @@ Frontend launch code lives in `src/web-ui/src/flow_chat/deep-review/launch`:
- context compression enabled
- `deepReviewRunManifest` stored on the child session metadata

If launch fails after the child session is created, the frontend closes the auxiliary pane, deletes the backend session when possible, discards local session state, and reports cleanup issues with the launch error.
If launch fails after the child session is created, the frontend runs idempotent UI/session cleanup, deletes the backend session when possible, discards local session state, and reports cleanup issues with the launch error.

## Review Team Configuration
## Strict Reviewer Configuration

The default review team contract is mirrored in Rust and TypeScript.
The default strict reviewer configuration contract is mirrored in Rust and TypeScript.

Rust source:

Expand All @@ -72,8 +81,8 @@ The desktop command `get_default_review_team_definition` returns the backend def
The persisted config path is `ai.review_teams.default`. The frontend config shape includes:

- extra subagent ids
- team strategy level
- per-member strategy overrides
- review strategy level
- per-reviewer strategy overrides
- reviewer and judge timeouts
- reviewer file-split threshold
- max same-role instances
Expand All @@ -83,7 +92,7 @@ The persisted config path is `ai.review_teams.default`. The frontend config shap
- provider capacity queue enablement
- bounded auto-retry enablement and elapsed guard

Extra team members must be enabled subagents with read-only review tooling. Core team members, `DeepReview`, and `ReviewFixer` are disallowed as extra members.
Extra reviewers must be enabled subagents with read-only review tooling. Core reviewers, `DeepReview`, and `ReviewFixer` are disallowed as extra reviewers.

## Manifest Shape

Expand Down Expand Up @@ -290,6 +299,6 @@ The review action bar persists UI state separately through `ReviewActionBarPersi
When changing DeepReview behavior, update all affected contracts together:

- Backend constants, team definition, execution policy, manifest gate, task adapter, queue events, and report enrichment.
- Frontend review-team defaults/types, manifest builder, prompt block, launch service, action-bar store, event mapping, report rendering, and locales.
- Desktop Tauri command DTOs when queue controls or default team definition contracts change.
- Tests near the touched module, especially policy tests, review-team manifest tests, queue event tests, launch tests, action-bar tests, and locale completeness tests.
- Frontend strict-review defaults/types, manifest builder, prompt block, launch service, action-bar store, event mapping, report rendering, and locales.
- Desktop Tauri command DTOs when capacity controls or default review definition contracts change.
- Tests near the touched module, especially policy tests, strict-review manifest tests, queue event tests, launch tests, action-bar tests, and locale completeness tests.
2 changes: 1 addition & 1 deletion docs/architecture/theme-token-optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ Phase 5 决策记录:

| low-external implementation key compression | retire preview/editor/gallery/MissionControl/mobile helper keys | `tokens.scss`, Markdown editor/Tiptap styles, component preview CSS/examples, GalleryLayout, MissionControl, NavSearchDialog, ContextMenu, Select, config/profile form styles, `src/mobile-web/src/theme/presets/shared.ts`, mobile SCSS | 将只表达局部实现或严格同义的低外部使用 key 移出 static root:Markdown editor list/task sizing、Markdown line-number gutter、gallery grid/skeleton defaults、preview palette/timing、旧 `flowchat-card-header-pad-*` 别名、`border-focus` 同义别名、glass green/disabled helper、MissionControl group helper 和 slate22 shadow helper。MissionControl 的组别区分保留为组件私有 modifier class,并继续使用 accent/success/warning;active filter 和 thumbnail badge 使用中性底加彩色指示,避免小字号实底语义色造成对比或状态误解;preview 和 gallery 不作为主题扩展入口;`--easing-smooth` 与 `--easing-standard` 当前同值,统一读 standard;mobile-web 同步删除未使用的 `--motion-instant`、同值 `--easing-smooth` 和不应作为主题扩展入口的 `--easing-decelerate`,现有 decelerate 动画由 mobile-local Sass owner 承载并补齐 reduced-motion 覆盖。该轮不触碰 Git added/staged/deleted、button payload、z-index、card/tool-card 跨组件布局等仍可能承担主题或相邻区域语义的 key。static root contract 320 -> 289,low external usage key 116 -> 86;普通 app raw、unresolved、fallback-only、non-contract 均保持 0,mobile color audit 保持通过。 |
| installer and utility contract compression | retire simple-surface ramp and utility helper keys | `BitFun-Installer/src/theme/installerThemesData.ts`、`installerThemeRuntime.ts`、`variables.css`、`global.css`、installer language/theme pages、`tokens.scss`、`ThemeService.ts`、web utility CSS | 安装器只保留主题卡和安装流程实际可见的单一 accent seed,弱强调背景、focus 边框和 step shadow 改由局部 `color-mix()` 派生,不再导出完整 accent ramp;同时删除 motion/header、`border-medium`、`element-bg-strong` 等实现型 key。web root 侧删除 z-index、glass shadow、hover/focus opacity 等不表达主题语义的 utility helper;z-index 作为局部层级常量保留,glass shadow 读取 canonical `--shadow-*`,opacity 使用局部常量。generated widget iframe static shell 仍保留历史 helper 名称作为边界 fallback,不重新进入 app/root 主题扩展入口。static root contract 289 -> 274,low external usage key 86 -> 72,runtime contract 114 -> 108;installer color occurrences 76 -> 61,unique colors 62 -> 49,static root 29 -> 17,low external usage key 21 -> 10,runtime contract 18 -> 14。普通 app raw、unresolved、fallback-only、non-contract 和 dynamic family 错误保持 0。 |
| local surface helper compression | remove root defaults for local-only helpers | `tokens.scss`、`surface-stagger.scss`、gallery/agent/skill/miniapp/profile card styles、`UserMessage.*`、`ReviewTeamPage.*`、profile quick input styles | 删除不属于主题扩展入口的局部默认 key:卡片 stagger index 从 root contract 移到共享 Sass mixin,保留同一动态输入名但避免跨文件游离 key;FlowChat inline tag 删除未引用 CSS 和无效颜色透传,继续由组件库 `Tag` 的语义色驱动;profile inline padding 改回 Sass spacing;review team member 默认色复用 `UI_EXCEPTION_ACCENTS` 常量。`--scene-viewport-border-width` 经复审保留静态默认,因为它是 ThemeService layout runtime key 且影响首屏边框宽度。static root contract 274 -> 270,low external usage key 72 -> 69,token contract unique colors 81 -> 80;fallback、unresolved、non-contract 和 dynamic family 错误保持 0。 |
| local surface helper compression | remove root defaults for local-only helpers | `tokens.scss`、`surface-stagger.scss`、gallery/agent/skill/miniapp/profile card styles、`UserMessage.*`、strict review settings styles、profile quick input styles | 删除不属于主题扩展入口的局部默认 key:卡片 stagger index 从 root contract 移到共享 Sass mixin,保留同一动态输入名但避免跨文件游离 key;FlowChat inline tag 删除未引用 CSS 和无效颜色透传,继续由组件库 `Tag` 的语义色驱动;profile inline padding 改回 Sass spacing;strict review member 默认色复用 `UI_EXCEPTION_ACCENTS` 常量。`--scene-viewport-border-width` 经复审保留静态默认,因为它是 ThemeService layout runtime key 且影响首屏边框宽度。static root contract 274 -> 270,low external usage key 72 -> 69,token contract unique colors 81 -> 80;fallback、unresolved、non-contract 和 dynamic family 错误保持 0。 |
| root/layout and widget projection compression | retire exact aliases and shrink widget payload | `tokens.scss`、`ThemeService.ts`、generated widget `themePayload.ts`、Card/SplashScreen/tool-card/config/Markdown/Tiptap/utility styles | 删除或本地化不承担主题语义的 exact alias:Splash 直接读 `--color-bg-primary`,Card elevated/subtle 复用 hover/transparent,scrollbar helper 改读 `--scrollbar-thumb`,glass utility 改读 canonical `--blur-*`,tool-card 固定布局 key 改为局部常量或既有 FlowChat token,Markdown/Tiptap table radius、pre radius/border style/font size、td foreground 和 code font 复用现有 contract;Config page 大间距改为本地布局值。generated widget payload 不再读取 shape/spacing/font size/font weight,iframe fallback/static shell 继续提供历史 radius/spacing 和本地布局默认,button component token 继续保留。该轮不触碰 Git added/staged/deleted、button projection、tooltip background、scene viewport border、accent/purple ramp 等仍承担状态或主题识别的 key。static root contract 270 -> 250,low external usage key 69 -> 51,generated widget payload 80 -> 57;普通 app raw、unresolved、fallback-only、non-contract 和 dynamic family 错误保持 0。 |
| low-external contract compression | localize card surfaces and retire narrow ramp stops | `tokens.scss`、`ThemeService.ts`、theme types/presets、`ThemeService.test.ts`、Card/Tag/Tabs/WindowControls/utility/FlowChat/workspace/diff styles | `--card-bg-*` 不再作为 root/runtime 主题入口,Card 内部用私有 `--v-card-*` 保留明暗主题 default/hover/active/accent 层级,组件外消费改读既有 `--element-bg-*`、`--color-accent-*`、`--color-purple-*`;`windowControls.close.hoverColor` 旧入口和 `--window-control-close-hover-color` runtime-only key 删除,关闭按钮统一读 `--color-error`;app root/runtime 的 `--color-purple-50/400/800`、`--color-accent-800`、`--font-weight-bold` 及对应 TS theme schema/preset authoring 字段移除或改为局部 `color-mix()`、`--font-weight-semibold`,避免新主题继续维护不投影的扩展字段;旧 custom theme 中的这些退役字段会在归一化、持久化和导出时剥离。generated widget iframe compatibility/static shell 仍保留历史 `--color-accent-800` fallback,不重新进入 app root/runtime contract。static root contract 211 -> 199,low external usage key 26 -> 18,runtime-only required 1 -> 0,token unique 177 -> 171,web unique colors 302 -> 296;普通 app raw、unresolved、fallback-only、non-contract 和 dynamic family 错误保持 0。 |
| background and utility contract retirement | retire low-external aliases and unused authoring stops | `tokens.scss`、`ThemeService.ts`、theme types/presets、generated widget `themePayload.ts` / compatibility aliases、mobile theme presets、Tooltip/SceneBar/Insights/utility/FlowChat styles | `colors.background.quaternary`、`colors.background.tooltip`、`colors.element.elevated` 不再作为主题 authoring/runtime/root contract,旧 custom theme 字段在归一化、持久化和导出时剥离;消费侧改读 `--color-bg-elevated`、`--color-bg-secondary` 或 `--element-bg-strong` 的局部派生,generated widget payload 停止读取 `--element-bg-elevated`,历史 iframe 内容通过 alias fallback 映射到 `--element-bg-strong`;app 静态 root 不再导出 `--flowchat-font-size-4xl`,utility 对 `--size-radius-xl` / `--blur-base` 的低价值读取改为局部值,runtime 可配置 `--size-radius-*` / `--blur-*` family 与 widget iframe shell fallback 仍由各自 owner 维护;Welcome/Nav/utility 样式使用局部派生或 Sass 私有 helper,mobile 删除未使用的 quaternary/tooltip/elevated root 默认。复审后保留 button payload 18 个交互 token、`--scene-viewport-border-width` 和 0.12/0.15 黑白 overlay stop,因为它们分别承担 iframe 主题按钮识别、首屏布局边界和相邻 surface/elevation 层级。static root contract 199 -> 193,low external usage key 18 -> 12,generated widget payload 57 -> 56,token unique 171 -> 168,theme preset 166/113 -> 159/112,token contract 82/74 -> 80/72;普通 app raw、unresolved、fallback-only、non-contract 和 dynamic family 错误保持 0。 |
Expand Down
4 changes: 0 additions & 4 deletions docs/development/ui-testids-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,17 +356,13 @@
| Agent 详情工具项 | `agent-detail-tool-item` | 重复的已启用工具项。包含 `data-tool-name`。 |
| Agent 详情关闭按钮 | `agent-detail-close` | 详情弹窗关闭按钮。 |
| Core 锚点按钮 | `agents-anchor-core` | 滚动到 core agents 区域。 |
| Teams 锚点按钮 | `agents-anchor-teams` | 滚动到 teams 区域。 |
| Custom agents 锚点按钮 | `agents-anchor-custom` | 滚动到 custom agents 区域。 |
| Agents 搜索按钮 | `agents-search-btn` | 搜索后缀按钮。 |
| Core agents 区域 | `agents-core-zone` | Core agents section。 |
| Teams 区域 | `agents-teams-zone` | Agent teams section。 |
| Custom agents 区域 | `agents-custom-zone` | Custom/subagent section。 |
| Review team 配置按钮 | `agents-review-team-configure-btn` | 打开 review team 配置。 |
| Agent source 过滤器 | `agents-source-filter` | 重复项。配合 `data-agent-source` 使用。 |
| Agent kind 过滤器 | `agents-kind-filter` | 重复项。配合 `data-agent-kind` 使用。 |
| 创建 agent 按钮 | `agents-create-agent-btn` | 打开 custom agent 创建页。 |
| Agent team 卡片 | `agents-team-card` | 重复项。配合 `data-team-id` 使用。 |
| BTW 停止 review 按钮 | `btw-session-panel-stop-review` | 从 BTW 面板停止 review session。 |
| BTW origin 按钮 | `btw-session-panel-origin-button` | 从 BTW 面板打开 origin session。 |

Expand Down
4 changes: 0 additions & 4 deletions docs/development/ui-testids.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,17 +356,13 @@ Notes:
| Agent detail tool item | `agent-detail-tool-item` | Repeated enabled tool item. Includes `data-tool-name`. |
| Agent detail close | `agent-detail-close` | Modal close button. |
| Core anchor button | `agents-anchor-core` | Scrolls to core agents zone. |
| Teams anchor button | `agents-anchor-teams` | Scrolls to teams zone. |
| Custom agents anchor button | `agents-anchor-custom` | Scrolls to custom agents zone. |
| Agents search button | `agents-search-btn` | Search suffix button. |
| Core agents zone | `agents-core-zone` | Core agents section. |
| Teams zone | `agents-teams-zone` | Agent teams section. |
| Custom agents zone | `agents-custom-zone` | Custom/subagent section. |
| Review team configure button | `agents-review-team-configure-btn` | Opens review team configuration. |
| Agent source filter | `agents-source-filter` | Repeated item. Pair with `data-agent-source`. |
| Agent kind filter | `agents-kind-filter` | Repeated item. Pair with `data-agent-kind`. |
| Create agent button | `agents-create-agent-btn` | Opens custom agent creation page. |
| Agent team card | `agents-team-card` | Repeated item. Pair with `data-team-id`. |
| BTW stop review button | `btw-session-panel-stop-review` | Stops review session from BTW panel. |
| BTW origin button | `btw-session-panel-origin-button` | Opens origin session from BTW panel. |

Expand Down
Loading
Loading