Files
Genarrative/docs/project-memory
kdletters c146f7f99c
Project CI / Repository checks (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
建立 AGC 稳定版生命周期基础合同 (#348)
## 变更内容

这是基于 PR #346 的稳定版生命周期基础切换,承接已完成的 HTTP body timeout、Runner blocking worker、最近项目逐项刷新和首页跨页防重:

- 新增统一 `ClientOperation` 合同,固定 operationId、requestId、phase、deadline、scope、cancellable 和 stale 判定;
- 认证 refresh 投影 `auth-refresh` operation;登录、401 refresh、退出共用平台 session generation,并由 `auth-transition` 投影 Runner phase/成功/失败/不确定状态;
- 首页自动创建记录 draft、startMode、phase 和建项后的 project scope,页面卸载不会释放 operation;
- `.app/dev-stack.json` 增加 instanceId、repoRoot、服务级 dataDir/instanceId,AGC Vite marker 增加 repoRoot/processId/port;缺身份的旧状态拒绝 AGC 后端复用;
- 新增稳定版生命周期主规范、开发运维口径和 shared pitfalls。

## 验证

- `npm --prefix apps/ai-game-creator-shell run typecheck`
- `npm --prefix apps/ai-game-creator-shell exec -- vitest run tests/clientOperation.test.ts tests/clientApi.test.ts tests/clientHttp.test.ts tests/recentProjectsModel.test.ts tests/start-dev-stack.test.ts tests/dev-port.test.ts --reporter=dot`(61 passed,2 skipped)
- `npm --prefix apps/ai-game-creator-shell exec -- vitest run tests/appSurface.test.ts --reporter=dot`(423/423 passed)
- `node --check scripts/dev.mjs`
- `node --check apps/ai-game-creator-shell/scripts/start-dev-stack.mjs`
- `npm run check:doc-index`
- `npm run check:encoding`
- `git diff --check`

`scripts/dev.test.ts` 全量仍有 1 个 Windows 文件权限相关既有失败:bootstrap secret 测试在 Windows 上无法通过 chmod 模拟 0600;本变更未触及该逻辑。

Reviewed-on: #348
2026-09-14 13:56:56 +08:00
..

项目记忆目录

本目录只保存可以通过 Git 共享、并且对当前开发仍有效的项目知识。.codex/ 只放 Codex 工具资源,不作为项目知识库。

当前结构

docs/project-memory/
├─ README.md
├─ shared-memory/
│  ├─ project-overview.md
│  ├─ team-conventions.md
│  ├─ development-workflow.md
│  ├─ document-map.md
│  ├─ decision-log.md
│  ├─ pitfalls.md
│  ├─ handoff-template.md
│  └─ 【模板】规范驱动开发主规范与里程碑模板-2026-09-12.md
├─ plans/   # 仅限正在执行的短期计划
└─ todos/   # 仅限仍开放且有退出条件的事项

使用原则

  • 开发前先读 AGENTS.md;复杂任务再读 Agent 执行准则、共享记忆和任务对应的当前专题文档。
  • 稳定架构、接口、流程和排障边界写入 shared-memory/;同一事实只保留一个当前口径,细节放在权威专题文档。
  • plans/ 只保存正在执行、具有明确剩余项和验收门禁的计划;完成或作废后立即删除,稳定结论融合进当前专题或共享记忆。
  • todos/ 只保存真实开放、有人接手即可执行的事项;每项应写明状态、下一决策点和关闭条件。已退役对象不保留未来 TODO。
  • 分支、提交、测试轮次和阶段流水账不进入长期记忆;需要追溯时使用 Git 历史。
  • 若本目录与代码或最新 docs/ 冲突,以代码和最新专题为准,并在同次变更中修正记忆。
  • 禁止写入个人配置、API Key、Token、Cookie、会话记录、认证文件、本地私密路径、构建产物、日志、缓存和数据库 dump。

RAG 索引

本目录是本地 RAG 的高权重索引源,但检索结果只作为候选上下文。索引脚本位于 scripts/rag/;运行时依赖和 .rag/ 数据默认不安装、不提交,启用前需先征得用户确认。