Commit Graph

3226 Commits

Author SHA1 Message Date
lhk229 d9530047db 兼容缺少槽位的非工具 Responses 事件
Project CI / Repository checks (pull_request) Successful in 2m41s
Project CI / Frontend tests (pull_request) Successful in 3m13s
Project CI / Backend tests (pull_request) Successful in 6m10s
Project CI / Native shell tests (pull_request) Successful in 19m54s
非 function_call output item 缺少 output_index 时忽略

保留 function_call 槽位缺失的 fail-closed 契约并补回归测试
2026-09-11 12:33:37 +00:00
lhk229 8012008d83 替换文档占位符
Project CI / Repository checks (pull_request) Successful in 2m24s
Project CI / Frontend tests (pull_request) Successful in 2m45s
Project CI / Backend tests (pull_request) Successful in 6m5s
Project CI / Native shell tests (pull_request) Successful in 18m40s
2026-09-11 12:22:46 +00:00
lhk229 8528c5ffce 修复直接创作首轮消息被误抑制
Project CI / Repository checks (pull_request) Successful in 2m26s
Project CI / Frontend tests (pull_request) Successful in 3m2s
Project CI / Backend tests (pull_request) Successful in 5m38s
Project CI / Native shell tests (pull_request) Successful in 19m38s
仅在顾问态切换到 GameAgent 时禁止自动首轮调用

恢复普通直接创作入口的初始需求投递
2026-09-11 12:12:24 +00:00
lhk229 3047434b33 接入策划顾问态做成游戏运行时切换
Project CI / Frontend tests (pull_request) Failing after 2m24s
Project CI / Repository checks (pull_request) Failing after 2m42s
Project CI / Native shell tests (pull_request) Failing after 5m45s
Project CI / Backend tests (pull_request) Successful in 6m46s
新增项目 Agent 运行时模式持久化与恢复判断

在顾问态增加做成游戏按钮并切换同项目 DirectProject

切换时不自动发起首轮 Provider 请求
2026-09-11 12:01:38 +00:00
lhk229 f8f1cdd1f4 清理未使用的策划会话入口
Project CI / Repository checks (pull_request) Successful in 2m46s
Project CI / Frontend tests (pull_request) Successful in 3m20s
Project CI / Backend tests (pull_request) Successful in 5m46s
Project CI / Native shell tests (pull_request) Successful in 17m26s
删除硬编码 quality 模型的 ensure_design_session

保留现有 selected_model_id 创建链路
2026-09-11 11:28:47 +00:00
lhk229 1102b5af23 Merge remote-tracking branch 'origin/master' into design_agent_refactor
Project CI / Repository checks (pull_request) Successful in 2m24s
Project CI / Frontend tests (pull_request) Successful in 3m13s
Project CI / Backend tests (pull_request) Successful in 6m15s
Project CI / Native shell tests (pull_request) Successful in 18m32s
2026-09-11 11:22:29 +00:00
lhk229 fd5a4c3136 调整策划调试日志默认开关
Project CI / Repository checks (pull_request) Failing after 13s
Project CI / Backend tests (pull_request) Failing after 13s
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
npm run agc 开发启动时默认开启 design debug

其他启动方式默认不创建 .debug 目录
2026-09-11 11:21:07 +00:00
lhk229 63f5a1d49e 精简项目写锁历史型注释
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 2m51s
Project CI / Native shell tests (pull_request) Successful in 18m39s
移除 Issue 编号和旧实现叙述

保留写锁等待与排障契约说明
2026-09-11 11:10:57 +00:00
lhk229 811abdd375 修复策划 Agent 四个审查问题
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 2m40s
Project CI / Native shell tests (pull_request) Successful in 17m42s
修复 Retry 流式回合身份与阶段审批 transient 清理

拒绝无效 write_file 内容并补齐顾问阶段导轨
2026-09-11 10:57:49 +00:00
lhk229 712f28e207 策划工作区改名为design_artifacts
Project CI / Repository checks (pull_request) Failing after 13s
Project CI / Backend tests (pull_request) Failing after 10s
Project CI / Frontend tests (pull_request) Successful in 3m20s
Project CI / Native shell tests (pull_request) Successful in 17m35s
更新策划文件工具和阶段产物检查路径

