补充质量检查聊天入口
新增 /qa 质量检查清单和后续草稿 补充 /next 与 /help 的 QA 入口覆盖 同步技术方案和项目决策记录
This commit is contained in:
@@ -1872,6 +1872,7 @@ const chatCommandHelp = [
|
||||
'/criteria:查看当前任务验收标准',
|
||||
'/groups:查看专业组进度',
|
||||
'/budget:查看最近 run 预算',
|
||||
'/qa:查看质量检查清单',
|
||||
'/review:查看 Evaluator 评审和返工焦点',
|
||||
'/context:查看生成上下文来源',
|
||||
'/timeline:查看项目活动时间线',
|
||||
@@ -2817,6 +2818,104 @@ function summarizeProjectPlaytestState(
|
||||
};
|
||||
}
|
||||
|
||||
function summarizeProjectQualityCheck(
|
||||
nextManifest: GameCreationAppManifest,
|
||||
trace: GameCreationAgentRunTrace | null,
|
||||
) {
|
||||
const tasks = taskRowsFromManifest(nextManifest);
|
||||
const completedCount = tasks.filter(
|
||||
(task) => task.status === 'completed',
|
||||
).length;
|
||||
const failedTasks = tasks.filter((task) => task.status === 'failed');
|
||||
const readyCount = selectGameCreationAppReadyTasks({ tasks }).length;
|
||||
const commandRuns = nextManifest.commandRuns ?? [];
|
||||
const latestCommandRun = commandRuns[commandRuns.length - 1] ?? null;
|
||||
const preview = nextManifest.preview;
|
||||
const previewRunning = preview?.status === 'running' && preview.url;
|
||||
const tracePassed = isAgentRunTracePassed(trace);
|
||||
const blockedTrace =
|
||||
trace?.lifecycleStatus === 'killed' ||
|
||||
trace?.status === 'failed' ||
|
||||
trace?.status === 'needs-revision' ||
|
||||
trace?.stopReason === 'max-passes-exhausted';
|
||||
const staticSmokePassed =
|
||||
commandRuns.some(
|
||||
(commandRun) =>
|
||||
commandRun.commandId === 'game.static_smoke' &&
|
||||
commandRun.status === 'completed',
|
||||
) ||
|
||||
Boolean(
|
||||
trace?.steps.some((step) =>
|
||||
step.toolCalls.some(
|
||||
(toolCall) =>
|
||||
toolCall.toolId === 'game.static_smoke' && toolCall.status === 'ok',
|
||||
),
|
||||
),
|
||||
);
|
||||
const latestReviewStep =
|
||||
trace?.steps.filter(isAgentReviewStep).slice(-1)[0] ?? null;
|
||||
const latestPlaytestStep =
|
||||
trace?.steps.filter(isPlaytestTraceStep).slice(-1)[0] ?? null;
|
||||
const evaluatorSummary = !trace
|
||||
? '暂无'
|
||||
: tracePassed
|
||||
? '通过'
|
||||
: blockedTrace
|
||||
? '需返工'
|
||||
: '未通过';
|
||||
const playtestSummary = previewRunning
|
||||
? `预览运行中 ${preview.url}`
|
||||
: tracePassed
|
||||
? '待启动预览'
|
||||
: '等待原型通过';
|
||||
|
||||
let draftCommand = '/publish';
|
||||
let draftCommandLabel = '查看发布准备';
|
||||
if (!trace) {
|
||||
draftCommand = '/next';
|
||||
draftCommandLabel = '查看下一步';
|
||||
} else if (blockedTrace) {
|
||||
draftCommand = '/review';
|
||||
draftCommandLabel = '查看评审';
|
||||
} else if (failedTasks.length > 0) {
|
||||
draftCommand = '/tasks';
|
||||
draftCommandLabel = '查看任务';
|
||||
} else if (!tracePassed) {
|
||||
draftCommand = '/trace';
|
||||
draftCommandLabel = '查看 trace';
|
||||
} else if (!staticSmokePassed || !previewRunning) {
|
||||
draftCommand = '/playtest';
|
||||
draftCommandLabel = '查看试玩状态';
|
||||
}
|
||||
|
||||
return {
|
||||
text: [
|
||||
'质量检查:',
|
||||
trace ? `- Run:${trace.runId} · ${formatAgentRunStatus(trace)}` : null,
|
||||
`- Evaluator:${evaluatorSummary}${
|
||||
latestReviewStep ? ` · ${latestReviewStep.summary}` : ''
|
||||
}`,
|
||||
`- 任务:完成 ${completedCount}/${tasks.length} · ready ${readyCount} · 失败 ${failedTasks.length}`,
|
||||
`- 静态自检:${staticSmokePassed ? '通过' : '未运行'}`,
|
||||
`- 试玩:${playtestSummary}`,
|
||||
`- 最近试玩步骤:${
|
||||
latestPlaytestStep
|
||||
? `${latestPlaytestStep.agent} #${latestPlaytestStep.pass} · ${latestPlaytestStep.status} · ${latestPlaytestStep.summary}`
|
||||
: '暂无'
|
||||
}`,
|
||||
`- 产物:${trace ? `${trace.artifacts.length} 个` : '暂无'}`,
|
||||
latestCommandRun?.status === 'failed'
|
||||
? `- 阻塞:最近命令 ${latestCommandRun.commandId} 失败 · /logs`
|
||||
: null,
|
||||
`- 建议:${draftCommand}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join('\n'),
|
||||
draftCommand,
|
||||
draftCommandLabel,
|
||||
};
|
||||
}
|
||||
|
||||
function summarizeNextProjectActions(
|
||||
nextManifest: GameCreationAppManifest,
|
||||
trace: GameCreationAgentRunTrace | null,
|
||||
@@ -2867,6 +2966,7 @@ function summarizeNextProjectActions(
|
||||
addSuggestion('查看当前任务验收标准', '/criteria');
|
||||
addSuggestion('查看专业组进度', '/groups');
|
||||
}
|
||||
addSuggestion('查看质量检查清单', '/qa');
|
||||
|
||||
if (nextManifest.assets.length > 0) {
|
||||
addSuggestion(`查看 ${nextManifest.assets.length} 个本地资产`, '/assets');
|
||||
@@ -6538,6 +6638,23 @@ export function App() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (prompt === '/qa') {
|
||||
if (!requireChatProjectForUserAction()) {
|
||||
return;
|
||||
}
|
||||
const summary = summarizeProjectQualityCheck(manifest, agentRunTrace);
|
||||
setMessages((current) => [
|
||||
...current,
|
||||
{
|
||||
role: 'assistant',
|
||||
text: summary.text,
|
||||
draftCommand: summary.draftCommand,
|
||||
draftCommandLabel: summary.draftCommandLabel,
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (prompt === '/review') {
|
||||
if (!requireChatProjectForUserAction()) {
|
||||
return;
|
||||
|
||||
@@ -2371,6 +2371,70 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
),
|
||||
).toHaveLength(runLocalCountBeforeBudget);
|
||||
|
||||
const fileReadCountBeforeQa = invoke.mock.calls.filter(
|
||||
([command]) => command === 'read_local_project_file',
|
||||
).length;
|
||||
const manifestReadCountBeforeQa = invoke.mock.calls.filter(
|
||||
([command]) => command === 'get_local_game_manifest',
|
||||
).length;
|
||||
const runLocalCountBeforeQa = invoke.mock.calls.filter(
|
||||
([command]) => command === 'run_limited_local_command',
|
||||
).length;
|
||||
const startPreviewCountBeforeQa = invoke.mock.calls.filter(
|
||||
([command]) => command === 'start_local_game_preview',
|
||||
).length;
|
||||
const openPreviewCountBeforeQa = invoke.mock.calls.filter(
|
||||
([command]) => command === 'open_local_game_preview',
|
||||
).length;
|
||||
submitChat('/qa');
|
||||
expect(await screen.findByText(/质量检查:/)).not.toBeNull();
|
||||
const qaMessages = screen.getAllByText(/质量检查:/);
|
||||
const qaMessage = qaMessages[qaMessages.length - 1];
|
||||
expect(qaMessage.textContent).toContain(
|
||||
'Run:run-main-shortcut-trace · passed / done · 1/3 轮 · evaluator-passed',
|
||||
);
|
||||
expect(qaMessage.textContent).toContain('Evaluator:通过 · 质量评审通过');
|
||||
expect(qaMessage.textContent).toContain(
|
||||
'任务:完成 0/16 · ready 1 · 失败 0',
|
||||
);
|
||||
expect(qaMessage.textContent).toContain('静态自检:通过');
|
||||
expect(qaMessage.textContent).toContain('试玩:待启动预览');
|
||||
expect(qaMessage.textContent).toContain('产物:3 个');
|
||||
expect(qaMessage.textContent).toContain('建议:/playtest');
|
||||
const qaDraftButtons = screen.getAllByRole('button', {
|
||||
name: '查看试玩状态',
|
||||
});
|
||||
fireEvent.click(qaDraftButtons[qaDraftButtons.length - 1]);
|
||||
expect(screen.getByLabelText('创作想法')).toHaveProperty(
|
||||
'value',
|
||||
'/playtest',
|
||||
);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'read_local_project_file',
|
||||
),
|
||||
).toHaveLength(fileReadCountBeforeQa);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'get_local_game_manifest',
|
||||
),
|
||||
).toHaveLength(manifestReadCountBeforeQa);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'run_limited_local_command',
|
||||
),
|
||||
).toHaveLength(runLocalCountBeforeQa);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'start_local_game_preview',
|
||||
),
|
||||
).toHaveLength(startPreviewCountBeforeQa);
|
||||
expect(
|
||||
invoke.mock.calls.filter(
|
||||
([command]) => command === 'open_local_game_preview',
|
||||
),
|
||||
).toHaveLength(openPreviewCountBeforeQa);
|
||||
|
||||
const fileReadCountBeforeReview = invoke.mock.calls.filter(
|
||||
([command]) => command === 'read_local_project_file',
|
||||
).length;
|
||||
@@ -2388,13 +2452,13 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
).length;
|
||||
submitChat('/review');
|
||||
expect(await screen.findByText(/评审状态:/)).not.toBeNull();
|
||||
expect(screen.getByText(/Evaluator:通过/)).not.toBeNull();
|
||||
expect(screen.getByText(/返工焦点:暂无/)).not.toBeNull();
|
||||
expect(
|
||||
screen.getByText(/评审记录:\/read \.agent\/findings\.md/),
|
||||
).not.toBeNull();
|
||||
const reviewMessages = screen.getAllByText(/评审状态:/);
|
||||
const reviewMessage = reviewMessages[reviewMessages.length - 1];
|
||||
expect(reviewMessage.textContent).toContain('Evaluator:通过');
|
||||
expect(reviewMessage.textContent).toContain('返工焦点:暂无');
|
||||
expect(reviewMessage.textContent).toContain(
|
||||
'评审记录:/read .agent/findings.md',
|
||||
);
|
||||
expect(reviewMessage.textContent).toContain(
|
||||
'Evaluator #1 · passed · 质量评审通过',
|
||||
);
|
||||
@@ -2643,6 +2707,7 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
expect(screen.getByText(/查看 .* 个 ready 任务:\/tasks/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看当前任务验收标准:\/criteria/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看专业组进度:\/groups/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看质量检查清单:\/qa/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看美术素材:\/art/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看发布准备清单:\/publish/)).not.toBeNull();
|
||||
expect(screen.getByText(/查看试玩状态:\/playtest/)).not.toBeNull();
|
||||
@@ -8544,6 +8609,7 @@ describe('AI 游戏创作 App 界面边界', () => {
|
||||
expect(screen.getByText(/\/criteria:查看当前任务验收标准/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/groups:查看专业组进度/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/budget:查看最近 run 预算/)).not.toBeNull();
|
||||
expect(screen.getByText(/\/qa:查看质量检查清单/)).not.toBeNull();
|
||||
expect(
|
||||
screen.getByText(/\/review:查看 Evaluator 评审和返工焦点/),
|
||||
).not.toBeNull();
|
||||
|
||||
@@ -3870,6 +3870,7 @@
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/criteria` 查看当前任务验收标准,只基于当前 manifest.tasks 和最近 run trace.taskGraph 汇总 active、carry、ready、失败或待处理任务的验收条件和产物,并提供 `/tasks` 草稿;该入口不得触发 Tauri 读写、不得读取任务文件或 trace 文件,也不得新增普通用户验收面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/groups` 查看专业组进度,只基于当前 manifest.tasks 和最近 run trace.taskGraph / passPlans 汇总六个专业组的完成、active、carry、ready、失败数量和下一步任务,并提供 `/tasks` 草稿;该入口不得触发 Tauri 读写、不得读取任务文件或 trace 文件,也不得新增普通用户专业组面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/budget` 查看最近 run 预算,只基于当前最近 run trace 汇总轮次、工具调用、stopReason 和下一步建议,并提供 `/review`、`/publish`、`/trace` 或 `/next` 草稿;该入口不得触发 Tauri 读写、不得读取 trace 文件,也不得新增普通用户预算面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/qa` 查看质量检查清单,只基于当前 manifest、最近 run trace、最近命令和 preview 状态汇总 Evaluator、任务、静态自检、试玩和产物状态,并提供 `/review`、`/tasks`、`/trace`、`/playtest`、`/publish` 或 `/next` 草稿;该入口不得触发 Tauri 读写、不得读取 trace 或日志文件、不得启动或打开预览,也不得新增普通用户 QA 面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/review` 查看 Evaluator 评审状态,只基于主窗口当前已加载的最近 run trace 派生通过 / 需返工状态、返工焦点、返工路线和最近评审步骤,并提供 `/read .agent/findings.md` 或 `/agent-resume ` 草稿;该入口不得直接读取评审文件、不得触发 Tauri 读写,也不得新增普通用户评审面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/context` 查看生成上下文来源,只基于当前 manifest 和最近 run trace 列出项目对话、短期记忆、长期记忆、项目黑板、Agent 对话、Agent 私有记忆、manifest、最近 trace 和最近 LLM 输入路径,并提供 `/read` 或 `/memory blackboard` 草稿;该入口不得触发 Tauri 读写、不得读取上下文文件,也不得新增普通用户上下文面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/timeline` 查看项目活动时间线,只基于当前 manifest.commandRuns 和最近 run trace 汇总最近命令、日志读取草稿和最近 Agent 步骤,并提供 `/read`、`/trace` 或 `/history` 草稿;该入口不得触发 Tauri 读写、不得读取日志或 trace 文件,也不得新增普通用户时间线面板。
|
||||
@@ -3883,7 +3884,7 @@
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/art` 查看美术素材,只基于当前 manifest 盘点图片、视频和序列帧素材的数量、来源、画板接入状态和路径,并提供 `/generate-art 首版核心美术素材` 或 `/read assets/manifest.art.json` 草稿;该入口不得触发 Tauri 读写、平台生成、画板同步或新增普通用户美术面板。
|
||||
- 2026-07-03 调整:主窗口新增音效登记和画板音频导入快捷入口,只填入 `/asset-register assets/audio/sfx.wav audio audio/wav` 或 `/import-canvas-asset assets/audio/sfx.wav ` 草稿;聊天输入 `/audio` 只基于当前 manifest 盘点音频素材、来源和路径,并给出登记音效或读取 `assets/manifest.audio.json` 的草稿。音乐组仍复用现有资产登记 / 画板回流链路,不新增独立音频生成系统。
|
||||
- 2026-07-03 调整:主窗口新增常用生成产物读取入口,只把入口 HTML、设计、数值、美术清单、音频清单和发布说明对应的 `/read` 草稿填入聊天输入框;聊天命令 `/artifacts` 只列出同一组固定读取命令并提供首个读取草稿,`/run-artifacts` 只列出最近 trace 里的产物读取命令并提供首个 `/read` 草稿,`/logs` 只列出固定日志读取命令;实际读取仍走聊天侧 `file.read` 权限流,不直接读本地文件。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/next` 触发下一步建议入口,只基于主窗口当前已加载的 manifest、最近 run trace 和最近命令摘要生成聊天建议,列出 `/tasks`、`/criteria`、`/groups`、`/budget`、`/trace`、`/review`、`/context`、`/timeline`、`/playtest`、`/run`、`/open-preview`、`/assets`、`/art`、`/audio`、`/publish`、`/artifacts`、`/run-artifacts`、`/passes`、`/run-files`、`/internals`、`/logs`、`/agent-resume ` 等安全命令草稿方向,并提供一个首选草稿;该命令不得直接执行 Tauri 读写、启动或打开预览、读取本地文件,也不得绕过原有命令确认和 `file.read` 权限流。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/next` 触发下一步建议入口,只基于主窗口当前已加载的 manifest、最近 run trace 和最近命令摘要生成聊天建议,列出 `/tasks`、`/criteria`、`/groups`、`/budget`、`/qa`、`/trace`、`/review`、`/context`、`/timeline`、`/playtest`、`/run`、`/open-preview`、`/assets`、`/art`、`/audio`、`/publish`、`/artifacts`、`/run-artifacts`、`/passes`、`/run-files`、`/internals`、`/logs`、`/agent-resume ` 等安全命令草稿方向,并提供一个首选草稿;该命令不得直接执行 Tauri 读写、启动或打开预览、读取本地文件,也不得绕过原有命令确认和 `file.read` 权限流。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/publish` 生成发布准备清单,只基于主窗口当前已加载的 manifest、最近 run trace、预览状态、资产来源和最近命令摘要列出原型通过、预览、任务、资产、音频、包装说明和试玩包状态,并提供 `/run`、`/trace`、`/agent-resume ` 或 `/export` 草稿;该入口不得触发 Tauri 读写、不得启动或打开预览、不得读取文件,也不得新增普通用户发布面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/internals` 只列出 `.agent/manifest.json`、`.agent/run.latest.json`、`.agent/spec.md`、`.agent/findings.md`、`.agent/policy.json`、`.agent/project.index.json`、`.agent/agent.db` 和 `.agent/conversations/project.jsonl` 的 `/read` 草稿,并提供首个读取草稿;该入口不得直接读取内部文件、不得触发 Tauri 读写,也不得新增普通用户内部文件面板。
|
||||
- 2026-07-03 调整:普通用户通过聊天输入 `/passes` 只从当前已加载的最近 run trace artifacts 中筛选 `.agent/passes/` 轮次产物,列出 `/read` 草稿并提供首个读取草稿;该入口不得直接读取轮次文件、不得触发 Tauri 读写,也不得新增普通用户轮次面板。
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user