清理 reasoning 改造临时计划
删除已完成的五份实施计划 保留里程碑规范与最终验收证据
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
# 【实施计划】Provider reasoning 协议解析
|
||||
|
||||
| 字段 | 值 |
|
||||
| --- | --- |
|
||||
| Milestone | `docs/project-memory/plans/【里程碑】Provider推理与正文分离及策划Agent展示-2026-09-14.md` |
|
||||
| Status | awaiting-review |
|
||||
| Owner | Codex |
|
||||
|
||||
## 修改边界
|
||||
|
||||
本轮只修改 `server-rs/crates/platform-llm/src/lib.rs` 的共享 Provider 解析、流式累计和相关单元测试;不接入策划 Runtime、Tauri 事件、前端 UI,也不修改 GameAgent、HTTP、OpenAPI、SpacetimeDB 或持久化 schema。
|
||||
|
||||
## 实现顺序
|
||||
|
||||
1. 扩展 Chat 与 Responses 的内部响应 DTO/事件提取器,识别 reasoning 文本并继续过滤出正文。
|
||||
2. 将 reasoning 作为独立事件字段进入流式累计;仅在 `capture_reasoning=true` 时写入累计值和回调,默认关闭保持空值。
|
||||
3. 在非流式 Responses/Chat 终态响应中填充 `LlmRunResponse.reasoning`,解析异常降级为空且不影响正文和工具调用。
|
||||
4. 增加协议级测试,覆盖增量顺序、终态快照、content parts、无 reasoning、工具调用共存和默认关闭兼容。
|
||||
|
||||
## 验收标准
|
||||
|
||||
- `reasoning_delta` 与 `delta_text` 分离,`accumulated_text` 永不包含 reasoning。
|
||||
- `capture_reasoning=false` 时 `LlmStreamDelta` 与 `LlmRunResponse` 的 reasoning 字段为空。
|
||||
- `capture_reasoning=true` 时 Chat 的 `reasoning`/`reasoning_content`/reasoning parts、Responses 的 reasoning summary 增量和终态 output 均可累计。
|
||||
- reasoning 缺失或形状未知时不影响正文、工具调用、finish reason 和 Responses 原生 output。
|
||||
- 相关 Rust 测试、格式、编码和 diff 检查通过。
|
||||
|
||||
## 本轮验收证据
|
||||
|
||||
| 证据 | 结果 |
|
||||
| --- | --- |
|
||||
| `cargo test --manifest-path server-rs/Cargo.toml -p platform-llm` | PASS,151 个单元测试通过;真实 Provider 测试按仓库约定保持 ignored |
|
||||
| `cargo fmt --manifest-path server-rs/Cargo.toml --all -- --check` | PASS |
|
||||
| `npm run check:encoding` | PASS,4560 个文件 |
|
||||
| `npm run check:doc-index` | PASS |
|
||||
| `git diff --check` | PASS |
|
||||
|
||||
未验证项:未连接真实 Provider;策划 Runtime、Tauri 事件和前端 UI 属于后续里程碑,本轮未接入。
|
||||
|
||||
## 验证命令
|
||||
|
||||
```text
|
||||
cargo test --manifest-path server-rs/Cargo.toml -p platform-llm
|
||||
cargo fmt --manifest-path server-rs/Cargo.toml --all -- --check
|
||||
npm run check:encoding
|
||||
git diff --check
|
||||
```
|
||||
|
||||
## 风险与回滚点
|
||||
|
||||
- Provider 兼容网关可能把 reasoning 放在未建模字段;提取器采用可选 JSON 读取,失败只丢弃 reasoning。
|
||||
- 终态 summary 可能重复增量;累计逻辑按快照与已有前缀去重。
|
||||
- 若发现正文或工具调用回归,回退本轮解析提交即可,第一轮共享契约仍可独立保留。
|
||||
@@ -1,67 +0,0 @@
|
||||
# 【实施计划】Provider 推理契约与兼容开关
|
||||
|
||||
| 字段 | 值 |
|
||||
| --- | --- |
|
||||
| Milestone | `docs/project-memory/plans/【里程碑】Provider推理与正文分离及策划Agent展示-2026-09-14.md` |
|
||||
| Status | awaiting-review |
|
||||
| Owner | Codex |
|
||||
|
||||
## 修改边界
|
||||
|
||||
允许修改:
|
||||
|
||||
- `server-rs/crates/platform-llm/src/lib.rs` 中的 Provider 请求/响应共享类型;
|
||||
- 受新增字段影响的 Rust 构造点和测试辅助函数;
|
||||
- 与共享字段语义直接相关的单元测试;
|
||||
- 本实施计划文档。
|
||||
|
||||
明确不修改:
|
||||
|
||||
- Responses / Chat reasoning 解析逻辑;
|
||||
- `design_runtime.rs`、Tauri 事件和前端 UI;
|
||||
- GameAgent 的正文过滤、工具调用和消息展示逻辑;
|
||||
- HTTP、OpenAPI、SpacetimeDB 和持久化 schema。
|
||||
|
||||
## 实现顺序
|
||||
|
||||
1. 在 `LlmStreamDelta` 和 `LlmRunResponse` 中增加独立 reasoning 字段,并明确空值语义。
|
||||
2. 在 `LlmRunRequest` 增加默认关闭的 reasoning 捕获开关,确保既有请求默认行为不变。
|
||||
3. 补齐共享层及 AGC Rust 侧全部结构体构造点,新增字段统一使用空值。
|
||||
4. 增加契约级测试,证明默认关闭时正文、工具调用和 finish reason 语义不受影响。
|
||||
5. 检查 GameAgent 及其它调用方仍只读取正文字段,形成第一轮验收证据。
|
||||
|
||||
## 验证命令
|
||||
|
||||
```text
|
||||
cargo test -p platform-llm
|
||||
cargo test --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml
|
||||
npm run check:encoding
|
||||
git diff --check
|
||||
```
|
||||
|
||||
## 风险与回滚点
|
||||
|
||||
- 共享结构体字段增加会触及多个构造点;以编译错误和全量搜索确保没有遗漏。
|
||||
- reasoning 字段只能作为旁路数据,任何正文拼接都不属于本轮范围。
|
||||
- 若发现现有调用方依赖结构体字段数量或序列化形状,停止扩展并回滚共享契约改动。
|
||||
- 本轮可整体回退共享类型与构造点提交,不影响既有策划 UI 预留代码。
|
||||
|
||||
## 第一轮执行记录
|
||||
|
||||
- 已完成:`LlmRunRequest.capture_reasoning` 默认关闭,并提供显式 builder;该字段不会进入 Provider 请求体。
|
||||
- 已完成:`LlmStreamDelta` 增加独立 reasoning 增量/累计字段;本轮所有现有调用点填空值。
|
||||
- 已完成:`LlmRunResponse` 增加独立 reasoning 字段;本轮所有现有解析和恢复构造点填空值。
|
||||
- 已确认:未修改 reasoning 解析逻辑、策划事件、前端 UI、GameAgent 正文过滤和工具调用规则。
|
||||
|
||||
### 第一轮验收证据
|
||||
|
||||
| 证据 | 结果 |
|
||||
| --- | --- |
|
||||
| `cargo test --manifest-path server-rs/Cargo.toml -p platform-llm` | PASS,146 个测试通过 |
|
||||
| `cargo check --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --tests` | PASS |
|
||||
| `cargo fmt --manifest-path server-rs/Cargo.toml --all -- --check` | PASS |
|
||||
| `cargo fmt --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml -- --check` | PASS |
|
||||
| `npm run check:encoding` | PASS |
|
||||
| `git diff --check` | PASS |
|
||||
|
||||
第一轮完成后暂停,等待评审通过再进入 Provider reasoning 解析和策划 Runtime 接通。
|
||||
@@ -1,54 +0,0 @@
|
||||
# 【实施计划】Provider 适配层兼容与 GameAgent 回归
|
||||
|
||||
| 字段 | 值 |
|
||||
| --- | --- |
|
||||
| Milestone | `docs/project-memory/plans/【里程碑】Provider推理与正文分离及策划Agent展示-2026-09-14.md` |
|
||||
| Status | awaiting-review |
|
||||
| Owner | Codex |
|
||||
|
||||
## 修改边界
|
||||
|
||||
本轮覆盖 `server-rs/crates/platform-llm/src/provider_adapter.rs` 与 AGC Runtime 中已有的正文流测试/辅助构造点;不新增 ProviderStreamEvent、HTTP DTO、OpenAPI、SpacetimeDB 字段,也不接入策划 Runtime 或前端 UI。
|
||||
|
||||
## 实现顺序
|
||||
|
||||
1. 核对 neutral Provider adapter 的请求映射保持 `capture_reasoning=false`,并确保适配层不把 reasoning 写入正文 content 或工具调用。
|
||||
2. 用带 reasoning 的 loopback 响应补充 invoke/stream 回归测试,证明适配层仍只向 GameAgent 暴露正文事件。
|
||||
3. 检查 AGC Runtime 的正文流校验、回退和工具调用测试只依赖 `delta_text`/`accumulated_text`/`finish_reason`,必要时补充新增字段为空的构造断言。
|
||||
|
||||
## 验收标准
|
||||
|
||||
- Provider adapter 的普通调用返回正文和工具调用不变,reasoning 不进入 `ProviderResponse.content()`。
|
||||
- Provider adapter 的流式 sink 只收到现有 `ProviderStreamEvent::TextDelta`,reasoning 不改变正文累计和 finish reason。
|
||||
- GameAgent/Agent Runtime 的现有正文流、回退、工具调用测试通过;未新增 reasoning 消费逻辑。
|
||||
- 不修改公开 Provider stream 枚举或 GameAgent 业务协议。
|
||||
|
||||
## 本轮验收证据
|
||||
|
||||
| 证据 | 结果 |
|
||||
| --- | --- |
|
||||
| `cargo test --manifest-path server-rs/Cargo.toml -p platform-llm` | PASS,151 个测试通过 |
|
||||
| `cargo check --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --tests` | PASS;现有编译警告未新增为错误 |
|
||||
| `cargo fmt --manifest-path server-rs/Cargo.toml --all -- --check` | PASS |
|
||||
| `cargo fmt --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml -- --check` | PASS |
|
||||
| `npm run check:encoding` | PASS,4561 个文件 |
|
||||
| `npm run check:doc-index` | PASS,101 份 Markdown |
|
||||
| `git diff --check` | PASS |
|
||||
|
||||
未验证项:未连接真实 Provider;第三轮未引入新的 ProviderStreamEvent,也未接入策划 Runtime/UI。
|
||||
|
||||
## 验证命令
|
||||
|
||||
```text
|
||||
cargo test --manifest-path server-rs/Cargo.toml -p platform-llm
|
||||
cargo check --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --tests
|
||||
cargo fmt --manifest-path server-rs/Cargo.toml --all -- --check
|
||||
cargo fmt --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml -- --check
|
||||
npm run check:encoding
|
||||
git diff --check
|
||||
```
|
||||
|
||||
## 风险与回滚点
|
||||
|
||||
- 若 neutral Provider core 后续需要公开 reasoning 事件,将另开契约变更,不在本轮扩展枚举。
|
||||
- 若 AGC 测试暴露 reasoning 字段被误写入正文,回退 adapter 透传改动,保留共享 Provider 解析结果供策划专用路径使用。
|
||||
@@ -1,50 +0,0 @@
|
||||
# 【实施计划】reasoning 最终回归与验收
|
||||
|
||||
| 字段 | 值 |
|
||||
| --- | --- |
|
||||
| Milestone | `docs/project-memory/plans/【里程碑】Provider推理与正文分离及策划Agent展示-2026-09-14.md` |
|
||||
| Status | awaiting-review |
|
||||
| Owner | Codex |
|
||||
|
||||
## 一句话交付结果
|
||||
|
||||
用确定性回归、文档同步和门禁证据确认 Provider reasoning 旁路不会改变正文、工具调用、GameAgent 或策划会话持久化行为。
|
||||
|
||||
## 修改边界
|
||||
|
||||
本轮只补最终验收所需的测试、当前权威文档和证据记录;不新增协议字段、不扩展真实 Provider、不修改公开 API、SpacetimeDB schema、GameAgent 消费逻辑或 UI 组件。
|
||||
|
||||
## 实施顺序
|
||||
|
||||
1. 核对并补齐 platform-llm 的 reasoning 解析、正文隔离、工具调用共存、默认关闭和解析异常降级测试。
|
||||
2. 核对并补齐策划 Runtime 的 reasoning 事件、重试清理、错误清理和不写入 history 的测试证据。
|
||||
3. 核对 GameAgent、Direct/Codex 与 response stream 只消费正文的回归证据,修正过时的 crate README 语义。
|
||||
4. 更新主技术方案与里程碑状态,整理证据矩阵,运行最终门禁;完成后删除本轮及已完成的临时实施计划。
|
||||
|
||||
## 验收标准
|
||||
|
||||
- Responses 和 Chat 的 reasoning 增量/终态均有确定性测试。
|
||||
- reasoning 永不进入正文、工具参数、正式 assistant message 或策划 history。
|
||||
- reasoning 与工具调用共存、无 reasoning 默认行为、reasoning 解析异常降级均有证据。
|
||||
- 策划 Runtime 的新回合、重试、项目切换和失败路径不会残留旧 reasoning。
|
||||
- GameAgent、Direct/Codex 和 response stream 的正文回归通过。
|
||||
- `cargo test`、`cargo check`、TypeScript、文档索引、编码和 diff 门禁通过;真实 Provider smoke 明确记录为未验证。
|
||||
|
||||
## 风险与回滚点
|
||||
|
||||
- 若补测试暴露正文或工具回归,优先回退调用方接线,不改变默认关闭契约。
|
||||
- 若文档与实现不一致,以源码和测试为准同步修正文档。
|
||||
- 真实 Provider 未连接时不宣称端到端协议 fidelity,只报告固定 fixture 和单元测试证据。
|
||||
|
||||
## 本轮验收证据
|
||||
|
||||
| 证据 | 结果 |
|
||||
| --- | --- |
|
||||
| `cargo test --manifest-path server-rs/Cargo.toml -p platform-llm` | PASS,152 个单元测试;1 个真实 Provider smoke 按需 `#[ignore]` |
|
||||
| `cargo test --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --bin genarrative-ai-game-creator-shell design_runtime` | PASS,10 个策划 Runtime 测试 |
|
||||
| `cargo check --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --tests` | PASS,既有编译警告未升级为错误 |
|
||||
| `npx tsc -p apps/ai-game-creator-shell/tsconfig.json --noEmit` | PASS |
|
||||
| `cargo fmt --all --manifest-path server-rs/Cargo.toml -- --check`、AGC Tauri 同命令 | PASS |
|
||||
| `npm run check:encoding`、`npm run check:doc-index`、`git diff --check` | PASS |
|
||||
|
||||
未验证项:真实 Provider 和浏览器运行时 smoke;`ai-game-creator-shell:typecheck` 中的 `check-config.mjs` 仍受当前 Windows 沙箱私有 DACL 限制,已用独立 TypeScript 检查替代类型门禁。
|
||||
@@ -1,55 +0,0 @@
|
||||
# 【实施计划】策划 Runtime 接通 reasoning 展示
|
||||
|
||||
| 字段 | 值 |
|
||||
| --- | --- |
|
||||
| Milestone | `docs/project-memory/plans/【里程碑】Provider推理与正文分离及策划Agent展示-2026-09-14.md` |
|
||||
| Status | awaiting-review |
|
||||
| Owner | Codex |
|
||||
|
||||
## 修改边界
|
||||
|
||||
本轮只修改策划 Agent 的 Rust Runtime 事件映射、已有 App 状态清理和对应测试;复用现有 `DesignEvent.reasoningText` 与 `ProjectSupervisorView` 折叠展示,不新建 UI 组件,不修改 GameAgent、Direct/Codex、公开 API、SpacetimeDB 或持久化 schema。
|
||||
|
||||
## 实现顺序
|
||||
|
||||
1. 在策划专用 `LlmRunRequest` 上显式开启 `capture_reasoning`,普通 Agent 请求保持默认关闭。
|
||||
2. 将流式 `accumulated_reasoning` 和终态 `response.reasoning` 映射到已有 `reasoningText` 事件;每次 attempt 开始先清空,避免重试残留。
|
||||
3. 在脚本 Provider、成功/失败和项目切换路径补齐 reasoning 生命周期,debug 记录只记长度与受控内容,不把 reasoning 写入会话 history。
|
||||
4. 在 App 现有规划状态重置与事件订阅中清理旧 reasoning,并补充 Runtime/UI 状态测试;复用既有默认折叠展示。
|
||||
|
||||
## 验收标准
|
||||
|
||||
- 策划 Agent 请求显式开启 reasoning 捕获;其它 Agent 请求不受影响。
|
||||
- 流式 reasoning 独立更新 `DesignEvent.reasoningText`,正文事件仍只携带正文累计值。
|
||||
- 重试、新回合、项目切换和错误路径不会残留上一回合 reasoning。
|
||||
- reasoning 不进入 `DesignMessage`、普通 history、工具调用参数或 GameAgent 消息流。
|
||||
- 现有 AGC Runtime 测试、前端相关测试和格式/编码检查通过。
|
||||
|
||||
## 本轮验收证据
|
||||
|
||||
| 证据 | 结果 |
|
||||
| --- | --- |
|
||||
| `cargo test --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --bin genarrative-ai-game-creator-shell design_runtime` | PASS,9 个策划 Runtime 测试通过 |
|
||||
| `cargo check --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --tests` | PASS;仓库既有警告未新增为错误 |
|
||||
| `tsc -p apps/ai-game-creator-shell/tsconfig.json --noEmit` | PASS |
|
||||
| `npm run check:encoding` | PASS,4562 个文件 |
|
||||
| `npm run check:doc-index` | PASS,102 份 Markdown |
|
||||
| `git diff --check` | PASS |
|
||||
|
||||
`npm run ai-game-creator-shell:typecheck` 的 TypeScript 与 skill-pack 检查通过,但其中既有 `check-config.mjs` 在当前 Windows 沙箱设置私有 DACL 时被系统拒绝;已单独运行 `tsc` 完成类型验证。未连接真实 Provider,未做浏览器运行时 smoke。
|
||||
|
||||
## 验证命令
|
||||
|
||||
```text
|
||||
cargo test --manifest-path server-rs/Cargo.toml -p platform-llm
|
||||
cargo test --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --tests
|
||||
npm run ai-game-creator-shell:typecheck
|
||||
npm run check:encoding
|
||||
git diff --check
|
||||
```
|
||||
|
||||
## 风险与回滚点
|
||||
|
||||
- 事件字段已存在但当前为空,优先补事件映射,不改变消息/会话持久化结构。
|
||||
- 终态 reasoning 可能重复流式累计,使用累计值覆盖同一响应槽并以回合开始清空控制生命周期。
|
||||
- 若 UI 状态清理影响规划会话恢复,回退 App 清理补丁,保留 Runtime reasoning 事件契约。
|
||||
Reference in New Issue
Block a user