同步测试夹具与生产迁移方案文档
2026-09-11 10:16:15 +00:00
kdletters fafe6b63cd 修复AGC模型请求与对话登录态自动续期 (#329)
Project CI / Repository checks (push) Successful in 2m40s
Project CI / Frontend tests (push) Successful in 3m23s
Project CI / Backend tests (push) Successful in 5m46s
Project CI / Native shell tests (push) Successful in 18m30s
## 变更说明

- AGC 客户端配套后端 API 在 401 时自动刷新登录态并重试一次,覆盖模型目录请求。
- DirectProject 对话鉴权失效时刷新平台会话、同步 Rust/Runner 凭据并重试同一 clientTurnId。
- 403 权限拒绝不触发续期;账号切换后不重发旧请求。
- 补充并发续期、失败保留原错误、权限边界和 Direct 对话重试测试。

## 验证

- npm run test -- apps/ai-game-creator-shell/tests/appSurface.test.ts apps/ai-game-creator-shell/tests/clientApi.test.ts apps/ai-game-creator-shell/tests/clientHttp.test.ts apps/ai-game-creator-shell/tests/conversationModelSelect.test.tsx
- npm run agc:typecheck
- npm run check:encoding
- git diff --check

Reviewed-on: #329
Co-authored-by: kdletters <kdletters@qq.com>
Co-committed-by: kdletters <kdletters@qq.com>
2026-09-11 18:09:48 +08:00
lhk229 d6a72c895c 修复策划项目命名相关 CI 检查
Project CI / Repository checks (pull_request) Successful in 2m47s
Project CI / Frontend tests (pull_request) Successful in 3m25s
Project CI / Backend tests (pull_request) Successful in 6m55s
Project CI / Native shell tests (pull_request) Successful in 20m14s
同步首页项目创建测试中的 planning 参数断言
格式化项目 Rust 测试文件以通过 rustfmt
2026-09-11 09:11:27 +00:00
lhk229 e6e2a5fda6 调整策划项目命名
Project CI / Repository checks (pull_request) Failing after 2m57s
Project CI / Frontend tests (pull_request) Failing after 7m44s
Project CI / Backend tests (pull_request) Successful in 8m6s
Project CI / Native shell tests (pull_request) Failing after 4m31s
策划入口使用带随机短码的策划项目名称

保留游戏与素材入口的现有命名链路

补充自动建项测试与技术方案说明
2026-09-11 07:35:41 +00:00
lhk229 123c699db9 修复策划澄清卡自由文本回答
Project CI / Repository checks (pull_request) Successful in 5m25s
Project CI / Frontend tests (pull_request) Successful in 6m36s
Project CI / Backend tests (pull_request) Successful in 29m4s
Project CI / Native shell tests (pull_request) Successful in 33m51s
将自由文本与选项回答分开提交

补充澄清卡回归测试和迁移方案说明
2026-09-11 06:44:47 +00:00
lhk229 f2f786d69b 修复策划 Agent 模型选择链路
保存策划会话的模型目录 ID并交由 api-server 解析

移除官方直连路径的固定模型并补齐 AGC 客户端标记
2026-09-11 05:51:35 +00:00
lhk229 8444dee9e9 优化策划工作区后台刷新体验
Project CI / Repository checks (pull_request) Successful in 2m36s
Project CI / Frontend tests (pull_request) Successful in 3m27s
Project CI / Native shell tests (pull_request) Successful in 20m41s
Project CI / Backend tests (pull_request) Successful in 22m53s
合并 Agent 工具事件并避免刷新时清空文件树

仅首次打开和手动刷新显示加载状态
2026-09-11 05:28:05 +00:00
lhk229 26169102a0 修复策划工作区文件树显示
Project CI / Repository checks (pull_request) Successful in 2m44s
Project CI / Frontend tests (pull_request) Successful in 3m32s
Project CI / Backend tests (pull_request) Successful in 6m21s
Project CI / Native shell tests (pull_request) Successful in 18m20s
改用可展开的层级目录树显示文件

保留相对路径读取并修复目录内产物不可见问题
2026-09-11 05:16:39 +00:00
lhk229 87711e4034 修复策划审批按钮的界面测试回归
Project CI / Repository checks (pull_request) Successful in 3m5s
Project CI / Frontend tests (pull_request) Successful in 3m54s
Project CI / Backend tests (pull_request) Successful in 6m38s
Project CI / Native shell tests (pull_request) Successful in 17m51s
补齐批准和继续修改按钮的无障碍名称

同步审批按钮文档并通过 389 个界面用例
2026-09-11 04:03:21 +00:00
lhk229 fd09f61473 修复策划工作台输入框布局
Project CI / Frontend tests (pull_request) Failing after 2m16s
Project CI / Repository checks (pull_request) Failing after 2m27s
Project CI / Backend tests (pull_request) Successful in 6m58s
Project CI / Native shell tests (pull_request) Failing after 4m45s
让策划聊天消息区只占用剩余空间

确保输入框在工作台底部持续可见
2026-09-11 03:52:34 +00:00
lhk229 9345236b93 重构策划 Agent 工作台界面
Project CI / Frontend tests (pull_request) Failing after 3m19s
Project CI / Repository checks (pull_request) Failing after 3m25s
Project CI / Native shell tests (pull_request) Failing after 6m54s
Project CI / Backend tests (pull_request) Successful in 7m20s
新增始终可见的策划工作区与文件预览

复用 GameAgent 双栏布局并调整审批澄清交互

审批按钮改为文字与图标并保留现有 Runtime 行为
2026-09-11 03:34:56 +00:00
lhk229 7484764024 Merge remote-tracking branch 'web/design_agent_refactor' into design_agent_refactor
Project CI / Repository checks (pull_request) Successful in 3m8s
Project CI / Frontend tests (pull_request) Successful in 4m3s
Project CI / Backend tests (pull_request) Successful in 6m54s
Project CI / Native shell tests (pull_request) Successful in 18m8s
2026-09-11 02:49:02 +00:00
lhk229 782fa77950 Merge branch 'master' into design_agent_refactor
Project CI / Repository checks (pull_request) Successful in 3m43s
Project CI / Frontend tests (pull_request) Successful in 4m37s
Project CI / Backend tests (pull_request) Successful in 7m30s
Project CI / Native shell tests (pull_request) Successful in 18m45s
2026-09-10 23:50:49 +08:00
lhk229 11c8cbdf67 Merge pull request '修复 AGC Direct 写通道项目锁零等待与持锁方不可诊断' (#320) from fix/issue-318-direct-write-lock-wait into master
Project CI / Repository checks (push) Successful in 3m7s
Project CI / Frontend tests (push) Successful in 3m41s
Project CI / Backend tests (push) Successful in 5m48s
Project CI / Native shell tests (push) Successful in 17m34s
Reviewed-on: https://git.genarrative.world/git/GenarrativeAI/Genarrative/pulls/320
2026-09-10 21:43:37 +08:00
suzmii ff42fff61c 按评审意见把写锁等待挪出 runtime worker 并收紧 wait_exhausted 记账
Project CI / Repository checks (pull_request) Successful in 3m18s
Project CI / Frontend tests (pull_request) Successful in 4m3s
Project CI / Backend tests (pull_request) Successful in 7m25s
Project CI / Native shell tests (pull_request) Successful in 19m35s
- agc_write_file 写路径改经 bridge_write_file_in_blocking_pool 走 tokio::task::spawn_blocking:有界等待是同步轮询(最多约 10 秒),直接在 async handler 里跑会占住 tokio worker,争用窗口内同一轮并行写多个文件时会波及共享同一 runtime 的只读端点与 UI 命令
- 新增用例用默认 current_thread runtime 加心跳任务锁住该性质;把 handler 临时改回同步直调时该用例按预期失败,确认有区分度
- project.write_lock.wait_exhausted 与终态改判一起改为只在真的等过(max_attempts > 1)时发生:hydrate 的单次试探不再写 waitedMs 近似 0 的“耗尽”日志
- 技术方案、decision-log、pitfalls 同步这两条,并补“同步有界等待不能直接跑在 async handler 里”的排障经验
2026-09-10 21:38:48 +08:00
lhk229 e8c5d2e247 Merge branch 'master' into fix/issue-318-direct-write-lock-wait
Project CI / Repository checks (pull_request) Successful in 2m58s
Project CI / Frontend tests (pull_request) Successful in 3m45s
Project CI / Backend tests (pull_request) Successful in 7m5s
Project CI / Native shell tests (pull_request) Successful in 17m13s
2026-09-10 21:13:23 +08:00
lhk229 ab86efa421 Merge pull request '停止追踪误提交的本地文档' (#323) from rm/local-docs into master
Project CI / Native shell tests (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Reviewed-on: https://git.genarrative.world/git/GenarrativeAI/Genarrative/pulls/323
2026-09-10 21:12:38 +08:00
lhk229 a12d18c1cd 停止追踪误提交的本地文档
Project CI / Repository checks (pull_request) Successful in 2m30s
Project CI / Frontend tests (pull_request) Successful in 3m19s
Project CI / Backend tests (pull_request) Successful in 6m6s
Project CI / Native shell tests (pull_request) Successful in 18m2s
从仓库索引移除 local-docs 下的 11 份本地过程文档
保留当前工作区本地文件,不新增或修改忽略规则
2026-09-10 13:00:26 +00:00
suzmii 71e9ad3133 修复锁失败终态判据漏传平台导致 CI 把权限改判成争用
Project CI / Repository checks (pull_request) Successful in 6m17s
Project CI / Frontend tests (pull_request) Successful in 8m23s
Project CI / Backend tests (pull_request) Successful in 12m7s
Project CI / Native shell tests (pull_request) Successful in 25m6s
- project_write_lock_permission_is_ambiguous 改为按平台加原始错误码判定(Windows 的 ACCESS_DENIED(5));只看 ErrorKind 在 Linux 上会得出相反结论:errno 5 在 Windows 是 ACCESS_DENIED、在 Linux 是 EIO
- ProjectWriteLockFailure::Retryable 携带 platform,终态改判与争用文案都用同一次分类的平台,不再依赖宿主 errno 语义
- 终态投影用例显式用 Windows 平台构造失败并补 Unix 反例,两个平台上结论一致;CI 首次推送正是在此失败(2358 passed / 1 failed,left contention / right permission_denied)
- pitfalls 补充“判据的每一环都要带平台”的排障经验
2026-09-10 20:46:10 +08:00
lhk229 8a93d69590 流式 Responses 从增量事件累积原生 output
completed 未带 output 时保留 output_item 与工具参数
补空 completed 与顶层 output 的回放测试并记录排障
2026-09-10 12:21:59 +00:00
suzmii 06f738dc99 将项目写锁从 project/filesystem.rs 纯搬移到 project/write_lock.rs
Project CI / Repository checks (pull_request) Successful in 2m37s
Project CI / Frontend tests (pull_request) Successful in 3m30s
Project CI / Backend tests (pull_request) Successful in 6m36s
Project CI / Native shell tests (pull_request) Failing after 13m57s
- 新建 project/write_lock.rs:取锁、等待分类、持锁方诊断、残留回收与 4 条锁用例整体搬移,逻辑不变
- project/filesystem.rs 只保留项目文件 IO(1533 → 680 行),锁相关常量、结构、进程判据与用例全部移出
- project.rs 注册 mod write_lock 并 pub(crate) use write_lock::*,crate::project:: 与 crate:: 既有路径不变
- windows_metadata_is_reparse_point 提为 pub(crate),供 write_lock 复用同一条 reparse point 判据
- agent_db.rs 与 checkpoint.rs 的 PROJECT_FILE_FLAG_OPEN_REPARSE_POINT 导入路径改为 super::write_lock
- 同步修正技术方案、Fast GDD 技术方案、decision-log、pitfalls 中指向锁实现的文件路径,并把“拆锁”从后续事项改为已完成
2026-09-10 20:12:28 +08:00
suzmii 8c639e5d13 修复项目写锁重试判据用一次元数据观察误判瞬时争用
- 项目写锁分类改为只按错误码判定重试性,不再用 path.exists() 决定“要不要等”:真机 6 万次建锁/删锁竞争实测 396-538 例命中“ACCESS_DENIED(5) + 目标不可见”,旧判据会让等待层立刻失败关闭,把毫秒级竞争换成更误导的 ACL 文案
- 新增 ProjectWriteLockFailure(Retryable / Terminal)与 acquire_project_write_lock_failure,有界等待改按类型分流,acquire_project_write_lock 退化为它的文案包装
- Windows 的 ACCESS_DENIED(5) 终态改判移到等待预算耗尽之后:只有真的等过预算且目标此刻仍不存在时才投影成权限拒绝,单次试探保持争用语义
- 锁分类判据改为平台参数传入(project_write_lock_open_failure_for),Linux CI 可覆盖 Windows 分支;替换原先只在 Windows 本地执行的分类用例
- 零等待入口在错误码不可区分时补一句“可能是删除挂起、删除拆链窗口或权限 / ACL 拒绝”,争用前缀逐字不变,调用方既有重试语义不受影响
- PROJECT_WRITE_LOCK_CONTENTION_PREFIX 收口 provider_recovery.rs、planning_session_v2.rs、direct_runtime.rs 三处手写文案
- project.write_lock.wait_exhausted 日志补 projection= 分类,attempts 记为实际尝试次数
- 同步更新技术方案、decision-log、pitfalls,并修正 ownerIsSelf 只比 PID 的表述
2026-09-10 20:07:28 +08:00
suzmii 59cab3d9fd Merge remote-tracking branch 'origin/master' into fix/issue-318-write-lock-classification 2026-09-10 19:58:05 +08:00
lhk229 bb010b4b1e 清理策划文档空白以通过仓库检查
Project CI / Repository checks (pull_request) Successful in 2m52s
Project CI / Frontend tests (pull_request) Successful in 3m17s
Project CI / Backend tests (pull_request) Successful in 5m39s
Project CI / Native shell tests (pull_request) Successful in 18m32s
去掉 system-prompt 文件末多余空行
去掉迁移方案标题下的行尾空格
2026-09-10 11:48:37 +00:00
lhk229 5d24301ef5 修复策划样式插入导致 Tailwind 解析失败
Project CI / Frontend tests (pull_request) Successful in 3m22s
Project CI / Backend tests (pull_request) Successful in 6m2s
Project CI / Repository checks (pull_request) Failing after 2m34s
Project CI / Native shell tests (pull_request) Successful in 17m37s
把阶段进度 span 颜色补回原规则
删除 design-agent 预览后的孤儿声明
2026-09-10 11:40:52 +00:00
lhk229 36dc93222a 合并最新 master
Project CI / Frontend tests (pull_request) Successful in 3m23s
Project CI / Backend tests (pull_request) Successful in 5m41s
Project CI / Native shell tests (pull_request) Failing after 15m24s
Project CI / Repository checks (pull_request) Has been cancelled
2026-09-10 11:19:35 +00:00
lhk229 54ae60576d 修复策划 Agent CI 回归
按 rustfmt 整理策划 Runtime 与相关测试字面量
首页做方案用例改为断言设计 Agent 命令
2026-09-10 11:19:24 +00:00
lhk229 a38eec743a 补齐 LlmRunRequest 字面量的 responses_input 字段
Project CI / Repository checks (pull_request) Failing after 1m18s
Project CI / Frontend tests (pull_request) Failing after 2m15s
Project CI / Native shell tests (pull_request) Failing after 4m59s
Project CI / Backend tests (pull_request) Successful in 6m10s
api-server LLM 代理与 platform-agent 适配器补 None
避免 cargo run api-server 因缺字段编不过
2026-09-10 10:59:13 +00:00
lhk229 18ed9778d8 拆分策划 Agent 与 Codex 随包清单
Project CI / Repository checks (pull_request) Failing after 53s
Project CI / Frontend tests (pull_request) Failing after 2m17s
Project CI / Backend tests (pull_request) Failing after 3m39s
Project CI / Native shell tests (pull_request) Failing after 3m54s
将 design-agent 资源包放到全平台 Tauri 基础配置
Windows 配置只保留 pinned Codex sidecar
配置门禁分别校验两份清单,禁止互相混入
2026-09-10 10:28:07 +00:00
lhk229 89447ed432 按评审意见强化回退模板读取通道回归测试
Project CI / Repository checks (pull_request) Successful in 2m47s
Project CI / Frontend tests (pull_request) Successful in 3m44s
Project CI / Backend tests (pull_request) Successful in 7m1s
Project CI / Native shell tests (pull_request) Successful in 18m11s
Project CI / Backend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
- tests/configuration.rs 回退模板测试改用与模板无关的 runtime dir,分类断言覆盖按路径归属而非 runtime dir 为 None 的恒真分支,并补充 runtime dir 内路径的 managed 正向断言
- tests/mod.rs 移除不再使用的 clear_test_runtime_config_dir 辅助
2026-09-10 09:46:48 +00:00
lhk229 af96174e07 接入策划 Agent 脚本化假 Provider 定向测试
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
拦截测试态 Provider 请求,按队列返回脚本响应或错误
覆盖五阶段推进、审批拒绝不唤醒、重启恢复、资源与工具失败及瞬态重试
同步迁移方案第 8 步验证口径
2026-09-10 09:42:26 +00:00
lhk229 cb79c4a9c6 对齐策划入口测试到新设计 Agent
Project CI / Repository checks (pull_request) Failing after 6m22s
Project CI / Frontend tests (pull_request) Failing after 6m48s
Project CI / Native shell tests (pull_request) Failing after 9m54s
Project CI / Backend tests (pull_request) Failing after 16m19s
新建策划入口走设计会话命令,已有 V2 会话仍走原链路
补审批与澄清卡界面用例
2026-09-10 09:09:37 +00:00
lhk229 3ebfcc0c2f 修正新增配置读取回归测试的 Rust 格式
Project CI / Repository checks (pull_request) Successful in 2m16s
Project CI / Frontend tests (pull_request) Successful in 3m8s
Project CI / Backend tests (pull_request) Successful in 7m2s
Project CI / Native shell tests (pull_request) Successful in 18m27s
- tests/configuration.rs 按 cargo fmt 调整两个 assert! 宏换行
2026-09-10 09:03:19 +00:00
lhk229 9b5d1fe107 修复仓库回退配置模板被读取通道私有化 ACL 锁定
Project CI / Frontend tests (pull_request) Successful in 3m30s
Project CI / Backend tests (pull_request) Successful in 6m27s
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
- config.rs 新增 game_creator_config_path_is_runtime_managed 判定,read_game_creator_config_file 按路径归属分流:AppData 托管目录内的真实凭据维持私有加固读取,仓库旁边的回退模板与 local 覆盖改用 open_project_snapshot_regular_file 非变异快照通道
- 根因:开发 CLI 无 AppHandle 时回退读取 worktree 内 git 跟踪模板,私有读通道在 Windows 上无条件收紧 DACL 为仅当前进程用户,导致其他账号与 cargo include_str! 全部 Access Denied
- tests/mod.rs 新增 clear_test_runtime_config_dir 辅助
- tests/configuration.rs 新增两个回归测试锁定快照 / 私有两条读取通道的分流
- pitfalls.md 记录该排障经验与读取通道副作用白名单教训
2026-09-10 08:57:31 +00:00
suzmii 4ecab19429 修正 CI 权限用例在 root 容器下的前提并补平台无关的分类判据
Project CI / Repository checks (pull_request) Successful in 3m5s
Project CI / Frontend tests (pull_request) Successful in 4m2s
Project CI / Backend tests (pull_request) Successful in 6m51s
Project CI / Native shell tests (pull_request) Successful in 19m16s
- project_write_lock_does_not_project_permission_denial_as_contention 不再用 expect_err 断言“只读目录必须挡住取锁”:CI 容器以 root 运行,0o500 不生效,取锁会正常成功;此时跳过端到端前提
- 新增平台无关用例 project_write_lock_classifies_by_whether_the_target_exists:目标存在才是争用、目标不存在却创建失败是权限拒绝、NotFound 归其它
- 让权限分类判据在不依赖 ACL 环境的条件下也有回归护栏,避免只靠会被 root 绕过的端到端用例
2026-09-10 16:52:30 +08:00
lhk229 aaa52c2b34 接入策划 Agent 生产迁移初版
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
新增独立设计会话、工作区工具和随包资源
platform-llm 支持 Responses 原生 input 续轮
无旧 V2 会话的策划入口切换到新设计 Agent
增加阶段审批、澄清卡和工作区文件浏览
同步迁移方案与决策记录
2026-09-10 08:45:11 +00:00
suzmii 81c2389132 修复 AGC Direct 写通道项目锁零等待与持锁方不可诊断
Project CI / Repository checks (pull_request) Successful in 3m9s
Project CI / Frontend tests (pull_request) Successful in 4m7s
Project CI / Backend tests (pull_request) Successful in 6m54s
Project CI / Native shell tests (pull_request) Failing after 14m11s
- Direct 写路径(agc_write_file)改用统一的有界等待,与 file.write / file.patch / file.delete 同语义,同一轮并行写多个文件按同一把锁串行,不再在 24-42ms 内把重叠判成"项目正在被其他写操作占用"
- create_new 失败拆成争用 / 权限拒绝 / 其它三类:锁文件不存在却仍创建失败不再投影成争用;sharing violation(32) 与 lock violation(33) 恒定归争用
- 争用错误与等待日志带上持锁方身份(commandId / pid / createdAt / ownerIsSelf),锁文件处于删除挂起或未写完时显式表达成"身份不可读"
- ProjectWriteLockSnapshot 补 commandId 与 describe_holder(),沿用既有快照 + 字节 CAS 回收机制,不新增第二套回收判据
- 有界等待预算耗尽记 project.write_lock.wait_exhausted(含等待毫秒数),权限拒绝记 project.write_lock.permission_denied,争用不在零等待入口里逐次记账
- 新增同进程重叠写等待、同轮并行写、活外部进程持锁带身份、权限拒绝分类、ACL 拒绝不投影成争用五条回归用例
- 同步 decision-log、pitfalls 与技术方案文档
2026-09-10 16:30:22 +08:00
suzmii a1b9b24891 修复 AGC Ctrl+C 残留上个工作树后端导致切换工作树复用旧后端 (#315)
Project CI / Frontend tests (push) Successful in 3m14s
Project CI / Backend tests (push) Successful in 8m54s
Project CI / Repository checks (push) Successful in 2m29s
Project CI / Native shell tests (push) Successful in 19m23s
closes #314

## 现象

`npm run agc` 按 Ctrl+C 后有概率残留上个工作树的 `api-server.exe` / SpacetimeDB,切换 worktree 再启动时 AGC 复用旧后端,改过数据库 / schema 的工作树会串库。

## 根因

1. Windows 下长驻服务都经 Node `shell: true` 的 `cmd.exe /d /s /c` 包装层启动,Ctrl+C 先杀包装层(`0xC000013A`);`dev.mjs` 的 `stopProcess` 见到直接子进程已退出就 return,`taskkill /PID <已退出 PID> /T /F` 也只会失败,深处的 `cargo → api-server.exe` 无人清理。
2. 按根 PID 遍历依赖快照里的父子链,中间层先消失时链断,只能拿到根 PID。
3. 复用判据只看 `.app/dev-stack.json` status 与 `/healthz`、`/readyz`、`/v1/ping`,不校验端口上的进程属于哪个工作树,残留后端照样被判为健康并复用。

## 改动

- 新增 `scripts/dev-windows-process.mjs`:按根 PID 遍历 + 按身份匹配(`server-rs/target/debug/api-server.exe` 绝对路径、SpacetimeDB `--data-dir`)两条独立清理路径,带 1s 快照缓存避免清理被拖慢。
- `scripts/dev.mjs`:直接子进程已退出时仍按记录 PID 清理后代;退出时按身份兜底清扫本工作树后端(复用他人 standalone 时跳过);启动前清理旧 api-server 保留 `Wait-Process` 语义,避免 `failed to remove file`。
- `apps/ai-game-creator-shell/scripts/start-dev-stack.mjs`:复用前校验端口监听进程归属,无法证明归属就不复用、改为启动本工作树后端并允许端口漂移;信号与 `finally` 各兜底清扫一次;`taskkill` 失败时降级按 PID 遍历;等待就绪时输出归属校验失败原因,避免静默超时。探测不可用时退化为旧行为,不阻断本地启动。
- 测试与文档:新增 `scripts/dev-windows-process.test.ts`、扩充 AGC 复用门禁用例;同步 `docs/project-memory/shared-memory/pitfalls.md` 与本地开发运维文档。

## 验证

- 伪造 `api-server.exe` 进程:按身份精确命中并杀掉(`matched=[17284] stopped=[17284]`)。
- 3 个真实监听进程下归属判定:`owned` / `api-server-owner-mismatch` / `spacetime-owner-mismatch` 均正确。
- `npx vitest run scripts/dev.test.ts scripts/dev-windows-process.test.ts scripts/dev-stack-port-utils.test.ts apps/ai-game-creator-shell/tests/...`:119 passed(唯一失败为 Windows 文件权限用例,已确认在合并基线 `origin/master` 上同样失败)。
- `node --check`、`eslint --max-warnings 0`、`prettier --check`、`npm run check:encoding`、`git diff --check` 全部通过。

## 备注

Rust 侧 `api-server` 的 `with_graceful_shutdown` 没有超时上限,是「有概率」的来源之一;本次只在 Node 侧收口,是否给优雅退出加 deadline 可另行评估。

Reviewed-on: https://git.genarrative.world/git/GenarrativeAI/Genarrative/pulls/315
Co-authored-by: Suzumiya <suzmii@qq.com>
Co-committed-by: Suzumiya <suzmii@qq.com>
2026-09-09 20:08:04 +08:00
suzmii 7c49e7e51c Merge pull request '修复 AGC 项目写锁残留无法回收与启动失败无诊断' (#313) from fix/agc-stale-lock into master
Project CI / Backend tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Reviewed-on: #313
Reviewed-by: 孔令弘 <ink29535@proton.me>
2026-09-09 20:07:37 +08:00
suzmii c0ef876b14 修复 AGC 项目写锁回收的并发删除竞争与启动诊断死路径
Project CI / Backend tests (pull_request) Successful in 5m56s
Project CI / Repository checks (pull_request) Successful in 2m29s
Project CI / Frontend tests (pull_request) Successful in 3m5s
Project CI / Native shell tests (pull_request) Successful in 17m44s
- 锁文件回收改为单次快照解析:payload 只解析一次,删除前重新核对字节,内容已被并发方替换或文件已消失时返回 false 并重试 create_new,不再无条件 unlink,也不再把 remove_file 的 NotFound 当成硬失败
- mtime 读取失败改用 Option 区分“未知”与“纪元 0”:未知年龄不回收,未知锁创建时间不做 PID 复用推断,避免把保守判定反转成抢走活持有者
- 新增并发替换/已消失、旧格式活持有者、存活未知、mtime 未知四条回归用例
- 启动日志槽优先用已经生效的配置目录(含 --config-dir),否则退到平台配置根(APPDATA / Application Support / XDG_CONFIG_HOME)
- 日志路径未知时 StartupLogSlot::fail 仍然给出用户可见提示,四处 inspect_err 不再被路径判空挡掉
- 同步 check-config 守卫、decision-log、pitfalls 与技术方案文档的用例数与新判据
2026-09-09 19:44:46 +08:00
suzmii b7f27721c5 修复 AGC 项目写锁回收判据的跨平台 PID 边界
Project CI / Repository checks (pull_request) Successful in 3m8s
Project CI / Frontend tests (pull_request) Successful in 4m15s
Project CI / Backend tests (pull_request) Successful in 6m47s
Project CI / Native shell tests (pull_request) Successful in 17m58s
- 项目写锁存活判定把平台不可能分配出的进程号(0 或超出平台 pid 宽度)判为持有者不存在并直接回收,不再落回 600 秒保守分支
- 回归用例的死进程 PID fixture 由 0xFFFF_FFF0 改为 i32::MAX - 1,同时落在两个平台进程号空间之外且在 Unix 有符号 32 位范围内
- 新增 project_write_lock_reclaims_unrepresentable_owner_pid 用例,覆盖 u64::MAX 非法进程号残留锁
- 修正 project_lock_recovery 头部注释,说明这些用例是回归护栏而不是待修缺陷
- 同步 decision-log 的 PID 边界决策与 pitfalls 的跨平台 fixture 经验
2026-09-09 18:00:53 +08:00